agesa/hudson pi/hudson: Skip device node search

The device node with requested path is already known.

Change-Id: I2de6a2a6893b1a24085ebcafd5d7604214ed10ef
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/26428
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Kyösti Mälkki 2018-05-20 10:39:10 +03:00
parent 1cbe19f2d8
commit b11d4e3ea4
2 changed files with 4 additions and 13 deletions

View File

@ -83,10 +83,7 @@ void hudson_enable(struct device *dev)
switch (dev->path.pci.devfn) { switch (dev->path.pci.devfn) {
case PCI_DEVFN(0x14, 5): case PCI_DEVFN(0x14, 5):
if (dev->enabled == 0) { if (dev->enabled == 0) {
// read the VENDEV ID u32 usb_device_id = pci_read_config32(dev, 0) >> 16;
struct device *usb_dev =
dev_find_slot( 0, PCI_DEVFN( 0x14, 5));
u32 usb_device_id = pci_read_config32(usb_dev, 0) >> 16;
u8 reg8; u8 reg8;
if (usb_device_id == PCI_DEVICE_ID_AMD_SB900_USB_20_5) { if (usb_device_id == PCI_DEVICE_ID_AMD_SB900_USB_20_5) {
/* turn off and remove device 0:14.5 from PCI space */ /* turn off and remove device 0:14.5 from PCI space */
@ -99,10 +96,7 @@ void hudson_enable(struct device *dev)
case PCI_DEVFN(0x14, 7): case PCI_DEVFN(0x14, 7):
if (dev->enabled == 0) { if (dev->enabled == 0) {
// read the VENDEV ID u32 sd_device_id = pci_read_config32(dev, 0) >> 16;
struct device *sd_dev =
dev_find_slot( 0, PCI_DEVFN( 0x14, 7));
u32 sd_device_id = pci_read_config32( sd_dev, 0) >> 16;
/* turn off the SDHC controller in the PM reg */ /* turn off the SDHC controller in the PM reg */
u8 reg8; u8 reg8;
if (sd_device_id == PCI_DEVICE_ID_AMD_HUDSON_SD) { if (sd_device_id == PCI_DEVICE_ID_AMD_HUDSON_SD) {

View File

@ -59,12 +59,9 @@ void hudson_enable(struct device *dev)
{ {
printk(BIOS_DEBUG, "hudson_enable()\n"); printk(BIOS_DEBUG, "hudson_enable()\n");
switch (dev->path.pci.devfn) { switch (dev->path.pci.devfn) {
case (0x14 << 3) | 7: /* 0:14.7 SD */ case PCI_DEVFN(0x14, 7): /* SD */
if (dev->enabled == 0) { if (dev->enabled == 0) {
// read the VENDEV ID u32 sd_device_id = pci_read_config32(dev, 0) >> 16;
struct device *sd_dev =
dev_find_slot( 0, PCI_DEVFN( 0x14, 7));
u32 sd_device_id = pci_read_config32( sd_dev, 0) >> 16;
/* turn off the SDHC controller in the PM reg */ /* turn off the SDHC controller in the PM reg */
u8 reg8; u8 reg8;
if (sd_device_id == PCI_DEVICE_ID_AMD_HUDSON_SD) { if (sd_device_id == PCI_DEVICE_ID_AMD_HUDSON_SD) {