brcm47xx: update board detection patches
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.10 / 072-MIPS-BCM47XX-only-print-SoC-name-in-system-type-in-c.patch
1 commit 88aaea30099c1562c4b4015d965c22df29034a74
2 Author: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Thu Sep 19 22:01:53 2013 +0200
4
5 MIPS: BCM47XX: only print SoC name in system type in cpuinfo
6
7 Recently the output of "system type" in /proc/cpuinfo was changed to
8 Broadcom BCM4730 (Some sample board), but it is better to just print
9 the SoC name in the "system type" entry. The board name will be added
10 in the machine entry later.
11
12 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13
14 --- a/arch/mips/bcm47xx/prom.c
15 +++ b/arch/mips/bcm47xx/prom.c
16 @@ -37,32 +37,19 @@
17
18 static int cfe_cons_handle;
19
20 -static u16 get_chip_id(void)
21 -{
22 - switch (bcm47xx_bus_type) {
23 -#ifdef CONFIG_BCM47XX_SSB
24 - case BCM47XX_BUS_TYPE_SSB:
25 - return bcm47xx_bus.ssb.chip_id;
26 -#endif
27 -#ifdef CONFIG_BCM47XX_BCMA
28 - case BCM47XX_BUS_TYPE_BCMA:
29 - return bcm47xx_bus.bcma.bus.chipinfo.id;
30 -#endif
31 - }
32 - return 0;
33 -}
34 +static char bcm47xx_system_type[20] = "Broadcom BCM47XX";
35
36 const char *get_system_type(void)
37 {
38 - static char buf[50];
39 - u16 chip_id = get_chip_id();
40 -
41 - snprintf(buf, sizeof(buf),
42 - (chip_id > 0x9999) ? "Broadcom BCM%d (%s)" :
43 - "Broadcom BCM%04X (%s)",
44 - chip_id, bcm47xx_board_get_name());
45 + return bcm47xx_system_type;
46 +}
47
48 - return buf;
49 +__init void bcm47xx_set_system_type(u16 chip_id)
50 +{
51 + snprintf(bcm47xx_system_type, sizeof(bcm47xx_system_type),
52 + (chip_id > 0x9999) ? "Broadcom BCM%d" :
53 + "Broadcom BCM%04X",
54 + chip_id);
55 }
56
57 void prom_putchar(char c)
58 --- a/arch/mips/bcm47xx/setup.c
59 +++ b/arch/mips/bcm47xx/setup.c
60 @@ -210,12 +210,14 @@ void __init plat_mem_setup(void)
61 #ifdef CONFIG_BCM47XX_BCMA
62 bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA;
63 bcm47xx_register_bcma();
64 + bcm47xx_set_system_type(bcm47xx_bus.bcma.bus.chipinfo.id);
65 #endif
66 } else {
67 printk(KERN_INFO "bcm47xx: using ssb bus\n");
68 #ifdef CONFIG_BCM47XX_SSB
69 bcm47xx_bus_type = BCM47XX_BUS_TYPE_SSB;
70 bcm47xx_register_ssb();
71 + bcm47xx_set_system_type(bcm47xx_bus.ssb.chip_id);
72 #endif
73 }
74
75 --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
76 +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
77 @@ -56,4 +56,6 @@ void bcm47xx_fill_bcma_boardinfo(struct
78 const char *prefix);
79 #endif
80
81 +void bcm47xx_set_system_type(u16 chip_id);
82 +
83 #endif /* __ASM_BCM47XX_H */