aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-03-02 11:49:28 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 18:09:23 -0400
commitd508eb79ab54917a9e741a09f3c1b699998e89f2 (patch)
tree1eae46665f0ad1337354b33223be3089910f4b5e /arch/mips/bcm47xx
parent96c10de32fde6c50e4f9e5c1f027e670073ea086 (diff)
MIPS: BCM47XX: Add detection and GPIO config for Siemens SE505v2
This adds board detection for the Siemens SE505v2 and the led gpio configuration. This board does not have any buttons. This is based on OpenWrt broadcom-diag and Manuel Munz's nvram dump. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: linux-mips@linux-mips.org Cc: zajec5@gmail.com Patchwork: https://patchwork.linux-mips.org/patch/6593/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r--arch/mips/bcm47xx/board.c17
-rw-r--r--arch/mips/bcm47xx/leds.c12
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c
index 63979dcec7e8..abfc04ebb5bd 100644
--- a/arch/mips/bcm47xx/board.c
+++ b/arch/mips/bcm47xx/board.c
@@ -181,6 +181,13 @@ struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
181 { {0}, NULL}, 181 { {0}, NULL},
182}; 182};
183 183
184/* boardtype, boardrev */
185static const
186struct bcm47xx_board_type_list2 bcm47xx_board_list_board_type_rev[] __initconst = {
187 {{BCM47XX_BOARD_SIEMENS_SE505V2, "Siemens SE505 V2"}, "0x0101", "0x10"},
188 { {0}, NULL},
189};
190
184static const 191static const
185struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = { 192struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = {
186 {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, 193 {BCM47XX_BOARD_UNKNOWN, "Unknown Board"},
@@ -274,6 +281,16 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void)
274 return &e3->board; 281 return &e3->board;
275 } 282 }
276 } 283 }
284
285 if (bcm47xx_nvram_getenv("boardtype", buf1, sizeof(buf1)) >= 0 &&
286 bcm47xx_nvram_getenv("boardrev", buf2, sizeof(buf2)) >= 0 &&
287 bcm47xx_nvram_getenv("boardnum", buf3, sizeof(buf3)) == -ENOENT) {
288 for (e2 = bcm47xx_board_list_board_type_rev; e2->value1; e2++) {
289 if (!strcmp(buf1, e2->value1) &&
290 !strcmp(buf2, e2->value2))
291 return &e2->board;
292 }
293 }
277 return bcm47xx_board_unknown; 294 return bcm47xx_board_unknown;
278} 295}
279 296
diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c
index d74117574f01..8bacc37e0382 100644
--- a/arch/mips/bcm47xx/leds.c
+++ b/arch/mips/bcm47xx/leds.c
@@ -383,6 +383,14 @@ bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
383 BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF), 383 BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF),
384}; 384};
385 385
386/* Siemens */
387static const struct gpio_led
388bcm47xx_leds_siemens_se505v2[] __initconst = {
389 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
390 BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
391 BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
392};
393
386/* SimpleTech */ 394/* SimpleTech */
387 395
388static const struct gpio_led 396static const struct gpio_led
@@ -562,6 +570,10 @@ void __init bcm47xx_leds_register(void)
562 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2); 570 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2);
563 break; 571 break;
564 572
573 case BCM47XX_BOARD_SIEMENS_SE505V2:
574 bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2);
575 break;
576
565 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: 577 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
566 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare); 578 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare);
567 break; 579 break;