ar71xx: show the SoC type earlier
[openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-jwap003.c
1 /*
2  *  jjPlus JWAP003 board support
3  *
4  */
5
6 #include <asm/mach-ar71xx/ar71xx.h>
7 #include <linux/i2c.h>
8 #include <linux/i2c-gpio.h>
9 #include <linux/platform_device.h>
10
11 #include "machtype.h"
12 #include "devices.h"
13 #include "dev-m25p80.h"
14 #include "dev-gpio-buttons.h"
15 #include "dev-pb42-pci.h"
16 #include "dev-usb.h"
17
18 #define JWAP003_BUTTONS_POLL_INTERVAL   20
19 #define JWAP003_GPIO_WPS        11
20 #define JWAP003_GPIO_I2C_SCL    0
21 #define JWAP003_GPIO_I2C_SDA    1
22
23 static struct gpio_button jwap003_gpio_buttons[] __initdata = {
24         {
25                 .desc           = "wps",
26                 .type           = EV_KEY,
27                 .code           = KEY_WPS_BUTTON,
28                 .threshold      = 3,
29                 .gpio           = JWAP003_GPIO_WPS,
30                 .active_low     = 1,
31         }
32 };
33
34 static struct i2c_gpio_platform_data jwap003_i2c_gpio_data = {
35         .sda_pin        = JWAP003_GPIO_I2C_SDA,
36         .scl_pin        = JWAP003_GPIO_I2C_SCL,
37 };
38
39 static struct platform_device jwap003_i2c_gpio_device = {
40         .name           = "i2c-gpio",
41         .id             = 0,
42         .dev = {
43                 .platform_data  = &jwap003_i2c_gpio_data,
44         }
45 };
46
47 #define JWAP003_WAN_PHYMASK     BIT(0)
48 #define JWAP003_LAN_PHYMASK     BIT(4)
49
50 static void __init jwap003_init(void)
51 {
52         ar71xx_add_device_m25p80(NULL);
53
54         ar71xx_add_device_mdio(0x0);
55
56         ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
57         ar71xx_eth0_data.phy_mask = JWAP003_WAN_PHYMASK;
58         ar71xx_eth0_data.speed = SPEED_100;
59         ar71xx_eth0_data.duplex = DUPLEX_FULL;
60         ar71xx_eth0_data.has_ar8216 = 1;
61
62         ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
63         ar71xx_eth1_data.phy_mask = JWAP003_LAN_PHYMASK;
64         ar71xx_eth1_data.speed = SPEED_100;
65         ar71xx_eth1_data.duplex = DUPLEX_FULL;
66
67         ar71xx_add_device_eth(0);
68         ar71xx_add_device_eth(1);
69
70         platform_device_register(&jwap003_i2c_gpio_device);
71
72         ar71xx_add_device_usb();
73
74         ar71xx_add_device_gpio_buttons(-1, JWAP003_BUTTONS_POLL_INTERVAL,
75                                         ARRAY_SIZE(jwap003_gpio_buttons),
76                                         jwap003_gpio_buttons);
77
78         pb42_pci_init();
79 }
80
81 MIPS_MACHINE(AR71XX_MACH_JWAP003, "JWAP003", "jjPlus JWAP003", jwap003_init);