Commit 786c497a authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by Ralf Baechle

MIPS: BCM47XX: Add board detection

Detect on which board this code is running based on some nvram
settings. This is needed to start board specific workarounds and
configure the leds and buttons which are on different gpios on every board.

This patches add some boards we have seen, but there are many more.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5840
Patchwork: https://patchwork.linux-mips.org/patch/5855/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 85f32dbd
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
# #
obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
obj-y += board.o
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
This diff is collapsed.
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <asm/time.h> #include <asm/time.h>
#include <bcm47xx.h> #include <bcm47xx.h>
#include <bcm47xx_nvram.h> #include <bcm47xx_nvram.h>
#include <bcm47xx_board.h>
union bcm47xx_bus bcm47xx_bus; union bcm47xx_bus bcm47xx_bus;
EXPORT_SYMBOL(bcm47xx_bus); EXPORT_SYMBOL(bcm47xx_bus);
...@@ -221,6 +222,7 @@ void __init plat_mem_setup(void) ...@@ -221,6 +222,7 @@ void __init plat_mem_setup(void)
_machine_restart = bcm47xx_machine_restart; _machine_restart = bcm47xx_machine_restart;
_machine_halt = bcm47xx_machine_halt; _machine_halt = bcm47xx_machine_halt;
pm_power_off = bcm47xx_machine_halt; pm_power_off = bcm47xx_machine_halt;
bcm47xx_board_detect();
} }
static int __init bcm47xx_register_bus_complete(void) static int __init bcm47xx_register_bus_complete(void)
......
#ifndef __BCM47XX_BOARD_H
#define __BCM47XX_BOARD_H
enum bcm47xx_board {
BCM47XX_BOARD_ASUS_RTAC66U,
BCM47XX_BOARD_ASUS_RTN10,
BCM47XX_BOARD_ASUS_RTN10D,
BCM47XX_BOARD_ASUS_RTN10U,
BCM47XX_BOARD_ASUS_RTN12,
BCM47XX_BOARD_ASUS_RTN12B1,
BCM47XX_BOARD_ASUS_RTN12C1,
BCM47XX_BOARD_ASUS_RTN12D1,
BCM47XX_BOARD_ASUS_RTN12HP,
BCM47XX_BOARD_ASUS_RTN15U,
BCM47XX_BOARD_ASUS_RTN16,
BCM47XX_BOARD_ASUS_RTN53,
BCM47XX_BOARD_ASUS_RTN66U,
BCM47XX_BOARD_ASUS_WL300G,
BCM47XX_BOARD_ASUS_WL320GE,
BCM47XX_BOARD_ASUS_WL330GE,
BCM47XX_BOARD_ASUS_WL500GD,
BCM47XX_BOARD_ASUS_WL500GPV1,
BCM47XX_BOARD_ASUS_WL500GPV2,
BCM47XX_BOARD_ASUS_WL500W,
BCM47XX_BOARD_ASUS_WL520GC,
BCM47XX_BOARD_ASUS_WL520GU,
BCM47XX_BOARD_ASUS_WL700GE,
BCM47XX_BOARD_ASUS_WLHDD,
BCM47XX_BOARD_BELKIN_F7D4301,
BCM47XX_BOARD_BUFFALO_WBR2_G54,
BCM47XX_BOARD_BUFFALO_WHR2_A54G54,
BCM47XX_BOARD_BUFFALO_WHR_G125,
BCM47XX_BOARD_BUFFALO_WHR_G54S,
BCM47XX_BOARD_BUFFALO_WHR_HP_G54,
BCM47XX_BOARD_BUFFALO_WLA2_G54L,
BCM47XX_BOARD_BUFFALO_WZR_G300N,
BCM47XX_BOARD_BUFFALO_WZR_RS_G54,
BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP,
BCM47XX_BOARD_CISCO_M10V1,
BCM47XX_BOARD_CISCO_M20V1,
BCM47XX_BOARD_DELL_TM2300,
BCM47XX_BOARD_DLINK_DIR130,
BCM47XX_BOARD_DLINK_DIR330,
BCM47XX_BOARD_HUAWEI_E970,
BCM47XX_BOARD_LINKSYS_E900V1,
BCM47XX_BOARD_LINKSYS_E1000V1,
BCM47XX_BOARD_LINKSYS_E1000V2,
BCM47XX_BOARD_LINKSYS_E1000V21,
BCM47XX_BOARD_LINKSYS_E1200V2,
BCM47XX_BOARD_LINKSYS_E2000V1,
BCM47XX_BOARD_LINKSYS_E3000V1,
BCM47XX_BOARD_LINKSYS_E3200V1,
BCM47XX_BOARD_LINKSYS_E4200V1,
BCM47XX_BOARD_LINKSYS_WRT150NV1,
BCM47XX_BOARD_LINKSYS_WRT150NV11,
BCM47XX_BOARD_LINKSYS_WRT160NV1,
BCM47XX_BOARD_LINKSYS_WRT160NV3,
BCM47XX_BOARD_LINKSYS_WRT300NV11,
BCM47XX_BOARD_LINKSYS_WRT310NV1,
BCM47XX_BOARD_LINKSYS_WRT310NV2,
BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
BCM47XX_BOARD_LINKSYS_WRT610NV1,
BCM47XX_BOARD_LINKSYS_WRT610NV2,
BCM47XX_BOARD_LINKSYS_WRTSL54GS,
BCM47XX_BOARD_MOTOROLA_WE800G,
BCM47XX_BOARD_MOTOROLA_WR850GP,
BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
BCM47XX_BOARD_NETGEAR_WGR614V8,
BCM47XX_BOARD_NETGEAR_WGR614V9,
BCM47XX_BOARD_NETGEAR_WNDR3300,
BCM47XX_BOARD_NETGEAR_WNDR3400V1,
BCM47XX_BOARD_NETGEAR_WNDR3400V2,
BCM47XX_BOARD_NETGEAR_WNDR3400VCNA,
BCM47XX_BOARD_NETGEAR_WNDR3700V3,
BCM47XX_BOARD_NETGEAR_WNDR4000,
BCM47XX_BOARD_NETGEAR_WNDR4500V1,
BCM47XX_BOARD_NETGEAR_WNDR4500V2,
BCM47XX_BOARD_NETGEAR_WNR2000,
BCM47XX_BOARD_NETGEAR_WNR3500L,
BCM47XX_BOARD_NETGEAR_WNR3500U,
BCM47XX_BOARD_NETGEAR_WNR3500V2,
BCM47XX_BOARD_NETGEAR_WNR3500V2VC,
BCM47XX_BOARD_NETGEAR_WNR834BV2,
BCM47XX_BOARD_PHICOMM_M1,
BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE,
BCM47XX_BOARD_ZTE_H218N,
BCM47XX_BOARD_UNKNOWN,
BCM47XX_BOARD_NO,
};
#define BCM47XX_BOARD_MAX_NAME 30
void bcm47xx_board_detect(void);
enum bcm47xx_board bcm47xx_board_get(void);
const char *bcm47xx_board_get_name(void);
#endif /* __BCM47XX_BOARD_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment