[adm5120] add definitions for RouterBOARD 150, no NAND driver yet
[openwrt/svn-archive/archive.git] / target / linux / adm5120-2.6 / files / arch / mips / adm5120 / boards / compex.c
index bbc5106e20ee0f70aa55d10ffc6296fccc0110a1..a59e08f4348b18fe68453e34d0d12d59f30459ab 100644 (file)
@@ -46,7 +46,7 @@ static void switch_bank_gpio5(unsigned bank)
 
 static void wp54_reset(void)
 {
-       gpio_direction_output(ADM5120_GPIO_PIN3, 0);
+       gpio_set_value(ADM5120_GPIO_PIN3, 0);
 }
 
 static struct mtd_partition wp54g_wrt_partitions[] = {
@@ -78,6 +78,7 @@ static struct platform_device *wp54_devices[] __initdata = {
 static void __init np2xg_setup(void)
 {
        gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
+       gpio_direction_output(ADM5120_GPIO_PIN5, 0);
 
        /* setup data for flash0 device */
        adm5120_flash0_data.switch_bank = switch_bank_gpio5;
@@ -88,7 +89,11 @@ static void __init np2xg_setup(void)
 static void __init wp54_setup(void)
 {
        gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
+       gpio_direction_output(ADM5120_GPIO_PIN5, 0);
+
        gpio_request(ADM5120_GPIO_PIN3, NULL); /* for system reset */
+       gpio_direction_output(ADM5120_GPIO_PIN3, 1);
+
 
        /* setup data for flash0 device */
        adm5120_flash0_data.switch_bank = switch_bank_gpio5;
@@ -99,7 +104,10 @@ static void __init wp54_setup(void)
 static void __init wp54_wrt_setup(void)
 {
        gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
+       gpio_direction_output(ADM5120_GPIO_PIN5, 0);
+
        gpio_request(ADM5120_GPIO_PIN3, NULL); /* for system reset */
+       gpio_direction_output(ADM5120_GPIO_PIN3, 1);
 
        /* setup data for flash0 device */
        adm5120_flash0_data.switch_bank = switch_bank_gpio5;
@@ -109,11 +117,27 @@ static void __init wp54_wrt_setup(void)
        /* TODO: setup mac address */
 }
 
+unsigned char np27g_vlans[6] __initdata = {
+       /* FIXME: untested */
+       0x41, 0x42, 0x44, 0x48, 0x50, 0x00
+};
+
+unsigned char np28g_vlans[6] __initdata = {
+       /* FIXME: untested */
+       0x41, 0x42, 0x44, 0x48, 0x00, 0x00
+};
+
+unsigned char wp54_vlans[6] __initdata = {
+       /* FIXME: untested */
+       0x41, 0x42, 0x00, 0x00, 0x00, 0x00
+};
+
 static struct adm5120_board np27g_board __initdata = {
        .mach_type      = MACH_ADM5120_NP27G,
        .name           = "Compex NetPassage 27G",
        .board_setup    = np2xg_setup,
-       .num_eth_ports  = 4,
+       .eth_num_ports  = 5,
+       .eth_vlans      = np27g_vlans,
        .num_devices    = ARRAY_SIZE(np2xg_devices),
        .devices        = np2xg_devices,
 };
@@ -122,7 +146,8 @@ static struct adm5120_board np28g_board __initdata = {
        .mach_type      = MACH_ADM5120_NP28G,
        .name           = "Compex NetPassage 28G",
        .board_setup    = np2xg_setup,
-       .num_eth_ports  = 3,
+       .eth_num_ports  = 4,
+       .eth_vlans      = np28g_vlans,
        .num_devices    = ARRAY_SIZE(np2xg_devices),
        .devices        = np2xg_devices,
 };
@@ -132,7 +157,8 @@ static struct adm5120_board wp54ag_board __initdata = {
        .name           = "Compex WP54AG",
        .board_setup    = wp54_setup,
        .board_reset    = wp54_reset,
-       .num_eth_ports  = 2,
+       .eth_num_ports  = 2,
+       .eth_vlans      = wp54_vlans,
        .num_devices    = ARRAY_SIZE(wp54_devices),
        .devices        = wp54_devices,
 };
@@ -142,7 +168,8 @@ static struct adm5120_board wp54g_board __initdata = {
        .name           = "Compex WP54G",
        .board_setup    = wp54_setup,
        .board_reset    = wp54_reset,
-       .num_eth_ports  = 2,
+       .eth_num_ports  = 2,
+       .eth_vlans      = wp54_vlans,
        .num_devices    = ARRAY_SIZE(wp54_devices),
        .devices        = wp54_devices,
 };
@@ -152,7 +179,8 @@ static struct adm5120_board wp54g_wrt_board __initdata = {
        .name           = "Compex WP54G-WRT",
        .board_setup    = wp54_wrt_setup,
        .board_reset    = wp54_reset,
-       .num_eth_ports  = 2,
+       .eth_num_ports  = 2,
+       .eth_vlans      = wp54_vlans,
        .num_devices    = ARRAY_SIZE(wp54_devices),
        .devices        = wp54_devices,
 };
@@ -162,7 +190,8 @@ static struct adm5120_board wpp54ag_board __initdata = {
        .name           = "Compex WPP54AG",
        .board_setup    = wp54_setup,
        .board_reset    = wp54_reset,
-       .num_eth_ports  = 2,
+       .eth_num_ports  = 2,
+       .eth_vlans      = wp54_vlans,
        .num_devices    = ARRAY_SIZE(wp54_devices),
        .devices        = wp54_devices,
 };
@@ -172,7 +201,8 @@ static struct adm5120_board wpp54g_board __initdata = {
        .name           = "Compex WPP54G",
        .board_setup    = wp54_setup,
        .board_reset    = wp54_reset,
-       .num_eth_ports  = 2,
+       .eth_num_ports  = 2,
+       .eth_vlans      = wp54_vlans,
        .num_devices    = ARRAY_SIZE(wp54_devices),
        .devices        = wp54_devices,
 };