diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-12-16 12:41:48 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-12-16 12:41:48 +0000 |
commit | 098732a6d32ffd022588e9e287dcbf77f6cc9e92 (patch) | |
tree | e71047a2c6629c5312b0ec7aad5e72dad6e693e5 /target/linux/ar71xx | |
parent | 6ea3cd876a2de6a1b6d5e7104f7d4b7b8e630912 (diff) | |
download | master-187ad058-098732a6d32ffd022588e9e287dcbf77f6cc9e92.tar.gz master-187ad058-098732a6d32ffd022588e9e287dcbf77f6cc9e92.tar.bz2 master-187ad058-098732a6d32ffd022588e9e287dcbf77f6cc9e92.zip |
ar71xx: rb2011: use board name from the hardware config
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39096 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c | 15 | ||||
-rw-r--r-- | target/linux/ar71xx/patches-3.10/300-MIPS-add-MIPS_MACHINE_NONAME-macro.patch | 21 |
2 files changed, 30 insertions, 6 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c index c0c24a5d26..916368465b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c @@ -24,6 +24,7 @@ #include <linux/routerboot.h> #include <linux/gpio.h> +#include <asm/prom.h> #include <asm/mach-ath79/ath79.h> #include <asm/mach-ath79/ar71xx_regs.h> @@ -237,11 +238,16 @@ static void __init rb2011_sfp_init(void) static int __init rb2011_setup(u32 flags) { const struct rb_info *info; + char buf[64]; info = rb_init_info((void *) KSEG1ADDR(0x1f000000), 0x10000); if (!info) return -ENODEV; + scnprintf(buf, sizeof(buf), "Mikrotik RouterBOARD %s", + (info->board_name) ? info->board_name : ""); + mips_set_machine_name(buf); + rb2011_init_partitions(info); ath79_register_m25p80(&rb2011_spi_flash_data); @@ -290,16 +296,14 @@ static void __init rb2011l_setup(void) rb2011_setup(0); } -MIPS_MACHINE(ATH79_MACH_RB_2011L, "2011L", "MikroTik RouterBOARD 2011L", - rb2011l_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_2011L, "2011L", rb2011l_setup); static void __init rb2011us_setup(void) { rb2011_setup(RB2011_FLAG_SFP | RB2011_FLAG_USB); } -MIPS_MACHINE(ATH79_MACH_RB_2011US, "2011US", "MikroTik RouterBOARD 2011UAS", - rb2011us_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_2011US, "2011US", rb2011us_setup); static void __init rb2011g_setup(void) { @@ -308,5 +312,4 @@ static void __init rb2011g_setup(void) RB2011_FLAG_WLAN); } -MIPS_MACHINE(ATH79_MACH_RB_2011G, "2011G", "MikroTik RouterBOARD 2011UAS-2HnD", - rb2011g_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_2011G, "2011G", rb2011g_setup); diff --git a/target/linux/ar71xx/patches-3.10/300-MIPS-add-MIPS_MACHINE_NONAME-macro.patch b/target/linux/ar71xx/patches-3.10/300-MIPS-add-MIPS_MACHINE_NONAME-macro.patch new file mode 100644 index 0000000000..0bc64b7a17 --- /dev/null +++ b/target/linux/ar71xx/patches-3.10/300-MIPS-add-MIPS_MACHINE_NONAME-macro.patch @@ -0,0 +1,21 @@ +--- a/arch/mips/include/asm/mips_machine.h ++++ b/arch/mips/include/asm/mips_machine.h +@@ -36,6 +36,18 @@ static struct mips_machine machine_##_ty + .mach_setup = _setup, \ + }; + ++#define MIPS_MACHINE_NONAME(_type, _id, _setup) \ ++static const char machine_id_##_type[] __initconst \ ++ __aligned(1) = _id; \ ++static struct mips_machine machine_##_type \ ++ __used __section(.mips.machines.init) = \ ++{ \ ++ .mach_type = _type, \ ++ .mach_id = machine_id_##_type, \ ++ .mach_name = NULL, \ ++ .mach_setup = _setup, \ ++}; ++ + extern long __mips_machines_start; + extern long __mips_machines_end; + |