summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/io/pci/pci_boot.c
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2021-09-28 15:26:03 -0500
committerRichard Lowe <richlowe@richlowe.net>2022-05-17 13:28:47 -0500
commitd4039345c8fe6e54a31d17d91e86e393fdcf401b (patch)
treeab973b47718004453559face05c726366767866e /usr/src/uts/intel/io/pci/pci_boot.c
parent68c72dd193abdcff98b7e21c4f9d7a4ba41d284b (diff)
downloadillumos-gate-d4039345c8fe6e54a31d17d91e86e393fdcf401b.tar.gz
14628 ancient devicedb should be removed
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/uts/intel/io/pci/pci_boot.c')
-rw-r--r--usr/src/uts/intel/io/pci/pci_boot.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/usr/src/uts/intel/io/pci/pci_boot.c b/usr/src/uts/intel/io/pci/pci_boot.c
index 25bae81079..ab3b5a5a8f 100644
--- a/usr/src/uts/intel/io/pci/pci_boot.c
+++ b/usr/src/uts/intel/io/pci/pci_boot.c
@@ -1740,6 +1740,18 @@ enumerate_bus_devs(uchar_t bus, int config_op)
}
}
+/*
+ * As a workaround for devices which is_pciide() (below, which see) would not
+ * match due to device issues, check an undocumented device tree property
+ * 'pci-ide', the value of which is a 1275 device identifier.
+ *
+ * Should a device matching this (in normal 'compatible' order) be found, and
+ * the device not otherwise bound, it will be have its node name changed to
+ * 'pci-ide' so the pci-ide driver will attach.
+ *
+ * This can be set via `eeprom pci-ide=pciXXXX,YYYY` (see eeprom(8)) or
+ * otherwise added to bootenv.rc.
+ */
static int
check_pciide_prop(uchar_t revid, ushort_t venid, ushort_t devid,
ushort_t subvenid, ushort_t subdevid)
@@ -1790,18 +1802,22 @@ static int
is_pciide(uchar_t basecl, uchar_t subcl, uchar_t revid,
ushort_t venid, ushort_t devid, ushort_t subvenid, ushort_t subdevid)
{
- struct ide_table { /* table for PCI_MASS_OTHER */
+ struct ide_table {
ushort_t venid;
ushort_t devid;
} *entry;
- /* XXX SATA and other devices: need a way to add dynamically */
+ /*
+ * Devices which need to be matched specially as pci-ide because of
+ * various device issues. Commonly their specification as being
+ * PCI_MASS_OTHER or PCI_MASS_SATA despite our using them in ATA mode.
+ */
static struct ide_table ide_other[] = {
- {0x1095, 0x3112},
- {0x1095, 0x3114},
- {0x1095, 0x3512},
- {0x1095, 0x680}, /* Sil0680 */
- {0x1283, 0x8211}, /* ITE 8211F is subcl PCI_MASS_OTHER */
+ {0x1095, 0x3112}, /* Silicon Image 3112 SATALink/SATARaid */
+ {0x1095, 0x3114}, /* Silicon Image 3114 SATALink/SATARaid */
+ {0x1095, 0x3512}, /* Silicon Image 3512 SATALink/SATARaid */
+ {0x1095, 0x680}, /* Silicon Image PCI0680 Ultra ATA-133 */
+ {0x1283, 0x8211}, /* Integrated Technology Express 8211F */
{0, 0}
};
@@ -1820,7 +1836,7 @@ is_pciide(uchar_t basecl, uchar_t subcl, uchar_t revid,
}
entry = &ide_other[0];
- while (entry->venid) {
+ while (entry->venid != 0) {
if (entry->venid == venid && entry->devid == devid)
return (1);
entry++;
@@ -1832,9 +1848,9 @@ static int
is_display(uint_t classcode)
{
static uint_t disp_classes[] = {
- 0x000100,
- 0x030000,
- 0x030001
+ 0x000100, /* pre-class code VGA Compatible */
+ 0x030000, /* VGA Compatible */
+ 0x030001 /* VGA+8514 Compatible */
};
int i, nclasses = sizeof (disp_classes) / sizeof (uint_t);
@@ -2209,7 +2225,7 @@ process_devfunc(uchar_t bus, uchar_t dev, uchar_t func, uchar_t header,
*
* If it is, check if any other higher precedence driver listed in
* driver_aliases will claim the node by calling
- * ddi_compatibile_driver_major. If so, clear pciide and do not
+ * ddi_compatible_driver_major. If so, clear pciide and do not
* create a pci-ide node or any other special handling.
*
* If another driver does not bind, set the node name to pci-ide
@@ -2473,7 +2489,7 @@ static struct {
};
static int
-pciIdeAdjustBAR(uchar_t progcl, int index, uint_t *basep, uint_t *lenp)
+pciide_adjust_bar(uchar_t progcl, int index, uint_t *basep, uint_t *lenp)
{
int hard_decode = 0;
@@ -2616,7 +2632,7 @@ add_reg_props(dev_info_t *dip, uchar_t bus, uchar_t dev, uchar_t func,
if (subclass != PCI_MASS_IDE)
progclass = (PCI_IDE_IF_NATIVE_PRI |
PCI_IDE_IF_NATIVE_SEC);
- hard_decode = pciIdeAdjustBAR(progclass, j,
+ hard_decode = pciide_adjust_bar(progclass, j,
&base, &len);
} else if (value == 0) {
/* skip base regs with size of 0 */