2 * Compex WP54 board support
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
14 #ifdef CONFIG_MTD_PARTITIONS
15 static struct mtd_partition wp54g_wrt_partitions[] = {
20 .mask_flags = MTD_WRITEABLE,
23 .offset = MTDPART_OFS_APPEND,
27 .offset = MTDPART_OFS_APPEND,
31 #endif /* CONFIG_MTD_PARTITIONS */
33 static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
34 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
37 static struct gpio_button wp54_gpio_buttons[] __initdata = {
39 .desc = "reset_button",
43 .gpio = ADM5120_GPIO_PIN4,
47 static struct gpio_led wp54_gpio_leds[] __initdata = {
48 GPIO_LED_INV(ADM5120_GPIO_PIN2, "diag", NULL),
49 GPIO_LED_INV(ADM5120_GPIO_PIN6, "wlan", NULL),
50 GPIO_LED_INV(ADM5120_GPIO_PIN7, "wan", NULL),
51 GPIO_LED_INV(ADM5120_GPIO_P0L0, "lan1", NULL),
52 GPIO_LED_INV(ADM5120_GPIO_P1L0, "lan2", NULL),
55 static u8 wp54_vlans[6] __initdata = {
56 0x41, 0x42, 0x00, 0x00, 0x00, 0x00
59 static void wp54_reset(void)
61 gpio_set_value(ADM5120_GPIO_PIN3, 0);
64 static void __init wp54_setup(void)
66 compex_generic_setup();
68 /* setup reset line */
69 gpio_request(ADM5120_GPIO_PIN3, NULL);
70 gpio_direction_output(ADM5120_GPIO_PIN3, 1);
71 adm5120_board_reset = wp54_reset;
73 adm5120_add_device_switch(2, wp54_vlans);
74 adm5120_add_device_gpio_buttons(ARRAY_SIZE(wp54_gpio_buttons),
76 adm5120_add_device_gpio_leds(ARRAY_SIZE(wp54_gpio_leds),
79 adm5120_pci_set_irq_map(ARRAY_SIZE(wp54_pci_irqs), wp54_pci_irqs);
82 ADM5120_BOARD(MACH_ADM5120_WP54, "Compex WP54 family", wp54_setup);
84 static void __init wp54_wrt_setup(void)
86 #ifdef CONFIG_MTD_PARTITIONS
87 adm5120_flash0_data.nr_parts = ARRAY_SIZE(wp54g_wrt_partitions);
88 adm5120_flash0_data.parts = wp54g_wrt_partitions;
94 ADM5120_BOARD(MACH_ADM5120_WP54G_WRT, "Compex WP54G-WRT", wp54_wrt_setup);