From a68c0ae54d7a2f19f58ebab49a6efa7af35676d5 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 25 Jan 2013 13:55:12 +0100 Subject: [PATCH] kernel-module-redpine: Set mac address and wdmode from kernel command line. The bootloader is passing the mac address and wdmode in the kernel command line. The driver startup script reads and and sets them. Signed-off-by: Alex Gonzalez --- .../kernel-module-redpine/files/redpine | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine b/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine index acd500906..190db555c 100644 --- a/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine +++ b/meta-digi-arm/recipes-kernel/kernel-module-redpine/files/redpine @@ -51,15 +51,14 @@ set -e FIRMWARE_DIR="/lib/firmware/redpine/" -#MAC_ADDR="$(nvram print module ethaddr2 | sed 's,ethaddr2=,,g')" +MAC_ADDR=`cat /proc/cmdline | sed 's/\s/\n/g' | awk '/ethaddr2/ {print}' | sed 's/ethaddr2=//g'` +if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then + MAC_ADDR="00:04:F3:AA:BB:05" +fi -# TODO: Hardcoded until passed to kernel command line from U-Boot. -MAC_ADDR="00:04:F3:AA:BB:05" - -# TODO: Read wdmode from NVRAM or pass in kernel command line. # Driver mode variable in u-boot takes precedence (for test purposes) -#wdmode="$(ubootenv -p wdmode | sed 's,^wdmode=,,g')" -#[ "${wdmode}" = "1" -o "${wdmode}" = "2" ] && DRIVER_MODE="${wdmode}" +wdmode=`cat /proc/cmdline | sed 's/\s/\n/g' | awk '/wdmode/ {print}' | sed 's/wdmode=//g'` +[ "${wdmode}" = "1" -o "${wdmode}" = "2" ] && DRIVER_MODE="${wdmode}" # Crystal frequency depends on the platform and HW revision. #