2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/leds.h>
12 #include <linux/gpio.h>
13 #include <linux/gpio_buttons.h>
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/physmap.h>
17 #include <linux/input.h>
19 #include <lantiq_soc.h>
21 #include <dev-gpio-leds.h>
22 #include <dev-gpio-buttons.h>
24 #include "../machtypes.h"
26 #include "dev-dwc_otg.h"
28 static struct mtd_partition wbmr_partitions
[] =
46 .name
= "calibration",
52 static struct physmap_flash_data wbmr_flash_data
= {
53 .nr_parts
= ARRAY_SIZE(wbmr_partitions
),
54 .parts
= wbmr_partitions
,
57 static struct gpio_led
58 wbmr_gpio_leds
[] __initdata
= {
59 { .name
= "soc:blue:movie", .gpio
= 20, .active_low
= 1, },
60 { .name
= "soc:red:internet", .gpio
= 18, .active_low
= 1, },
61 { .name
= "soc:green:internet", .gpio
= 17, .active_low
= 1, },
62 { .name
= "soc:green:adsl", .gpio
= 16, .active_low
= 1, },
63 { .name
= "soc:green:wlan", .gpio
= 15, .active_low
= 1, },
64 { .name
= "soc:red:security", .gpio
= 14, .active_low
= 1, },
65 { .name
= "soc:green:power", .gpio
= 1, .active_low
= 1, },
66 { .name
= "soc:red:power", .gpio
= 5, .active_low
= 1, },
67 { .name
= "soc:green:usb", .gpio
= 28, .active_low
= 1, },
70 static struct gpio_keys_button
71 wbmr_gpio_keys
[] __initdata
= {
76 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
84 .debounce_interval
= LTQ_KEYS_DEBOUNCE_INTERVAL
,
90 static struct ltq_pci_data ltq_pci_data
= {
91 .clock
= PCI_CLOCK_INT
,
92 .gpio
= PCI_GNT1
| PCI_REQ1
,
94 [14] = INT_NUM_IM0_IRL0
+ 22,
98 static struct ltq_eth_data ltq_eth_data
= {
99 .mii_mode
= PHY_INTERFACE_MODE_RGMII
,
105 #define WMBR_BRN_MAC 0x1fd0024
107 ltq_add_device_gpio_leds(-1, ARRAY_SIZE(wbmr_gpio_leds
), wbmr_gpio_leds
);
108 ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL
, ARRAY_SIZE(wbmr_gpio_keys
), wbmr_gpio_keys
);
109 ltq_register_nor(&wbmr_flash_data
);
110 ltq_register_pci(<q_pci_data
);
111 memcpy_fromio(<q_eth_data
.mac
.sa_data
,
112 (void *)KSEG1ADDR(LTQ_FLASH_START
+ WMBR_BRN_MAC
), 6);
113 ltq_register_etop(<q_eth_data
);
114 xway_register_dwc(36);
117 MIPS_MACHINE(LANTIQ_MACH_WBMR
,