Arthur Heymans (arthur@aheymans.xyz) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18088
-gerrit
commit f33ec95f4df48400c5bdb08876dd62ca102f9fe1 Author: Arthur Heymans arthur@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.
Change-Id: I24674d8df11845167b837b79344427ce0c67f4fb Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- src/drivers/net/Kconfig | 10 ++++++++++ src/drivers/net/Makefile.inc | 8 ++++++++ 2 files changed, 18 insertions(+)
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..fdb85cc 100644 --- a/src/drivers/net/Makefile.inc +++ b/src/drivers/net/Makefile.inc @@ -1,3 +1,11 @@ romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c ramstage-$(CONFIG_REALTEK_8168_RESET) += r8168.c + +$(obj)/macaddress: + echo " Creating a file holding the rt8168 macaddress" + printf %s $(CONFIG_REALTEK_8168_MACADDRESS) > $@ + +cbfs-files-$(CONFIG_REALTEK_8168_RESET) += macaddress +macaddress-file := $(obj)/macaddress +macaddress-type := raw