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/Kconfig10
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c114
-rw-r--r--arch/arm/mach-davinci/da850.c9
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c3
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c1
-rw-r--r--arch/arm/mach-davinci/dm355.c1
-rw-r--r--arch/arm/mach-davinci/dm644x.c1
-rw-r--r--arch/arm/mach-davinci/dm646x.c1
-rw-r--r--arch/arm/mach-davinci/dma.c5
-rw-r--r--arch/arm/mach-davinci/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/mmc.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h10
12 files changed, 156 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index c0deacae778d..32d837d8eab9 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -192,6 +192,16 @@ config DA850_UI_RMII
192 192
193endchoice 193endchoice
194 194
195config DA850_WL12XX
196 bool "AM18x wl1271 daughter board"
197 depends on MACH_DAVINCI_DA850_EVM
198 help
199 The wl1271 daughter card for AM18x EVMs is a combo wireless
200 connectivity add-on card, based on the LS Research TiWi module with
201 Texas Instruments' wl1271 solution.
202 Say Y if you want to use a wl1271 expansion card connected to the
203 AM18x EVM.
204
195config GPIO_PCA953X 205config GPIO_PCA953X
196 default MACH_DAVINCI_DA850_EVM 206 default MACH_DAVINCI_DA850_EVM
197 207
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 6e41cb5baeb4..ec21663f8ddc 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -31,6 +31,8 @@
31#include <linux/input/tps6507x-ts.h> 31#include <linux/input/tps6507x-ts.h>
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <linux/spi/flash.h> 33#include <linux/spi/flash.h>
34#include <linux/delay.h>
35#include <linux/wl12xx.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -49,6 +51,9 @@
49#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) 51#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
50#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) 52#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
51 53
54#define DA850_WLAN_EN GPIO_TO_PIN(6, 9)
55#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10)
56
52#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) 57#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
53 58
54static struct mtd_partition da850evm_spiflash_part[] = { 59static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1143,6 +1148,110 @@ static __init int da850_evm_init_cpufreq(void)
1143static __init int da850_evm_init_cpufreq(void) { return 0; } 1148static __init int da850_evm_init_cpufreq(void) { return 0; }
1144#endif 1149#endif
1145 1150
1151#ifdef CONFIG_DA850_WL12XX
1152
1153static void wl12xx_set_power(int index, bool power_on)
1154{
1155 static bool power_state;
1156
1157 pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
1158
1159 if (power_on == power_state)
1160 return;
1161 power_state = power_on;
1162
1163 if (power_on) {
1164 /* Power up sequence required for wl127x devices */
1165 gpio_set_value(DA850_WLAN_EN, 1);
1166 usleep_range(15000, 15000);
1167 gpio_set_value(DA850_WLAN_EN, 0);
1168 usleep_range(1000, 1000);
1169 gpio_set_value(DA850_WLAN_EN, 1);
1170 msleep(70);
1171 } else {
1172 gpio_set_value(DA850_WLAN_EN, 0);
1173 }
1174}
1175
1176static struct davinci_mmc_config da850_wl12xx_mmc_config = {
1177 .set_power = wl12xx_set_power,
1178 .wires = 4,
1179 .max_freq = 25000000,
1180 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
1181 MMC_CAP_POWER_OFF_CARD,
1182 .version = MMC_CTLR_VERSION_2,
1183};
1184
1185static const short da850_wl12xx_pins[] __initconst = {
1186 DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
1187 DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
1188 DA850_GPIO6_9, DA850_GPIO6_10,
1189 -1
1190};
1191
1192static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
1193 .irq = -1,
1194 .board_ref_clock = WL12XX_REFCLOCK_38,
1195 .platform_quirks = WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
1196};
1197
1198static __init int da850_wl12xx_init(void)
1199{
1200 int ret;
1201
1202 ret = davinci_cfg_reg_list(da850_wl12xx_pins);
1203 if (ret) {
1204 pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
1205 goto exit;
1206 }
1207
1208 ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
1209 if (ret) {
1210 pr_err("wl12xx/mmc registration failed: %d\n", ret);
1211 goto exit;
1212 }
1213
1214 ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
1215 if (ret) {
1216 pr_err("Could not request wl12xx enable gpio: %d\n", ret);
1217 goto exit;
1218 }
1219
1220 ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
1221 if (ret) {
1222 pr_err("Could not request wl12xx irq gpio: %d\n", ret);
1223 goto free_wlan_en;
1224 }
1225
1226 da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
1227
1228 ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
1229 if (ret) {
1230 pr_err("Could not set wl12xx data: %d\n", ret);
1231 goto free_wlan_irq;
1232 }
1233
1234 return 0;
1235
1236free_wlan_irq:
1237 gpio_free(DA850_WLAN_IRQ);
1238
1239free_wlan_en:
1240 gpio_free(DA850_WLAN_EN);
1241
1242exit:
1243 return ret;
1244}
1245
1246#else /* CONFIG_DA850_WL12XX */
1247
1248static __init int da850_wl12xx_init(void)
1249{
1250 return 0;
1251}
1252
1253#endif /* CONFIG_DA850_WL12XX */
1254
1146#define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000) 1255#define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000)
1147 1256
1148static __init void da850_evm_init(void) 1257static __init void da850_evm_init(void)
@@ -1197,6 +1306,11 @@ static __init void da850_evm_init(void)
1197 if (ret) 1306 if (ret)
1198 pr_warning("da850_evm_init: mmcsd0 registration failed:" 1307 pr_warning("da850_evm_init: mmcsd0 registration failed:"
1199 " %d\n", ret); 1308 " %d\n", ret);
1309
1310 ret = da850_wl12xx_init();
1311 if (ret)
1312 pr_warning("da850_evm_init: wl12xx initialization"
1313 " failed: %d\n", ret);
1200 } 1314 }
1201 1315
1202 davinci_serial_init(&da850_evm_uart_config); 1316 davinci_serial_init(&da850_evm_uart_config);
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 4aae01576aab..b047f8702278 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -536,6 +536,13 @@ static const struct mux_config da850_pins[] = {
536 MUX_CFG(DA850, MMCSD0_DAT_3, 10, 20, 15, 2, false) 536 MUX_CFG(DA850, MMCSD0_DAT_3, 10, 20, 15, 2, false)
537 MUX_CFG(DA850, MMCSD0_CLK, 10, 0, 15, 2, false) 537 MUX_CFG(DA850, MMCSD0_CLK, 10, 0, 15, 2, false)
538 MUX_CFG(DA850, MMCSD0_CMD, 10, 4, 15, 2, false) 538 MUX_CFG(DA850, MMCSD0_CMD, 10, 4, 15, 2, false)
539 /* MMC/SD1 function */
540 MUX_CFG(DA850, MMCSD1_DAT_0, 18, 8, 15, 2, false)
541 MUX_CFG(DA850, MMCSD1_DAT_1, 19, 16, 15, 2, false)
542 MUX_CFG(DA850, MMCSD1_DAT_2, 19, 12, 15, 2, false)
543 MUX_CFG(DA850, MMCSD1_DAT_3, 19, 8, 15, 2, false)
544 MUX_CFG(DA850, MMCSD1_CLK, 18, 12, 15, 2, false)
545 MUX_CFG(DA850, MMCSD1_CMD, 18, 16, 15, 2, false)
539 /* EMIF2.5/EMIFA function */ 546 /* EMIF2.5/EMIFA function */
540 MUX_CFG(DA850, EMA_D_7, 9, 0, 15, 1, false) 547 MUX_CFG(DA850, EMA_D_7, 9, 0, 15, 1, false)
541 MUX_CFG(DA850, EMA_D_6, 9, 4, 15, 1, false) 548 MUX_CFG(DA850, EMA_D_6, 9, 4, 15, 1, false)
@@ -594,6 +601,8 @@ static const struct mux_config da850_pins[] = {
594 MUX_CFG(DA850, GPIO3_13, 7, 8, 15, 8, false) 601 MUX_CFG(DA850, GPIO3_13, 7, 8, 15, 8, false)
595 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) 602 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false)
596 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) 603 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false)
604 MUX_CFG(DA850, GPIO6_9, 13, 24, 15, 8, false)
605 MUX_CFG(DA850, GPIO6_10, 13, 20, 15, 8, false)
597 MUX_CFG(DA850, GPIO6_13, 13, 8, 15, 8, false) 606 MUX_CFG(DA850, GPIO6_13, 13, 8, 15, 8, false)
598 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false) 607 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false)
599#endif 608#endif
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 2f7e719636f1..68def7188868 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -136,6 +136,7 @@ static struct edma_soc_info da830_edma_cc0_info = {
136 .n_cc = 1, 136 .n_cc = 1,
137 .queue_tc_mapping = da8xx_queue_tc_mapping, 137 .queue_tc_mapping = da8xx_queue_tc_mapping,
138 .queue_priority_mapping = da8xx_queue_priority_mapping, 138 .queue_priority_mapping = da8xx_queue_priority_mapping,
139 .default_queue = EVENTQ_1,
139}; 140};
140 141
141static struct edma_soc_info *da830_edma_info[EDMA_MAX_CC] = { 142static struct edma_soc_info *da830_edma_info[EDMA_MAX_CC] = {
@@ -151,6 +152,7 @@ static struct edma_soc_info da850_edma_cc_info[] = {
151 .n_cc = 1, 152 .n_cc = 1,
152 .queue_tc_mapping = da8xx_queue_tc_mapping, 153 .queue_tc_mapping = da8xx_queue_tc_mapping,
153 .queue_priority_mapping = da8xx_queue_priority_mapping, 154 .queue_priority_mapping = da8xx_queue_priority_mapping,
155 .default_queue = EVENTQ_1,
154 }, 156 },
155 { 157 {
156 .n_channel = 32, 158 .n_channel = 32,
@@ -160,6 +162,7 @@ static struct edma_soc_info da850_edma_cc_info[] = {
160 .n_cc = 1, 162 .n_cc = 1,
161 .queue_tc_mapping = da850_queue_tc_mapping, 163 .queue_tc_mapping = da850_queue_tc_mapping,
162 .queue_priority_mapping = da850_queue_priority_mapping, 164 .queue_priority_mapping = da850_queue_priority_mapping,
165 .default_queue = EVENTQ_0,
163 }, 166 },
164}; 167};
165 168
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 6162cae7f868..29b17f7d3a5f 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -80,6 +80,7 @@ static struct edma_soc_info edma_cc0_info = {
80 .n_cc = 1, 80 .n_cc = 1,
81 .queue_tc_mapping = edma_tc_mapping, 81 .queue_tc_mapping = edma_tc_mapping,
82 .queue_priority_mapping = edma_priority_mapping, 82 .queue_priority_mapping = edma_priority_mapping,
83 .default_queue = EVENTQ_1,
83}; 84};
84 85
85static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = { 86static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = {
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index c143f43addcc..fe520d4167a2 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -591,6 +591,7 @@ static struct edma_soc_info edma_cc0_info = {
591 .n_cc = 1, 591 .n_cc = 1,
592 .queue_tc_mapping = queue_tc_mapping, 592 .queue_tc_mapping = queue_tc_mapping,
593 .queue_priority_mapping = queue_priority_mapping, 593 .queue_priority_mapping = queue_priority_mapping,
594 .default_queue = EVENTQ_1,
594}; 595};
595 596
596static struct edma_soc_info *dm355_edma_info[EDMA_MAX_CC] = { 597static struct edma_soc_info *dm355_edma_info[EDMA_MAX_CC] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 9a274665edc5..3470983aa343 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -514,6 +514,7 @@ static struct edma_soc_info edma_cc0_info = {
514 .n_cc = 1, 514 .n_cc = 1,
515 .queue_tc_mapping = queue_tc_mapping, 515 .queue_tc_mapping = queue_tc_mapping,
516 .queue_priority_mapping = queue_priority_mapping, 516 .queue_priority_mapping = queue_priority_mapping,
517 .default_queue = EVENTQ_1,
517}; 518};
518 519
519static struct edma_soc_info *dm644x_edma_info[EDMA_MAX_CC] = { 520static struct edma_soc_info *dm644x_edma_info[EDMA_MAX_CC] = {
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 03e5f4931b42..0b68ed534f8e 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -555,6 +555,7 @@ static struct edma_soc_info edma_cc0_info = {
555 .n_cc = 1, 555 .n_cc = 1,
556 .queue_tc_mapping = dm646x_queue_tc_mapping, 556 .queue_tc_mapping = dm646x_queue_tc_mapping,
557 .queue_priority_mapping = dm646x_queue_priority_mapping, 557 .queue_priority_mapping = dm646x_queue_priority_mapping,
558 .default_queue = EVENTQ_1,
558}; 559};
559 560
560static struct edma_soc_info *dm646x_edma_info[EDMA_MAX_CC] = { 561static struct edma_soc_info *dm646x_edma_info[EDMA_MAX_CC] = {
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
index 6b9669869c46..da90103a313d 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c
@@ -1435,12 +1435,11 @@ static int __init edma_probe(struct platform_device *pdev)
1435 goto fail1; 1435 goto fail1;
1436 } 1436 }
1437 1437
1438 edma_cc[j] = kmalloc(sizeof(struct edma), GFP_KERNEL); 1438 edma_cc[j] = kzalloc(sizeof(struct edma), GFP_KERNEL);
1439 if (!edma_cc[j]) { 1439 if (!edma_cc[j]) {
1440 status = -ENOMEM; 1440 status = -ENOMEM;
1441 goto fail1; 1441 goto fail1;
1442 } 1442 }
1443 memset(edma_cc[j], 0, sizeof(struct edma));
1444 1443
1445 edma_cc[j]->num_channels = min_t(unsigned, info[j]->n_channel, 1444 edma_cc[j]->num_channels = min_t(unsigned, info[j]->n_channel,
1446 EDMA_MAX_DMACH); 1445 EDMA_MAX_DMACH);
@@ -1450,8 +1449,6 @@ static int __init edma_probe(struct platform_device *pdev)
1450 EDMA_MAX_CC); 1449 EDMA_MAX_CC);
1451 1450
1452 edma_cc[j]->default_queue = info[j]->default_queue; 1451 edma_cc[j]->default_queue = info[j]->default_queue;
1453 if (!edma_cc[j]->default_queue)
1454 edma_cc[j]->default_queue = EVENTQ_1;
1455 1452
1456 dev_dbg(&pdev->dev, "DMA REG BASE ADDR=%p\n", 1453 dev_dbg(&pdev->dev, "DMA REG BASE ADDR=%p\n",
1457 edmacc_regs_base[j]); 1454 edmacc_regs_base[j]);
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index fbaae4772b91..960e9de47e1e 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -15,6 +15,8 @@
15 15
16#include <asm-generic/gpio.h> 16#include <asm-generic/gpio.h>
17 17
18#define __ARM_GPIOLIB_COMPLEX
19
18/* The inline versions use the static inlines in the driver header */ 20/* The inline versions use the static inlines in the driver header */
19#include "gpio-davinci.h" 21#include "gpio-davinci.h"
20 22
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/arch/arm/mach-davinci/include/mach/mmc.h
index d4f1e9675069..5ba6b22ce338 100644
--- a/arch/arm/mach-davinci/include/mach/mmc.h
+++ b/arch/arm/mach-davinci/include/mach/mmc.h
@@ -12,6 +12,9 @@ struct davinci_mmc_config {
12 /* get_cd()/get_wp() may sleep */ 12 /* get_cd()/get_wp() may sleep */
13 int (*get_cd)(int module); 13 int (*get_cd)(int module);
14 int (*get_ro)(int module); 14 int (*get_ro)(int module);
15
16 void (*set_power)(int module, bool on);
17
15 /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */ 18 /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */
16 u8 wires; 19 u8 wires;
17 20
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index 5d4e0fed828a..a7e92fca32e6 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -857,6 +857,14 @@ enum davinci_da850_index {
857 DA850_MMCSD0_CLK, 857 DA850_MMCSD0_CLK,
858 DA850_MMCSD0_CMD, 858 DA850_MMCSD0_CMD,
859 859
860 /* MMC/SD1 function */
861 DA850_MMCSD1_DAT_0,
862 DA850_MMCSD1_DAT_1,
863 DA850_MMCSD1_DAT_2,
864 DA850_MMCSD1_DAT_3,
865 DA850_MMCSD1_CLK,
866 DA850_MMCSD1_CMD,
867
860 /* EMIF2.5/EMIFA function */ 868 /* EMIF2.5/EMIFA function */
861 DA850_EMA_D_7, 869 DA850_EMA_D_7,
862 DA850_EMA_D_6, 870 DA850_EMA_D_6,
@@ -916,6 +924,8 @@ enum davinci_da850_index {
916 DA850_GPIO3_13, 924 DA850_GPIO3_13,
917 DA850_GPIO4_0, 925 DA850_GPIO4_0,
918 DA850_GPIO4_1, 926 DA850_GPIO4_1,
927 DA850_GPIO6_9,
928 DA850_GPIO6_10,
919 DA850_GPIO6_13, 929 DA850_GPIO6_13,
920 DA850_RTC_ALARM, 930 DA850_RTC_ALARM,
921}; 931};