summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-08-02 13:48:10 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-08-02 13:48:10 +0000
commitba2b02e7ad57de1371c81926430df0b4214de346 (patch)
tree3ed22f3caf4a49e8ffb28cedb5d80e1fcc898c98 /sys/arch
parent4e195c3067ccc764fcab6a0db3193f5d330b0cc8 (diff)
Ignore the ata channel on 164SX when controller is the built-in one, when
looking for the boot device; PR #5895
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/dec_eb164.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/arch/alpha/alpha/dec_eb164.c b/sys/arch/alpha/alpha/dec_eb164.c
index aa02493655a..32315c9a379 100644
--- a/sys/arch/alpha/alpha/dec_eb164.c
+++ b/sys/arch/alpha/alpha/dec_eb164.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dec_eb164.c,v 1.15 2008/07/16 20:03:20 miod Exp $ */
+/* $OpenBSD: dec_eb164.c,v 1.16 2008/08/02 13:48:09 miod Exp $ */
/* $NetBSD: dec_eb164.c,v 1.33 2000/05/22 20:13:32 thorpej Exp $ */
/*
@@ -250,6 +250,7 @@ dec_eb164_device_register(dev, aux)
*/
if (!strcmp(cd->cd_name, "wd")) {
struct ata_atapi_attach *aa_link = aux;
+ int variation = hwrpb->rpb_variation & SV_ST_MASK;
if ((strncmp("pciide", parent->dv_xname, 6) != 0))
return;
@@ -260,10 +261,26 @@ dec_eb164_device_register(dev, aux)
aa_link->aa_drv_data->drive, aa_link->aa_channel));
DR_VERBOSE(printf("Bootdev info: unit: %d, channel: %d\n",
b->unit, b->channel));
- if (b->unit != aa_link->aa_drv_data->drive ||
- b->channel != aa_link->aa_channel)
+ if (b->unit != aa_link->aa_drv_data->drive)
return;
+ /*
+ * On 164SX, the built-in IDE controller appears as
+ * two distinct pciide devices, both with a single
+ * channel. However SRM will nevertheless pretend
+ * the second channel is channel #1 of the second
+ * device, while it is really channel #0, so just
+ * ignore the channel number in this case.
+ */
+ if (variation >= SV_ST_ALPHAPC164SX_400 &&
+ variation <= SV_ST_ALPHAPC164SX_600 &&
+ b->slot == 0 * 1000 + 2 * 100 + 8) {
+ /* nothing */
+ } else {
+ if (b->channel != aa_link->aa_channel)
+ return;
+ }
+
/* we've found it! */
booted_device = dev;
DR_VERBOSE(printf("booted_device = %s\n", dev->dv_xname));