4 * Copyright (C) 2012 Daniel Golle <dgolle@allnet.de>
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.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/spi/spi.h>
14 #include <linux/spi/flash.h>
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/mtd/physmap.h>
19 #include <asm/mach-ralink/machine.h>
20 #include <asm/mach-ralink/dev-gpio-buttons.h>
21 #include <asm/mach-ralink/dev-gpio-leds.h>
22 #include <asm/mach-ralink/rt305x.h>
23 #include <asm/mach-ralink/rt305x_regs.h>
27 // #define ALL5002_GPIO_BUTTON_RESET 0
28 // #define ALL5002_GPIO_LED_RSSI_LOW 14
29 // #define ALL5002_GPIO_LED_RSSI_MED 12
30 // #define ALL5002_GPIO_LED_RSSI_HIGH 13
31 // #define ALL5002_BUTTONS_POLL_INTERVAL 20
33 const struct flash_platform_data all5002_flash = {
34 .type = "mx25l25635e",
37 struct spi_board_info all5002_spi_slave_info[] __initdata = {
40 .platform_data = &all5002_flash,
42 .max_speed_hz = 10000000,
48 static void __init all5002_init(void)
50 rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
51 rt305x_register_spi(all5002_spi_slave_info,
52 ARRAY_SIZE(all5002_spi_slave_info));
53 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
54 rt305x_register_ethernet();
55 rt305x_register_wifi();
56 rt305x_register_wdt();
57 rt305x_register_usb();
60 MIPS_MACHINE(RAMIPS_MACH_ALL5002, "ALL5002", "Allnet ALL5002",