137bf6b84e61627b1b3cfc81e3e4e7971fd8b103
[openwrt.git] / target / linux / ar71xx / patches-3.3 / 507-MIPS-ath79-prom-add-myloader-support.patch
1 --- a/arch/mips/ath79/prom.c
2 +++ b/arch/mips/ath79/prom.c
3 @@ -16,6 +16,7 @@
4
5 #include <asm/bootinfo.h>
6 #include <asm/addrspace.h>
7 +#include <asm/fw/myloader/myloader.h>
8
9 #include "common.h"
10
11 @@ -69,6 +70,34 @@ static const char * __init ath79_prom_fi
12 return ret;
13 }
14
15 +static int __init ath79_prom_init_myloader(void)
16 +{
17 + struct myloader_info *mylo;
18 + char mac_buf[32];
19 + unsigned char *mac;
20 +
21 + mylo = myloader_get_info();
22 + if (!mylo)
23 + return 0;
24 +
25 + switch (mylo->did) {
26 + case DEVID_COMPEX_WP543:
27 + ath79_prom_append_cmdline("board", "WP543");
28 + break;
29 + default:
30 + pr_warn("prom: unknown device id: %x\n", mylo->did);
31 + return 0;
32 + }
33 +
34 + mac = mylo->macs[0];
35 + snprintf(mac_buf, sizeof(mac_buf), "%02x:%02x:%02x:%02x:%02x:%02x",
36 + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
37 +
38 + ath79_prom_append_cmdline("ethaddr", mac_buf);
39 +
40 + return 1;
41 +}
42 +
43 static __init void ath79_prom_init_cmdline(int argc, char **argv)
44 {
45 int i;
46 @@ -88,6 +117,9 @@ void __init prom_init(void)
47 const char *env;
48 char **envp;
49
50 + if (ath79_prom_init_myloader())
51 + return;
52 +
53 ath79_prom_init_cmdline(fw_arg0, (char **)fw_arg1);
54
55 envp = (char **)fw_arg2;
This page took 0.048926 seconds and 3 git commands to generate.