From 899b28acdb0f65521405540b7a52b2ad05049720 Mon Sep 17 00:00:00 2001 From: Piotr Kleinschmidt Date: Thu, 18 Jun 2020 12:30:42 +0200 Subject: mb/pcengines/apu1/mainboard.c: reorder includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally, there was problem with PC Engines apu1 platform which returned serial number value as -64. It was caused by wrong value of dev->bus->secondary. Source of the problem is in Porting.h header file. It contains '#pragma pack(1)' which affects struct device. As mainboard.c uses different binary layout because of this attribute, reference dev->bus->secondary lands at wrong memory address. This patch reorder includes and put and at the end of list, making struct device consistent. As a result bus number value in device's structure is correct and hence serial number. TEST=`dmidecode -t 2` command in Linux Debian Signed-off-by: Piotr Kleinschmidt Change-Id: I5e8690d100b38ac7889395d375c0ff32bdefda0b Reviewed-on: https://review.coreboot.org/c/coreboot/+/42512 Reviewed-by: Michał Żygowski Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/mainboard/pcengines/apu1/mainboard.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mainboard') diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c index a2a78c55ce..45d326a818 100644 --- a/src/mainboard/pcengines/apu1/mainboard.c +++ b/src/mainboard/pcengines/apu1/mainboard.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include -#include + #include #include #include @@ -11,12 +10,14 @@ #include #include #include -#include #include #include #include #include #include "gpio_ftns.h" +#include +#include +#include /*********************************************************** * These arrays set up the FCH PCI_INTR registers 0xC00/0xC01. @@ -301,7 +302,7 @@ const char *smbios_mainboard_serial_number(void) /* 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); -- cgit v1.2.3