Date: Sun, 10 Sep 2000 15:33:43 -0700 (PDT) From: Matthew Jacob <mjacob@feral.com> To: Peter Wemm <peter@netplex.com.au>, Bernd Walter <ticso@cicely5.cicely.de>, Christian Weisgerber <naddy@mips.inka.de> Cc: freebsd-alpha@FreeBSD.ORG Subject: Re: cvs commit: src/sys/pci pcisupport.c (fwd) Message-ID: <Pine.LNX.4.21.0009101520380.23495-200000@zeppo.feral.com> In-Reply-To: <200009100808.e8A88FG76895@netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
The following diffs worked for me. I'm in a hurry, otherwise I'd analyze this
more closely. The main ideas here are
1) determination of type of chipset should be done cia_probe
2) Pyxis *should* imply BWX. But they're not the same thing, really.
3) (for now) chipset_bwx is the gating item, and it's a true/false
value, while the ivar (which really should just be removed) is a
uintptr_t.
4) While I was at it, the correct test for implver is < ALPHA_IMPLVER_EV5
(I assume that ALPHA_IMPLVER_EV6 has BWX).
The cia.c file didn't change in the smp merge, so this should be
orthogonal to the change (I haven't yet run with top of tree).
Can somebody test the attached diff against an SX or an LX to make sure it's
right? If so, I'll commit it, or Peter can commit it if he's around, etc...
Much as I despise BWX, this encourages me to add this into rawhide.
-matt
[-- Attachment #2 --]
Index: alpha/pci/cia.c
===================================================================
RCS file: /home/ncvs/src/sys/alpha/pci/cia.c,v
retrieving revision 1.27
diff -u -r1.27 cia.c
--- alpha/pci/cia.c 2000/09/02 01:05:37 1.27
+++ alpha/pci/cia.c 2000/09/10 22:25:43
@@ -355,31 +355,7 @@
if (initted) return;
initted = 1;
- cia_rev = REGVAL(CIA_CSR_REV) & REV_MASK;
-
- /*
- * Determine if we have a Pyxis. Only two systypes can
- * have this: the EB164 systype (AlphaPC164LX and AlphaPC164SX)
- * and the DEC_ST550 systype (Miata).
- */
- if ((hwrpb->rpb_type == ST_EB164 &&
- (hwrpb->rpb_variation & SV_ST_MASK) >= SV_ST_ALPHAPC164LX_400) ||
- hwrpb->rpb_type == ST_DEC_550)
- cia_ispyxis = TRUE;
- else
- cia_ispyxis = FALSE;
-
- /*
- * ALCOR/ALCOR2 Revisions >= 2 and Pyxis have the CNFG register.
- */
- if (cia_rev >= 2 || cia_ispyxis)
- cia_config = REGVAL(CIA_CSR_CNFG);
- else
- cia_config = 0;
-
- if (alpha_implver() != ALPHA_IMPLVER_EV5
- || alpha_amask(ALPHA_AMASK_BWX)
- || !(cia_config & CNFG_BWEN)) {
+ if (chipset_bwx == 0) {
swiz_init_space(&io_space.swiz, KV(CIA_PCI_SIO1));
swiz_init_space_hae(&mem_space.swiz, KV(CIA_PCI_SMEM1),
cia_swiz_set_hae_mem, 0);
@@ -413,17 +389,48 @@
pci_init_resources();
isa_init_intr();
cia_init_sgmap();
+
+ cia_rev = REGVAL(CIA_CSR_REV) & REV_MASK;
+
+ /*
+ * Determine if we have a Pyxis. Only two systypes can
+ * have this: the EB164 systype (AlphaPC164LX and AlphaPC164SX)
+ * and the DEC_ST550 systype (Miata).
+ */
+ if ((hwrpb->rpb_type == ST_EB164 &&
+ (hwrpb->rpb_variation & SV_ST_MASK) >= SV_ST_ALPHAPC164LX_400) ||
+ hwrpb->rpb_type == ST_DEC_550)
+ cia_ispyxis = TRUE;
+ else
+ cia_ispyxis = FALSE;
+
+
- if (alpha_implver() != ALPHA_IMPLVER_EV5
- || alpha_amask(ALPHA_AMASK_BWX)
- || !(cia_config & CNFG_BWEN))
+ /*
+ * ALCOR/ALCOR2 Revisions >= 2 and Pyxis have the CNFG register.
+ */
+ if (cia_rev >= 2 || cia_ispyxis)
+ cia_config = REGVAL(CIA_CSR_CNFG);
+ else
+ cia_config = 0;
+
+ if ((alpha_implver() < ALPHA_IMPLVER_EV5) ||
+ (alpha_amask(ALPHA_AMASK_BWX) != 0) ||
+ (cia_config & CNFG_BWEN) == 0) {
use_bwx = 0;
+ } else {
+ use_bwx = 1;
+ }
+ if (cia_ispyxis) {
+ if (use_bwx == 0) {
+ printf("PYXIS but not BWX?\n");
+ }
+ }
+
device_add_child(dev, "pcib", 0);
device_set_ivars(dev, (void *)use_bwx);
-
- chipset_bwx = use_bwx;
-
+ chipset_bwx = use_bwx = (use_bwx == (uintptr_t) 1);
return 0;
}
@@ -485,14 +492,14 @@
if (!platform.iointr) /* XXX */
set_iointr(alpha_dispatch_intr);
- if (cia_ispyxis) {
- snprintf(chipset_type, sizeof(chipset_type), "pyxis");
+ if (chipset_bwx) {
+ snprintf(chipset_type, sizeof(chipset_type), "cia/bwx");
chipset_bwx = 1;
chipset_ports = CIA_EV56_BWIO;
chipset_memory = CIA_EV56_BWMEM;
chipset_dense = CIA_PCI_DENSE;
} else {
- snprintf(chipset_type, sizeof(chipset_type), "cia");
+ snprintf(chipset_type, sizeof(chipset_type), "cia/swiz");
chipset_bwx = 0;
chipset_ports = CIA_PCI_SIO1;
chipset_memory = CIA_PCI_SMEM1;
Index: cam/scsi/scsi_sa.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0009101520380.23495-200000>
