diff options
author | Olof Johansson <olof@lixom.net> | 2012-11-20 01:24:44 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-20 01:25:01 -0500 |
commit | 6ee052a38fa83553eb269cdba2387f30bc790dd9 (patch) | |
tree | 7c48f3151455f3c383f05f20e2fb59f28ec25c16 | |
parent | e014f774d32b8930215c95fd19307b5395b996e2 (diff) | |
parent | 3a373904b88a73445f7a78249cf60efabbf1a9f3 (diff) |
Merge tag 'davinci-for-v3.8/dt' of git://gitorious.org/linux-davinci/linux-davinci into next/dt
From Sekhar Nori:
These changes add DT boot support to DaVinci DA850
SoC.
* tag 'davinci-for-v3.8/dt' of git://gitorious.org/linux-davinci/linux-davinci:
ARM: davinci: da850: generate dtbs for da850 boards
ARM: davinci: add support for am1808 based EnBW CMC board
ARM: davinci: da850 evm: add DT data
ARM: davinci: da850: add SoC DT data
ARM: davinci: da850: add DT boot support
ARM: davinci: da8xx: add DA850 PRUSS support
ARM: davinci: add platform hook to fetch the SRAM pool
ARM: davinci: da850: changed SRAM allocator to shared ram.
ARM: davinci: sram: switch from iotable to ioremapped regions
uio: uio_pruss: replace private SRAM API with genalloc
ARM: davinci: serial: provide API to initialze UART clocks
ARM: davinci: convert platform code to use clk_prepare/clk_unprepare
Signed-off-by: Olof Johansson <olof@lixom.net>
30 files changed, 378 insertions, 68 deletions
diff --git a/Documentation/devicetree/bindings/arm/davinci.txt b/Documentation/devicetree/bindings/arm/davinci.txt new file mode 100644 index 000000000000..cfaeda4274e6 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/davinci.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | Texas Instruments DaVinci Platforms Device Tree Bindings | ||
2 | -------------------------------------------------------- | ||
3 | |||
4 | DA850/OMAP-L138/AM18x Evaluation Module (EVM) board | ||
5 | Required root node properties: | ||
6 | - compatible = "ti,da850-evm", "ti,da850"; | ||
7 | |||
8 | EnBW AM1808 based CMC board | ||
9 | Required root node properties: | ||
10 | - compatible = "enbw,cmc", "ti,da850; | ||
11 | |||
12 | Generic DaVinci Boards | ||
13 | ---------------------- | ||
14 | |||
15 | DA850/OMAP-L138/AM18x generic board | ||
16 | Required root node properties: | ||
17 | - compatible = "ti,da850"; | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 23252783e93f..dbbe74c10b1c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -911,6 +911,7 @@ config ARCH_DAVINCI | |||
911 | select GENERIC_IRQ_CHIP | 911 | select GENERIC_IRQ_CHIP |
912 | select HAVE_IDE | 912 | select HAVE_IDE |
913 | select NEED_MACH_GPIO_H | 913 | select NEED_MACH_GPIO_H |
914 | select USE_OF | ||
914 | select ZONE_DMA | 915 | select ZONE_DMA |
915 | help | 916 | help |
916 | Support for TI's DaVinci platform. | 917 | Support for TI's DaVinci platform. |
diff --git a/arch/arm/boot/dts/da850-enbw-cmc.dts b/arch/arm/boot/dts/da850-enbw-cmc.dts new file mode 100644 index 000000000000..422fdb3fcfc1 --- /dev/null +++ b/arch/arm/boot/dts/da850-enbw-cmc.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Device Tree for AM1808 EnBW CMC board | ||
3 | * | ||
4 | * Copyright 2012 DENX Software Engineering GmbH | ||
5 | * Heiko Schocher <hs@denx.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | /dts-v1/; | ||
13 | /include/ "da850.dtsi" | ||
14 | |||
15 | / { | ||
16 | compatible = "enbw,cmc", "ti,da850"; | ||
17 | model = "EnBW CMC"; | ||
18 | |||
19 | soc { | ||
20 | serial0: serial@1c42000 { | ||
21 | status = "okay"; | ||
22 | }; | ||
23 | serial1: serial@1d0c000 { | ||
24 | status = "okay"; | ||
25 | }; | ||
26 | serial2: serial@1d0d000 { | ||
27 | status = "okay"; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts new file mode 100644 index 000000000000..37dc5a3243b8 --- /dev/null +++ b/arch/arm/boot/dts/da850-evm.dts | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Device Tree for DA850 EVM board | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation, version 2. | ||
9 | */ | ||
10 | /dts-v1/; | ||
11 | /include/ "da850.dtsi" | ||
12 | |||
13 | / { | ||
14 | compatible = "ti,da850-evm", "ti,da850"; | ||
15 | model = "DA850/AM1808/OMAP-L138 EVM"; | ||
16 | |||
17 | soc { | ||
18 | serial0: serial@1c42000 { | ||
19 | status = "okay"; | ||
20 | }; | ||
21 | serial1: serial@1d0c000 { | ||
22 | status = "okay"; | ||
23 | }; | ||
24 | serial2: serial@1d0d000 { | ||
25 | status = "okay"; | ||
26 | }; | ||
27 | }; | ||
28 | }; | ||
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi new file mode 100644 index 000000000000..640ab75c20db --- /dev/null +++ b/arch/arm/boot/dts/da850.dtsi | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright 2012 DENX Software Engineering GmbH | ||
3 | * Heiko Schocher <hs@denx.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | /include/ "skeleton.dtsi" | ||
11 | |||
12 | / { | ||
13 | arm { | ||
14 | #address-cells = <1>; | ||
15 | #size-cells = <1>; | ||
16 | ranges; | ||
17 | intc: interrupt-controller { | ||
18 | compatible = "ti,cp-intc"; | ||
19 | interrupt-controller; | ||
20 | #interrupt-cells = <1>; | ||
21 | ti,intc-size = <100>; | ||
22 | reg = <0xfffee000 0x2000>; | ||
23 | }; | ||
24 | }; | ||
25 | soc { | ||
26 | compatible = "simple-bus"; | ||
27 | model = "da850"; | ||
28 | #address-cells = <1>; | ||
29 | #size-cells = <1>; | ||
30 | ranges = <0x0 0x01c00000 0x400000>; | ||
31 | |||
32 | serial0: serial@1c42000 { | ||
33 | compatible = "ns16550a"; | ||
34 | reg = <0x42000 0x100>; | ||
35 | clock-frequency = <150000000>; | ||
36 | reg-shift = <2>; | ||
37 | interrupts = <25>; | ||
38 | interrupt-parent = <&intc>; | ||
39 | status = "disabled"; | ||
40 | }; | ||
41 | serial1: serial@1d0c000 { | ||
42 | compatible = "ns16550a"; | ||
43 | reg = <0x10c000 0x100>; | ||
44 | clock-frequency = <150000000>; | ||
45 | reg-shift = <2>; | ||
46 | interrupts = <53>; | ||
47 | interrupt-parent = <&intc>; | ||
48 | status = "disabled"; | ||
49 | }; | ||
50 | serial2: serial@1d0d000 { | ||
51 | compatible = "ns16550a"; | ||
52 | reg = <0x10d000 0x100>; | ||
53 | clock-frequency = <150000000>; | ||
54 | reg-shift = <2>; | ||
55 | interrupts = <61>; | ||
56 | interrupt-parent = <&intc>; | ||
57 | status = "disabled"; | ||
58 | }; | ||
59 | }; | ||
60 | }; | ||
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 | ||
59 | comment "DaVinci Board Type" | 59 | comment "DaVinci Board Type" |
60 | 60 | ||
61 | config 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 | |||
61 | config MACH_DAVINCI_EVM | 69 | config 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 | |||
22 | obj-$(CONFIG_CP_INTC) += cp_intc.o | 22 | obj-$(CONFIG_CP_INTC) += cp_intc.o |
23 | 23 | ||
24 | # Board specific | 24 | # Board specific |
25 | obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o | ||
25 | obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o | 26 | obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o |
26 | obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o | 27 | obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o |
27 | obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o | 28 | obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o |
diff --git a/arch/arm/mach-davinci/Makefile.boot b/arch/arm/mach-davinci/Makefile.boot index 04a6c4e67b14..5c5a95a9d7d2 100644 --- a/arch/arm/mach-davinci/Makefile.boot +++ b/arch/arm/mach-davinci/Makefile.boot | |||
@@ -11,3 +11,5 @@ else | |||
11 | params_phys-y := 0x80000100 | 11 | params_phys-y := 0x80000100 |
12 | initrd_phys-y := 0x80800000 | 12 | initrd_phys-y := 0x80800000 |
13 | endif | 13 | endif |
14 | |||
15 | dtb-$(CONFIG_MACH_DA8XX_DT) += da850-enbw-cmc.dtb da850-evm.dtb | ||
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); |
490 | fail: | 490 | fail: |
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..a84dfcbc1154 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -776,7 +776,7 @@ static __init void davinci_evm_init(void) | |||
776 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 776 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
777 | 777 | ||
778 | aemif_clk = clk_get(NULL, "aemif"); | 778 | aemif_clk = clk_get(NULL, "aemif"); |
779 | clk_enable(aemif_clk); | 779 | clk_prepare_enable(aemif_clk); |
780 | 780 | ||
781 | if (HAS_ATA) { | 781 | if (HAS_ATA) { |
782 | if (HAS_NAND || HAS_NOR) | 782 | if (HAS_NAND || HAS_NOR) |
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/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 | ||
215 | static struct clk pruss_clk = { | ||
216 | .name = "pruss", | ||
217 | .parent = &pll0_sysclk2, | ||
218 | .lpsc = DA8XX_LPSC0_PRUSS, | ||
219 | }; | ||
220 | |||
215 | static struct clk uart0_clk = { | 221 | static 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 | ||
792 | static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE }; | 793 | static 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 | ||
1246 | void __init da850_init(void) | 1247 | void __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 | |||
23 | void __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 | |||
30 | static struct of_device_id da8xx_irq_match[] __initdata = { | ||
31 | { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, | ||
32 | { } | ||
33 | }; | ||
34 | |||
35 | static void __init da8xx_init_irq(void) | ||
36 | { | ||
37 | of_irq_init(da8xx_irq_match); | ||
38 | } | ||
39 | |||
40 | #ifdef CONFIG_ARCH_DAVINCI_DA850 | ||
41 | |||
42 | static 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 | |||
49 | static const char *da850_boards_compat[] __initdata = { | ||
50 | "enbw,cmc", | ||
51 | "ti,da850-evm", | ||
52 | "ti,da850", | ||
53 | NULL, | ||
54 | }; | ||
55 | |||
56 | DT_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, | ||
64 | MACHINE_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 | ||
523 | static 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 | |||
571 | static struct uio_pruss_pdata da8xx_uio_pruss_pdata = { | ||
572 | .pintc_base = 0x4000, | ||
573 | }; | ||
574 | |||
575 | static 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 | |||
586 | int __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 | |||
521 | static const struct display_panel disp_panel = { | 592 | static 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 | ||
933 | err1: | 1004 | err1: |
934 | clk_disable(da850_sata_clk); | 1005 | clk_disable_unprepare(da850_sata_clk); |
935 | err0: | 1006 | err0: |
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 | ||
940 | static void da850_sata_exit(struct device *dev) | 1011 | static 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/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 | ||
996 | static struct resource dm365_ks_resources[] = { | 990 | static struct resource dm365_ks_resources[] = { |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index cd0c8b1e1ecf..9ab1f105cf00 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -786,12 +786,6 @@ static struct map_desc dm644x_io_desc[] = { | |||
786 | .length = IO_SIZE, | 786 | .length = IO_SIZE, |
787 | .type = MT_DEVICE | 787 | .type = MT_DEVICE |
788 | }, | 788 | }, |
789 | { | ||
790 | .virtual = SRAM_VIRT, | ||
791 | .pfn = __phys_to_pfn(0x00008000), | ||
792 | .length = SZ_16K, | ||
793 | .type = MT_MEMORY_NONCACHED, | ||
794 | }, | ||
795 | }; | 789 | }; |
796 | 790 | ||
797 | /* Contents of JTAG ID register used to identify exact cpu type */ | 791 | /* 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); | |||
104 | static inline int davinci_pm_init(void) { return 0; } | 104 | static 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 | ||
77 | void __init da830_init(void); | 79 | void __init da830_init(void); |
@@ -86,6 +88,7 @@ int da8xx_register_watchdog(void); | |||
86 | int da8xx_register_usb20(unsigned mA, unsigned potpgt); | 88 | int da8xx_register_usb20(unsigned mA, unsigned potpgt); |
87 | int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); | 89 | int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); |
88 | int da8xx_register_emac(void); | 90 | int da8xx_register_emac(void); |
91 | int da8xx_register_uio_pruss(void); | ||
89 | int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); | 92 | int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); |
90 | int da8xx_register_mmcsd0(struct davinci_mmc_config *config); | 93 | int da8xx_register_mmcsd0(struct davinci_mmc_config *config); |
91 | int da850_register_mmcsd1(struct davinci_mmc_config *config); | 94 | int 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..2d9d921e8b01 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -43,6 +43,7 @@ struct davinci_uart_config { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | extern int davinci_serial_init(struct davinci_uart_config *); | 45 | extern int davinci_serial_init(struct davinci_uart_config *); |
46 | extern 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 @@ | |||
24 | extern void *sram_alloc(size_t len, dma_addr_t *dma); | 24 | extern void *sram_alloc(size_t len, dma_addr_t *dma); |
25 | extern void sram_free(void *addr, size_t len); | 25 | extern void sram_free(void *addr, size_t len); |
26 | 26 | ||
27 | /* Get the struct gen_pool * for use in platform data */ | ||
28 | extern 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/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 | ||
73 | int __init davinci_serial_init(struct davinci_uart_config *info) | 73 | /* Enable UART clock and obtain its rate */ |
74 | int __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 | |||
97 | int __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 | ||
18 | static struct gen_pool *sram_pool; | 19 | static struct gen_pool *sram_pool; |
19 | 20 | ||
21 | struct gen_pool *sram_get_gen_pool(void) | ||
22 | { | ||
23 | return sram_pool; | ||
24 | } | ||
25 | |||
20 | void *sram_alloc(size_t len, dma_addr_t *dma) | 26 | void *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 | */ |
54 | static int __init sram_init(void) | 60 | static 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/drivers/uio/Kconfig b/drivers/uio/Kconfig index 6f3ea9bbc818..c48b93813fc1 100644 --- a/drivers/uio/Kconfig +++ b/drivers/uio/Kconfig | |||
@@ -97,6 +97,7 @@ config UIO_NETX | |||
97 | config UIO_PRUSS | 97 | config UIO_PRUSS |
98 | tristate "Texas Instruments PRUSS driver" | 98 | tristate "Texas Instruments PRUSS driver" |
99 | depends on ARCH_DAVINCI_DA850 | 99 | depends on ARCH_DAVINCI_DA850 |
100 | select GENERIC_ALLOCATOR | ||
100 | help | 101 | help |
101 | PRUSS driver for OMAPL138/DA850/AM18XX devices | 102 | PRUSS driver for OMAPL138/DA850/AM18XX devices |
102 | PRUSS driver requires user space components, examples and user space | 103 | PRUSS driver requires user space components, examples and user space |
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index 33a7a273b453..f8738de342be 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <mach/sram.h> | 28 | #include <linux/genalloc.h> |
29 | 29 | ||
30 | #define DRV_NAME "pruss_uio" | 30 | #define DRV_NAME "pruss_uio" |
31 | #define DRV_VERSION "1.0" | 31 | #define DRV_VERSION "1.0" |
@@ -65,10 +65,11 @@ struct uio_pruss_dev { | |||
65 | dma_addr_t sram_paddr; | 65 | dma_addr_t sram_paddr; |
66 | dma_addr_t ddr_paddr; | 66 | dma_addr_t ddr_paddr; |
67 | void __iomem *prussio_vaddr; | 67 | void __iomem *prussio_vaddr; |
68 | void *sram_vaddr; | 68 | unsigned long sram_vaddr; |
69 | void *ddr_vaddr; | 69 | void *ddr_vaddr; |
70 | unsigned int hostirq_start; | 70 | unsigned int hostirq_start; |
71 | unsigned int pintc_base; | 71 | unsigned int pintc_base; |
72 | struct gen_pool *sram_pool; | ||
72 | }; | 73 | }; |
73 | 74 | ||
74 | static irqreturn_t pruss_handler(int irq, struct uio_info *info) | 75 | static irqreturn_t pruss_handler(int irq, struct uio_info *info) |
@@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev, | |||
106 | gdev->ddr_paddr); | 107 | gdev->ddr_paddr); |
107 | } | 108 | } |
108 | if (gdev->sram_vaddr) | 109 | if (gdev->sram_vaddr) |
109 | sram_free(gdev->sram_vaddr, sram_pool_sz); | 110 | gen_pool_free(gdev->sram_pool, |
111 | gdev->sram_vaddr, | ||
112 | sram_pool_sz); | ||
110 | kfree(gdev->info); | 113 | kfree(gdev->info); |
111 | clk_put(gdev->pruss_clk); | 114 | clk_put(gdev->pruss_clk); |
112 | kfree(gdev); | 115 | kfree(gdev); |
@@ -152,10 +155,17 @@ static int __devinit pruss_probe(struct platform_device *dev) | |||
152 | goto out_free; | 155 | goto out_free; |
153 | } | 156 | } |
154 | 157 | ||
155 | gdev->sram_vaddr = sram_alloc(sram_pool_sz, &(gdev->sram_paddr)); | 158 | if (pdata->sram_pool) { |
156 | if (!gdev->sram_vaddr) { | 159 | gdev->sram_pool = pdata->sram_pool; |
157 | dev_err(&dev->dev, "Could not allocate SRAM pool\n"); | 160 | gdev->sram_vaddr = |
158 | goto out_free; | 161 | gen_pool_alloc(gdev->sram_pool, sram_pool_sz); |
162 | if (!gdev->sram_vaddr) { | ||
163 | dev_err(&dev->dev, "Could not allocate SRAM pool\n"); | ||
164 | goto out_free; | ||
165 | } | ||
166 | gdev->sram_paddr = | ||
167 | gen_pool_virt_to_phys(gdev->sram_pool, | ||
168 | gdev->sram_vaddr); | ||
159 | } | 169 | } |
160 | 170 | ||
161 | gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, | 171 | gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, |
diff --git a/include/linux/platform_data/uio_pruss.h b/include/linux/platform_data/uio_pruss.h index f39140aabc6f..3d47d219827f 100644 --- a/include/linux/platform_data/uio_pruss.h +++ b/include/linux/platform_data/uio_pruss.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | /* To configure the PRUSS INTC base offset for UIO driver */ | 21 | /* To configure the PRUSS INTC base offset for UIO driver */ |
22 | struct uio_pruss_pdata { | 22 | struct uio_pruss_pdata { |
23 | u32 pintc_base; | 23 | u32 pintc_base; |
24 | struct gen_pool *sram_pool; | ||
24 | }; | 25 | }; |
25 | #endif /* _UIO_PRUSS_H_ */ | 26 | #endif /* _UIO_PRUSS_H_ */ |