brcm63xx: allow bcm963xx and livebox support at the same time
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.14 / 526-board_CT6373-1.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -635,6 +635,13 @@ static struct board_info __initdata boar
4 #define NB4_SPI_GPIO_CLK 6
5 #define NB4_74HC64_GPIO(X) (NB4_74X164_GPIO_BASE + (X))
6
7 +#define CT6373_PID_OFFSET 0xff80
8 +#define CT6373_74X164_GPIO_BASE 64
9 +#define CT6373_SPI_GPIO_MOSI 7
10 +#define CT6373_SPI_GPIO_CLK 6
11 +#define CT6373_74HC64_GPIO(X) (CT6373_74X164_GPIO_BASE + (X))
12 +
13 +
14
15 .has_ohci0 = 1,
16 .has_pccard = 1,
17 @@ -2339,6 +2346,117 @@ static struct board_info __initdata boar
18 .num_spis = ARRAY_SIZE(nb4_spi_devices),
19 };
20
21 +
22 +struct spi_gpio_platform_data ct6373_spi_gpio_data = {
23 + .sck = CT6373_SPI_GPIO_CLK,
24 + .mosi = CT6373_SPI_GPIO_MOSI,
25 + .miso = SPI_GPIO_NO_MISO,
26 + .num_chipselect = 1,
27 +};
28 +
29 +static struct platform_device ct6373_spi_gpio = {
30 + .name = "spi_gpio",
31 + .id = 1,
32 + .dev = {
33 + .platform_data = &ct6373_spi_gpio_data,
34 + },
35 +};
36 +
37 +static struct platform_device * __initdata ct6373_devices[] = {
38 + &ct6373_spi_gpio,
39 +};
40 +
41 +#if 0 /* FIXME: 3.14 dropped non-DT support */
42 +const struct gen_74x164_chip_platform_data ct6373_74x164_platform_data = {
43 + .base = CT6373_74X164_GPIO_BASE
44 +};
45 +#endif
46 +
47 +static struct spi_board_info ct6373_spi_devices[] = {
48 +#if 0 /* FIXME: 3.14 dropped non-DT support */
49 + {
50 + .modalias = "74x164",
51 + .max_speed_hz = 781000,
52 + .bus_num = 1,
53 + .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT,
54 + .mode = SPI_MODE_0,
55 + .platform_data = &ct6373_74x164_platform_data
56 + }
57 +#endif
58 +};
59 +
60 +static struct board_info __initdata board_ct6373_1 = {
61 + .name = "CT6373-1",
62 + .expected_cpu_id = 0x6358,
63 +
64 + .has_uart0 = 1,
65 + .has_pci = 1,
66 + .has_ohci0 = 1,
67 + .has_ehci0 = 1,
68 +
69 + .has_enet1 = 1,
70 + .enet1 = {
71 + .has_phy = 1,
72 + .phy_id = 0,
73 + .force_speed_100 = 1,
74 + .force_duplex_full = 1,
75 + },
76 +
77 + .leds = {
78 + {
79 + .name = "CT6373-1:green:power",
80 + .gpio = 0,
81 + .default_trigger = "default-on",
82 + },
83 + {
84 + .name = "CT6373-1:green:usb",
85 + .gpio = 3,
86 + .active_low = 1,
87 + },
88 + {
89 + .name = "CT6373-1:green:wlan",
90 + .gpio = 9,
91 + .active_low = 1,
92 + },
93 + {
94 + .name = "CT6373-1:green:adsl",
95 + .gpio = CT6373_74HC64_GPIO(0),
96 + .active_low = 1,
97 + },
98 + {
99 + .name = "CT6373-1:green:line",
100 + .gpio = CT6373_74HC64_GPIO(1),
101 + .active_low = 1,
102 + },
103 + {
104 + .name = "CT6373-1:green:fxs1",
105 + .gpio = CT6373_74HC64_GPIO(2),
106 + .active_low = 1,
107 + },
108 + {
109 + .name = "CT6373-1:green:fxs2",
110 + .gpio = CT6373_74HC64_GPIO(3),
111 + .active_low = 1,
112 + },
113 + },
114 +
115 + .buttons = {
116 + {
117 + .desc = "reset",
118 + .gpio = 35,
119 + .active_low = 1,
120 + .type = EV_KEY,
121 + .code = KEY_RESTART,
122 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
123 + },
124 + },
125 +
126 + .devs = ct6373_devices,
127 + .num_devs = ARRAY_SIZE(ct6373_devices),
128 + .spis = ct6373_spi_devices,
129 + .num_spis = ARRAY_SIZE(ct6373_spi_devices),
130 +};
131 +
132 static struct board_info __initdata board_HW553 = {
133 .name = "HW553",
134 .expected_cpu_id = 0x6358,
135 @@ -2683,6 +2801,7 @@ static const struct board_info __initcon
136 &board_nb4_ser_r2,
137 &board_nb4_fxc_r1,
138 &board_nb4_fxc_r2,
139 + &board_ct6373_1,
140 &board_HW553,
141 &board_spw303v,
142 #endif