2 * Compex WP543 board support
4 * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
12 #include <linux/platform_device.h>
13 #include <linux/spi/spi.h>
14 #include <linux/spi/flash.h>
15 #include <linux/leds.h>
17 #include <asm/mips_machine.h>
18 #include <asm/mach-ar71xx/ar71xx.h>
19 #include <asm/mach-ar71xx/pci.h>
20 #include <asm/mach-ar71xx/platform.h>
22 #define WP543_GPIO_LED_1 3
23 #define WP543_GPIO_LED_2 4
24 #define WP543_GPIO_LED_WLAN 5
25 #define WP543_GPIO_LED_CONN 6
26 #define WP543_GPIO_LED_DIAG 7
28 static struct flash_platform_data wp543_flash_data
= {
29 /* TODO: add partition map */
32 static struct spi_board_info wp543_spi_info
[] = {
36 .max_speed_hz
= 25000000,
38 .platform_data
= &wp543_flash_data
,
42 static struct ar71xx_pci_irq wp543_pci_irqs
[] __initdata
= {
46 .irq
= AR71XX_PCI_IRQ_DEV0
,
50 .irq
= AR71XX_PCI_IRQ_DEV1
,
54 static struct gpio_led wp543_leds_gpio
[] = {
56 .name
= "wp543:green:led1",
57 .gpio
= WP543_GPIO_LED_1
,
60 .name
= "wp543:green:led2",
61 .gpio
= WP543_GPIO_LED_2
,
64 .name
= "wp543:green:wlan",
65 .gpio
= WP543_GPIO_LED_WLAN
,
68 .name
= "wp543:green:conn",
69 .gpio
= WP543_GPIO_LED_CONN
,
72 .name
= "wp543:green:diag",
73 .gpio
= WP543_GPIO_LED_DIAG
,
78 static struct gpio_led_platform_data wp543_leds_gpio_data
= {
79 .leds
= wp543_leds_gpio
,
80 .num_leds
= ARRAY_SIZE(wp543_leds_gpio
),
83 static struct platform_device wp543_leds_gpio_device
= {
87 .platform_data
= &wp543_leds_gpio_data
,
91 static void __init
wp543_setup(void)
93 ar71xx_add_device_spi(NULL
, wp543_spi_info
, ARRAY_SIZE(wp543_spi_info
));
95 ar71xx_add_device_mdio(0xfffffff7);
96 ar71xx_add_device_eth(0, PHY_INTERFACE_MODE_MII
, 0x00000008);
98 ar71xx_add_device_usb();
100 ar71xx_pci_init(ARRAY_SIZE(wp543_pci_irqs
), wp543_pci_irqs
);
102 platform_device_register(&wp543_leds_gpio_device
);
105 MIPS_MACHINE(MACH_AR71XX_WP543
, "Compex WP543", wp543_setup
);