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/Kconfig8
-rw-r--r--arch/arm/mach-davinci/Makefile1
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c34
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c4
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c7
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c2
-rw-r--r--arch/arm/mach-davinci/common.c2
-rw-r--r--arch/arm/mach-davinci/da850.c17
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c66
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c77
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c2
-rw-r--r--arch/arm/mach-davinci/dm355.c6
-rw-r--r--arch/arm/mach-davinci/dm365.c6
-rw-r--r--arch/arm/mach-davinci/dm644x.c9
-rw-r--r--arch/arm/mach-davinci/dm646x.c6
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/serial.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/sram.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-davinci/serial.c39
-rw-r--r--arch/arm/mach-davinci/sram.c23
-rw-r--r--arch/arm/mach-davinci/time.c4
-rw-r--r--arch/arm/mach-davinci/usb.c6
27 files changed, 253 insertions, 89 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index f8eecb959413..0153950f6068 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -58,6 +58,14 @@ config ARCH_DAVINCI_TNETV107X
58 58
59comment "DaVinci Board Type" 59comment "DaVinci Board Type"
60 60
61config MACH_DA8XX_DT
62 bool "Support DA8XX platforms using device tree"
63 default y
64 depends on ARCH_DAVINCI_DA8XX
65 help
66 Say y here to include support for TI DaVinci DA850 based using
67 Flattened Device Tree. More information at Documentation/devicetree
68
61config MACH_DAVINCI_EVM 69config MACH_DAVINCI_EVM
62 bool "TI DM644x EVM" 70 bool "TI DM644x EVM"
63 default ARCH_DAVINCI_DM644x 71 default ARCH_DAVINCI_DM644x
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 2227effcb0e9..fb5c1aa98a63 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_AINTC) += irq.o
22obj-$(CONFIG_CP_INTC) += cp_intc.o 22obj-$(CONFIG_CP_INTC) += cp_intc.o
23 23
24# Board specific 24# Board specific
25obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o
25obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o 26obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
26obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o 27obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
27obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o 28obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 32ee3f895967..d4f4dbfc0e59 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -11,39 +11,40 @@
11 * is licensed "as is" without any warranty of any kind, whether express 11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied. 12 * or implied.
13 */ 13 */
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/console.h> 14#include <linux/console.h>
15#include <linux/delay.h>
16#include <linux/gpio.h>
17#include <linux/gpio_keys.h>
18#include <linux/init.h>
19#include <linux/kernel.h>
17#include <linux/i2c.h> 20#include <linux/i2c.h>
18#include <linux/i2c/at24.h> 21#include <linux/i2c/at24.h>
19#include <linux/i2c/pca953x.h> 22#include <linux/i2c/pca953x.h>
20#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/input/tps6507x-ts.h>
21#include <linux/mfd/tps6507x.h> 25#include <linux/mfd/tps6507x.h>
22#include <linux/gpio.h>
23#include <linux/gpio_keys.h>
24#include <linux/platform_device.h>
25#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
26#include <linux/mtd/nand.h> 27#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h> 29#include <linux/mtd/physmap.h>
30#include <linux/platform_device.h>
31#include <linux/platform_data/mtd-davinci.h>
32#include <linux/platform_data/mtd-davinci-aemif.h>
33#include <linux/platform_data/spi-davinci.h>
34#include <linux/platform_data/uio_pruss.h>
29#include <linux/regulator/machine.h> 35#include <linux/regulator/machine.h>
30#include <linux/regulator/tps6507x.h> 36#include <linux/regulator/tps6507x.h>
31#include <linux/input/tps6507x-ts.h>
32#include <linux/spi/spi.h> 37#include <linux/spi/spi.h>
33#include <linux/spi/flash.h> 38#include <linux/spi/flash.h>
34#include <linux/delay.h>
35#include <linux/wl12xx.h> 39#include <linux/wl12xx.h>
36 40
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
39#include <asm/system_info.h>
40
41#include <mach/cp_intc.h> 41#include <mach/cp_intc.h>
42#include <mach/da8xx.h> 42#include <mach/da8xx.h>
43#include <linux/platform_data/mtd-davinci.h>
44#include <mach/mux.h> 43#include <mach/mux.h>
45#include <linux/platform_data/mtd-davinci-aemif.h> 44
46#include <linux/platform_data/spi-davinci.h> 45#include <asm/mach-types.h>
46#include <asm/mach/arch.h>
47#include <asm/system_info.h>
47 48
48#include <media/tvp514x.h> 49#include <media/tvp514x.h>
49#include <media/adv7343.h> 50#include <media/adv7343.h>
@@ -1516,6 +1517,11 @@ static __init void da850_evm_init(void)
1516 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", 1517 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
1517 ret); 1518 ret);
1518 1519
1520 ret = da8xx_register_uio_pruss();
1521 if (ret)
1522 pr_warn("da850_evm_init: pruss initialization failed: %d\n",
1523 ret);
1524
1519 /* Handle board specific muxing for LCD here */ 1525 /* Handle board specific muxing for LCD here */
1520 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins); 1526 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
1521 if (ret) 1527 if (ret)
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 88ebea89abdf..cdf8d0746e79 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -324,7 +324,7 @@ static __init void dm355_evm_init(void)
324 if (IS_ERR(aemif)) 324 if (IS_ERR(aemif))
325 WARN("%s: unable to get AEMIF clock\n", __func__); 325 WARN("%s: unable to get AEMIF clock\n", __func__);
326 else 326 else
327 clk_enable(aemif); 327 clk_prepare_enable(aemif);
328 328
329 platform_add_devices(davinci_evm_devices, 329 platform_add_devices(davinci_evm_devices,
330 ARRAY_SIZE(davinci_evm_devices)); 330 ARRAY_SIZE(davinci_evm_devices));
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 2f88103c6459..d41954507fc2 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -246,7 +246,7 @@ static __init void dm355_leopard_init(void)
246 if (IS_ERR(aemif)) 246 if (IS_ERR(aemif))
247 WARN("%s: unable to get AEMIF clock\n", __func__); 247 WARN("%s: unable to get AEMIF clock\n", __func__);
248 else 248 else
249 clk_enable(aemif); 249 clk_prepare_enable(aemif);
250 250
251 platform_add_devices(davinci_leopard_devices, 251 platform_add_devices(davinci_leopard_devices,
252 ARRAY_SIZE(davinci_leopard_devices)); 252 ARRAY_SIZE(davinci_leopard_devices));
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 1b4a8adcfdc9..5d49c75388ca 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -478,7 +478,7 @@ static void __init evm_init_cpld(void)
478 aemif_clk = clk_get(NULL, "aemif"); 478 aemif_clk = clk_get(NULL, "aemif");
479 if (IS_ERR(aemif_clk)) 479 if (IS_ERR(aemif_clk))
480 return; 480 return;
481 clk_enable(aemif_clk); 481 clk_prepare_enable(aemif_clk);
482 482
483 if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE, 483 if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE,
484 "cpld") == NULL) 484 "cpld") == NULL)
@@ -489,7 +489,7 @@ static void __init evm_init_cpld(void)
489 SECTION_SIZE); 489 SECTION_SIZE);
490fail: 490fail:
491 pr_err("ERROR: can't map CPLD\n"); 491 pr_err("ERROR: can't map CPLD\n");
492 clk_disable(aemif_clk); 492 clk_disable_unprepare(aemif_clk);
493 return; 493 return;
494 } 494 }
495 495
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index f22572cee49d..f5e018de7fa5 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -519,13 +519,11 @@ static int dm6444evm_msp430_get_pins(void)
519 char buf[4]; 519 char buf[4];
520 struct i2c_msg msg[2] = { 520 struct i2c_msg msg[2] = {
521 { 521 {
522 .addr = dm6446evm_msp->addr,
523 .flags = 0, 522 .flags = 0,
524 .len = 2, 523 .len = 2,
525 .buf = (void __force *)txbuf, 524 .buf = (void __force *)txbuf,
526 }, 525 },
527 { 526 {
528 .addr = dm6446evm_msp->addr,
529 .flags = I2C_M_RD, 527 .flags = I2C_M_RD,
530 .len = 4, 528 .len = 4,
531 .buf = buf, 529 .buf = buf,
@@ -536,6 +534,9 @@ static int dm6444evm_msp430_get_pins(void)
536 if (!dm6446evm_msp) 534 if (!dm6446evm_msp)
537 return -ENXIO; 535 return -ENXIO;
538 536
537 msg[0].addr = dm6446evm_msp->addr;
538 msg[1].addr = dm6446evm_msp->addr;
539
539 /* Command 4 == get input state, returns port 2 and port3 data 540 /* Command 4 == get input state, returns port 2 and port3 data
540 * S Addr W [A] len=2 [A] cmd=4 [A] 541 * S Addr W [A] len=2 [A] cmd=4 [A]
541 * RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P 542 * RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P
@@ -776,7 +777,7 @@ static __init void davinci_evm_init(void)
776 struct davinci_soc_info *soc_info = &davinci_soc_info; 777 struct davinci_soc_info *soc_info = &davinci_soc_info;
777 778
778 aemif_clk = clk_get(NULL, "aemif"); 779 aemif_clk = clk_get(NULL, "aemif");
779 clk_enable(aemif_clk); 780 clk_prepare_enable(aemif_clk);
780 781
781 if (HAS_ATA) { 782 if (HAS_ATA) {
782 if (HAS_NAND || HAS_NOR) 783 if (HAS_NAND || HAS_NOR)
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 1dbf85beed1b..9211e8800c79 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -194,7 +194,7 @@ static int evm_led_setup(struct i2c_client *client, int gpio,
194 while (ngpio--) { 194 while (ngpio--) {
195 leds->gpio = gpio++; 195 leds->gpio = gpio++;
196 leds++; 196 leds++;
197 }; 197 }
198 198
199 evm_led_dev = platform_device_alloc("leds-gpio", 0); 199 evm_led_dev = platform_device_alloc("leds-gpio", 0);
200 platform_device_add_data(evm_led_dev, &evm_led_data, 200 platform_device_add_data(evm_led_dev, &evm_led_data,
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 144bf31d68dd..3e3e3afebf88 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -188,7 +188,7 @@ static __init void davinci_ntosd2_init(void)
188 struct davinci_soc_info *soc_info = &davinci_soc_info; 188 struct davinci_soc_info *soc_info = &davinci_soc_info;
189 189
190 aemif_clk = clk_get(NULL, "aemif"); 190 aemif_clk = clk_get(NULL, "aemif");
191 clk_enable(aemif_clk); 191 clk_prepare_enable(aemif_clk);
192 192
193 if (HAS_ATA) { 193 if (HAS_ATA) {
194 if (HAS_NAND) 194 if (HAS_NAND)
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 64b0f65a8639..a794f6d9d444 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -87,8 +87,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
87 iotable_init(davinci_soc_info.io_desc, 87 iotable_init(davinci_soc_info.io_desc,
88 davinci_soc_info.io_desc_num); 88 davinci_soc_info.io_desc_num);
89 89
90 init_consistent_dma_size(14 << 20);
91
92 /* 90 /*
93 * Normally devicemaps_init() would flush caches and tlb after 91 * Normally devicemaps_init() would flush caches and tlb after
94 * mdesc->map_io(), but we must also do it here because of the CPU 92 * mdesc->map_io(), but we must also do it here because of the CPU
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index b90c172d5541..68c5fe01857c 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -212,6 +212,12 @@ static struct clk tptc2_clk = {
212 .flags = ALWAYS_ENABLED, 212 .flags = ALWAYS_ENABLED,
213}; 213};
214 214
215static struct clk pruss_clk = {
216 .name = "pruss",
217 .parent = &pll0_sysclk2,
218 .lpsc = DA8XX_LPSC0_PRUSS,
219};
220
215static struct clk uart0_clk = { 221static struct clk uart0_clk = {
216 .name = "uart0", 222 .name = "uart0",
217 .parent = &pll0_sysclk2, 223 .parent = &pll0_sysclk2,
@@ -385,6 +391,7 @@ static struct clk_lookup da850_clks[] = {
385 CLK(NULL, "tptc1", &tptc1_clk), 391 CLK(NULL, "tptc1", &tptc1_clk),
386 CLK(NULL, "tpcc1", &tpcc1_clk), 392 CLK(NULL, "tpcc1", &tpcc1_clk),
387 CLK(NULL, "tptc2", &tptc2_clk), 393 CLK(NULL, "tptc2", &tptc2_clk),
394 CLK("pruss_uio", "pruss", &pruss_clk),
388 CLK(NULL, "uart0", &uart0_clk), 395 CLK(NULL, "uart0", &uart0_clk),
389 CLK(NULL, "uart1", &uart1_clk), 396 CLK(NULL, "uart1", &uart1_clk),
390 CLK(NULL, "uart2", &uart2_clk), 397 CLK(NULL, "uart2", &uart2_clk),
@@ -781,12 +788,6 @@ static struct map_desc da850_io_desc[] = {
781 .length = DA8XX_CP_INTC_SIZE, 788 .length = DA8XX_CP_INTC_SIZE,
782 .type = MT_DEVICE 789 .type = MT_DEVICE
783 }, 790 },
784 {
785 .virtual = SRAM_VIRT,
786 .pfn = __phys_to_pfn(DA8XX_ARM_RAM_BASE),
787 .length = SZ_8K,
788 .type = MT_DEVICE
789 },
790}; 791};
791 792
792static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE }; 793static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE };
@@ -1239,8 +1240,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
1239 .gpio_irq = IRQ_DA8XX_GPIO0, 1240 .gpio_irq = IRQ_DA8XX_GPIO0,
1240 .serial_dev = &da8xx_serial_device, 1241 .serial_dev = &da8xx_serial_device,
1241 .emac_pdata = &da8xx_emac_pdata, 1242 .emac_pdata = &da8xx_emac_pdata,
1242 .sram_dma = DA8XX_ARM_RAM_BASE, 1243 .sram_dma = DA8XX_SHARED_RAM_BASE,
1243 .sram_len = SZ_8K, 1244 .sram_len = SZ_128K,
1244}; 1245};
1245 1246
1246void __init da850_init(void) 1247void __init da850_init(void)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
new file mode 100644
index 000000000000..37c27af18fa0
--- /dev/null
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -0,0 +1,66 @@
1/*
2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * Modified from mach-omap/omap2/board-generic.c
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/io.h>
11#include <linux/of_irq.h>
12#include <linux/of_platform.h>
13#include <linux/irqdomain.h>
14
15#include <asm/mach/arch.h>
16
17#include <mach/common.h>
18#include <mach/cp_intc.h>
19#include <mach/da8xx.h>
20
21#define DA8XX_NUM_UARTS 3
22
23void __init da8xx_uart_clk_enable(void)
24{
25 int i;
26 for (i = 0; i < DA8XX_NUM_UARTS; i++)
27 davinci_serial_setup_clk(i, NULL);
28}
29
30static struct of_device_id da8xx_irq_match[] __initdata = {
31 { .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
32 { }
33};
34
35static void __init da8xx_init_irq(void)
36{
37 of_irq_init(da8xx_irq_match);
38}
39
40#ifdef CONFIG_ARCH_DAVINCI_DA850
41
42static void __init da850_init_machine(void)
43{
44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
45
46 da8xx_uart_clk_enable();
47}
48
49static const char *da850_boards_compat[] __initdata = {
50 "enbw,cmc",
51 "ti,da850-evm",
52 "ti,da850",
53 NULL,
54};
55
56DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
57 .map_io = da850_init,
58 .init_irq = da8xx_init_irq,
59 .timer = &davinci_timer,
60 .init_machine = da850_init_machine,
61 .dt_compat = da850_boards_compat,
62 .init_late = davinci_init_late,
63 .restart = da8xx_restart,
64MACHINE_END
65
66#endif
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index bd2f72b414bc..46c9a0c09ae5 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -22,6 +22,7 @@
22#include <mach/time.h> 22#include <mach/time.h>
23#include <mach/da8xx.h> 23#include <mach/da8xx.h>
24#include <mach/cpuidle.h> 24#include <mach/cpuidle.h>
25#include <mach/sram.h>
25 26
26#include "clock.h" 27#include "clock.h"
27#include "asp.h" 28#include "asp.h"
@@ -32,6 +33,7 @@
32#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ 33#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
33#define DA8XX_I2C0_BASE 0x01c22000 34#define DA8XX_I2C0_BASE 0x01c22000
34#define DA8XX_RTC_BASE 0x01c23000 35#define DA8XX_RTC_BASE 0x01c23000
36#define DA8XX_PRUSS_MEM_BASE 0x01c30000
35#define DA8XX_MMCSD0_BASE 0x01c40000 37#define DA8XX_MMCSD0_BASE 0x01c40000
36#define DA8XX_SPI0_BASE 0x01c41000 38#define DA8XX_SPI0_BASE 0x01c41000
37#define DA830_SPI1_BASE 0x01e12000 39#define DA830_SPI1_BASE 0x01e12000
@@ -518,6 +520,75 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
518 } 520 }
519} 521}
520 522
523static struct resource da8xx_pruss_resources[] = {
524 {
525 .start = DA8XX_PRUSS_MEM_BASE,
526 .end = DA8XX_PRUSS_MEM_BASE + 0xFFFF,
527 .flags = IORESOURCE_MEM,
528 },
529 {
530 .start = IRQ_DA8XX_EVTOUT0,
531 .end = IRQ_DA8XX_EVTOUT0,
532 .flags = IORESOURCE_IRQ,
533 },
534 {
535 .start = IRQ_DA8XX_EVTOUT1,
536 .end = IRQ_DA8XX_EVTOUT1,
537 .flags = IORESOURCE_IRQ,
538 },
539 {
540 .start = IRQ_DA8XX_EVTOUT2,
541 .end = IRQ_DA8XX_EVTOUT2,
542 .flags = IORESOURCE_IRQ,
543 },
544 {
545 .start = IRQ_DA8XX_EVTOUT3,
546 .end = IRQ_DA8XX_EVTOUT3,
547 .flags = IORESOURCE_IRQ,
548 },
549 {
550 .start = IRQ_DA8XX_EVTOUT4,
551 .end = IRQ_DA8XX_EVTOUT4,
552 .flags = IORESOURCE_IRQ,
553 },
554 {
555 .start = IRQ_DA8XX_EVTOUT5,
556 .end = IRQ_DA8XX_EVTOUT5,
557 .flags = IORESOURCE_IRQ,
558 },
559 {
560 .start = IRQ_DA8XX_EVTOUT6,
561 .end = IRQ_DA8XX_EVTOUT6,
562 .flags = IORESOURCE_IRQ,
563 },
564 {
565 .start = IRQ_DA8XX_EVTOUT7,
566 .end = IRQ_DA8XX_EVTOUT7,
567 .flags = IORESOURCE_IRQ,
568 },
569};
570
571static struct uio_pruss_pdata da8xx_uio_pruss_pdata = {
572 .pintc_base = 0x4000,
573};
574
575static struct platform_device da8xx_uio_pruss_dev = {
576 .name = "pruss_uio",
577 .id = -1,
578 .num_resources = ARRAY_SIZE(da8xx_pruss_resources),
579 .resource = da8xx_pruss_resources,
580 .dev = {
581 .coherent_dma_mask = DMA_BIT_MASK(32),
582 .platform_data = &da8xx_uio_pruss_pdata,
583 }
584};
585
586int __init da8xx_register_uio_pruss(void)
587{
588 da8xx_uio_pruss_pdata.sram_pool = sram_get_gen_pool();
589 return platform_device_register(&da8xx_uio_pruss_dev);
590}
591
521static const struct display_panel disp_panel = { 592static const struct display_panel disp_panel = {
522 QVGA, 593 QVGA,
523 16, 594 16,
@@ -900,7 +971,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
900 if (IS_ERR(da850_sata_clk)) 971 if (IS_ERR(da850_sata_clk))
901 return PTR_ERR(da850_sata_clk); 972 return PTR_ERR(da850_sata_clk);
902 973
903 ret = clk_enable(da850_sata_clk); 974 ret = clk_prepare_enable(da850_sata_clk);
904 if (ret) 975 if (ret)
905 goto err0; 976 goto err0;
906 977
@@ -931,7 +1002,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
931 return 0; 1002 return 0;
932 1003
933err1: 1004err1:
934 clk_disable(da850_sata_clk); 1005 clk_disable_unprepare(da850_sata_clk);
935err0: 1006err0:
936 clk_put(da850_sata_clk); 1007 clk_put(da850_sata_clk);
937 return ret; 1008 return ret;
@@ -939,7 +1010,7 @@ err0:
939 1010
940static void da850_sata_exit(struct device *dev) 1011static void da850_sata_exit(struct device *dev)
941{ 1012{
942 clk_disable(da850_sata_clk); 1013 clk_disable_unprepare(da850_sata_clk);
943 clk_put(da850_sata_clk); 1014 clk_put(da850_sata_clk);
944} 1015}
945 1016
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 29b17f7d3a5f..773ab07a71a0 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -374,7 +374,7 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
374 * complete sample conversion in time. 374 * complete sample conversion in time.
375 */ 375 */
376 tsc_clk = clk_get(NULL, "sys_tsc_clk"); 376 tsc_clk = clk_get(NULL, "sys_tsc_clk");
377 if (tsc_clk) { 377 if (!IS_ERR(tsc_clk)) {
378 error = clk_set_rate(tsc_clk, 5000000); 378 error = clk_set_rate(tsc_clk, 5000000);
379 WARN_ON(error < 0); 379 WARN_ON(error < 0);
380 clk_put(tsc_clk); 380 clk_put(tsc_clk);
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a255434908db..b49c3b77d55e 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -758,12 +758,6 @@ static struct map_desc dm355_io_desc[] = {
758 .length = IO_SIZE, 758 .length = IO_SIZE,
759 .type = MT_DEVICE 759 .type = MT_DEVICE
760 }, 760 },
761 {
762 .virtual = SRAM_VIRT,
763 .pfn = __phys_to_pfn(0x00010000),
764 .length = SZ_32K,
765 .type = MT_MEMORY_NONCACHED,
766 },
767}; 761};
768 762
769/* Contents of JTAG ID register used to identify exact cpu type */ 763/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index b680c832e0ba..6c3980540be0 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -985,12 +985,6 @@ static struct map_desc dm365_io_desc[] = {
985 .length = IO_SIZE, 985 .length = IO_SIZE,
986 .type = MT_DEVICE 986 .type = MT_DEVICE
987 }, 987 },
988 {
989 .virtual = SRAM_VIRT,
990 .pfn = __phys_to_pfn(0x00010000),
991 .length = SZ_32K,
992 .type = MT_MEMORY_NONCACHED,
993 },
994}; 988};
995 989
996static struct resource dm365_ks_resources[] = { 990static struct resource dm365_ks_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index cd0c8b1e1ecf..11c79a3362ef 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -713,8 +713,7 @@ static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
713 break; 713 break;
714 case VPBE_ENC_CUSTOM_TIMINGS: 714 case VPBE_ENC_CUSTOM_TIMINGS:
715 if (pclock <= 27000000) { 715 if (pclock <= 27000000) {
716 v |= DM644X_VPSS_MUXSEL_PLL2_MODE | 716 v |= DM644X_VPSS_DACCLKEN;
717 DM644X_VPSS_DACCLKEN;
718 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL)); 717 writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
719 } else { 718 } else {
720 /* 719 /*
@@ -786,12 +785,6 @@ static struct map_desc dm644x_io_desc[] = {
786 .length = IO_SIZE, 785 .length = IO_SIZE,
787 .type = MT_DEVICE 786 .type = MT_DEVICE
788 }, 787 },
789 {
790 .virtual = SRAM_VIRT,
791 .pfn = __phys_to_pfn(0x00008000),
792 .length = SZ_16K,
793 .type = MT_MEMORY_NONCACHED,
794 },
795}; 788};
796 789
797/* Contents of JTAG ID register used to identify exact cpu type */ 790/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 97c0f8e555bd..ac7b431c4c8e 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -756,12 +756,6 @@ static struct map_desc dm646x_io_desc[] = {
756 .length = IO_SIZE, 756 .length = IO_SIZE,
757 .type = MT_DEVICE 757 .type = MT_DEVICE
758 }, 758 },
759 {
760 .virtual = SRAM_VIRT,
761 .pfn = __phys_to_pfn(0x00010000),
762 .length = SZ_32K,
763 .type = MT_MEMORY_NONCACHED,
764 },
765}; 759};
766 760
767/* Contents of JTAG ID register used to identify exact cpu type */ 761/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index bdc4aa8e672a..046c7238a3d6 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -104,8 +104,6 @@ int davinci_pm_init(void);
104static inline int davinci_pm_init(void) { return 0; } 104static inline int davinci_pm_init(void) { return 0; }
105#endif 105#endif
106 106
107/* standard place to map on-chip SRAMs; they *may* support DMA */
108#define SRAM_VIRT 0xfffe0000
109#define SRAM_SIZE SZ_128K 107#define SRAM_SIZE SZ_128K
110 108
111#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ 109#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index aaccdc4528fc..700d311c6854 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -26,6 +26,7 @@
26#include <linux/platform_data/mmc-davinci.h> 26#include <linux/platform_data/mmc-davinci.h>
27#include <linux/platform_data/usb-davinci.h> 27#include <linux/platform_data/usb-davinci.h>
28#include <linux/platform_data/spi-davinci.h> 28#include <linux/platform_data/spi-davinci.h>
29#include <linux/platform_data/uio_pruss.h>
29 30
30#include <media/davinci/vpif_types.h> 31#include <media/davinci/vpif_types.h>
31 32
@@ -72,6 +73,7 @@ extern unsigned int da850_max_speed;
72#define DA8XX_AEMIF_CS2_BASE 0x60000000 73#define DA8XX_AEMIF_CS2_BASE 0x60000000
73#define DA8XX_AEMIF_CS3_BASE 0x62000000 74#define DA8XX_AEMIF_CS3_BASE 0x62000000
74#define DA8XX_AEMIF_CTL_BASE 0x68000000 75#define DA8XX_AEMIF_CTL_BASE 0x68000000
76#define DA8XX_SHARED_RAM_BASE 0x80000000
75#define DA8XX_ARM_RAM_BASE 0xffff0000 77#define DA8XX_ARM_RAM_BASE 0xffff0000
76 78
77void __init da830_init(void); 79void __init da830_init(void);
@@ -86,6 +88,7 @@ int da8xx_register_watchdog(void);
86int da8xx_register_usb20(unsigned mA, unsigned potpgt); 88int da8xx_register_usb20(unsigned mA, unsigned potpgt);
87int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); 89int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
88int da8xx_register_emac(void); 90int da8xx_register_emac(void);
91int da8xx_register_uio_pruss(void);
89int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); 92int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
90int da8xx_register_mmcsd0(struct davinci_mmc_config *config); 93int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
91int da850_register_mmcsd1(struct davinci_mmc_config *config); 94int da850_register_mmcsd1(struct davinci_mmc_config *config);
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index 46b3cd11c3c2..62ad300440f5 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -38,11 +38,12 @@
38 38
39#ifndef __ASSEMBLY__ 39#ifndef __ASSEMBLY__
40struct davinci_uart_config { 40struct davinci_uart_config {
41 /* Bit field of UARTs present; bit 0 --> UART1 */ 41 /* Bit field of UARTs present; bit 0 --> UART0 */
42 unsigned int enabled_uarts; 42 unsigned int enabled_uarts;
43}; 43};
44 44
45extern int davinci_serial_init(struct davinci_uart_config *); 45extern int davinci_serial_init(struct davinci_uart_config *);
46extern int davinci_serial_setup_clk(unsigned instance, unsigned int *rate);
46#endif 47#endif
47 48
48#endif /* __ASM_ARCH_SERIAL_H */ 49#endif /* __ASM_ARCH_SERIAL_H */
diff --git a/arch/arm/mach-davinci/include/mach/sram.h b/arch/arm/mach-davinci/include/mach/sram.h
index 111f7cc71e07..4e5db56218b8 100644
--- a/arch/arm/mach-davinci/include/mach/sram.h
+++ b/arch/arm/mach-davinci/include/mach/sram.h
@@ -24,4 +24,7 @@
24extern void *sram_alloc(size_t len, dma_addr_t *dma); 24extern void *sram_alloc(size_t len, dma_addr_t *dma);
25extern void sram_free(void *addr, size_t len); 25extern void sram_free(void *addr, size_t len);
26 26
27/* Get the struct gen_pool * for use in platform data */
28extern struct gen_pool *sram_get_gen_pool(void);
29
27#endif /* __MACH_SRAM_H */ 30#endif /* __MACH_SRAM_H */
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 18cfd4977155..3a0ff905a69b 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -32,6 +32,9 @@ u32 *uart;
32/* PORT_16C550A, in polled non-fifo mode */ 32/* PORT_16C550A, in polled non-fifo mode */
33static void putc(char c) 33static void putc(char c)
34{ 34{
35 if (!uart)
36 return;
37
35 while (!(uart[UART_LSR] & UART_LSR_THRE)) 38 while (!(uart[UART_LSR] & UART_LSR_THRE))
36 barrier(); 39 barrier();
37 uart[UART_TX] = c; 40 uart[UART_TX] = c;
@@ -39,6 +42,9 @@ static void putc(char c)
39 42
40static inline void flush(void) 43static inline void flush(void)
41{ 44{
45 if (!uart)
46 return;
47
42 while (!(uart[UART_LSR] & UART_LSR_THRE)) 48 while (!(uart[UART_LSR] & UART_LSR_THRE))
43 barrier(); 49 barrier();
44} 50}
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 1875740fe27c..f2625814c3c9 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -70,11 +70,33 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
70 UART_DM646X_SCR_TX_WATERMARK); 70 UART_DM646X_SCR_TX_WATERMARK);
71} 71}
72 72
73int __init davinci_serial_init(struct davinci_uart_config *info) 73/* Enable UART clock and obtain its rate */
74int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
74{ 75{
75 int i;
76 char name[16]; 76 char name[16];
77 struct clk *uart_clk; 77 struct clk *clk;
78 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev;
80
81 sprintf(name, "uart%d", instance);
82 clk = clk_get(dev, name);
83 if (IS_ERR(clk)) {
84 pr_err("%s:%d: failed to get UART%d clock\n",
85 __func__, __LINE__, instance);
86 return PTR_ERR(clk);
87 }
88
89 clk_prepare_enable(clk);
90
91 if (rate)
92 *rate = clk_get_rate(clk);
93
94 return 0;
95}
96
97int __init davinci_serial_init(struct davinci_uart_config *info)
98{
99 int i, ret;
78 struct davinci_soc_info *soc_info = &davinci_soc_info; 100 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev; 101 struct device *dev = &soc_info->serial_dev->dev;
80 struct plat_serial8250_port *p = dev->platform_data; 102 struct plat_serial8250_port *p = dev->platform_data;
@@ -87,16 +109,9 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
87 if (!(info->enabled_uarts & (1 << i))) 109 if (!(info->enabled_uarts & (1 << i)))
88 continue; 110 continue;
89 111
90 sprintf(name, "uart%d", i); 112 ret = davinci_serial_setup_clk(i, &p->uartclk);
91 uart_clk = clk_get(dev, name); 113 if (ret)
92 if (IS_ERR(uart_clk)) {
93 printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
94 __func__, __LINE__, i);
95 continue; 114 continue;
96 }
97
98 clk_enable(uart_clk);
99 p->uartclk = clk_get_rate(uart_clk);
100 115
101 if (!p->membase && p->mapbase) { 116 if (!p->membase && p->mapbase) {
102 p->membase = ioremap(p->mapbase, SZ_4K); 117 p->membase = ioremap(p->mapbase, SZ_4K);
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c
index db0f7787faf1..c5f7ee5cc80a 100644
--- a/arch/arm/mach-davinci/sram.c
+++ b/arch/arm/mach-davinci/sram.c
@@ -10,6 +10,7 @@
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/io.h>
13#include <linux/genalloc.h> 14#include <linux/genalloc.h>
14 15
15#include <mach/common.h> 16#include <mach/common.h>
@@ -17,6 +18,11 @@
17 18
18static struct gen_pool *sram_pool; 19static struct gen_pool *sram_pool;
19 20
21struct gen_pool *sram_get_gen_pool(void)
22{
23 return sram_pool;
24}
25
20void *sram_alloc(size_t len, dma_addr_t *dma) 26void *sram_alloc(size_t len, dma_addr_t *dma)
21{ 27{
22 unsigned long vaddr; 28 unsigned long vaddr;
@@ -32,7 +38,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma)
32 return NULL; 38 return NULL;
33 39
34 if (dma) 40 if (dma)
35 *dma = dma_base + (vaddr - SRAM_VIRT); 41 *dma = gen_pool_virt_to_phys(sram_pool, vaddr);
36 return (void *)vaddr; 42 return (void *)vaddr;
37 43
38} 44}
@@ -53,8 +59,10 @@ EXPORT_SYMBOL(sram_free);
53 */ 59 */
54static int __init sram_init(void) 60static int __init sram_init(void)
55{ 61{
62 phys_addr_t phys = davinci_soc_info.sram_dma;
56 unsigned len = davinci_soc_info.sram_len; 63 unsigned len = davinci_soc_info.sram_len;
57 int status = 0; 64 int status = 0;
65 void *addr;
58 66
59 if (len) { 67 if (len) {
60 len = min_t(unsigned, len, SRAM_SIZE); 68 len = min_t(unsigned, len, SRAM_SIZE);
@@ -62,8 +70,17 @@ static int __init sram_init(void)
62 if (!sram_pool) 70 if (!sram_pool)
63 status = -ENOMEM; 71 status = -ENOMEM;
64 } 72 }
65 if (sram_pool) 73
66 status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1); 74 if (sram_pool) {
75 addr = ioremap(phys, len);
76 if (!addr)
77 return -ENOMEM;
78 status = gen_pool_add_virt(sram_pool, (unsigned)addr,
79 phys, len, -1);
80 if (status < 0)
81 iounmap(addr);
82 }
83
67 WARN_ON(status < 0); 84 WARN_ON(status < 0);
68 return status; 85 return status;
69} 86}
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 75da315b6587..9847938785ca 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -379,7 +379,7 @@ static void __init davinci_timer_init(void)
379 379
380 timer_clk = clk_get(NULL, "timer0"); 380 timer_clk = clk_get(NULL, "timer0");
381 BUG_ON(IS_ERR(timer_clk)); 381 BUG_ON(IS_ERR(timer_clk));
382 clk_enable(timer_clk); 382 clk_prepare_enable(timer_clk);
383 383
384 /* init timer hw */ 384 /* init timer hw */
385 timer_init(); 385 timer_init();
@@ -429,7 +429,7 @@ void davinci_watchdog_reset(struct platform_device *pdev)
429 wd_clk = clk_get(&pdev->dev, NULL); 429 wd_clk = clk_get(&pdev->dev, NULL);
430 if (WARN_ON(IS_ERR(wd_clk))) 430 if (WARN_ON(IS_ERR(wd_clk)))
431 return; 431 return;
432 clk_enable(wd_clk); 432 clk_prepare_enable(wd_clk);
433 433
434 /* disable, internal clock source */ 434 /* disable, internal clock source */
435 __raw_writel(0, base + TCR); 435 __raw_writel(0, base + TCR);
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index f77b95336e2b..34509ffba221 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -42,14 +42,8 @@ static struct musb_hdrc_config musb_config = {
42}; 42};
43 43
44static struct musb_hdrc_platform_data usb_data = { 44static struct musb_hdrc_platform_data usb_data = {
45#if defined(CONFIG_USB_MUSB_OTG)
46 /* OTG requires a Mini-AB connector */ 45 /* OTG requires a Mini-AB connector */
47 .mode = MUSB_OTG, 46 .mode = MUSB_OTG,
48#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
49 .mode = MUSB_PERIPHERAL,
50#elif defined(CONFIG_USB_MUSB_HOST)
51 .mode = MUSB_HOST,
52#endif
53 .clock = "usb", 47 .clock = "usb",
54 .config = &musb_config, 48 .config = &musb_config,
55}; 49};