aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c57
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c25
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h2
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c2
5 files changed, 88 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 0ca90b834586..556bbd468db3 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -440,11 +440,6 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
440 gpio_request(gpio + 7, "nCF_SEL"); 440 gpio_request(gpio + 7, "nCF_SEL");
441 gpio_direction_output(gpio + 7, 1); 441 gpio_direction_output(gpio + 7, 1);
442 442
443 /* irlml6401 switches over 1A, in under 8 msec;
444 * now it can be managed by nDRV_VBUS ...
445 */
446 davinci_setup_usb(1000, 8);
447
448 return 0; 443 return 0;
449} 444}
450 445
@@ -705,6 +700,9 @@ static __init void davinci_evm_init(void)
705 davinci_serial_init(&uart_config); 700 davinci_serial_init(&uart_config);
706 dm644x_init_asp(&dm644x_evm_snd_data); 701 dm644x_init_asp(&dm644x_evm_snd_data);
707 702
703 /* irlml6401 switches over 1A, in under 8 msec */
704 davinci_setup_usb(1000, 8);
705
708 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID; 706 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
709 /* Register the fixup for PHY on DaVinci */ 707 /* Register the fixup for PHY on DaVinci */
710 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, 708 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index a6db85460227..1a656e882262 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/input/matrix_keypad.h> 27#include <linux/input/matrix_keypad.h>
28#include <linux/spi/spi.h>
28 29
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -37,6 +38,7 @@
37 38
38#define EVM_MMC_WP_GPIO 21 39#define EVM_MMC_WP_GPIO 21
39#define EVM_MMC_CD_GPIO 24 40#define EVM_MMC_CD_GPIO 24
41#define EVM_SPI_CS_GPIO 54
40 42
41static int initialize_gpio(int gpio, char *desc) 43static int initialize_gpio(int gpio, char *desc)
42{ 44{
@@ -99,6 +101,12 @@ static const short uart1_pins[] __initdata = {
99 -1 101 -1
100}; 102};
101 103
104static const short ssp_pins[] __initdata = {
105 TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2,
106 TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2,
107 TNETV107X_SSP1_3, -1
108};
109
102static struct mtd_partition nand_partitions[] = { 110static struct mtd_partition nand_partitions[] = {
103 /* bootloader (U-Boot, etc) in first 12 sectors */ 111 /* bootloader (U-Boot, etc) in first 12 sectors */
104 { 112 {
@@ -196,19 +204,68 @@ static struct matrix_keypad_platform_data keypad_config = {
196 .no_autorepeat = 0, 204 .no_autorepeat = 0,
197}; 205};
198 206
207static void spi_select_device(int cs)
208{
209 static int gpio;
210
211 if (!gpio) {
212 int ret;
213 ret = gpio_request(EVM_SPI_CS_GPIO, "spi chipsel");
214 if (ret < 0) {
215 pr_err("cannot open spi chipsel gpio\n");
216 gpio = -ENOSYS;
217 return;
218 } else {
219 gpio = EVM_SPI_CS_GPIO;
220 gpio_direction_output(gpio, 0);
221 }
222 }
223
224 if (gpio < 0)
225 return;
226
227 return gpio_set_value(gpio, cs ? 1 : 0);
228}
229
230static struct ti_ssp_spi_data spi_master_data = {
231 .num_cs = 2,
232 .select = spi_select_device,
233 .iosel = SSP_PIN_SEL(0, SSP_CLOCK) | SSP_PIN_SEL(1, SSP_DATA) |
234 SSP_PIN_SEL(2, SSP_CHIPSEL) | SSP_PIN_SEL(3, SSP_IN) |
235 SSP_INPUT_SEL(3),
236};
237
238static struct ti_ssp_data ssp_config = {
239 .out_clock = 250 * 1000,
240 .dev_data = {
241 [1] = {
242 .dev_name = "ti-ssp-spi",
243 .pdata = &spi_master_data,
244 .pdata_size = sizeof(spi_master_data),
245 },
246 },
247};
248
199static struct tnetv107x_device_info evm_device_info __initconst = { 249static struct tnetv107x_device_info evm_device_info __initconst = {
200 .serial_config = &serial_config, 250 .serial_config = &serial_config,
201 .mmc_config[1] = &mmc_config, /* controller 1 */ 251 .mmc_config[1] = &mmc_config, /* controller 1 */
202 .nand_config[0] = &nand_config, /* chip select 0 */ 252 .nand_config[0] = &nand_config, /* chip select 0 */
203 .keypad_config = &keypad_config, 253 .keypad_config = &keypad_config,
254 .ssp_config = &ssp_config,
255};
256
257static struct spi_board_info spi_info[] __initconst = {
204}; 258};
205 259
206static __init void tnetv107x_evm_board_init(void) 260static __init void tnetv107x_evm_board_init(void)
207{ 261{
208 davinci_cfg_reg_list(sdio1_pins); 262 davinci_cfg_reg_list(sdio1_pins);
209 davinci_cfg_reg_list(uart1_pins); 263 davinci_cfg_reg_list(uart1_pins);
264 davinci_cfg_reg_list(ssp_pins);
210 265
211 tnetv107x_devices_init(&evm_device_info); 266 tnetv107x_devices_init(&evm_device_info);
267
268 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
212} 269}
213 270
214#ifdef CONFIG_SERIAL_8250_CONSOLE 271#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 85503debda51..6162cae7f868 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -35,6 +35,7 @@
35#define TNETV107X_SDIO0_BASE 0x08088700 35#define TNETV107X_SDIO0_BASE 0x08088700
36#define TNETV107X_SDIO1_BASE 0x08088800 36#define TNETV107X_SDIO1_BASE 0x08088800
37#define TNETV107X_KEYPAD_BASE 0x08088a00 37#define TNETV107X_KEYPAD_BASE 0x08088a00
38#define TNETV107X_SSP_BASE 0x08088c00
38#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 39#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000
39#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 40#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000
40#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 41#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000
@@ -342,6 +343,25 @@ static struct platform_device tsc_device = {
342 .resource = tsc_resources, 343 .resource = tsc_resources,
343}; 344};
344 345
346static struct resource ssp_resources[] = {
347 {
348 .start = TNETV107X_SSP_BASE,
349 .end = TNETV107X_SSP_BASE + 0x1ff,
350 .flags = IORESOURCE_MEM,
351 },
352 {
353 .start = IRQ_TNETV107X_SSP,
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device ssp_device = {
359 .name = "ti-ssp",
360 .id = -1,
361 .num_resources = ARRAY_SIZE(ssp_resources),
362 .resource = ssp_resources,
363};
364
345void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) 365void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
346{ 366{
347 int i, error; 367 int i, error;
@@ -380,4 +400,9 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
380 keypad_device.dev.platform_data = info->keypad_config; 400 keypad_device.dev.platform_data = info->keypad_config;
381 platform_device_register(&keypad_device); 401 platform_device_register(&keypad_device);
382 } 402 }
403
404 if (info->ssp_config) {
405 ssp_device.dev.platform_data = info->ssp_config;
406 platform_device_register(&ssp_device);
407 }
383} 408}
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 5a681d880dcb..89c1fdc63c0b 100644
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -34,6 +34,7 @@
34 34
35#include <linux/serial_8250.h> 35#include <linux/serial_8250.h>
36#include <linux/input/matrix_keypad.h> 36#include <linux/input/matrix_keypad.h>
37#include <linux/mfd/ti_ssp.h>
37 38
38#include <mach/mmc.h> 39#include <mach/mmc.h>
39#include <mach/nand.h> 40#include <mach/nand.h>
@@ -44,6 +45,7 @@ struct tnetv107x_device_info {
44 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ 45 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */
45 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ 46 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */
46 struct matrix_keypad_platform_data *keypad_config; 47 struct matrix_keypad_platform_data *keypad_config;
48 struct ti_ssp_data *ssp_config;
47}; 49};
48 50
49extern struct platform_device tnetv107x_wdt_device; 51extern struct platform_device tnetv107x_wdt_device;
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
index 6fcdecec8d8c..1b28fdd892a6 100644
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ b/arch/arm/mach-davinci/tnetv107x.c
@@ -278,7 +278,7 @@ static struct clk_lookup clks[] = {
278 CLK(NULL, "timer1", &clk_timer1), 278 CLK(NULL, "timer1", &clk_timer1),
279 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm), 279 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm),
280 CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp), 280 CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp),
281 CLK("ti-ssp.0", NULL, &clk_ssp), 281 CLK("ti-ssp", NULL, &clk_ssp),
282 CLK(NULL, "clk_tdm0", &clk_tdm0), 282 CLK(NULL, "clk_tdm0", &clk_tdm0),
283 CLK(NULL, "clk_vlynq", &clk_vlynq), 283 CLK(NULL, "clk_vlynq", &clk_vlynq),
284 CLK(NULL, "clk_mcdma", &clk_mcdma), 284 CLK(NULL, "clk_mcdma", &clk_mcdma),