diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 1998-08-06 15:04:07 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 1998-08-06 15:04:07 +0000 |
commit | f2eb56e84359146c0b65ee6d6d2a05b37cb15de3 (patch) | |
tree | 680bf4b641876eebf5553230c3f45cc160a5df6b /sys/arch | |
parent | 205a31e70c1419a091cf12bb5cdb3693dfecf842 (diff) |
Some small fixes for non ofw systems
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/powerpc/include/limits.h | 3 | ||||
-rw-r--r-- | sys/arch/powerpc/include/pio.h | 24 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/mpcpcibus.c | 18 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/pci_machdep.h | 10 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/pcibrvar.h | 5 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/autoconf.c | 8 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/conf.c | 4 |
7 files changed, 51 insertions, 21 deletions
diff --git a/sys/arch/powerpc/include/limits.h b/sys/arch/powerpc/include/limits.h index 6dd061bd6b8..4e805434b0d 100644 --- a/sys/arch/powerpc/include/limits.h +++ b/sys/arch/powerpc/include/limits.h @@ -1,4 +1,4 @@ -/* $OpenBSD: limits.h,v 1.5 1998/03/22 21:15:22 millert Exp $ */ +/* $OpenBSD: limits.h,v 1.6 1998/08/06 15:03:55 pefo Exp $ */ /* $NetBSD: limits.h,v 1.1 1996/09/30 16:34:28 ws Exp $ */ /*- @@ -56,6 +56,7 @@ #define ULONG_MAX 0xffffffff /* max value in unsigned long */ #if !defined(_ANSI_SOURCE) +#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) #define SIZE_T_MAX UINT_MAX /* max value for a size_t */ diff --git a/sys/arch/powerpc/include/pio.h b/sys/arch/powerpc/include/pio.h index c5e767c6de1..64259e455e2 100644 --- a/sys/arch/powerpc/include/pio.h +++ b/sys/arch/powerpc/include/pio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pio.h,v 1.1 1997/10/13 10:53:47 pefo Exp $ */ +/* $OpenBSD: pio.h,v 1.2 1998/08/06 15:03:57 pefo Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA. @@ -169,4 +169,26 @@ __inlrb(a) #define inlrb(a) (__inlrb((volatile u_int32_t *)(a))) #define in32rb(a) inlrb(a) +#ifdef DEBUG +static __inline void +__flash_led(bits, count) + int bits; +{ + int i, v = 0; + + if(bits == 0) { + v = 1; bits = 3; + } + bits &= 3; + count += count; + v |= (*(volatile u_int8_t *)0x800001f4) & ~3; + while(count--) { + v ^= bits; + for(i = 100000; i > 0; i--) + *(volatile u_int8_t *)0x800001f4 = v; + } + *(u_int8_t *)0x800001f4 &= ~3; +} +#endif /* DEBUG */ + #endif /*_MACHINE_PIO_H_*/ diff --git a/sys/arch/powerpc/pci/mpcpcibus.c b/sys/arch/powerpc/pci/mpcpcibus.c index 63683e3e385..6e263c607c7 100644 --- a/sys/arch/powerpc/pci/mpcpcibus.c +++ b/sys/arch/powerpc/pci/mpcpcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpcpcibus.c,v 1.4 1998/04/06 20:23:21 pefo Exp $ */ +/* $OpenBSD: mpcpcibus.c,v 1.5 1998/08/06 15:04:00 pefo Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -74,7 +74,7 @@ const char *mpc_intr_string __P((void *, pci_intr_handle_t)); void *mpc_intr_establish __P((void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *)); void mpc_intr_disestablish __P((void *, void *)); -int mpc_ether_hw_addr __P((u_int8_t *)); +int mpc_ether_hw_addr __P((u_int8_t *, u_int8_t, u_int8_t)); struct cfattach mpcpcibr_ca = { sizeof(struct pcibr_softc), mpcpcibrmatch, mpcpcibrattach, @@ -132,8 +132,10 @@ mpcpcibrattach(parent, self, aux) case POWER4e: lcp = sc->sc_pcibr = &mpc_config; - sc->sc_bus_space.bus_base = MPC106_V_PCI_MEM_SPACE; - sc->sc_bus_space.bus_reverse = 1; + sc->sc_membus_space.bus_base = MPC106_V_PCI_MEM_SPACE; + sc->sc_membus_space.bus_reverse = 1; + sc->sc_iobus_space.bus_base = MPC106_PCI_IO_SPACE; + sc->sc_iobus_space.bus_reverse = 1; lcp->lc_pc.pc_conf_v = lcp; lcp->lc_pc.pc_attach_hook = mpc_attach_hook; @@ -157,8 +159,8 @@ mpcpcibrattach(parent, self, aux) } pba.pba_busname = "pci"; - pba.pba_iot = &sc->sc_bus_space; - pba.pba_memt = &sc->sc_bus_space; + pba.pba_iot = &sc->sc_iobus_space; + pba.pba_memt = &sc->sc_membus_space; pba.pba_pc = &lcp->lc_pc; pba.pba_bus = 0; config_found(self, &pba, mpcpcibrprint); @@ -208,8 +210,8 @@ mpc_attach_hook(parent, self, pba) } int -mpc_ether_hw_addr(p) - u_int8_t *p; +mpc_ether_hw_addr(p, b, s) + u_int8_t *p, b, s; { int i; diff --git a/sys/arch/powerpc/pci/pci_machdep.h b/sys/arch/powerpc/pci/pci_machdep.h index 73cde72ba95..ea5c88e5dfa 100644 --- a/sys/arch/powerpc/pci/pci_machdep.h +++ b/sys/arch/powerpc/pci/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.3 1998/04/06 20:24:22 pefo Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.4 1998/08/06 15:04:01 pefo Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -60,9 +60,11 @@ struct p4e_pci_chipset { void *(*pc_intr_establish) __P((void *, pci_intr_handle_t, int, int (*)(void *), void *, char *)); void (*pc_intr_disestablish) __P((void *, void *)); - int (*pc_ether_hw_addr) __P((u_int8_t *)); + int (*pc_ether_hw_addr) __P((u_int8_t *, u_int8_t, u_int8_t)); }; +#define NEED_PCI_ETHER_HW_ADDR_FUNC /* srom less pci ether adapter */ + /* * Functions provided to machine-independent PCI code. */ @@ -86,8 +88,8 @@ struct p4e_pci_chipset { (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (nm)) #define pci_intr_disestablish(c, iv) \ (*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv)) -#define pci_ether_hw_addr(c, p) \ - (*(c)->pc_ether_hw_addr)((p)) +#define pci_ether_hw_addr(c, p, b, s) \ + (*(c)->pc_ether_hw_addr)((p), (b), (s)) vm_offset_t vtophys __P((void *)); diff --git a/sys/arch/powerpc/pci/pcibrvar.h b/sys/arch/powerpc/pci/pcibrvar.h index ab0506094fd..a5533a98de6 100644 --- a/sys/arch/powerpc/pci/pcibrvar.h +++ b/sys/arch/powerpc/pci/pcibrvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcibrvar.h,v 1.1 1997/10/11 11:29:32 pefo Exp $ */ +/* $OpenBSD: pcibrvar.h,v 1.2 1998/08/06 15:04:03 pefo Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -42,7 +42,8 @@ struct pcibr_config { struct pcibr_softc { struct device sc_dev; struct pcibr_config *sc_pcibr; - struct p4e_bus_space sc_bus_space; /* Same for I/O and Mem */ + struct p4e_bus_space sc_membus_space; + struct p4e_bus_space sc_iobus_space; }; diff --git a/sys/arch/powerpc/powerpc/autoconf.c b/sys/arch/powerpc/powerpc/autoconf.c index 4ea12832c49..1e47d7a851e 100644 --- a/sys/arch/powerpc/powerpc/autoconf.c +++ b/sys/arch/powerpc/powerpc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.5 1998/05/29 04:15:37 rahnds Exp $ */ +/* $OpenBSD: autoconf.c,v 1.6 1998/08/06 15:04:05 pefo Exp $ */ /* * Copyright (c) 1996, 1997 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -41,7 +41,7 @@ * from: Utah Hdr: autoconf.c 1.31 91/01/21 * * from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: autoconf.c,v 1.5 1998/05/29 04:15:37 rahnds Exp $ + * $Id: autoconf.c,v 1.6 1998/08/06 15:04:05 pefo Exp $ */ /* @@ -93,7 +93,9 @@ configure() (void)splhigh(); /* To be really sure.. */ if(config_rootfound("mainbus", "mainbus") == 0) panic("no mainbus found"); - ofrootfound(); + if(system_type == OFWMACH) { + ofrootfound(); + } (void)spl0(); setroot(); diff --git a/sys/arch/powerpc/powerpc/conf.c b/sys/arch/powerpc/powerpc/conf.c index 8e0917cf252..4eddf3af7f5 100644 --- a/sys/arch/powerpc/powerpc/conf.c +++ b/sys/arch/powerpc/powerpc/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.9 1998/07/07 06:56:09 deraadt Exp $ */ +/* $OpenBSD: conf.c,v 1.10 1998/08/06 15:04:06 pefo Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -241,7 +241,7 @@ int chrtoblk(dev) dev_t dev; { - int major; + int blkmaj; if (major(dev) >= nchrdev || major(dev) > sizeof(chrtoblktbl)/sizeof(chrtoblktbl[0])) |