summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-07-19 17:58:40 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-07-19 17:58:40 +0000
commit78b1a6b773aaebdeff6f6b43df98598749e44930 (patch)
tree1cacb1c7de856ee70af780d86e6c70b9559bb247 /target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch
parentd26e8d9439052ed8f433b6ffb15a5f0c54712121 (diff)
downloadmtk-20170518-78b1a6b773aaebdeff6f6b43df98598749e44930.zip
mtk-20170518-78b1a6b773aaebdeff6f6b43df98598749e44930.tar.gz
mtk-20170518-78b1a6b773aaebdeff6f6b43df98598749e44930.tar.bz2
ar71xx: add 4.1 support
Signed-off-by: Roman Yeryomin <roman@advem.lv> SVN-Revision: 46426
Diffstat (limited to 'target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch')
-rw-r--r--target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch b/target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch
new file mode 100644
index 0000000..1761fcd
--- /dev/null
+++ b/target/linux/ar71xx/patches-4.1/507-MIPS-ath79-prom-add-myloader-support.patch
@@ -0,0 +1,55 @@
+--- a/arch/mips/ath79/prom.c
++++ b/arch/mips/ath79/prom.c
+@@ -18,6 +18,7 @@
+ #include <asm/bootinfo.h>
+ #include <asm/addrspace.h>
+ #include <asm/fw/fw.h>
++#include <asm/fw/myloader/myloader.h>
+
+ #include "common.h"
+
+@@ -31,10 +32,44 @@ static void __init ath79_prom_append_cmd
+ strlcat(arcs_cmdline, ath79_cmdline_buf, sizeof(arcs_cmdline));
+ }
+
++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;
++}
++
+ void __init prom_init(void)
+ {
+ const char *env;
+
++ if (ath79_prom_init_myloader())
++ return;
++
+ fw_init_cmdline();
+
+ env = fw_getenv("ethaddr");