Piotr Kleinschmidt has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42512 )
Change subject: mb/pcengines/apu1/mainboard.c: fix apu1 serial number counting ......................................................................
mb/pcengines/apu1/mainboard.c: fix apu1 serial number counting
PC Engines apu1 platform returns serial number value as -64. It is caused by faulty read of NIC's registers. This patch adjust NIC's bus number to valid value, so NIC's registers can be correctly read and hence NIC's MAC address.
TEST=`dmidecode -t 2` command in Linux Debian
Signed-off-by: Piotr Kleinschmidt piotr.kleinschmidt@3mdeb.com Change-Id: I5e8690d100b38ac7889395d375c0ff32bdefda0b --- M src/mainboard/pcengines/apu1/mainboard.c 1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/42512/1
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c index a2a78c5..b297061 100644 --- a/src/mainboard/pcengines/apu1/mainboard.c +++ b/src/mainboard/pcengines/apu1/mainboard.c @@ -299,9 +299,18 @@ if (!dev) return serial;
+ /* FIXME: dev->bus->secondary has 0x100 value, while it should + * has 0x001 value, as it is on PCI bridge 1. + * Without this workaround pci_read_config32(dev, 0x18) returns + * incorrect data and hence platform's serial number is incorrect. + * However, shifting dev->bus->secondary 8 bits right is not + * reliable solution, as the problem probably lies earlier. + */ + dev->bus->secondary >>= 8; + /* Read in the last 3 bytes of NIC's MAC address. */ bar18 = pci_read_config32(dev, 0x18); - bar18 &= 0xFFFFFC00; + bar18 &= 0xFFFFFFF0; for (i = 3; i < 6; i++) { mac_addr <<= 8; mac_addr |= read8((u8 *)bar18 + i);