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 <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2013-01-25 13:55:12 +01:00
parent ad9436f733
commit a68c0ae54d
1 changed files with 6 additions and 7 deletions

View File

@ -51,15 +51,14 @@ set -e
FIRMWARE_DIR="/lib/firmware/redpine/" 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
# TODO: Hardcoded until passed to kernel command line from U-Boot.
MAC_ADDR="00:04:F3:AA:BB:05" MAC_ADDR="00:04:F3:AA:BB:05"
fi
# TODO: Read wdmode from NVRAM or pass in kernel command line.
# Driver mode variable in u-boot takes precedence (for test purposes) # Driver mode variable in u-boot takes precedence (for test purposes)
#wdmode="$(ubootenv -p wdmode | sed 's,^wdmode=,,g')" wdmode=`cat /proc/cmdline | sed 's/\s/\n/g' | awk '/wdmode/ {print}' | sed 's/wdmode=//g'`
#[ "${wdmode}" = "1" -o "${wdmode}" = "2" ] && DRIVER_MODE="${wdmode}" [ "${wdmode}" = "1" -o "${wdmode}" = "2" ] && DRIVER_MODE="${wdmode}"
# Crystal frequency depends on the platform and HW revision. # Crystal frequency depends on the platform and HW revision.
# #