diff options
| author | simonb <simonb@NetBSD.org> | 2001-06-13 06:01:44 +0000 |
|---|---|---|
| committer | simonb <simonb@NetBSD.org> | 2001-06-13 06:01:44 +0000 |
| commit | 18b2f7e6a144fe16e64dcc92a7ab9b218373299b (patch) | |
| tree | 6ea95d0ae0c6bf63812f4fada4efaf0a5055a7f3 /sys/dev | |
| parent | a167adffcebbc2af09f9c5a73ae528a9d2f3fd46 (diff) | |
Add a port to IBM's PPC405GP Reference Board (the "walnut")
by Eduardo Horvath and Simon Burge of Wasabi Systems.
IBM 4xx series CPU features:
- New pmap and revised trap handler.
- Support on-chip timers, PCI controller, UARTs
- Framework for on-chip ethernet and watchdog timer.
General PowerPC features:
- Add in-kernel PPC floating point emulation
- New in{,4}_cksum that is between 1.5 and 5 times faster than the
old version depending on CPU type.
General changes:
- Kernel support for generic dbsym-style symbols.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/DEVNAMES | 8 | ||||
| -rw-r--r-- | sys/dev/pci/pciconf.c | 77 | ||||
| -rw-r--r-- | sys/dev/pci/pciconf.h | 16 | ||||
| -rw-r--r-- | sys/dev/pci/pcidevs | 4 |
4 files changed, 73 insertions, 32 deletions
diff --git a/sys/dev/DEVNAMES b/sys/dev/DEVNAMES index 22b7d6335a1..33d8c8a405f 100644 --- a/sys/dev/DEVNAMES +++ b/sys/dev/DEVNAMES @@ -1,4 +1,4 @@ -# $NetBSD: DEVNAMES,v 1.61 2001/06/09 13:51:49 bjh21 Exp $ +# $NetBSD: DEVNAMES,v 1.62 2001/06/13 06:01:45 simonb Exp $ # # This file contains all used device names and defined attributes in # alphabetical order. New devices added to the system somewhere should first @@ -202,6 +202,7 @@ cpu sgimips cpu sparc cpu sparc64 cpu vax +cpu walnut cpu x68k crime sgimips crypto MI Attribute @@ -243,6 +244,7 @@ drsc amigappc drsupio amiga drsupio amigappc dsrtc arm32 +dsrtc walnut dtide MI dtop pmax dvbox hp300 @@ -271,6 +273,7 @@ eisabus MI Attribute el MI elink MI Attribute elmc MI (MCA) +emac walnut empsc amiga empsc amigappc en MI @@ -365,6 +368,7 @@ giobus sgimips Attribute gm macppc gpbus hpcmips gpbusif hpcmips +gpio walnut grackle macppc grf amiga grf amigappc @@ -589,6 +593,7 @@ mainbus sparc64 mainbus sparc64 Attribute mainbus sun3 mainbus vax +mainbus walnut mainbus x68k mb86960 MI Attribute mba vax @@ -1090,6 +1095,7 @@ wdc MI wdc_base MI Attribute wdog evbsh3 wdog mmeye +wdog walnut wds MI wdsc mvme68k we MI diff --git a/sys/dev/pci/pciconf.c b/sys/dev/pci/pciconf.c index bdba1ef03a4..c3c5ebabe95 100644 --- a/sys/dev/pci/pciconf.c +++ b/sys/dev/pci/pciconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: pciconf.c,v 1.3 2001/05/27 17:50:40 thorpej Exp $ */ +/* $NetBSD: pciconf.c,v 1.4 2001/06/13 06:01:45 simonb Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -137,7 +137,7 @@ typedef struct _s_pciconf_bus_t { static int probe_bus(pciconf_bus_t *); static void alloc_busno(pciconf_bus_t *, pciconf_bus_t *); -static int pci_do_device_query(pciconf_bus_t *, pcitag_t, int, int); +static int pci_do_device_query(pciconf_bus_t *, pcitag_t, int, int, int); static int setup_iowins(pciconf_bus_t *); static int setup_memwins(pciconf_bus_t *); static int configure_bridge(pciconf_dev_t *); @@ -204,18 +204,24 @@ probe_bus(pciconf_bus_t *pb) pb->max_mingnt = 0; /* we are looking for the maximum */ pb->min_maxlat = 0x100; /* we are looking for the minimum */ pb->bandwidth_used = 0; + for (device=0; device < maxdevs; device++) { pcitag_t tag; pcireg_t id, bhlcr; int function, nfunction; + int confmode; tag = pci_make_tag(pb->pc, pb->busno, device, 0); if (pci_conf_debug) { print_tag(pb->pc, tag); - printf("probing.\n"); + printf("probing with tag %x.\n", tag); } id = pci_conf_read(pb->pc, tag, PCI_ID_REG); + if (pci_conf_debug) { + printf("id=%x: Vendor=%x, Product=%x\n", + id, PCI_VENDOR(id),PCI_PRODUCT(id)); + } /* Invalid vendor ID value? */ if (PCI_VENDOR(id) == PCI_VENDOR_INVALID) continue; @@ -234,8 +240,16 @@ probe_bus(pciconf_bus_t *pb) "really probing.\n", PCI_VENDOR(id), PCI_PRODUCT(id)); } +#ifdef __HAVE_PCI_CONF_HOOK + confmode = pci_conf_hook(pb->pc, pb->busno, + device, function, id); + if (confmode == 0) + continue; +#else + confmode = PCI_CONF_ALL; +#endif if (pci_do_device_query(pb, tag, device, - function)) + function, confmode)) return -1; pb->ndevs++; } @@ -365,7 +379,7 @@ err: } static int -pci_do_device_query(pciconf_bus_t *pb, pcitag_t tag, int dev, int func) +pci_do_device_query(pciconf_bus_t *pb, pcitag_t tag, int dev, int func, int mode) { pciconf_dev_t *pd; pciconf_win_t *pi, *pm; @@ -377,7 +391,7 @@ pci_do_device_query(pciconf_bus_t *pb, pcitag_t tag, int dev, int func) pd->pc = pb->pc; pd->tag = tag; pd->ppb = NULL; - pd->enable = 1; + pd->enable = mode; class = pci_conf_read(pb->pc, tag, PCI_CLASS_REG); @@ -476,7 +490,8 @@ pci_do_device_query(pciconf_bus_t *pb, pcitag_t tag, int dev, int func) } pb->niowin++; pb->io_total += size; - } else { + } else if ((mode & PCI_CONF_MAP_MEM) + && (PCI_MAPREG_TYPE(mask) == PCI_MAPREG_TYPE_MEM)) { switch (PCI_MAPREG_MEM_TYPE(mask)) { case PCI_MAPREG_MEM_TYPE_32BIT: case PCI_MAPREG_MEM_TYPE_32BIT_1M: @@ -534,30 +549,32 @@ pci_do_device_query(pciconf_bus_t *pb, pcitag_t tag, int dev, int func) } } - bar = pci_conf_read(pb->pc, tag, PCI_MAPREG_ROM); - pci_conf_write(pb->pc, tag, PCI_MAPREG_ROM, 0xfffffffe); - mask = pci_conf_read(pb->pc, tag, PCI_MAPREG_ROM); - pci_conf_write(pb->pc, tag, PCI_MAPREG_ROM, bar); + if (mode & PCI_CONF_MAP_ROM) { + bar = pci_conf_read(pb->pc, tag, PCI_MAPREG_ROM); + pci_conf_write(pb->pc, tag, PCI_MAPREG_ROM, 0xfffffffe); + mask = pci_conf_read(pb->pc, tag, PCI_MAPREG_ROM); + pci_conf_write(pb->pc, tag, PCI_MAPREG_ROM, bar); - if (mask != 0 && mask != 0xffffffff) { - if (pb->nmemwin >= MAX_CONF_MEM) { - printf("pciconf: too many memory windows"); - return -1; - } - size = (u_int64_t) PCI_MAPREG_MEM_SIZE(mask); + if (mask != 0 && mask != 0xffffffff) { + if (pb->nmemwin >= MAX_CONF_MEM) { + printf("pciconf: too many memory windows"); + return -1; + } + size = (u_int64_t) PCI_MAPREG_MEM_SIZE(mask); - pm = get_mem_desc(pb, size); - pm->dev = pd; - pm->reg = PCI_MAPREG_ROM; - pm->size = size; - pm->align = 4; - pm->prefetch = 1; - if (pci_conf_debug) { - print_tag(pb->pc, tag); - printf("Expansion ROM memory size %llu\n", pm->size); + pm = get_mem_desc(pb, size); + pm->dev = pd; + pm->reg = PCI_MAPREG_ROM; + pm->size = size; + pm->align = 4; + pm->prefetch = 1; + if (pci_conf_debug) { + print_tag(pb->pc, tag); + printf("Expansion ROM memory size %llu\n", pm->size); + } + pb->nmemwin++; + pb->pmem_total += size; } - pb->nmemwin++; - pb->pmem_total += size; } return 0; @@ -577,7 +594,9 @@ pci_allocate_range(struct extent *ex, u_int64_t amt, int align) r = extent_alloc(ex, amt, align, 0, EX_NOWAIT, &addr); if (r) { addr = (u_long) -1; - printf("extent_alloc() returned %d\n", r); + printf("extent_alloc(%p, %llu, %d) returned %d\n", + ex, amt, align, r); + extent_print(ex); } return (pcireg_t) addr; } diff --git a/sys/dev/pci/pciconf.h b/sys/dev/pci/pciconf.h index a6519248833..0a75e880ceb 100644 --- a/sys/dev/pci/pciconf.h +++ b/sys/dev/pci/pciconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciconf.h,v 1.1 2001/02/09 14:33:15 briggs Exp $ */ +/* $NetBSD: pciconf.h,v 1.2 2001/06/13 06:01:45 simonb Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -47,3 +47,17 @@ int pci_configure_bus __P((pci_chipset_tag_t, struct extent *, /* args: chipset_tag, bus, dev, function, ptr to interrupt line */ void pci_conf_interrupt __P((pci_chipset_tag_t, int, int, int, int, int *)); +#define PCI_CONF_MAP_IO 0x01 +#define PCI_CONF_MAP_MEM 0x02 +#define PCI_CONF_MAP_ROM 0x04 +#define PCI_CONF_ENABLE_IO 0x08 +#define PCI_CONF_ENABLE_MEM 0x10 +#define PCI_CONF_ENABLE_BM 0x20 + +#define PCI_CONF_ALL 0x3f + +#ifdef __HAVE_PCI_CONF_HOOK +/* Defined in machdep code. returns 0 if it's*/ +/* args: chipset_tag, bus,dev, function, id */ +int pci_conf_hook(pci_chipset_tag_t, int, int, int, int); +#endif diff --git a/sys/dev/pci/pcidevs b/sys/dev/pci/pcidevs index 9fe48d754d4..0c5d3241f4a 100644 --- a/sys/dev/pci/pcidevs +++ b/sys/dev/pci/pcidevs @@ -1,4 +1,4 @@ -$NetBSD: pcidevs,v 1.327 2001/06/11 21:12:29 thorpej Exp $ +$NetBSD: pcidevs,v 1.328 2001/06/13 06:01:45 simonb Exp $ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -1117,6 +1117,7 @@ product IBM SERVERAID 0x002e ServeRAID product IBM OLYMPIC 0x003e Token Ring product IBM MIAMI 0x0036 Miami/PCI product IBM TURBOWAYS25 0x0053 Turboways 25 ATM +product IBM 405GP 0x0156 IBM 405GP PCI Bridge product IBM MPIC2 0xffff MPIC-II /* IDT products */ @@ -1193,6 +1194,7 @@ product INTEL 82441FX 0x1237 82441FX PCI and Memory Controller (PMC) product INTEL 82380AB 0x123c 82380AB Mobile PCI-to-ISA Bridge (MISA) product INTEL 82380FB 0x124b 82380FB Mobile PCI-to-PCI Bridge (MPCI2) product INTEL 82439HX 0x1250 82439HX System Controller (TXC) +product INTEL 80960_RP 0x1960 ROB-in i960RP Microprocessor product INTEL 82840_HB 0x1a21 82840 Host product INTEL 82840_AGP 0x1a23 82840 AGP product INTEL 82840_PCI 0x1a24 82840 PCI |
