From b6e8369fc62e7fbcdebf7dce0e3a6388ea53a879 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 3 Jan 2010 20:19:32 +0000 Subject: [ar7] add support for titan variant (WRTP54G) (#6185) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19022 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar7/files/arch/mips/ar7/gpio.c | 4 ++-- target/linux/ar7/files/arch/mips/ar7/setup.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'target/linux/ar7/files/arch/mips') diff --git a/target/linux/ar7/files/arch/mips/ar7/gpio.c b/target/linux/ar7/files/arch/mips/ar7/gpio.c index 207d27093..56860f46d 100644 --- a/target/linux/ar7/files/arch/mips/ar7/gpio.c +++ b/target/linux/ar7/files/arch/mips/ar7/gpio.c @@ -21,11 +21,11 @@ #include -static const char *ar7_gpio_list[AR7_GPIO_MAX]; +static const char *ar7_gpio_list[TITAN_GPIO_MAX]; int gpio_request(unsigned gpio, const char *label) { - if (gpio >= AR7_GPIO_MAX) + if (gpio >= (ar7_is_titan() ? TITAN_GPIO_MAX : AR7_GPIO_MAX)) return -EINVAL; if (ar7_gpio_list[gpio]) diff --git a/target/linux/ar7/files/arch/mips/ar7/setup.c b/target/linux/ar7/files/arch/mips/ar7/setup.c index 58e152857..35b7b8d77 100644 --- a/target/linux/ar7/files/arch/mips/ar7/setup.c +++ b/target/linux/ar7/files/arch/mips/ar7/setup.c @@ -23,8 +23,10 @@ #include #include #include +#include #include +static int titan_variant; /*hold the results of the gpio_init_titan_variant() so that it is only called once*/ static void ar7_machine_restart(char *command); static void ar7_machine_halt(void); static void ar7_machine_power_off(void); @@ -59,6 +61,18 @@ const char *get_system_type(void) return "TI AR7 (TNETD7100)"; case AR7_CHIP_7200: return "TI AR7 (TNETD7200)"; + case AR7_CHIP_TITAN: + titan_variant = ar7_init_titan_variant(); + switch (titan_variant /*(gpio_get_value_titan(1) >> 12) & 0xf*/) { + case TITAN_CHIP_1050: + return "TI AR7 (TNETV1050)"; + case TITAN_CHIP_1055: + return "TI AR7 (TNETV1055)"; + case TITAN_CHIP_1056: + return "TI AR7 (TNETV1056)"; + case TITAN_CHIP_1060: + return "TI AR7 (TNETV1060)"; + } default: return "TI AR7 (Unknown)"; } -- cgit v1.2.3