diff options
30 files changed, 523 insertions, 44 deletions
diff --git a/Documentation/devicetree/bindings/mmc/davinci_mmc.txt b/Documentation/devicetree/bindings/mmc/davinci_mmc.txt new file mode 100644 index 000000000000..e5a0140b2381 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/davinci_mmc.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | * TI Highspeed MMC host controller for DaVinci | ||
2 | |||
3 | The Highspeed MMC Host Controller on TI DaVinci family | ||
4 | provides an interface for MMC, SD and SDIO types of memory cards. | ||
5 | |||
6 | This file documents the properties used by the davinci_mmc driver. | ||
7 | |||
8 | Required properties: | ||
9 | - compatible: | ||
10 | Should be "ti,da830-mmc": for da830, da850, dm365 | ||
11 | Should be "ti,dm355-mmc": for dm355, dm644x | ||
12 | |||
13 | Optional properties: | ||
14 | - bus-width: Number of data lines, can be <1>, <4>, or <8>, default <1> | ||
15 | - max-frequency: Maximum operating clock frequency, default 25MHz. | ||
16 | - dmas: List of DMA specifiers with the controller specific format | ||
17 | as described in the generic DMA client binding. A tx and rx | ||
18 | specifier is required. | ||
19 | - dma-names: RX and TX DMA request names. These strings correspond | ||
20 | 1:1 with the DMA specifiers listed in dmas. | ||
21 | |||
22 | Example: | ||
23 | mmc0: mmc@1c40000 { | ||
24 | compatible = "ti,da830-mmc", | ||
25 | reg = <0x40000 0x1000>; | ||
26 | interrupts = <16>; | ||
27 | status = "okay"; | ||
28 | bus-width = <4>; | ||
29 | max-frequency = <50000000>; | ||
30 | dmas = <&edma 16 | ||
31 | &edma 17>; | ||
32 | dma-names = "rx", "tx"; | ||
33 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/spi-davinci.txt b/Documentation/devicetree/bindings/spi/spi-davinci.txt new file mode 100644 index 000000000000..6d0ac8d0ad9b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-davinci.txt | |||
@@ -0,0 +1,51 @@ | |||
1 | Davinci SPI controller device bindings | ||
2 | |||
3 | Required properties: | ||
4 | - #address-cells: number of cells required to define a chip select | ||
5 | address on the SPI bus. Should be set to 1. | ||
6 | - #size-cells: should be zero. | ||
7 | - compatible: | ||
8 | - "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family | ||
9 | - "ti,da830-spi" for SPI used similar to that on DA8xx SoC family | ||
10 | - reg: Offset and length of SPI controller register space | ||
11 | - num-cs: Number of chip selects | ||
12 | - ti,davinci-spi-intr-line: interrupt line used to connect the SPI | ||
13 | IP to the interrupt controller within the SoC. Possible values | ||
14 | are 0 and 1. Manual says one of the two possible interrupt | ||
15 | lines can be tied to the interrupt controller. Set this | ||
16 | based on a specifc SoC configuration. | ||
17 | - interrupts: interrupt number mapped to CPU. | ||
18 | - clocks: spi clk phandle | ||
19 | |||
20 | Example of a NOR flash slave device (n25q032) connected to DaVinci | ||
21 | SPI controller device over the SPI bus. | ||
22 | |||
23 | spi0:spi@20BF0000 { | ||
24 | #address-cells = <1>; | ||
25 | #size-cells = <0>; | ||
26 | compatible = "ti,dm6446-spi"; | ||
27 | reg = <0x20BF0000 0x1000>; | ||
28 | num-cs = <4>; | ||
29 | ti,davinci-spi-intr-line = <0>; | ||
30 | interrupts = <338>; | ||
31 | clocks = <&clkspi>; | ||
32 | |||
33 | flash: n25q032@0 { | ||
34 | #address-cells = <1>; | ||
35 | #size-cells = <1>; | ||
36 | compatible = "st,m25p32"; | ||
37 | spi-max-frequency = <25000000>; | ||
38 | reg = <0>; | ||
39 | |||
40 | partition@0 { | ||
41 | label = "u-boot-spl"; | ||
42 | reg = <0x0 0x80000>; | ||
43 | read-only; | ||
44 | }; | ||
45 | |||
46 | partition@1 { | ||
47 | label = "test"; | ||
48 | reg = <0x80000 0x380000>; | ||
49 | }; | ||
50 | }; | ||
51 | }; | ||
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index f712fb607a42..c914357c0d89 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts | |||
@@ -35,14 +35,124 @@ | |||
35 | clock-frequency = <100000>; | 35 | clock-frequency = <100000>; |
36 | pinctrl-names = "default"; | 36 | pinctrl-names = "default"; |
37 | pinctrl-0 = <&i2c0_pins>; | 37 | pinctrl-0 = <&i2c0_pins>; |
38 | |||
39 | tps: tps@48 { | ||
40 | reg = <0x48>; | ||
41 | }; | ||
38 | }; | 42 | }; |
39 | wdt: wdt@1c21000 { | 43 | wdt: wdt@1c21000 { |
40 | status = "okay"; | 44 | status = "okay"; |
41 | }; | 45 | }; |
46 | mmc0: mmc@1c40000 { | ||
47 | max-frequency = <50000000>; | ||
48 | bus-width = <4>; | ||
49 | status = "okay"; | ||
50 | pinctrl-names = "default"; | ||
51 | pinctrl-0 = <&mmc0_pins>; | ||
52 | }; | ||
53 | spi1: spi@1f0e000 { | ||
54 | status = "okay"; | ||
55 | pinctrl-names = "default"; | ||
56 | pinctrl-0 = <&spi1_pins &spi1_cs0_pin>; | ||
57 | flash: m25p80@0 { | ||
58 | #address-cells = <1>; | ||
59 | #size-cells = <1>; | ||
60 | compatible = "m25p64"; | ||
61 | spi-max-frequency = <30000000>; | ||
62 | reg = <0>; | ||
63 | partition@0 { | ||
64 | label = "U-Boot-SPL"; | ||
65 | reg = <0x00000000 0x00010000>; | ||
66 | read-only; | ||
67 | }; | ||
68 | partition@1 { | ||
69 | label = "U-Boot"; | ||
70 | reg = <0x00010000 0x00080000>; | ||
71 | read-only; | ||
72 | }; | ||
73 | partition@2 { | ||
74 | label = "U-Boot-Env"; | ||
75 | reg = <0x00090000 0x00010000>; | ||
76 | read-only; | ||
77 | }; | ||
78 | partition@3 { | ||
79 | label = "Kernel"; | ||
80 | reg = <0x000a0000 0x00280000>; | ||
81 | }; | ||
82 | partition@4 { | ||
83 | label = "Filesystem"; | ||
84 | reg = <0x00320000 0x00400000>; | ||
85 | }; | ||
86 | partition@5 { | ||
87 | label = "MAC-Address"; | ||
88 | reg = <0x007f0000 0x00010000>; | ||
89 | read-only; | ||
90 | }; | ||
91 | }; | ||
92 | }; | ||
42 | }; | 93 | }; |
43 | nand_cs3@62000000 { | 94 | nand_cs3@62000000 { |
44 | status = "okay"; | 95 | status = "okay"; |
45 | pinctrl-names = "default"; | 96 | pinctrl-names = "default"; |
46 | pinctrl-0 = <&nand_cs3_pins>; | 97 | pinctrl-0 = <&nand_cs3_pins>; |
47 | }; | 98 | }; |
99 | vbat: fixedregulator@0 { | ||
100 | compatible = "regulator-fixed"; | ||
101 | regulator-name = "vbat"; | ||
102 | regulator-min-microvolt = <5000000>; | ||
103 | regulator-max-microvolt = <5000000>; | ||
104 | regulator-boot-on; | ||
105 | }; | ||
106 | }; | ||
107 | |||
108 | /include/ "tps6507x.dtsi" | ||
109 | |||
110 | &tps { | ||
111 | vdcdc1_2-supply = <&vbat>; | ||
112 | vdcdc3-supply = <&vbat>; | ||
113 | vldo1_2-supply = <&vbat>; | ||
114 | |||
115 | regulators { | ||
116 | vdcdc1_reg: regulator@0 { | ||
117 | regulator-name = "VDCDC1_3.3V"; | ||
118 | regulator-min-microvolt = <3150000>; | ||
119 | regulator-max-microvolt = <3450000>; | ||
120 | regulator-always-on; | ||
121 | regulator-boot-on; | ||
122 | }; | ||
123 | |||
124 | vdcdc2_reg: regulator@1 { | ||
125 | regulator-name = "VDCDC2_3.3V"; | ||
126 | regulator-min-microvolt = <1710000>; | ||
127 | regulator-max-microvolt = <3450000>; | ||
128 | regulator-always-on; | ||
129 | regulator-boot-on; | ||
130 | ti,defdcdc_default = <1>; | ||
131 | }; | ||
132 | |||
133 | vdcdc3_reg: regulator@2 { | ||
134 | regulator-name = "VDCDC3_1.2V"; | ||
135 | regulator-min-microvolt = <950000>; | ||
136 | regulator-max-microvolt = <1350000>; | ||
137 | regulator-always-on; | ||
138 | regulator-boot-on; | ||
139 | ti,defdcdc_default = <1>; | ||
140 | }; | ||
141 | |||
142 | ldo1_reg: regulator@3 { | ||
143 | regulator-name = "LDO1_1.8V"; | ||
144 | regulator-min-microvolt = <1710000>; | ||
145 | regulator-max-microvolt = <1890000>; | ||
146 | regulator-always-on; | ||
147 | regulator-boot-on; | ||
148 | }; | ||
149 | |||
150 | ldo2_reg: regulator@4 { | ||
151 | regulator-name = "LDO2_1.2V"; | ||
152 | regulator-min-microvolt = <1140000>; | ||
153 | regulator-max-microvolt = <1320000>; | ||
154 | regulator-always-on; | ||
155 | regulator-boot-on; | ||
156 | }; | ||
157 | }; | ||
48 | }; | 158 | }; |
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 3ec1bda64356..2c88313d2c7a 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi | |||
@@ -62,6 +62,69 @@ | |||
62 | 0x10 0x00002200 0x0000ff00 | 62 | 0x10 0x00002200 0x0000ff00 |
63 | >; | 63 | >; |
64 | }; | 64 | }; |
65 | mmc0_pins: pinmux_mmc_pins { | ||
66 | pinctrl-single,bits = < | ||
67 | /* MMCSD0_DAT[3] MMCSD0_DAT[2] | ||
68 | * MMCSD0_DAT[1] MMCSD0_DAT[0] | ||
69 | * MMCSD0_CMD MMCSD0_CLK | ||
70 | */ | ||
71 | 0x28 0x00222222 0x00ffffff | ||
72 | >; | ||
73 | }; | ||
74 | ehrpwm0a_pins: pinmux_ehrpwm0a_pins { | ||
75 | pinctrl-single,bits = < | ||
76 | /* EPWM0A */ | ||
77 | 0xc 0x00000002 0x0000000f | ||
78 | >; | ||
79 | }; | ||
80 | ehrpwm0b_pins: pinmux_ehrpwm0b_pins { | ||
81 | pinctrl-single,bits = < | ||
82 | /* EPWM0B */ | ||
83 | 0xc 0x00000020 0x000000f0 | ||
84 | >; | ||
85 | }; | ||
86 | ehrpwm1a_pins: pinmux_ehrpwm1a_pins { | ||
87 | pinctrl-single,bits = < | ||
88 | /* EPWM1A */ | ||
89 | 0x14 0x00000002 0x0000000f | ||
90 | >; | ||
91 | }; | ||
92 | ehrpwm1b_pins: pinmux_ehrpwm1b_pins { | ||
93 | pinctrl-single,bits = < | ||
94 | /* EPWM1B */ | ||
95 | 0x14 0x00000020 0x000000f0 | ||
96 | >; | ||
97 | }; | ||
98 | ecap0_pins: pinmux_ecap0_pins { | ||
99 | pinctrl-single,bits = < | ||
100 | /* ECAP0_APWM0 */ | ||
101 | 0x8 0x20000000 0xf0000000 | ||
102 | >; | ||
103 | }; | ||
104 | ecap1_pins: pinmux_ecap1_pins { | ||
105 | pinctrl-single,bits = < | ||
106 | /* ECAP1_APWM1 */ | ||
107 | 0x4 0x40000000 0xf0000000 | ||
108 | >; | ||
109 | }; | ||
110 | ecap2_pins: pinmux_ecap2_pins { | ||
111 | pinctrl-single,bits = < | ||
112 | /* ECAP2_APWM2 */ | ||
113 | 0x4 0x00000004 0x0000000f | ||
114 | >; | ||
115 | }; | ||
116 | spi1_pins: pinmux_spi_pins { | ||
117 | pinctrl-single,bits = < | ||
118 | /* SIMO, SOMI, CLK */ | ||
119 | 0x14 0x00110100 0x00ff0f00 | ||
120 | >; | ||
121 | }; | ||
122 | spi1_cs0_pin: pinmux_spi1_cs0 { | ||
123 | pinctrl-single,bits = < | ||
124 | /* CS0 */ | ||
125 | 0x14 0x00000010 0x000000f0 | ||
126 | >; | ||
127 | }; | ||
65 | }; | 128 | }; |
66 | serial0: serial@1c42000 { | 129 | serial0: serial@1c42000 { |
67 | compatible = "ns16550a"; | 130 | compatible = "ns16550a"; |
@@ -107,6 +170,52 @@ | |||
107 | reg = <0x21000 0x1000>; | 170 | reg = <0x21000 0x1000>; |
108 | status = "disabled"; | 171 | status = "disabled"; |
109 | }; | 172 | }; |
173 | mmc0: mmc@1c40000 { | ||
174 | compatible = "ti,da830-mmc"; | ||
175 | reg = <0x40000 0x1000>; | ||
176 | interrupts = <16>; | ||
177 | status = "disabled"; | ||
178 | }; | ||
179 | ehrpwm0: ehrpwm@01f00000 { | ||
180 | compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm"; | ||
181 | #pwm-cells = <3>; | ||
182 | reg = <0x300000 0x2000>; | ||
183 | status = "disabled"; | ||
184 | }; | ||
185 | ehrpwm1: ehrpwm@01f02000 { | ||
186 | compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm"; | ||
187 | #pwm-cells = <3>; | ||
188 | reg = <0x302000 0x2000>; | ||
189 | status = "disabled"; | ||
190 | }; | ||
191 | ecap0: ecap@01f06000 { | ||
192 | compatible = "ti,da850-ecap", "ti,am33xx-ecap"; | ||
193 | #pwm-cells = <3>; | ||
194 | reg = <0x306000 0x80>; | ||
195 | status = "disabled"; | ||
196 | }; | ||
197 | ecap1: ecap@01f07000 { | ||
198 | compatible = "ti,da850-ecap", "ti,am33xx-ecap"; | ||
199 | #pwm-cells = <3>; | ||
200 | reg = <0x307000 0x80>; | ||
201 | status = "disabled"; | ||
202 | }; | ||
203 | ecap2: ecap@01f08000 { | ||
204 | compatible = "ti,da850-ecap", "ti,am33xx-ecap"; | ||
205 | #pwm-cells = <3>; | ||
206 | reg = <0x308000 0x80>; | ||
207 | status = "disabled"; | ||
208 | }; | ||
209 | spi1: spi@1f0e000 { | ||
210 | #address-cells = <1>; | ||
211 | #size-cells = <0>; | ||
212 | compatible = "ti,da830-spi"; | ||
213 | reg = <0x30e000 0x1000>; | ||
214 | num-cs = <4>; | ||
215 | ti,davinci-spi-intr-line = <1>; | ||
216 | interrupts = <56>; | ||
217 | status = "disabled"; | ||
218 | }; | ||
110 | }; | 219 | }; |
111 | nand_cs3@62000000 { | 220 | nand_cs3@62000000 { |
112 | compatible = "ti,davinci-nand"; | 221 | compatible = "ti,davinci-nand"; |
diff --git a/arch/arm/boot/dts/tps6507x.dtsi b/arch/arm/boot/dts/tps6507x.dtsi new file mode 100644 index 000000000000..4c326e591e5a --- /dev/null +++ b/arch/arm/boot/dts/tps6507x.dtsi | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | /* | ||
10 | * Integrated Power Management Chip | ||
11 | * http://www.ti.com/lit/ds/symlink/tps65070.pdf | ||
12 | */ | ||
13 | |||
14 | &tps { | ||
15 | compatible = "ti,tps6507x"; | ||
16 | |||
17 | regulators { | ||
18 | #address-cells = <1>; | ||
19 | #size-cells = <0>; | ||
20 | |||
21 | vdcdc1_reg: regulator@0 { | ||
22 | reg = <0>; | ||
23 | regulator-compatible = "VDCDC1"; | ||
24 | }; | ||
25 | |||
26 | vdcdc2_reg: regulator@1 { | ||
27 | reg = <1>; | ||
28 | regulator-compatible = "VDCDC2"; | ||
29 | }; | ||
30 | |||
31 | vdcdc3_reg: regulator@2 { | ||
32 | reg = <2>; | ||
33 | regulator-compatible = "VDCDC3"; | ||
34 | }; | ||
35 | |||
36 | ldo1_reg: regulator@3 { | ||
37 | reg = <3>; | ||
38 | regulator-compatible = "LDO1"; | ||
39 | }; | ||
40 | |||
41 | ldo2_reg: regulator@4 { | ||
42 | reg = <4>; | ||
43 | regulator-compatible = "LDO2"; | ||
44 | }; | ||
45 | |||
46 | }; | ||
47 | }; | ||
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 6da25eebf911..12e6f756361d 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -246,7 +246,6 @@ static struct davinci_mmc_config da830_evm_mmc_config = { | |||
246 | .wires = 8, | 246 | .wires = 8, |
247 | .max_freq = 50000000, | 247 | .max_freq = 50000000, |
248 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 248 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
249 | .version = MMC_CTLR_VERSION_2, | ||
250 | }; | 249 | }; |
251 | 250 | ||
252 | static inline void da830_evm_init_mmc(void) | 251 | static inline void da830_evm_init_mmc(void) |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index c2dfe06563df..dcc8710936a5 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -802,7 +802,6 @@ static struct davinci_mmc_config da850_mmc_config = { | |||
802 | .wires = 4, | 802 | .wires = 4, |
803 | .max_freq = 50000000, | 803 | .max_freq = 50000000, |
804 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 804 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
805 | .version = MMC_CTLR_VERSION_2, | ||
806 | }; | 805 | }; |
807 | 806 | ||
808 | static const short da850_evm_mmcsd0_pins[] __initconst = { | 807 | static const short da850_evm_mmcsd0_pins[] __initconst = { |
@@ -1372,7 +1371,6 @@ static struct davinci_mmc_config da850_wl12xx_mmc_config = { | |||
1372 | .max_freq = 25000000, | 1371 | .max_freq = 25000000, |
1373 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE | | 1372 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE | |
1374 | MMC_CAP_POWER_OFF_CARD, | 1373 | MMC_CAP_POWER_OFF_CARD, |
1375 | .version = MMC_CTLR_VERSION_2, | ||
1376 | }; | 1374 | }; |
1377 | 1375 | ||
1378 | static const short da850_wl12xx_pins[] __initconst = { | 1376 | static const short da850_wl12xx_pins[] __initconst = { |
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 147b8e1a4407..bfdf8b979a64 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -280,7 +280,6 @@ static struct davinci_mmc_config dm355evm_mmc_config = { | |||
280 | .wires = 4, | 280 | .wires = 4, |
281 | .max_freq = 50000000, | 281 | .max_freq = 50000000, |
282 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 282 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
283 | .version = MMC_CTLR_VERSION_1, | ||
284 | }; | 283 | }; |
285 | 284 | ||
286 | /* Don't connect anything to J10 unless you're only using USB host | 285 | /* Don't connect anything to J10 unless you're only using USB host |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index c2d4958a0cb6..4cfdd9109e19 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -253,7 +253,6 @@ static struct davinci_mmc_config dm365evm_mmc_config = { | |||
253 | .wires = 4, | 253 | .wires = 4, |
254 | .max_freq = 50000000, | 254 | .max_freq = 50000000, |
255 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 255 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
256 | .version = MMC_CTLR_VERSION_2, | ||
257 | }; | 256 | }; |
258 | 257 | ||
259 | static void dm365evm_emac_configure(void) | 258 | static void dm365evm_emac_configure(void) |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 71735e7797cc..c0206d5f2bf6 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -570,7 +570,6 @@ static struct davinci_mmc_config dm6446evm_mmc_config = { | |||
570 | .get_cd = dm6444evm_mmc_get_cd, | 570 | .get_cd = dm6444evm_mmc_get_cd, |
571 | .get_ro = dm6444evm_mmc_get_ro, | 571 | .get_ro = dm6444evm_mmc_get_ro, |
572 | .wires = 4, | 572 | .wires = 4, |
573 | .version = MMC_CTLR_VERSION_1 | ||
574 | }; | 573 | }; |
575 | 574 | ||
576 | static struct i2c_board_info __initdata i2c_info[] = { | 575 | static struct i2c_board_info __initdata i2c_info[] = { |
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 1c98107527fa..b70e83c03bed 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c | |||
@@ -164,7 +164,6 @@ static void __init davinci_ntosd2_map_io(void) | |||
164 | 164 | ||
165 | static struct davinci_mmc_config davinci_ntosd2_mmc_config = { | 165 | static struct davinci_mmc_config davinci_ntosd2_mmc_config = { |
166 | .wires = 4, | 166 | .wires = 4, |
167 | .version = MMC_CTLR_VERSION_1 | ||
168 | }; | 167 | }; |
169 | 168 | ||
170 | 169 | ||
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index 5a2bd44da54d..328dbd8a37f5 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c | |||
@@ -136,7 +136,6 @@ static struct davinci_mmc_config da850_mmc_config = { | |||
136 | .wires = 4, | 136 | .wires = 4, |
137 | .max_freq = 50000000, | 137 | .max_freq = 50000000, |
138 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 138 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
139 | .version = MMC_CTLR_VERSION_2, | ||
140 | }; | 139 | }; |
141 | 140 | ||
142 | static __init void omapl138_hawk_mmc_init(void) | 141 | static __init void omapl138_hawk_mmc_init(void) |
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c index 4f416023d4e2..ba798370fc96 100644 --- a/arch/arm/mach-davinci/board-tnetv107x-evm.c +++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c | |||
@@ -85,7 +85,6 @@ static struct davinci_mmc_config mmc_config = { | |||
85 | .wires = 4, | 85 | .wires = 4, |
86 | .max_freq = 50000000, | 86 | .max_freq = 50000000, |
87 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 87 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
88 | .version = MMC_CTLR_VERSION_1, | ||
89 | }; | 88 | }; |
90 | 89 | ||
91 | static const short sdio1_pins[] __initconst = { | 90 | static const short sdio1_pins[] __initconst = { |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index d458558ee84a..dc9a470ff9c5 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk) | |||
35 | { | 35 | { |
36 | if (clk->parent) | 36 | if (clk->parent) |
37 | __clk_enable(clk->parent); | 37 | __clk_enable(clk->parent); |
38 | if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) | 38 | if (clk->usecount++ == 0) { |
39 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, | 39 | if (clk->flags & CLK_PSC) |
40 | true, clk->flags); | 40 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, |
41 | true, clk->flags); | ||
42 | else if (clk->clk_enable) | ||
43 | clk->clk_enable(clk); | ||
44 | } | ||
41 | } | 45 | } |
42 | 46 | ||
43 | static void __clk_disable(struct clk *clk) | 47 | static void __clk_disable(struct clk *clk) |
44 | { | 48 | { |
45 | if (WARN_ON(clk->usecount == 0)) | 49 | if (WARN_ON(clk->usecount == 0)) |
46 | return; | 50 | return; |
47 | if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) && | 51 | if (--clk->usecount == 0) { |
48 | (clk->flags & CLK_PSC)) | 52 | if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC)) |
49 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, | 53 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, |
50 | false, clk->flags); | 54 | false, clk->flags); |
55 | else if (clk->clk_disable) | ||
56 | clk->clk_disable(clk); | ||
57 | } | ||
51 | if (clk->parent) | 58 | if (clk->parent) |
52 | __clk_disable(clk->parent); | 59 | __clk_disable(clk->parent); |
53 | } | 60 | } |
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index 8694b395fc92..1e4e836173a1 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h | |||
@@ -104,6 +104,8 @@ struct clk { | |||
104 | int (*set_rate) (struct clk *clk, unsigned long rate); | 104 | int (*set_rate) (struct clk *clk, unsigned long rate); |
105 | int (*round_rate) (struct clk *clk, unsigned long rate); | 105 | int (*round_rate) (struct clk *clk, unsigned long rate); |
106 | int (*reset) (struct clk *clk, bool reset); | 106 | int (*reset) (struct clk *clk, bool reset); |
107 | void (*clk_enable) (struct clk *clk); | ||
108 | void (*clk_disable) (struct clk *clk); | ||
107 | }; | 109 | }; |
108 | 110 | ||
109 | /* Clock flags: SoC-specific flags start at BIT(16) */ | 111 | /* Clock flags: SoC-specific flags start at BIT(16) */ |
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 678a54a64dae..abbaf0270be6 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c | |||
@@ -394,7 +394,7 @@ static struct clk_lookup da830_clks[] = { | |||
394 | CLK(NULL, "tpcc", &tpcc_clk), | 394 | CLK(NULL, "tpcc", &tpcc_clk), |
395 | CLK(NULL, "tptc0", &tptc0_clk), | 395 | CLK(NULL, "tptc0", &tptc0_clk), |
396 | CLK(NULL, "tptc1", &tptc1_clk), | 396 | CLK(NULL, "tptc1", &tptc1_clk), |
397 | CLK("davinci_mmc.0", NULL, &mmcsd_clk), | 397 | CLK("da830-mmc.0", NULL, &mmcsd_clk), |
398 | CLK(NULL, "uart0", &uart0_clk), | 398 | CLK(NULL, "uart0", &uart0_clk), |
399 | CLK(NULL, "uart1", &uart1_clk), | 399 | CLK(NULL, "uart1", &uart1_clk), |
400 | CLK(NULL, "uart2", &uart2_clk), | 400 | CLK(NULL, "uart2", &uart2_clk), |
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 0c4a26ddebba..4d6933848abf 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
@@ -383,6 +383,49 @@ static struct clk dsp_clk = { | |||
383 | .flags = PSC_LRST | PSC_FORCE, | 383 | .flags = PSC_LRST | PSC_FORCE, |
384 | }; | 384 | }; |
385 | 385 | ||
386 | static struct clk ehrpwm_clk = { | ||
387 | .name = "ehrpwm", | ||
388 | .parent = &pll0_sysclk2, | ||
389 | .lpsc = DA8XX_LPSC1_PWM, | ||
390 | .gpsc = 1, | ||
391 | .flags = DA850_CLK_ASYNC3, | ||
392 | }; | ||
393 | |||
394 | #define DA8XX_EHRPWM_TBCLKSYNC BIT(12) | ||
395 | |||
396 | static void ehrpwm_tblck_enable(struct clk *clk) | ||
397 | { | ||
398 | u32 val; | ||
399 | |||
400 | val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG)); | ||
401 | val |= DA8XX_EHRPWM_TBCLKSYNC; | ||
402 | writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG)); | ||
403 | } | ||
404 | |||
405 | static void ehrpwm_tblck_disable(struct clk *clk) | ||
406 | { | ||
407 | u32 val; | ||
408 | |||
409 | val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG)); | ||
410 | val &= ~DA8XX_EHRPWM_TBCLKSYNC; | ||
411 | writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG)); | ||
412 | } | ||
413 | |||
414 | static struct clk ehrpwm_tbclk = { | ||
415 | .name = "ehrpwm_tbclk", | ||
416 | .parent = &ehrpwm_clk, | ||
417 | .clk_enable = ehrpwm_tblck_enable, | ||
418 | .clk_disable = ehrpwm_tblck_disable, | ||
419 | }; | ||
420 | |||
421 | static struct clk ecap_clk = { | ||
422 | .name = "ecap", | ||
423 | .parent = &pll0_sysclk2, | ||
424 | .lpsc = DA8XX_LPSC1_ECAP, | ||
425 | .gpsc = 1, | ||
426 | .flags = DA850_CLK_ASYNC3, | ||
427 | }; | ||
428 | |||
386 | static struct clk_lookup da850_clks[] = { | 429 | static struct clk_lookup da850_clks[] = { |
387 | CLK(NULL, "ref", &ref_clk), | 430 | CLK(NULL, "ref", &ref_clk), |
388 | CLK(NULL, "pll0", &pll0_clk), | 431 | CLK(NULL, "pll0", &pll0_clk), |
@@ -420,8 +463,8 @@ static struct clk_lookup da850_clks[] = { | |||
420 | CLK("davinci_emac.1", NULL, &emac_clk), | 463 | CLK("davinci_emac.1", NULL, &emac_clk), |
421 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), | 464 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), |
422 | CLK("da8xx_lcdc.0", "fck", &lcdc_clk), | 465 | CLK("da8xx_lcdc.0", "fck", &lcdc_clk), |
423 | CLK("davinci_mmc.0", NULL, &mmcsd0_clk), | 466 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), |
424 | CLK("davinci_mmc.1", NULL, &mmcsd1_clk), | 467 | CLK("da830-mmc.1", NULL, &mmcsd1_clk), |
425 | CLK(NULL, "aemif", &aemif_clk), | 468 | CLK(NULL, "aemif", &aemif_clk), |
426 | CLK(NULL, "usb11", &usb11_clk), | 469 | CLK(NULL, "usb11", &usb11_clk), |
427 | CLK(NULL, "usb20", &usb20_clk), | 470 | CLK(NULL, "usb20", &usb20_clk), |
@@ -430,6 +473,9 @@ static struct clk_lookup da850_clks[] = { | |||
430 | CLK("vpif", NULL, &vpif_clk), | 473 | CLK("vpif", NULL, &vpif_clk), |
431 | CLK("ahci", NULL, &sata_clk), | 474 | CLK("ahci", NULL, &sata_clk), |
432 | CLK("davinci-rproc.0", NULL, &dsp_clk), | 475 | CLK("davinci-rproc.0", NULL, &dsp_clk), |
476 | CLK("ehrpwm", "fck", &ehrpwm_clk), | ||
477 | CLK("ehrpwm", "tbclk", &ehrpwm_tbclk), | ||
478 | CLK("ecap", "fck", &ecap_clk), | ||
433 | CLK(NULL, NULL, NULL), | 479 | CLK(NULL, NULL, NULL), |
434 | }; | 480 | }; |
435 | 481 | ||
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 6b7a0a27fbd1..fb8d8607f445 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c | |||
@@ -40,6 +40,13 @@ static void __init da8xx_init_irq(void) | |||
40 | struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { | 40 | struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { |
41 | OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), | 41 | OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), |
42 | OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), | 42 | OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), |
43 | OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL), | ||
44 | OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL), | ||
45 | OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL), | ||
46 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL), | ||
47 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), | ||
48 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), | ||
49 | OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL), | ||
43 | {} | 50 | {} |
44 | }; | 51 | }; |
45 | 52 | ||
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index fc50243b1481..cb97e07db284 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -664,7 +664,7 @@ static struct resource da8xx_mmcsd0_resources[] = { | |||
664 | }; | 664 | }; |
665 | 665 | ||
666 | static struct platform_device da8xx_mmcsd0_device = { | 666 | static struct platform_device da8xx_mmcsd0_device = { |
667 | .name = "davinci_mmc", | 667 | .name = "da830-mmc", |
668 | .id = 0, | 668 | .id = 0, |
669 | .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources), | 669 | .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources), |
670 | .resource = da8xx_mmcsd0_resources, | 670 | .resource = da8xx_mmcsd0_resources, |
@@ -701,7 +701,7 @@ static struct resource da850_mmcsd1_resources[] = { | |||
701 | }; | 701 | }; |
702 | 702 | ||
703 | static struct platform_device da850_mmcsd1_device = { | 703 | static struct platform_device da850_mmcsd1_device = { |
704 | .name = "davinci_mmc", | 704 | .name = "da830-mmc", |
705 | .id = 1, | 705 | .id = 1, |
706 | .num_resources = ARRAY_SIZE(da850_mmcsd1_resources), | 706 | .num_resources = ARRAY_SIZE(da850_mmcsd1_resources), |
707 | .resource = da850_mmcsd1_resources, | 707 | .resource = da850_mmcsd1_resources, |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 773ab07a71a0..cfb194df18ed 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c | |||
@@ -218,7 +218,7 @@ static u64 mmc1_dma_mask = DMA_BIT_MASK(32); | |||
218 | 218 | ||
219 | static struct platform_device mmc_devices[2] = { | 219 | static struct platform_device mmc_devices[2] = { |
220 | { | 220 | { |
221 | .name = "davinci_mmc", | 221 | .name = "dm6441-mmc", |
222 | .id = 0, | 222 | .id = 0, |
223 | .dev = { | 223 | .dev = { |
224 | .dma_mask = &mmc0_dma_mask, | 224 | .dma_mask = &mmc0_dma_mask, |
@@ -228,7 +228,7 @@ static struct platform_device mmc_devices[2] = { | |||
228 | .resource = mmc0_resources | 228 | .resource = mmc0_resources |
229 | }, | 229 | }, |
230 | { | 230 | { |
231 | .name = "davinci_mmc", | 231 | .name = "dm6441-mmc", |
232 | .id = 1, | 232 | .id = 1, |
233 | .dev = { | 233 | .dev = { |
234 | .dma_mask = &mmc1_dma_mask, | 234 | .dma_mask = &mmc1_dma_mask, |
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 4c48a36ee567..f6927df2dda8 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c | |||
@@ -150,7 +150,7 @@ static struct resource mmcsd0_resources[] = { | |||
150 | }; | 150 | }; |
151 | 151 | ||
152 | static struct platform_device davinci_mmcsd0_device = { | 152 | static struct platform_device davinci_mmcsd0_device = { |
153 | .name = "davinci_mmc", | 153 | .name = "dm6441-mmc", |
154 | .id = 0, | 154 | .id = 0, |
155 | .dev = { | 155 | .dev = { |
156 | .dma_mask = &mmcsd0_dma_mask, | 156 | .dma_mask = &mmcsd0_dma_mask, |
@@ -187,7 +187,7 @@ static struct resource mmcsd1_resources[] = { | |||
187 | }; | 187 | }; |
188 | 188 | ||
189 | static struct platform_device davinci_mmcsd1_device = { | 189 | static struct platform_device davinci_mmcsd1_device = { |
190 | .name = "davinci_mmc", | 190 | .name = "dm6441-mmc", |
191 | .id = 1, | 191 | .id = 1, |
192 | .dev = { | 192 | .dev = { |
193 | .dma_mask = &mmcsd1_dma_mask, | 193 | .dma_mask = &mmcsd1_dma_mask, |
@@ -235,6 +235,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config) | |||
235 | mmcsd1_resources[0].end = DM365_MMCSD1_BASE + | 235 | mmcsd1_resources[0].end = DM365_MMCSD1_BASE + |
236 | SZ_4K - 1; | 236 | SZ_4K - 1; |
237 | mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1; | 237 | mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1; |
238 | davinci_mmcsd1_device.name = "da830-mmc"; | ||
238 | } else | 239 | } else |
239 | break; | 240 | break; |
240 | 241 | ||
@@ -256,6 +257,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config) | |||
256 | mmcsd0_resources[0].end = DM365_MMCSD0_BASE + | 257 | mmcsd0_resources[0].end = DM365_MMCSD0_BASE + |
257 | SZ_4K - 1; | 258 | SZ_4K - 1; |
258 | mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; | 259 | mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; |
260 | davinci_mmcsd0_device.name = "da830-mmc"; | ||
259 | } else if (cpu_is_davinci_dm644x()) { | 261 | } else if (cpu_is_davinci_dm644x()) { |
260 | /* REVISIT: should this be in board-init code? */ | 262 | /* REVISIT: should this be in board-init code? */ |
261 | /* Power-on 3.3V IO cells */ | 263 | /* Power-on 3.3V IO cells */ |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index b49c3b77d55e..87e6104f45e6 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -361,8 +361,8 @@ static struct clk_lookup dm355_clks[] = { | |||
361 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 361 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
362 | CLK("davinci-mcbsp.0", NULL, &asp0_clk), | 362 | CLK("davinci-mcbsp.0", NULL, &asp0_clk), |
363 | CLK("davinci-mcbsp.1", NULL, &asp1_clk), | 363 | CLK("davinci-mcbsp.1", NULL, &asp1_clk), |
364 | CLK("davinci_mmc.0", NULL, &mmcsd0_clk), | 364 | CLK("dm6441-mmc.0", NULL, &mmcsd0_clk), |
365 | CLK("davinci_mmc.1", NULL, &mmcsd1_clk), | 365 | CLK("dm6441-mmc.1", NULL, &mmcsd1_clk), |
366 | CLK("spi_davinci.0", NULL, &spi0_clk), | 366 | CLK("spi_davinci.0", NULL, &spi0_clk), |
367 | CLK("spi_davinci.1", NULL, &spi1_clk), | 367 | CLK("spi_davinci.1", NULL, &spi1_clk), |
368 | CLK("spi_davinci.2", NULL, &spi2_clk), | 368 | CLK("spi_davinci.2", NULL, &spi2_clk), |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 6c3980540be0..2791df9187b3 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -454,8 +454,8 @@ static struct clk_lookup dm365_clks[] = { | |||
454 | CLK(NULL, "uart0", &uart0_clk), | 454 | CLK(NULL, "uart0", &uart0_clk), |
455 | CLK(NULL, "uart1", &uart1_clk), | 455 | CLK(NULL, "uart1", &uart1_clk), |
456 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 456 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
457 | CLK("davinci_mmc.0", NULL, &mmcsd0_clk), | 457 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), |
458 | CLK("davinci_mmc.1", NULL, &mmcsd1_clk), | 458 | CLK("da830-mmc.1", NULL, &mmcsd1_clk), |
459 | CLK("spi_davinci.0", NULL, &spi0_clk), | 459 | CLK("spi_davinci.0", NULL, &spi0_clk), |
460 | CLK("spi_davinci.1", NULL, &spi1_clk), | 460 | CLK("spi_davinci.1", NULL, &spi1_clk), |
461 | CLK("spi_davinci.2", NULL, &spi2_clk), | 461 | CLK("spi_davinci.2", NULL, &spi2_clk), |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index db1dd92e00af..ab6bf54c65c7 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -310,7 +310,7 @@ static struct clk_lookup dm644x_clks[] = { | |||
310 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 310 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
311 | CLK("palm_bk3710", NULL, &ide_clk), | 311 | CLK("palm_bk3710", NULL, &ide_clk), |
312 | CLK("davinci-mcbsp", NULL, &asp_clk), | 312 | CLK("davinci-mcbsp", NULL, &asp_clk), |
313 | CLK("davinci_mmc.0", NULL, &mmcsd_clk), | 313 | CLK("dm6441-mmc.0", NULL, &mmcsd_clk), |
314 | CLK(NULL, "spi", &spi_clk), | 314 | CLK(NULL, "spi", &spi_clk), |
315 | CLK(NULL, "gpio", &gpio_clk), | 315 | CLK(NULL, "gpio", &gpio_clk), |
316 | CLK(NULL, "usb", &usb_clk), | 316 | CLK(NULL, "usb", &usb_clk), |
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index de439b7b9af1..be77ce269cb0 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h | |||
@@ -55,6 +55,7 @@ extern unsigned int da850_max_speed; | |||
55 | #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) | 55 | #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) |
56 | #define DA8XX_JTAG_ID_REG 0x18 | 56 | #define DA8XX_JTAG_ID_REG 0x18 |
57 | #define DA8XX_CFGCHIP0_REG 0x17c | 57 | #define DA8XX_CFGCHIP0_REG 0x17c |
58 | #define DA8XX_CFGCHIP1_REG 0x180 | ||
58 | #define DA8XX_CFGCHIP2_REG 0x184 | 59 | #define DA8XX_CFGCHIP2_REG 0x184 |
59 | #define DA8XX_CFGCHIP3_REG 0x188 | 60 | #define DA8XX_CFGCHIP3_REG 0x188 |
60 | 61 | ||
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index 34290d14754b..b18b8ebc6508 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -24,8 +24,6 @@ | |||
24 | 24 | ||
25 | #if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0) | 25 | #if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0) |
26 | #define UART_BASE DAVINCI_UART0_BASE | 26 | #define UART_BASE DAVINCI_UART0_BASE |
27 | #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART0) | ||
28 | #define UART_BASE DA8XX_UART0_BASE | ||
29 | #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1) | 27 | #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1) |
30 | #define UART_BASE DA8XX_UART1_BASE | 28 | #define UART_BASE DA8XX_UART1_BASE |
31 | #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2) | 29 | #elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2) |
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c index dc1a209b9b66..3b2a70d43efa 100644 --- a/arch/arm/mach-davinci/tnetv107x.c +++ b/arch/arm/mach-davinci/tnetv107x.c | |||
@@ -272,7 +272,7 @@ static struct clk_lookup clks[] = { | |||
272 | CLK("tnetv107x-keypad.0", NULL, &clk_keypad), | 272 | CLK("tnetv107x-keypad.0", NULL, &clk_keypad), |
273 | CLK(NULL, "clk_gpio", &clk_gpio), | 273 | CLK(NULL, "clk_gpio", &clk_gpio), |
274 | CLK(NULL, "clk_mdio", &clk_mdio), | 274 | CLK(NULL, "clk_mdio", &clk_mdio), |
275 | CLK("davinci_mmc.0", NULL, &clk_sdio0), | 275 | CLK("dm6441-mmc.0", NULL, &clk_sdio0), |
276 | CLK(NULL, "uart0", &clk_uart0), | 276 | CLK(NULL, "uart0", &clk_uart0), |
277 | CLK(NULL, "uart1", &clk_uart1), | 277 | CLK(NULL, "uart1", &clk_uart1), |
278 | CLK(NULL, "timer0", &clk_timer0), | 278 | CLK(NULL, "timer0", &clk_timer0), |
@@ -292,7 +292,7 @@ static struct clk_lookup clks[] = { | |||
292 | CLK(NULL, "clk_system", &clk_system), | 292 | CLK(NULL, "clk_system", &clk_system), |
293 | CLK(NULL, "clk_imcop", &clk_imcop), | 293 | CLK(NULL, "clk_imcop", &clk_imcop), |
294 | CLK(NULL, "clk_spare", &clk_spare), | 294 | CLK(NULL, "clk_spare", &clk_spare), |
295 | CLK("davinci_mmc.1", NULL, &clk_sdio1), | 295 | CLK("dm6441-mmc.1", NULL, &clk_sdio1), |
296 | CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), | 296 | CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), |
297 | CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), | 297 | CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), |
298 | CLK(NULL, NULL, NULL), | 298 | CLK(NULL, NULL, NULL), |
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 20636772c09b..f8a96d652e9e 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | #include <linux/edma.h> | 35 | #include <linux/edma.h> |
36 | #include <linux/mmc/mmc.h> | 36 | #include <linux/mmc/mmc.h> |
37 | #include <linux/of.h> | ||
38 | #include <linux/of_device.h> | ||
37 | 39 | ||
38 | #include <linux/platform_data/mmc-davinci.h> | 40 | #include <linux/platform_data/mmc-davinci.h> |
39 | 41 | ||
@@ -522,14 +524,16 @@ static int __init davinci_acquire_dma_channels(struct mmc_davinci_host *host) | |||
522 | dma_cap_set(DMA_SLAVE, mask); | 524 | dma_cap_set(DMA_SLAVE, mask); |
523 | 525 | ||
524 | host->dma_tx = | 526 | host->dma_tx = |
525 | dma_request_channel(mask, edma_filter_fn, &host->txdma); | 527 | dma_request_slave_channel_compat(mask, edma_filter_fn, |
528 | &host->txdma, mmc_dev(host->mmc), "tx"); | ||
526 | if (!host->dma_tx) { | 529 | if (!host->dma_tx) { |
527 | dev_err(mmc_dev(host->mmc), "Can't get dma_tx channel\n"); | 530 | dev_err(mmc_dev(host->mmc), "Can't get dma_tx channel\n"); |
528 | return -ENODEV; | 531 | return -ENODEV; |
529 | } | 532 | } |
530 | 533 | ||
531 | host->dma_rx = | 534 | host->dma_rx = |
532 | dma_request_channel(mask, edma_filter_fn, &host->rxdma); | 535 | dma_request_slave_channel_compat(mask, edma_filter_fn, |
536 | &host->rxdma, mmc_dev(host->mmc), "rx"); | ||
533 | if (!host->dma_rx) { | 537 | if (!host->dma_rx) { |
534 | dev_err(mmc_dev(host->mmc), "Can't get dma_rx channel\n"); | 538 | dev_err(mmc_dev(host->mmc), "Can't get dma_rx channel\n"); |
535 | r = -ENODEV; | 539 | r = -ENODEV; |
@@ -1157,16 +1161,86 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host) | |||
1157 | mmc_davinci_reset_ctrl(host, 0); | 1161 | mmc_davinci_reset_ctrl(host, 0); |
1158 | } | 1162 | } |
1159 | 1163 | ||
1160 | static int __init davinci_mmcsd_probe(struct platform_device *pdev) | 1164 | static struct platform_device_id davinci_mmc_devtype[] = { |
1165 | { | ||
1166 | .name = "dm6441-mmc", | ||
1167 | .driver_data = MMC_CTLR_VERSION_1, | ||
1168 | }, { | ||
1169 | .name = "da830-mmc", | ||
1170 | .driver_data = MMC_CTLR_VERSION_2, | ||
1171 | }, | ||
1172 | {}, | ||
1173 | }; | ||
1174 | MODULE_DEVICE_TABLE(platform, davinci_mmc_devtype); | ||
1175 | |||
1176 | static const struct of_device_id davinci_mmc_dt_ids[] = { | ||
1177 | { | ||
1178 | .compatible = "ti,dm6441-mmc", | ||
1179 | .data = &davinci_mmc_devtype[MMC_CTLR_VERSION_1], | ||
1180 | }, | ||
1181 | { | ||
1182 | .compatible = "ti,da830-mmc", | ||
1183 | .data = &davinci_mmc_devtype[MMC_CTLR_VERSION_2], | ||
1184 | }, | ||
1185 | {}, | ||
1186 | }; | ||
1187 | MODULE_DEVICE_TABLE(of, davinci_mmc_dt_ids); | ||
1188 | |||
1189 | static struct davinci_mmc_config | ||
1190 | *mmc_parse_pdata(struct platform_device *pdev) | ||
1161 | { | 1191 | { |
1192 | struct device_node *np; | ||
1162 | struct davinci_mmc_config *pdata = pdev->dev.platform_data; | 1193 | struct davinci_mmc_config *pdata = pdev->dev.platform_data; |
1194 | const struct of_device_id *match = | ||
1195 | of_match_device(of_match_ptr(davinci_mmc_dt_ids), &pdev->dev); | ||
1196 | u32 data; | ||
1197 | |||
1198 | np = pdev->dev.of_node; | ||
1199 | if (!np) | ||
1200 | return pdata; | ||
1201 | |||
1202 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | ||
1203 | if (!pdata) { | ||
1204 | dev_err(&pdev->dev, "Failed to allocate memory for struct davinci_mmc_config\n"); | ||
1205 | goto nodata; | ||
1206 | } | ||
1207 | |||
1208 | if (match) | ||
1209 | pdev->id_entry = match->data; | ||
1210 | |||
1211 | if (of_property_read_u32(np, "max-frequency", &pdata->max_freq)) | ||
1212 | dev_info(&pdev->dev, "'max-frequency' property not specified, defaulting to 25MHz\n"); | ||
1213 | |||
1214 | of_property_read_u32(np, "bus-width", &data); | ||
1215 | switch (data) { | ||
1216 | case 1: | ||
1217 | case 4: | ||
1218 | case 8: | ||
1219 | pdata->wires = data; | ||
1220 | break; | ||
1221 | default: | ||
1222 | pdata->wires = 1; | ||
1223 | dev_info(&pdev->dev, "Unsupported buswidth, defaulting to 1 bit\n"); | ||
1224 | } | ||
1225 | nodata: | ||
1226 | return pdata; | ||
1227 | } | ||
1228 | |||
1229 | static int __init davinci_mmcsd_probe(struct platform_device *pdev) | ||
1230 | { | ||
1231 | struct davinci_mmc_config *pdata = NULL; | ||
1163 | struct mmc_davinci_host *host = NULL; | 1232 | struct mmc_davinci_host *host = NULL; |
1164 | struct mmc_host *mmc = NULL; | 1233 | struct mmc_host *mmc = NULL; |
1165 | struct resource *r, *mem = NULL; | 1234 | struct resource *r, *mem = NULL; |
1166 | int ret = 0, irq = 0; | 1235 | int ret = 0, irq = 0; |
1167 | size_t mem_size; | 1236 | size_t mem_size; |
1237 | const struct platform_device_id *id_entry; | ||
1168 | 1238 | ||
1169 | /* REVISIT: when we're fully converted, fail if pdata is NULL */ | 1239 | pdata = mmc_parse_pdata(pdev); |
1240 | if (pdata == NULL) { | ||
1241 | dev_err(&pdev->dev, "Couldn't get platform data\n"); | ||
1242 | return -ENOENT; | ||
1243 | } | ||
1170 | 1244 | ||
1171 | ret = -ENODEV; | 1245 | ret = -ENODEV; |
1172 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1246 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -1237,7 +1311,9 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev) | |||
1237 | if (pdata && (pdata->wires == 8)) | 1311 | if (pdata && (pdata->wires == 8)) |
1238 | mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); | 1312 | mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); |
1239 | 1313 | ||
1240 | host->version = pdata->version; | 1314 | id_entry = platform_get_device_id(pdev); |
1315 | if (id_entry) | ||
1316 | host->version = id_entry->driver_data; | ||
1241 | 1317 | ||
1242 | mmc->ops = &mmc_davinci_ops; | 1318 | mmc->ops = &mmc_davinci_ops; |
1243 | mmc->f_min = 312500; | 1319 | mmc->f_min = 312500; |
@@ -1406,8 +1482,10 @@ static struct platform_driver davinci_mmcsd_driver = { | |||
1406 | .name = "davinci_mmc", | 1482 | .name = "davinci_mmc", |
1407 | .owner = THIS_MODULE, | 1483 | .owner = THIS_MODULE, |
1408 | .pm = davinci_mmcsd_pm_ops, | 1484 | .pm = davinci_mmcsd_pm_ops, |
1485 | .of_match_table = of_match_ptr(davinci_mmc_dt_ids), | ||
1409 | }, | 1486 | }, |
1410 | .remove = __exit_p(davinci_mmcsd_remove), | 1487 | .remove = __exit_p(davinci_mmcsd_remove), |
1488 | .id_table = davinci_mmc_devtype, | ||
1411 | }; | 1489 | }; |
1412 | 1490 | ||
1413 | static int __init davinci_mmcsd_init(void) | 1491 | static int __init davinci_mmcsd_init(void) |
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 8234d2259722..2e8f24a1fb95 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c | |||
@@ -776,10 +776,10 @@ rx_dma_failed: | |||
776 | #if defined(CONFIG_OF) | 776 | #if defined(CONFIG_OF) |
777 | static const struct of_device_id davinci_spi_of_match[] = { | 777 | static const struct of_device_id davinci_spi_of_match[] = { |
778 | { | 778 | { |
779 | .compatible = "ti,dm644x-spi", | 779 | .compatible = "ti,dm6441-spi", |
780 | }, | 780 | }, |
781 | { | 781 | { |
782 | .compatible = "ti,da8xx-spi", | 782 | .compatible = "ti,da830-spi", |
783 | .data = (void *)SPI_VERSION_2, | 783 | .data = (void *)SPI_VERSION_2, |
784 | }, | 784 | }, |
785 | { }, | 785 | { }, |
diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h index 5ba6b22ce338..9cea4ee377b5 100644 --- a/include/linux/platform_data/mmc-davinci.h +++ b/include/linux/platform_data/mmc-davinci.h | |||
@@ -23,9 +23,6 @@ struct davinci_mmc_config { | |||
23 | /* any additional host capabilities: OR'd in to mmc->f_caps */ | 23 | /* any additional host capabilities: OR'd in to mmc->f_caps */ |
24 | u32 caps; | 24 | u32 caps; |
25 | 25 | ||
26 | /* Version of the MMC/SD controller */ | ||
27 | u8 version; | ||
28 | |||
29 | /* Number of sg segments */ | 26 | /* Number of sg segments */ |
30 | u8 nr_sg; | 27 | u8 nr_sg; |
31 | }; | 28 | }; |