diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-07-09 12:52:18 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-07-09 12:52:18 +0000 |
commit | f42a1b166f43219853c00dc21f25b0254efbbceb (patch) | |
tree | 8fac5ee67f0a836a95385d15ae8f729d34660b9e /target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch | |
parent | f56e62651455e1a7cdae45a4a12d5258e57dbb75 (diff) | |
download | master-187ad058-f42a1b166f43219853c00dc21f25b0254efbbceb.tar.gz master-187ad058-f42a1b166f43219853c00dc21f25b0254efbbceb.tar.bz2 master-187ad058-f42a1b166f43219853c00dc21f25b0254efbbceb.zip |
ar71xx: add linux 3.10
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37214 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch')
-rw-r--r-- | target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch b/target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch new file mode 100644 index 0000000000..67c1faf9b0 --- /dev/null +++ b/target/linux/ar71xx/patches-3.10/507-MIPS-ath79-prom-add-myloader-support.patch @@ -0,0 +1,58 @@ +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -16,6 +16,7 @@ + + #include <asm/bootinfo.h> + #include <asm/addrspace.h> ++#include <asm/fw/myloader/myloader.h> + + #include "common.h" + +@@ -69,6 +70,37 @@ static const char * __init ath79_prom_fi + return ret; + } + ++static int __init ath79_prom_init_myloader(void) ++{ ++ struct myloader_info *mylo; ++ char mac_buf[32]; ++ unsigned char *mac; ++ ++ mylo = myloader_get_info(); ++ if (!mylo) ++ return 0; ++ ++ switch (mylo->did) { ++ case DEVID_COMPEX_WP543: ++ ath79_prom_append_cmdline("board", "WP543"); ++ break; ++ case DEVID_COMPEX_WPE72: ++ ath79_prom_append_cmdline("board", "WPE72"); ++ break; ++ default: ++ pr_warn("prom: unknown device id: %x\n", mylo->did); ++ return 0; ++ } ++ ++ mac = mylo->macs[0]; ++ snprintf(mac_buf, sizeof(mac_buf), "%02x:%02x:%02x:%02x:%02x:%02x", ++ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); ++ ++ ath79_prom_append_cmdline("ethaddr", mac_buf); ++ ++ return 1; ++} ++ + static __init void ath79_prom_init_cmdline(int argc, char **argv) + { + int i; +@@ -88,6 +120,9 @@ void __init prom_init(void) + const char *env; + char **envp; + ++ if (ath79_prom_init_myloader()) ++ return; ++ + ath79_prom_init_cmdline(fw_arg0, (char **)fw_arg1); + + envp = (char **)fw_arg2; |