Module Name: src
Committed By: matt
Date: Thu Jan 21 07:46:01 UTC 2010
Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.sibyte
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbpcihb.c
src/sys/arch/sbmips/conf [matt-nb5-mips64]: GENERIC
Removed Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbldthb.c
Log Message:
sbldthb is dead. ppb.c will now take care of it.
sbpcihb is now brain dead. only print whether we are in host or device mode
To generate a diff of this commit:
cvs rdiff -u -r1.5.124.1 -r1.5.124.2 src/sys/arch/mips/conf/files.sibyte
cvs rdiff -u -r1.1.2.1 -r0 src/sys/arch/mips/sibyte/pci/sbldthb.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/sibyte/pci/sbpcihb.c
cvs rdiff -u -r1.70.8.1 -r1.70.8.2 src/sys/arch/sbmips/conf/GENERIC
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/conf/files.sibyte
diff -u src/sys/arch/mips/conf/files.sibyte:1.5.124.1 src/sys/arch/mips/conf/files.sibyte:1.5.124.2
--- src/sys/arch/mips/conf/files.sibyte:1.5.124.1 Thu Jan 21 06:59:11 2010
+++ src/sys/arch/mips/conf/files.sibyte Thu Jan 21 07:46:01 2010
@@ -26,15 +26,10 @@
file arch/mips/sibyte/pci/sbbrz_bus_mem.c sbbrz
# Instantiated SB-1250 PCI Host bridge
-device sbpcihb: pcibus
+device sbpcihb
attach sbpcihb at pci
file arch/mips/sibyte/pci/sbpcihb.c sbpcihb
-# SB-1250 LDT Host bridge (acts like ppb)
-device sbldthb: pcibus
-attach sbldthb at pci
-file arch/mips/sibyte/pci/sbldthb.c sbldthb
-
# sbscd children
device sbtimer
Index: src/sys/arch/mips/sibyte/pci/sbpcihb.c
diff -u src/sys/arch/mips/sibyte/pci/sbpcihb.c:1.1.2.1 src/sys/arch/mips/sibyte/pci/sbpcihb.c:1.1.2.2
--- src/sys/arch/mips/sibyte/pci/sbpcihb.c:1.1.2.1 Thu Jan 21 04:22:33 2010
+++ src/sys/arch/mips/sibyte/pci/sbpcihb.c Thu Jan 21 07:46:01 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbpcihb.c,v 1.1.2.1 2010/01/21 04:22:33 matt Exp $ */
+/* $NetBSD: sbpcihb.c,v 1.1.2.2 2010/01/21 07:46:01 matt Exp $ */
/*
* Copyright 2000, 2001
@@ -54,99 +54,36 @@
static int sbpcihb_match(device_t, cfdata_t, void *);
static void sbpcihb_attach(device_t, device_t, void *);
-static int sbpcihb_print(void *, const char *);
CFATTACH_DECL_NEW(sbpcihb, 0,
sbpcihb_match, sbpcihb_attach, NULL, NULL);
-bool sbpcihbfound;
-
static int
sbpcihb_match(device_t parent, cfdata_t match, void *aux)
{
struct pci_attach_args *pa = aux;
+ int bus, device;
- if (sbpcihbfound) {
- return(0);
- }
+ pci_decompose_tag(pa->pa_pc, pa->pa_tag, &bus, &device, NULL);
/* Check for a vendor/device match. */
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SIBYTE &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SIBYTE_BCM1250_PCIHB)
- return (1);
+ if (bus == 0 && device == 0
+ && PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SIBYTE
+ && PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SIBYTE_BCM1250_PCIHB)
+ return 1;
- return (0);
+ return 0;
}
static void
sbpcihb_attach(device_t parent, device_t self, void *aux)
{
uint64_t regval;
- int host;
-
- sbpcihbfound = true;
+ bool host;
/* Tell the user whether it's host or device mode. */
-printf("\n\tA_SCD_SYSTEM_CFG: %x\n", A_SCD_SYSTEM_CFG);
regval = mips3_ld((void *)MIPS_PHYS_TO_KSEG0(A_SCD_SYSTEM_CFG));
host = (regval & M_SYS_PCI_HOST) != 0;
-printf("\tregval: %"PRIx64"\n", regval);
-printf("\thost: %x\n", host);
aprint_normal(": %s mode\n", host ? "host" : "device");
-
-#if 1
- struct pci_attach_args *pa = aux;
- pci_chipset_tag_t pc = pa->pa_pc;
- struct pcibus_attach_args pba;
- pcireg_t busdata;
- char devinfo[256];
-
- pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
- aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
-
-printf("\tpc: %p\n", pc);
-printf("\tpa: %p\n", pa);
-printf("\tpa->pa_tag: %"PRIxPTR"\n", (uintptr_t)(pa->pa_tag));
-printf("\tPPB_REG_BUSINFO %x\n", PPB_REG_BUSINFO);
- busdata = pci_conf_read(pc, pa->pa_tag, PPB_REG_BUSINFO);
-printf("\tbusdata is: %"PRIx32"\n", busdata);
-
- if (PPB_BUSINFO_PRIMARY(busdata) == 0 &&
- PPB_BUSINFO_SECONDARY(busdata) == 0) {
- aprint_normal_dev(self, "not configured by system firmware\n");
- return;
- }
-
- /*
- * Attach the PCI bus than hangs off of it.
- *
- * XXX Don't pass-through Memory Read Multiple. Should we?
- * XXX Consult the spec...
- */
-// pba.pba_busname = "pci"; /* XXX should be pci_ppb attachment */
- pba.pba_iot = pa->pa_iot;
- pba.pba_memt = pa->pa_memt;
- pba.pba_dmat = pa->pa_dmat; /* XXXLDT??? */
- pba.pba_pc = pc; /* XXXLDT??? */
- pba.pba_flags = pa->pa_flags & ~PCI_FLAGS_MRM_OKAY; /* XXXLDT??? */
- pba.pba_bus = PPB_BUSINFO_SECONDARY(busdata);
- pba.pba_intrswiz = pa->pa_intrswiz; /* XXXLDT??? */
- pba.pba_intrtag = pa->pa_intrtag; /* XXXLDT??? */
-
- config_found(self, &pba, sbpcihb_print);
-#endif
}
-
-int
-sbpcihb_print( void *aux, const char *pnp)
-{
- struct pcibus_attach_args *pba = aux;
-
- /* only PCIs can attach to PPBs; easy. */
- if (pnp)
- printf("pci at %s", pnp);
- printf(" bus %d", pba->pba_bus);
- return (UNCONF);
-}
-
Index: src/sys/arch/sbmips/conf/GENERIC
diff -u src/sys/arch/sbmips/conf/GENERIC:1.70.8.1 src/sys/arch/sbmips/conf/GENERIC:1.70.8.2
--- src/sys/arch/sbmips/conf/GENERIC:1.70.8.1 Thu Jan 21 04:23:29 2010
+++ src/sys/arch/sbmips/conf/GENERIC Thu Jan 21 07:46:01 2010
@@ -1,10 +1,10 @@
-# $NetBSD: GENERIC,v 1.70.8.1 2010/01/21 04:23:29 matt Exp $
+# $NetBSD: GENERIC,v 1.70.8.2 2010/01/21 07:46:01 matt Exp $
include "arch/sbmips/conf/std.sbmips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.70.8.1 $"
+#ident "GENERIC-$Revision: 1.70.8.2 $"
#options LOCKDEBUG # XXX XXX XXX XXX
#options DEBUG # extra kernel debugging support
@@ -144,10 +144,9 @@
pci* at sbbrz? bus ?
sbpcihb* at pci? dev ?
-sbldthb* at pci? dev ?
+ppb* at pci? dev ?
-pci* at sbpcihb? bus ?
-pci* at sbldthb? bus ?
+pci* at ppb?
bge* at pci? dev ?
#vga* at pci? dev ?