1 1.7 tsutsui /* $NetBSD: apbus.h,v 1.7 2018/10/19 13:40:33 tsutsui Exp $ */ 2 1.1 tsubai 3 1.1 tsubai /*- 4 1.1 tsubai * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. 5 1.1 tsubai * 6 1.1 tsubai * Redistribution and use in source and binary forms, with or without 7 1.1 tsubai * modification, are permitted provided that the following conditions 8 1.1 tsubai * are met: 9 1.1 tsubai * 1. Redistributions of source code must retain the above copyright 10 1.1 tsubai * notice, this list of conditions and the following disclaimer. 11 1.1 tsubai * 2. Redistributions in binary form must reproduce the above copyright 12 1.1 tsubai * notice, this list of conditions and the following disclaimer in the 13 1.1 tsubai * documentation and/or other materials provided with the distribution. 14 1.1 tsubai * 3. The name of the author may not be used to endorse or promote products 15 1.1 tsubai * derived from this software without specific prior written permission. 16 1.1 tsubai * 17 1.1 tsubai * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 1.1 tsubai * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 1.1 tsubai * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 1.1 tsubai * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 1.1 tsubai * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 1.1 tsubai * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 1.1 tsubai * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 1.1 tsubai * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 1.1 tsubai * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 1.1 tsubai * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 1.1 tsubai */ 28 1.1 tsubai 29 1.1 tsubai #ifndef __MACHINE_APBUS__ 30 1.1 tsubai #define __MACHINE_APBUS__ 31 1.1 tsubai 32 1.1 tsubai struct apbus_ctl { 33 1.2 tsubai u_int apbc_ctlno; 34 1.2 tsubai u_int apbc_mu; 35 1.2 tsubai u_int apbc_unknown2; 36 1.2 tsubai void *apbc_sladdr; 37 1.2 tsubai 38 1.2 tsubai u_int apbc_unknown4; 39 1.2 tsubai u_int apbc_hwbase; 40 1.2 tsubai char *apbc_softc; 41 1.2 tsubai u_int *apbc_ent7; 42 1.2 tsubai 43 1.2 tsubai u_int apbc_unknown8; 44 1.2 tsubai u_int apbc_sl; 45 1.2 tsubai 46 1.2 tsubai struct apbus_ctl *apbc_child0; 47 1.2 tsubai u_int apbc_child0no[3]; 48 1.2 tsubai 49 1.2 tsubai struct apbus_ctl *apbc_child1; 50 1.2 tsubai u_int apbc_child1no[3]; 51 1.2 tsubai 52 1.2 tsubai struct apbus_ctl *apbc_child2; 53 1.2 tsubai u_int apbc_child2no[3]; 54 1.1 tsubai 55 1.2 tsubai struct apbus_ctl *apbc_parent; 56 1.2 tsubai u_int apbc_parentno[3]; 57 1.1 tsubai 58 1.2 tsubai struct apbus_ctl *apbc_link; 59 1.1 tsubai }; 60 1.1 tsubai 61 1.2 tsubai struct apbus_dev { 62 1.2 tsubai char *apbd_name; 63 1.2 tsubai char *apbd_vendor; 64 1.2 tsubai u_int apbd_atr; 65 1.2 tsubai u_int apbd_rev; 66 1.2 tsubai void *apbd_driver; 67 1.2 tsubai void *table[16]; 68 1.2 tsubai struct apbus_ctl *apbd_ctl; 69 1.2 tsubai struct apbus_dev *apbd_link; 70 1.1 tsubai }; 71 1.1 tsubai 72 1.1 tsubai struct apbus_sysinfo { 73 1.2 tsubai int apbsi_revision; 74 1.3 matt int (*apbsi_call)(int, ...);/* apcall entry */ 75 1.2 tsubai int apbsi_errno; /* errno from apcall? */ 76 1.2 tsubai void *apbsi_bootstart; /* entry of primary boot */ 77 1.2 tsubai void *apbsi_bootend; 78 1.2 tsubai struct apbus_dev *apbsi_dev; 79 1.2 tsubai struct apbus_bus *apbsi_bus; 80 1.2 tsubai int apbsi_exterr; /* ? */ 81 1.2 tsubai 82 1.2 tsubai int apbsi_pad1[2]; 83 1.2 tsubai int apbsi_memsize; /* memory size */ 84 1.2 tsubai int apbsi_pad2[24]; 85 1.2 tsubai int apbsi_romversion; 86 1.2 tsubai int apbsi_pad3[28]; 87 1.1 tsubai }; 88 1.1 tsubai 89 1.1 tsubai /* 90 1.1 tsubai * FYI: result of 'ss -m' command on NEWS5000 rom monitor on my machine... 91 1.1 tsubai * 92 1.1 tsubai * > ss -m 93 1.1 tsubai * Memory use: 94 1.1 tsubai * diag info: bf881800 95 1.1 tsubai * environ: bf881000 96 1.1 tsubai * apinfo: bf880000 97 1.1 tsubai * sysinfo: 9ff03270 -> struct apbus_sysinfo 98 1.1 tsubai * alloc list: ffffbff8 99 1.1 tsubai * max mem: 04000000 100 1.1 tsubai * free mem: 03ff1678 101 1.1 tsubai * mem base: 100000000 102 1.1 tsubai * 103 1.1 tsubai */ 104 1.1 tsubai 105 1.1 tsubai extern struct apbus_sysinfo *_sip; 106 1.6 tsutsui extern volatile uint32_t *news_wbflush; 107 1.7 tsutsui extern void *sccport0a; 108 1.4 tsutsui void apbus_wbflush(void); 109 1.1 tsubai 110 1.1 tsubai #endif /* !__MACHINE_APBUS__ */ 111