Arthur Heymans (arthur(a)aheymans.xyz) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18088
-gerrit
commit 46280770835e31b48f805fa4509cc48039f8b472
Author: Arthur Heymans <arthur(a)aheymans.xyz>
Date: Tue Jan 10 15:44:47 2017 +0100
drivers/net/rt8168: Add a macaddress cbfsfile using Kconfig
The default macaddress in rt8168.c can be changed with a cbfsfile
called macaddress. This patch makes it possible to add such a file
using Kconfig at build time.
This also changes the name of the cbfsfile from "macaddress" to
"rt8168-macaddress" to avoid confusion.
Change-Id: I24674d8df11845167b837b79344427ce0c67f4fb
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
src/drivers/net/Kconfig | 10 ++++++++++
src/drivers/net/Makefile.inc | 10 ++++++++++
src/drivers/net/r8168.c | 6 +++---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/drivers/net/Kconfig b/src/drivers/net/Kconfig
index e9c6e71..274a591 100644
--- a/src/drivers/net/Kconfig
+++ b/src/drivers/net/Kconfig
@@ -3,3 +3,13 @@ config REALTEK_8168_RESET
help
This forces a realtek 10ec:8168 card to reset to ensure power state
is correct at boot.
+
+config REALTEK_8168_MACADDRESS
+ string "Realtek rt8168 mac address"
+ depends on REALTEK_8168_RESET
+ default "00:e0:4c:00:c0:b0"
+ help
+ This is a string to set the mac address on a Realtek rt8168 card.
+ It must be in the form of "xx:xx:xx:xx:xx:xx", where x is a
+ hexadecimal number for it to be valid. Failing to do so will
+ result in the default macaddress being used.
diff --git a/src/drivers/net/Makefile.inc b/src/drivers/net/Makefile.inc
index e435d48..20dbe50 100644
--- a/src/drivers/net/Makefile.inc
+++ b/src/drivers/net/Makefile.inc
@@ -1,3 +1,13 @@
romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c
ramstage-$(CONFIG_REALTEK_8168_RESET) += r8168.c
+
+ifneq ($(CONFIG_REALTEK_8168_MACADDRESS),"")
+$(obj)/rt8168-macaddress: $(DOTCONFIG)
+ echo " Creating a file holding the rt8168 macaddress"
+ printf %s $(CONFIG_REALTEK_8168_MACADDRESS) > $@
+
+cbfs-files-$(CONFIG_REALTEK_8168_RESET) += rt8168-macaddress
+rt8168-macaddress-file := $(obj)/rt8168-macaddress
+rt8168-macaddress-type := raw
+endif
diff --git a/src/drivers/net/r8168.c b/src/drivers/net/r8168.c
index 90171d5..61c36e9 100644
--- a/src/drivers/net/r8168.c
+++ b/src/drivers/net/r8168.c
@@ -88,14 +88,14 @@ static void program_mac_address(struct device *dev, u16 io_base)
int i = 0;
u8 mac[6] = { 0x00, 0xe0, 0x4c, 0x00, 0xc0, 0xb0 };
- if (!cbfs_boot_locate(&fh, "macaddress", &matchraw)) {
+ if (!cbfs_boot_locate(&fh, "rt8168-macaddress", &matchraw)) {
if (rdev_readat(&fh.data, macstrbuf, 0, MACLEN) == MACLEN)
get_mac_address(mac, macstrbuf);
else
printk(BIOS_ERR, "r8168: Error reading MAC from CBFS\n");
} else {
- printk(BIOS_ERR, "r8168: 'macaddress' not found in CBFS, "
- "using default 00:e0:4c:00:c0:b0\n");
+ printk(BIOS_ERR, "r8168: 'rt8168-macaddress' not found in CBFS,"
+ " using default 00:e0:4c:00:c0:b0\n");
}
/* Reset NIC */
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18220
-gerrit
commit 0585a6c91a927b16e1543fce7b7164083d2996a9
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Tue Jan 24 12:30:04 2017 +0100
arch/x86: do not define type of SPIN_LOCK_UNLOCKED
This fixes building coreboot with -std=gnu11 on gcc 4.9.x
Change-Id: I920d492a1422433d7d4b4659b27f5a22914bc438
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
src/arch/x86/include/arch/smp/spinlock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/arch/x86/include/arch/smp/spinlock.h b/src/arch/x86/include/arch/smp/spinlock.h
index 24f52f1..767f96e 100644
--- a/src/arch/x86/include/arch/smp/spinlock.h
+++ b/src/arch/x86/include/arch/smp/spinlock.h
@@ -36,7 +36,7 @@ spinlock_t* romstage_microcode_cbfs_lock(void);
void initialize_romstage_microcode_cbfs_lock(void);
#endif
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
+#define SPIN_LOCK_UNLOCKED { 1 }
#ifndef __PRE_RAM__
#define DECLARE_SPIN_LOCK(x) static spinlock_t x = SPIN_LOCK_UNLOCKED;