diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 18:21:28 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 18:21:28 -0500 |
commit | 31b2a868451d630bacfdeddc626371b3f9d9a01c (patch) | |
tree | b8823382f687c34dd8c180abcfb85eed34d701e6 /arch | |
parent | 9cad9a5ff61abeddc2acb22aace9245f39b98f72 (diff) | |
parent | 4eb821999086417ab42a15174b51497122fc406e (diff) |
Merge branch 'samsung/dt' into next/dt
* samsung/dt: (27 commits)
ARM: dts: Add intial dts file for EXYNOS4210 SoC, SMDKV310 and ORIGEN
ARM: EXYNOS: Add Exynos4 device tree enabled board file
rtc: rtc-s3c: Add device tree support
input: samsung-keypad: Add device tree support
ARM: S5PV210: Modify platform data for pl330 driver
ARM: S5PC100: Modify platform data for pl330 driver
ARM: S5P64x0: Modify platform data for pl330 driver
ARM: EXYNOS: Add a alias for pdma clocks
ARM: EXYNOS: Limit usage of pl330 device instance to non-dt build
ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers
DMA: PL330: Add device tree support
ARM: EXYNOS: Modify platform data for pl330 driver
DMA: PL330: Infer transfer direction from transfer request instead of platform data
DMA: PL330: move filter function into driver
serial: samsung: Fix build for non-Exynos4210 devices
serial: samsung: add device tree support
serial: samsung: merge probe() function from all SoC specific extensions
serial: samsung: merge all SoC specific port reset functions
ARM: SAMSUNG: register uart clocks to clock lookup list
serial: samsung: remove all uses of get_clksrc and set_clksrc
...
Diffstat (limited to 'arch')
41 files changed, 1505 insertions, 1052 deletions
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts new file mode 100644 index 000000000000..b8c476384eef --- /dev/null +++ b/arch/arm/boot/dts/exynos4210-origen.dts | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | * Samsung's Exynos4210 based Origen board device tree source | ||
3 | * | ||
4 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
5 | * http://www.samsung.com | ||
6 | * Copyright (c) 2010-2011 Linaro Ltd. | ||
7 | * www.linaro.org | ||
8 | * | ||
9 | * Device tree source file for Insignal's Origen board which is based on | ||
10 | * Samsung's Exynos4210 SoC. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | /dts-v1/; | ||
18 | /include/ "exynos4210.dtsi" | ||
19 | |||
20 | / { | ||
21 | model = "Insignal Origen evaluation board based on Exynos4210"; | ||
22 | compatible = "insignal,origen", "samsung,exynos4210"; | ||
23 | |||
24 | memory { | ||
25 | reg = <0x40000000 0x40000000>; | ||
26 | }; | ||
27 | |||
28 | chosen { | ||
29 | bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; | ||
30 | }; | ||
31 | |||
32 | sdhci@12530000 { | ||
33 | samsung,sdhci-bus-width = <4>; | ||
34 | linux,mmc_cap_4_bit_data; | ||
35 | samsung,sdhci-cd-internal; | ||
36 | gpio-cd = <&gpk2 2 2 3 3>; | ||
37 | gpios = <&gpk2 0 2 0 3>, | ||
38 | <&gpk2 1 2 0 3>, | ||
39 | <&gpk2 3 2 3 3>, | ||
40 | <&gpk2 4 2 3 3>, | ||
41 | <&gpk2 5 2 3 3>, | ||
42 | <&gpk2 6 2 3 3>; | ||
43 | }; | ||
44 | |||
45 | sdhci@12510000 { | ||
46 | samsung,sdhci-bus-width = <4>; | ||
47 | linux,mmc_cap_4_bit_data; | ||
48 | samsung,sdhci-cd-internal; | ||
49 | gpio-cd = <&gpk0 2 2 3 3>; | ||
50 | gpios = <&gpk0 0 2 0 3>, | ||
51 | <&gpk0 1 2 0 3>, | ||
52 | <&gpk0 3 2 3 3>, | ||
53 | <&gpk0 4 2 3 3>, | ||
54 | <&gpk0 5 2 3 3>, | ||
55 | <&gpk0 6 2 3 3>; | ||
56 | }; | ||
57 | |||
58 | gpio_keys { | ||
59 | compatible = "gpio-keys"; | ||
60 | #address-cells = <1>; | ||
61 | #size-cells = <0>; | ||
62 | |||
63 | up { | ||
64 | label = "Up"; | ||
65 | gpios = <&gpx2 0 0 0 2>; | ||
66 | linux,code = <103>; | ||
67 | }; | ||
68 | |||
69 | down { | ||
70 | label = "Down"; | ||
71 | gpios = <&gpx2 1 0 0 2>; | ||
72 | linux,code = <108>; | ||
73 | }; | ||
74 | |||
75 | back { | ||
76 | label = "Back"; | ||
77 | gpios = <&gpx1 7 0 0 2>; | ||
78 | linux,code = <158>; | ||
79 | }; | ||
80 | |||
81 | home { | ||
82 | label = "Home"; | ||
83 | gpios = <&gpx1 6 0 0 2>; | ||
84 | linux,code = <102>; | ||
85 | }; | ||
86 | |||
87 | menu { | ||
88 | label = "Menu"; | ||
89 | gpios = <&gpx1 5 0 0 2>; | ||
90 | linux,code = <139>; | ||
91 | }; | ||
92 | }; | ||
93 | |||
94 | keypad@100A0000 { | ||
95 | status = "disabled"; | ||
96 | }; | ||
97 | |||
98 | sdhci@12520000 { | ||
99 | status = "disabled"; | ||
100 | }; | ||
101 | |||
102 | sdhci@12540000 { | ||
103 | status = "disabled"; | ||
104 | }; | ||
105 | |||
106 | i2c@13860000 { | ||
107 | status = "disabled"; | ||
108 | }; | ||
109 | |||
110 | i2c@13870000 { | ||
111 | status = "disabled"; | ||
112 | }; | ||
113 | |||
114 | i2c@13880000 { | ||
115 | status = "disabled"; | ||
116 | }; | ||
117 | |||
118 | i2c@13890000 { | ||
119 | status = "disabled"; | ||
120 | }; | ||
121 | |||
122 | i2c@138A0000 { | ||
123 | status = "disabled"; | ||
124 | }; | ||
125 | |||
126 | i2c@138B0000 { | ||
127 | status = "disabled"; | ||
128 | }; | ||
129 | |||
130 | i2c@138C0000 { | ||
131 | status = "disabled"; | ||
132 | }; | ||
133 | |||
134 | i2c@138D0000 { | ||
135 | status = "disabled"; | ||
136 | }; | ||
137 | }; | ||
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts new file mode 100644 index 000000000000..27afc8e535ca --- /dev/null +++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts | |||
@@ -0,0 +1,182 @@ | |||
1 | /* | ||
2 | * Samsung's Exynos4210 based SMDKV310 board device tree source | ||
3 | * | ||
4 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
5 | * http://www.samsung.com | ||
6 | * Copyright (c) 2010-2011 Linaro Ltd. | ||
7 | * www.linaro.org | ||
8 | * | ||
9 | * Device tree source file for Samsung's SMDKV310 board which is based on | ||
10 | * Samsung's Exynos4210 SoC. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | /dts-v1/; | ||
18 | /include/ "exynos4210.dtsi" | ||
19 | |||
20 | / { | ||
21 | model = "Samsung smdkv310 evaluation board based on Exynos4210"; | ||
22 | compatible = "samsung,smdkv310", "samsung,exynos4210"; | ||
23 | |||
24 | memory { | ||
25 | reg = <0x40000000 0x80000000>; | ||
26 | }; | ||
27 | |||
28 | chosen { | ||
29 | bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc"; | ||
30 | }; | ||
31 | |||
32 | sdhci@12530000 { | ||
33 | samsung,sdhci-bus-width = <4>; | ||
34 | linux,mmc_cap_4_bit_data; | ||
35 | samsung,sdhci-cd-internal; | ||
36 | gpio-cd = <&gpk2 2 2 3 3>; | ||
37 | gpios = <&gpk2 0 2 0 3>, | ||
38 | <&gpk2 1 2 0 3>, | ||
39 | <&gpk2 3 2 3 3>, | ||
40 | <&gpk2 4 2 3 3>, | ||
41 | <&gpk2 5 2 3 3>, | ||
42 | <&gpk2 6 2 3 3>; | ||
43 | }; | ||
44 | |||
45 | keypad@100A0000 { | ||
46 | samsung,keypad-num-rows = <2>; | ||
47 | samsung,keypad-num-columns = <8>; | ||
48 | linux,keypad-no-autorepeat; | ||
49 | linux,keypad-wakeup; | ||
50 | |||
51 | row-gpios = <&gpx2 0 3 3 0>, | ||
52 | <&gpx2 1 3 3 0>; | ||
53 | |||
54 | col-gpios = <&gpx1 0 3 0 0>, | ||
55 | <&gpx1 1 3 0 0>, | ||
56 | <&gpx1 2 3 0 0>, | ||
57 | <&gpx1 3 3 0 0>, | ||
58 | <&gpx1 4 3 0 0>, | ||
59 | <&gpx1 5 3 0 0>, | ||
60 | <&gpx1 6 3 0 0>, | ||
61 | <&gpx1 7 3 0 0>; | ||
62 | |||
63 | key_1 { | ||
64 | keypad,row = <0>; | ||
65 | keypad,column = <3>; | ||
66 | linux,code = <2>; | ||
67 | }; | ||
68 | |||
69 | key_2 { | ||
70 | keypad,row = <0>; | ||
71 | keypad,column = <4>; | ||
72 | linux,code = <3>; | ||
73 | }; | ||
74 | |||
75 | key_3 { | ||
76 | keypad,row = <0>; | ||
77 | keypad,column = <5>; | ||
78 | linux,code = <4>; | ||
79 | }; | ||
80 | |||
81 | key_4 { | ||
82 | keypad,row = <0>; | ||
83 | keypad,column = <6>; | ||
84 | linux,code = <5>; | ||
85 | }; | ||
86 | |||
87 | key_5 { | ||
88 | keypad,row = <0>; | ||
89 | keypad,column = <7>; | ||
90 | linux,code = <6>; | ||
91 | }; | ||
92 | |||
93 | key_a { | ||
94 | keypad,row = <1>; | ||
95 | keypad,column = <3>; | ||
96 | linux,code = <30>; | ||
97 | }; | ||
98 | |||
99 | key_b { | ||
100 | keypad,row = <1>; | ||
101 | keypad,column = <4>; | ||
102 | linux,code = <48>; | ||
103 | }; | ||
104 | |||
105 | key_c { | ||
106 | keypad,row = <1>; | ||
107 | keypad,column = <5>; | ||
108 | linux,code = <46>; | ||
109 | }; | ||
110 | |||
111 | key_d { | ||
112 | keypad,row = <1>; | ||
113 | keypad,column = <6>; | ||
114 | linux,code = <32>; | ||
115 | }; | ||
116 | |||
117 | key_e { | ||
118 | keypad,row = <1>; | ||
119 | keypad,column = <7>; | ||
120 | linux,code = <18>; | ||
121 | }; | ||
122 | }; | ||
123 | |||
124 | i2c@13860000 { | ||
125 | #address-cells = <1>; | ||
126 | #size-cells = <0>; | ||
127 | samsung,i2c-sda-delay = <100>; | ||
128 | samsung,i2c-max-bus-freq = <20000>; | ||
129 | gpios = <&gpd1 0 2 3 0>, | ||
130 | <&gpd1 1 2 3 0>; | ||
131 | |||
132 | eeprom@50 { | ||
133 | compatible = "samsung,24ad0xd1"; | ||
134 | reg = <0x50>; | ||
135 | }; | ||
136 | |||
137 | eeprom@52 { | ||
138 | compatible = "samsung,24ad0xd1"; | ||
139 | reg = <0x52>; | ||
140 | }; | ||
141 | }; | ||
142 | |||
143 | sdhci@12510000 { | ||
144 | status = "disabled"; | ||
145 | }; | ||
146 | |||
147 | sdhci@12520000 { | ||
148 | status = "disabled"; | ||
149 | }; | ||
150 | |||
151 | sdhci@12540000 { | ||
152 | status = "disabled"; | ||
153 | }; | ||
154 | |||
155 | i2c@13870000 { | ||
156 | status = "disabled"; | ||
157 | }; | ||
158 | |||
159 | i2c@13880000 { | ||
160 | status = "disabled"; | ||
161 | }; | ||
162 | |||
163 | i2c@13890000 { | ||
164 | status = "disabled"; | ||
165 | }; | ||
166 | |||
167 | i2c@138A0000 { | ||
168 | status = "disabled"; | ||
169 | }; | ||
170 | |||
171 | i2c@138B0000 { | ||
172 | status = "disabled"; | ||
173 | }; | ||
174 | |||
175 | i2c@138C0000 { | ||
176 | status = "disabled"; | ||
177 | }; | ||
178 | |||
179 | i2c@138D0000 { | ||
180 | status = "disabled"; | ||
181 | }; | ||
182 | }; | ||
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi new file mode 100644 index 000000000000..63d7578856c1 --- /dev/null +++ b/arch/arm/boot/dts/exynos4210.dtsi | |||
@@ -0,0 +1,397 @@ | |||
1 | /* | ||
2 | * Samsung's Exynos4210 SoC device tree source | ||
3 | * | ||
4 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
5 | * http://www.samsung.com | ||
6 | * Copyright (c) 2010-2011 Linaro Ltd. | ||
7 | * www.linaro.org | ||
8 | * | ||
9 | * Samsung's Exynos4210 SoC device nodes are listed in this file. Exynos4210 | ||
10 | * based board files can include this file and provide values for board specfic | ||
11 | * bindings. | ||
12 | * | ||
13 | * Note: This file does not include device nodes for all the controllers in | ||
14 | * Exynos4210 SoC. As device tree coverage for Exynos4210 increases, additional | ||
15 | * nodes can be added to this file. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or modify | ||
18 | * it under the terms of the GNU General Public License version 2 as | ||
19 | * published by the Free Software Foundation. | ||
20 | */ | ||
21 | |||
22 | /include/ "skeleton.dtsi" | ||
23 | |||
24 | / { | ||
25 | compatible = "samsung,exynos4210"; | ||
26 | interrupt-parent = <&gic>; | ||
27 | |||
28 | gic:interrupt-controller@10490000 { | ||
29 | compatible = "arm,cortex-a9-gic"; | ||
30 | #interrupt-cells = <3>; | ||
31 | interrupt-controller; | ||
32 | reg = <0x10490000 0x1000>, <0x10480000 0x100>; | ||
33 | }; | ||
34 | |||
35 | watchdog@10060000 { | ||
36 | compatible = "samsung,s3c2410-wdt"; | ||
37 | reg = <0x10060000 0x100>; | ||
38 | interrupts = <0 43 0>; | ||
39 | }; | ||
40 | |||
41 | rtc@10070000 { | ||
42 | compatible = "samsung,s3c6410-rtc"; | ||
43 | reg = <0x10070000 0x100>; | ||
44 | interrupts = <0 44 0>, <0 45 0>; | ||
45 | }; | ||
46 | |||
47 | keypad@100A0000 { | ||
48 | compatible = "samsung,s5pv210-keypad"; | ||
49 | reg = <0x100A0000 0x100>; | ||
50 | interrupts = <0 109 0>; | ||
51 | }; | ||
52 | |||
53 | sdhci@12510000 { | ||
54 | compatible = "samsung,exynos4210-sdhci"; | ||
55 | reg = <0x12510000 0x100>; | ||
56 | interrupts = <0 73 0>; | ||
57 | }; | ||
58 | |||
59 | sdhci@12520000 { | ||
60 | compatible = "samsung,exynos4210-sdhci"; | ||
61 | reg = <0x12520000 0x100>; | ||
62 | interrupts = <0 74 0>; | ||
63 | }; | ||
64 | |||
65 | sdhci@12530000 { | ||
66 | compatible = "samsung,exynos4210-sdhci"; | ||
67 | reg = <0x12530000 0x100>; | ||
68 | interrupts = <0 75 0>; | ||
69 | }; | ||
70 | |||
71 | sdhci@12540000 { | ||
72 | compatible = "samsung,exynos4210-sdhci"; | ||
73 | reg = <0x12540000 0x100>; | ||
74 | interrupts = <0 76 0>; | ||
75 | }; | ||
76 | |||
77 | serial@13800000 { | ||
78 | compatible = "samsung,exynos4210-uart"; | ||
79 | reg = <0x13800000 0x100>; | ||
80 | interrupts = <0 52 0>; | ||
81 | }; | ||
82 | |||
83 | serial@13810000 { | ||
84 | compatible = "samsung,exynos4210-uart"; | ||
85 | reg = <0x13810000 0x100>; | ||
86 | interrupts = <0 53 0>; | ||
87 | }; | ||
88 | |||
89 | serial@13820000 { | ||
90 | compatible = "samsung,exynos4210-uart"; | ||
91 | reg = <0x13820000 0x100>; | ||
92 | interrupts = <0 54 0>; | ||
93 | }; | ||
94 | |||
95 | serial@13830000 { | ||
96 | compatible = "samsung,exynos4210-uart"; | ||
97 | reg = <0x13830000 0x100>; | ||
98 | interrupts = <0 55 0>; | ||
99 | }; | ||
100 | |||
101 | i2c@13860000 { | ||
102 | compatible = "samsung,s3c2440-i2c"; | ||
103 | reg = <0x13860000 0x100>; | ||
104 | interrupts = <0 58 0>; | ||
105 | }; | ||
106 | |||
107 | i2c@13870000 { | ||
108 | compatible = "samsung,s3c2440-i2c"; | ||
109 | reg = <0x13870000 0x100>; | ||
110 | interrupts = <0 59 0>; | ||
111 | }; | ||
112 | |||
113 | i2c@13880000 { | ||
114 | compatible = "samsung,s3c2440-i2c"; | ||
115 | reg = <0x13880000 0x100>; | ||
116 | interrupts = <0 60 0>; | ||
117 | }; | ||
118 | |||
119 | i2c@13890000 { | ||
120 | compatible = "samsung,s3c2440-i2c"; | ||
121 | reg = <0x13890000 0x100>; | ||
122 | interrupts = <0 61 0>; | ||
123 | }; | ||
124 | |||
125 | i2c@138A0000 { | ||
126 | compatible = "samsung,s3c2440-i2c"; | ||
127 | reg = <0x138A0000 0x100>; | ||
128 | interrupts = <0 62 0>; | ||
129 | }; | ||
130 | |||
131 | i2c@138B0000 { | ||
132 | compatible = "samsung,s3c2440-i2c"; | ||
133 | reg = <0x138B0000 0x100>; | ||
134 | interrupts = <0 63 0>; | ||
135 | }; | ||
136 | |||
137 | i2c@138C0000 { | ||
138 | compatible = "samsung,s3c2440-i2c"; | ||
139 | reg = <0x138C0000 0x100>; | ||
140 | interrupts = <0 64 0>; | ||
141 | }; | ||
142 | |||
143 | i2c@138D0000 { | ||
144 | compatible = "samsung,s3c2440-i2c"; | ||
145 | reg = <0x138D0000 0x100>; | ||
146 | interrupts = <0 65 0>; | ||
147 | }; | ||
148 | |||
149 | amba { | ||
150 | #address-cells = <1>; | ||
151 | #size-cells = <1>; | ||
152 | compatible = "arm,amba-bus"; | ||
153 | interrupt-parent = <&gic>; | ||
154 | ranges; | ||
155 | |||
156 | pdma0: pdma@12680000 { | ||
157 | compatible = "arm,pl330", "arm,primecell"; | ||
158 | reg = <0x12680000 0x1000>; | ||
159 | interrupts = <0 35 0>; | ||
160 | }; | ||
161 | |||
162 | pdma1: pdma@12690000 { | ||
163 | compatible = "arm,pl330", "arm,primecell"; | ||
164 | reg = <0x12690000 0x1000>; | ||
165 | interrupts = <0 36 0>; | ||
166 | }; | ||
167 | }; | ||
168 | |||
169 | gpio-controllers { | ||
170 | #address-cells = <1>; | ||
171 | #size-cells = <1>; | ||
172 | gpio-controller; | ||
173 | ranges; | ||
174 | |||
175 | gpa0: gpio-controller@11400000 { | ||
176 | compatible = "samsung,exynos4-gpio"; | ||
177 | reg = <0x11400000 0x20>; | ||
178 | #gpio-cells = <4>; | ||
179 | }; | ||
180 | |||
181 | gpa1: gpio-controller@11400020 { | ||
182 | compatible = "samsung,exynos4-gpio"; | ||
183 | reg = <0x11400020 0x20>; | ||
184 | #gpio-cells = <4>; | ||
185 | }; | ||
186 | |||
187 | gpb: gpio-controller@11400040 { | ||
188 | compatible = "samsung,exynos4-gpio"; | ||
189 | reg = <0x11400040 0x20>; | ||
190 | #gpio-cells = <4>; | ||
191 | }; | ||
192 | |||
193 | gpc0: gpio-controller@11400060 { | ||
194 | compatible = "samsung,exynos4-gpio"; | ||
195 | reg = <0x11400060 0x20>; | ||
196 | #gpio-cells = <4>; | ||
197 | }; | ||
198 | |||
199 | gpc1: gpio-controller@11400080 { | ||
200 | compatible = "samsung,exynos4-gpio"; | ||
201 | reg = <0x11400080 0x20>; | ||
202 | #gpio-cells = <4>; | ||
203 | }; | ||
204 | |||
205 | gpd0: gpio-controller@114000A0 { | ||
206 | compatible = "samsung,exynos4-gpio"; | ||
207 | reg = <0x114000A0 0x20>; | ||
208 | #gpio-cells = <4>; | ||
209 | }; | ||
210 | |||
211 | gpd1: gpio-controller@114000C0 { | ||
212 | compatible = "samsung,exynos4-gpio"; | ||
213 | reg = <0x114000C0 0x20>; | ||
214 | #gpio-cells = <4>; | ||
215 | }; | ||
216 | |||
217 | gpe0: gpio-controller@114000E0 { | ||
218 | compatible = "samsung,exynos4-gpio"; | ||
219 | reg = <0x114000E0 0x20>; | ||
220 | #gpio-cells = <4>; | ||
221 | }; | ||
222 | |||
223 | gpe1: gpio-controller@11400100 { | ||
224 | compatible = "samsung,exynos4-gpio"; | ||
225 | reg = <0x11400100 0x20>; | ||
226 | #gpio-cells = <4>; | ||
227 | }; | ||
228 | |||
229 | gpe2: gpio-controller@11400120 { | ||
230 | compatible = "samsung,exynos4-gpio"; | ||
231 | reg = <0x11400120 0x20>; | ||
232 | #gpio-cells = <4>; | ||
233 | }; | ||
234 | |||
235 | gpe3: gpio-controller@11400140 { | ||
236 | compatible = "samsung,exynos4-gpio"; | ||
237 | reg = <0x11400140 0x20>; | ||
238 | #gpio-cells = <4>; | ||
239 | }; | ||
240 | |||
241 | gpe4: gpio-controller@11400160 { | ||
242 | compatible = "samsung,exynos4-gpio"; | ||
243 | reg = <0x11400160 0x20>; | ||
244 | #gpio-cells = <4>; | ||
245 | }; | ||
246 | |||
247 | gpf0: gpio-controller@11400180 { | ||
248 | compatible = "samsung,exynos4-gpio"; | ||
249 | reg = <0x11400180 0x20>; | ||
250 | #gpio-cells = <4>; | ||
251 | }; | ||
252 | |||
253 | gpf1: gpio-controller@114001A0 { | ||
254 | compatible = "samsung,exynos4-gpio"; | ||
255 | reg = <0x114001A0 0x20>; | ||
256 | #gpio-cells = <4>; | ||
257 | }; | ||
258 | |||
259 | gpf2: gpio-controller@114001C0 { | ||
260 | compatible = "samsung,exynos4-gpio"; | ||
261 | reg = <0x114001C0 0x20>; | ||
262 | #gpio-cells = <4>; | ||
263 | }; | ||
264 | |||
265 | gpf3: gpio-controller@114001E0 { | ||
266 | compatible = "samsung,exynos4-gpio"; | ||
267 | reg = <0x114001E0 0x20>; | ||
268 | #gpio-cells = <4>; | ||
269 | }; | ||
270 | |||
271 | gpj0: gpio-controller@11000000 { | ||
272 | compatible = "samsung,exynos4-gpio"; | ||
273 | reg = <0x11000000 0x20>; | ||
274 | #gpio-cells = <4>; | ||
275 | }; | ||
276 | |||
277 | gpj1: gpio-controller@11000020 { | ||
278 | compatible = "samsung,exynos4-gpio"; | ||
279 | reg = <0x11000020 0x20>; | ||
280 | #gpio-cells = <4>; | ||
281 | }; | ||
282 | |||
283 | gpk0: gpio-controller@11000040 { | ||
284 | compatible = "samsung,exynos4-gpio"; | ||
285 | reg = <0x11000040 0x20>; | ||
286 | #gpio-cells = <4>; | ||
287 | }; | ||
288 | |||
289 | gpk1: gpio-controller@11000060 { | ||
290 | compatible = "samsung,exynos4-gpio"; | ||
291 | reg = <0x11000060 0x20>; | ||
292 | #gpio-cells = <4>; | ||
293 | }; | ||
294 | |||
295 | gpk2: gpio-controller@11000080 { | ||
296 | compatible = "samsung,exynos4-gpio"; | ||
297 | reg = <0x11000080 0x20>; | ||
298 | #gpio-cells = <4>; | ||
299 | }; | ||
300 | |||
301 | gpk3: gpio-controller@110000A0 { | ||
302 | compatible = "samsung,exynos4-gpio"; | ||
303 | reg = <0x110000A0 0x20>; | ||
304 | #gpio-cells = <4>; | ||
305 | }; | ||
306 | |||
307 | gpl0: gpio-controller@110000C0 { | ||
308 | compatible = "samsung,exynos4-gpio"; | ||
309 | reg = <0x110000C0 0x20>; | ||
310 | #gpio-cells = <4>; | ||
311 | }; | ||
312 | |||
313 | gpl1: gpio-controller@110000E0 { | ||
314 | compatible = "samsung,exynos4-gpio"; | ||
315 | reg = <0x110000E0 0x20>; | ||
316 | #gpio-cells = <4>; | ||
317 | }; | ||
318 | |||
319 | gpl2: gpio-controller@11000100 { | ||
320 | compatible = "samsung,exynos4-gpio"; | ||
321 | reg = <0x11000100 0x20>; | ||
322 | #gpio-cells = <4>; | ||
323 | }; | ||
324 | |||
325 | gpy0: gpio-controller@11000120 { | ||
326 | compatible = "samsung,exynos4-gpio"; | ||
327 | reg = <0x11000120 0x20>; | ||
328 | #gpio-cells = <4>; | ||
329 | }; | ||
330 | |||
331 | gpy1: gpio-controller@11000140 { | ||
332 | compatible = "samsung,exynos4-gpio"; | ||
333 | reg = <0x11000140 0x20>; | ||
334 | #gpio-cells = <4>; | ||
335 | }; | ||
336 | |||
337 | gpy2: gpio-controller@11000160 { | ||
338 | compatible = "samsung,exynos4-gpio"; | ||
339 | reg = <0x11000160 0x20>; | ||
340 | #gpio-cells = <4>; | ||
341 | }; | ||
342 | |||
343 | gpy3: gpio-controller@11000180 { | ||
344 | compatible = "samsung,exynos4-gpio"; | ||
345 | reg = <0x11000180 0x20>; | ||
346 | #gpio-cells = <4>; | ||
347 | }; | ||
348 | |||
349 | gpy4: gpio-controller@110001A0 { | ||
350 | compatible = "samsung,exynos4-gpio"; | ||
351 | reg = <0x110001A0 0x20>; | ||
352 | #gpio-cells = <4>; | ||
353 | }; | ||
354 | |||
355 | gpy5: gpio-controller@110001C0 { | ||
356 | compatible = "samsung,exynos4-gpio"; | ||
357 | reg = <0x110001C0 0x20>; | ||
358 | #gpio-cells = <4>; | ||
359 | }; | ||
360 | |||
361 | gpy6: gpio-controller@110001E0 { | ||
362 | compatible = "samsung,exynos4-gpio"; | ||
363 | reg = <0x110001E0 0x20>; | ||
364 | #gpio-cells = <4>; | ||
365 | }; | ||
366 | |||
367 | gpx0: gpio-controller@11000C00 { | ||
368 | compatible = "samsung,exynos4-gpio"; | ||
369 | reg = <0x11000C00 0x20>; | ||
370 | #gpio-cells = <4>; | ||
371 | }; | ||
372 | |||
373 | gpx1: gpio-controller@11000C20 { | ||
374 | compatible = "samsung,exynos4-gpio"; | ||
375 | reg = <0x11000C20 0x20>; | ||
376 | #gpio-cells = <4>; | ||
377 | }; | ||
378 | |||
379 | gpx2: gpio-controller@11000C40 { | ||
380 | compatible = "samsung,exynos4-gpio"; | ||
381 | reg = <0x11000C40 0x20>; | ||
382 | #gpio-cells = <4>; | ||
383 | }; | ||
384 | |||
385 | gpx3: gpio-controller@11000C60 { | ||
386 | compatible = "samsung,exynos4-gpio"; | ||
387 | reg = <0x11000C60 0x20>; | ||
388 | #gpio-cells = <4>; | ||
389 | }; | ||
390 | |||
391 | gpz: gpio-controller@03860000 { | ||
392 | compatible = "samsung,exynos4-gpio"; | ||
393 | reg = <0x03860000 0x20>; | ||
394 | #gpio-cells = <4>; | ||
395 | }; | ||
396 | }; | ||
397 | }; | ||
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 724ec0f3560d..0afcc3b0f870 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -57,6 +57,11 @@ config EXYNOS4_MCT | |||
57 | help | 57 | help |
58 | Use MCT (Multi Core Timer) as kernel timers | 58 | Use MCT (Multi Core Timer) as kernel timers |
59 | 59 | ||
60 | config EXYNOS4_DEV_DMA | ||
61 | bool | ||
62 | help | ||
63 | Compile in amba device definitions for DMA controller | ||
64 | |||
60 | config EXYNOS4_DEV_AHCI | 65 | config EXYNOS4_DEV_AHCI |
61 | bool | 66 | bool |
62 | help | 67 | help |
@@ -177,6 +182,7 @@ config MACH_SMDKV310 | |||
177 | select SAMSUNG_DEV_BACKLIGHT | 182 | select SAMSUNG_DEV_BACKLIGHT |
178 | select EXYNOS4_DEV_AHCI | 183 | select EXYNOS4_DEV_AHCI |
179 | select SAMSUNG_DEV_KEYPAD | 184 | select SAMSUNG_DEV_KEYPAD |
185 | select EXYNOS4_DEV_DMA | ||
180 | select EXYNOS4_DEV_PD | 186 | select EXYNOS4_DEV_PD |
181 | select SAMSUNG_DEV_PWM | 187 | select SAMSUNG_DEV_PWM |
182 | select EXYNOS4_DEV_SYSMMU | 188 | select EXYNOS4_DEV_SYSMMU |
@@ -197,6 +203,7 @@ config MACH_ARMLEX4210 | |||
197 | select S3C_DEV_HSMMC2 | 203 | select S3C_DEV_HSMMC2 |
198 | select S3C_DEV_HSMMC3 | 204 | select S3C_DEV_HSMMC3 |
199 | select EXYNOS4_DEV_AHCI | 205 | select EXYNOS4_DEV_AHCI |
206 | select EXYNOS4_DEV_DMA | ||
200 | select EXYNOS4_DEV_SYSMMU | 207 | select EXYNOS4_DEV_SYSMMU |
201 | select EXYNOS4_SETUP_SDHCI | 208 | select EXYNOS4_SETUP_SDHCI |
202 | help | 209 | help |
@@ -222,6 +229,7 @@ config MACH_UNIVERSAL_C210 | |||
222 | select S5P_DEV_MFC | 229 | select S5P_DEV_MFC |
223 | select S5P_DEV_ONENAND | 230 | select S5P_DEV_ONENAND |
224 | select S5P_DEV_TV | 231 | select S5P_DEV_TV |
232 | select EXYNOS4_DEV_DMA | ||
225 | select EXYNOS4_DEV_PD | 233 | select EXYNOS4_DEV_PD |
226 | select EXYNOS4_SETUP_FIMD0 | 234 | select EXYNOS4_SETUP_FIMD0 |
227 | select EXYNOS4_SETUP_I2C1 | 235 | select EXYNOS4_SETUP_I2C1 |
@@ -255,6 +263,7 @@ config MACH_NURI | |||
255 | select S5P_DEV_MFC | 263 | select S5P_DEV_MFC |
256 | select S5P_DEV_USB_EHCI | 264 | select S5P_DEV_USB_EHCI |
257 | select S5P_SETUP_MIPIPHY | 265 | select S5P_SETUP_MIPIPHY |
266 | select EXYNOS4_DEV_DMA | ||
258 | select EXYNOS4_DEV_PD | 267 | select EXYNOS4_DEV_PD |
259 | select EXYNOS4_SETUP_FIMC | 268 | select EXYNOS4_SETUP_FIMC |
260 | select EXYNOS4_SETUP_FIMD0 | 269 | select EXYNOS4_SETUP_FIMD0 |
@@ -287,6 +296,7 @@ config MACH_ORIGEN | |||
287 | select S5P_DEV_USB_EHCI | 296 | select S5P_DEV_USB_EHCI |
288 | select SAMSUNG_DEV_BACKLIGHT | 297 | select SAMSUNG_DEV_BACKLIGHT |
289 | select SAMSUNG_DEV_PWM | 298 | select SAMSUNG_DEV_PWM |
299 | select EXYNOS4_DEV_DMA | ||
290 | select EXYNOS4_DEV_PD | 300 | select EXYNOS4_DEV_PD |
291 | select EXYNOS4_SETUP_FIMD0 | 301 | select EXYNOS4_SETUP_FIMD0 |
292 | select EXYNOS4_SETUP_SDHCI | 302 | select EXYNOS4_SETUP_SDHCI |
@@ -327,6 +337,20 @@ config MACH_SMDK4412 | |||
327 | Machine support for Samsung SMDK4412 | 337 | Machine support for Samsung SMDK4412 |
328 | endif | 338 | endif |
329 | 339 | ||
340 | comment "Flattened Device Tree based board for Exynos4 based SoC" | ||
341 | |||
342 | config MACH_EXYNOS4_DT | ||
343 | bool "Samsung Exynos4 Machine using device tree" | ||
344 | select CPU_EXYNOS4210 | ||
345 | select USE_OF | ||
346 | select ARM_AMBA | ||
347 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD | ||
348 | help | ||
349 | Machine support for Samsung Exynos4 machine with device tree enabled. | ||
350 | Select this if a fdt blob is available for the Exynos4 SoC based board. | ||
351 | Note: This is under development and not all peripherals can be supported | ||
352 | with this machine file. | ||
353 | |||
330 | if ARCH_EXYNOS4 | 354 | if ARCH_EXYNOS4 |
331 | 355 | ||
332 | comment "Configuration for HSMMC 8-bit bus width" | 356 | comment "Configuration for HSMMC 8-bit bus width" |
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 59069a35e40b..8d85ae635ac2 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile | |||
@@ -13,7 +13,7 @@ obj- := | |||
13 | # Core support for EXYNOS4 system | 13 | # Core support for EXYNOS4 system |
14 | 14 | ||
15 | obj-$(CONFIG_ARCH_EXYNOS4) += cpu.o init.o clock.o irq-combiner.o setup-i2c0.o | 15 | obj-$(CONFIG_ARCH_EXYNOS4) += cpu.o init.o clock.o irq-combiner.o setup-i2c0.o |
16 | obj-$(CONFIG_ARCH_EXYNOS4) += irq-eint.o dma.o pmu.o | 16 | obj-$(CONFIG_ARCH_EXYNOS4) += irq-eint.o pmu.o |
17 | obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o | 17 | obj-$(CONFIG_CPU_EXYNOS4210) += clock-exynos4210.o |
18 | obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o | 18 | obj-$(CONFIG_SOC_EXYNOS4212) += clock-exynos4212.o |
19 | obj-$(CONFIG_PM) += pm.o | 19 | obj-$(CONFIG_PM) += pm.o |
@@ -37,6 +37,8 @@ obj-$(CONFIG_MACH_ORIGEN) += mach-origen.o | |||
37 | obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o | 37 | obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o |
38 | obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o | 38 | obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o |
39 | 39 | ||
40 | obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o | ||
41 | |||
40 | # device support | 42 | # device support |
41 | 43 | ||
42 | obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o | 44 | obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o |
@@ -44,6 +46,7 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o | |||
44 | obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o | 46 | obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o |
45 | obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o | 47 | obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o |
46 | obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o | 48 | obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o |
49 | obj-$(CONFIG_EXYNOS4_DEV_DMA) += dma.o | ||
47 | 50 | ||
48 | obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o | 51 | obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o |
49 | obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o | 52 | obj-$(CONFIG_EXYNOS4_SETUP_FIMD0) += setup-fimd0.o |
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c index 2894f0adef5c..7dee8694486a 100644 --- a/arch/arm/mach-exynos/clock.c +++ b/arch/arm/mach-exynos/clock.c | |||
@@ -553,16 +553,6 @@ static struct clk init_clocks_off[] = { | |||
553 | .enable = exynos4_clk_dac_ctrl, | 553 | .enable = exynos4_clk_dac_ctrl, |
554 | .ctrlbit = (1 << 0), | 554 | .ctrlbit = (1 << 0), |
555 | }, { | 555 | }, { |
556 | .name = "dma", | ||
557 | .devname = "dma-pl330.0", | ||
558 | .enable = exynos4_clk_ip_fsys_ctrl, | ||
559 | .ctrlbit = (1 << 0), | ||
560 | }, { | ||
561 | .name = "dma", | ||
562 | .devname = "dma-pl330.1", | ||
563 | .enable = exynos4_clk_ip_fsys_ctrl, | ||
564 | .ctrlbit = (1 << 1), | ||
565 | }, { | ||
566 | .name = "adc", | 556 | .name = "adc", |
567 | .enable = exynos4_clk_ip_peril_ctrl, | 557 | .enable = exynos4_clk_ip_peril_ctrl, |
568 | .ctrlbit = (1 << 15), | 558 | .ctrlbit = (1 << 15), |
@@ -778,6 +768,20 @@ static struct clk init_clocks[] = { | |||
778 | } | 768 | } |
779 | }; | 769 | }; |
780 | 770 | ||
771 | static struct clk clk_pdma0 = { | ||
772 | .name = "dma", | ||
773 | .devname = "dma-pl330.0", | ||
774 | .enable = exynos4_clk_ip_fsys_ctrl, | ||
775 | .ctrlbit = (1 << 0), | ||
776 | }; | ||
777 | |||
778 | static struct clk clk_pdma1 = { | ||
779 | .name = "dma", | ||
780 | .devname = "dma-pl330.1", | ||
781 | .enable = exynos4_clk_ip_fsys_ctrl, | ||
782 | .ctrlbit = (1 << 1), | ||
783 | }; | ||
784 | |||
781 | struct clk *clkset_group_list[] = { | 785 | struct clk *clkset_group_list[] = { |
782 | [0] = &clk_ext_xtal_mux, | 786 | [0] = &clk_ext_xtal_mux, |
783 | [1] = &clk_xusbxti, | 787 | [1] = &clk_xusbxti, |
@@ -1009,46 +1013,6 @@ static struct clksrc_clk clk_dout_mmc4 = { | |||
1009 | 1013 | ||
1010 | static struct clksrc_clk clksrcs[] = { | 1014 | static struct clksrc_clk clksrcs[] = { |
1011 | { | 1015 | { |
1012 | .clk = { | ||
1013 | .name = "uclk1", | ||
1014 | .devname = "s5pv210-uart.0", | ||
1015 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1016 | .ctrlbit = (1 << 0), | ||
1017 | }, | ||
1018 | .sources = &clkset_group, | ||
1019 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 }, | ||
1020 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 }, | ||
1021 | }, { | ||
1022 | .clk = { | ||
1023 | .name = "uclk1", | ||
1024 | .devname = "s5pv210-uart.1", | ||
1025 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1026 | .ctrlbit = (1 << 4), | ||
1027 | }, | ||
1028 | .sources = &clkset_group, | ||
1029 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 }, | ||
1030 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 }, | ||
1031 | }, { | ||
1032 | .clk = { | ||
1033 | .name = "uclk1", | ||
1034 | .devname = "s5pv210-uart.2", | ||
1035 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1036 | .ctrlbit = (1 << 8), | ||
1037 | }, | ||
1038 | .sources = &clkset_group, | ||
1039 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 }, | ||
1040 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 }, | ||
1041 | }, { | ||
1042 | .clk = { | ||
1043 | .name = "uclk1", | ||
1044 | .devname = "s5pv210-uart.3", | ||
1045 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1046 | .ctrlbit = (1 << 12), | ||
1047 | }, | ||
1048 | .sources = &clkset_group, | ||
1049 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 }, | ||
1050 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 }, | ||
1051 | }, { | ||
1052 | .clk = { | 1016 | .clk = { |
1053 | .name = "sclk_pwm", | 1017 | .name = "sclk_pwm", |
1054 | .enable = exynos4_clksrc_mask_peril0_ctrl, | 1018 | .enable = exynos4_clksrc_mask_peril0_ctrl, |
@@ -1237,6 +1201,54 @@ static struct clksrc_clk clksrcs[] = { | |||
1237 | } | 1201 | } |
1238 | }; | 1202 | }; |
1239 | 1203 | ||
1204 | static struct clksrc_clk clk_sclk_uart0 = { | ||
1205 | .clk = { | ||
1206 | .name = "uclk1", | ||
1207 | .devname = "exynos4210-uart.0", | ||
1208 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1209 | .ctrlbit = (1 << 0), | ||
1210 | }, | ||
1211 | .sources = &clkset_group, | ||
1212 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 }, | ||
1213 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 }, | ||
1214 | }; | ||
1215 | |||
1216 | static struct clksrc_clk clk_sclk_uart1 = { | ||
1217 | .clk = { | ||
1218 | .name = "uclk1", | ||
1219 | .devname = "exynos4210-uart.1", | ||
1220 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1221 | .ctrlbit = (1 << 4), | ||
1222 | }, | ||
1223 | .sources = &clkset_group, | ||
1224 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 }, | ||
1225 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 }, | ||
1226 | }; | ||
1227 | |||
1228 | static struct clksrc_clk clk_sclk_uart2 = { | ||
1229 | .clk = { | ||
1230 | .name = "uclk1", | ||
1231 | .devname = "exynos4210-uart.2", | ||
1232 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1233 | .ctrlbit = (1 << 8), | ||
1234 | }, | ||
1235 | .sources = &clkset_group, | ||
1236 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 }, | ||
1237 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 }, | ||
1238 | }; | ||
1239 | |||
1240 | static struct clksrc_clk clk_sclk_uart3 = { | ||
1241 | .clk = { | ||
1242 | .name = "uclk1", | ||
1243 | .devname = "exynos4210-uart.3", | ||
1244 | .enable = exynos4_clksrc_mask_peril0_ctrl, | ||
1245 | .ctrlbit = (1 << 12), | ||
1246 | }, | ||
1247 | .sources = &clkset_group, | ||
1248 | .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 }, | ||
1249 | .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 }, | ||
1250 | }; | ||
1251 | |||
1240 | /* Clock initialization code */ | 1252 | /* Clock initialization code */ |
1241 | static struct clksrc_clk *sysclks[] = { | 1253 | static struct clksrc_clk *sysclks[] = { |
1242 | &clk_mout_apll, | 1254 | &clk_mout_apll, |
@@ -1271,6 +1283,27 @@ static struct clksrc_clk *sysclks[] = { | |||
1271 | &clk_mout_mfc1, | 1283 | &clk_mout_mfc1, |
1272 | }; | 1284 | }; |
1273 | 1285 | ||
1286 | static struct clk *clk_cdev[] = { | ||
1287 | &clk_pdma0, | ||
1288 | &clk_pdma1, | ||
1289 | }; | ||
1290 | |||
1291 | static struct clksrc_clk *clksrc_cdev[] = { | ||
1292 | &clk_sclk_uart0, | ||
1293 | &clk_sclk_uart1, | ||
1294 | &clk_sclk_uart2, | ||
1295 | &clk_sclk_uart3, | ||
1296 | }; | ||
1297 | |||
1298 | static struct clk_lookup exynos4_clk_lookup[] = { | ||
1299 | CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &clk_sclk_uart0.clk), | ||
1300 | CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk), | ||
1301 | CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk), | ||
1302 | CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk), | ||
1303 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0), | ||
1304 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1), | ||
1305 | }; | ||
1306 | |||
1274 | static int xtal_rate; | 1307 | static int xtal_rate; |
1275 | 1308 | ||
1276 | static unsigned long exynos4_fout_apll_get_rate(struct clk *clk) | 1309 | static unsigned long exynos4_fout_apll_get_rate(struct clk *clk) |
@@ -1478,11 +1511,19 @@ void __init exynos4_register_clocks(void) | |||
1478 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | 1511 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) |
1479 | s3c_register_clksrc(sclk_tv[ptr], 1); | 1512 | s3c_register_clksrc(sclk_tv[ptr], 1); |
1480 | 1513 | ||
1514 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
1515 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
1516 | |||
1481 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1517 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1482 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1518 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1483 | 1519 | ||
1520 | s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev)); | ||
1521 | for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++) | ||
1522 | s3c_disable_clocks(clk_cdev[ptr], 1); | ||
1523 | |||
1484 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1524 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1485 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1525 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1526 | clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup)); | ||
1486 | 1527 | ||
1487 | register_syscore_ops(&exynos4_clock_syscore_ops); | 1528 | register_syscore_ops(&exynos4_clock_syscore_ops); |
1488 | s3c24xx_register_clock(&dummy_apb_pclk); | 1529 | s3c24xx_register_clock(&dummy_apb_pclk); |
diff --git a/arch/arm/mach-exynos/cpu.c b/arch/arm/mach-exynos/cpu.c index 90ec247f3b37..0eb7b6a6903d 100644 --- a/arch/arm/mach-exynos/cpu.c +++ b/arch/arm/mach-exynos/cpu.c | |||
@@ -10,6 +10,8 @@ | |||
10 | 10 | ||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/sysdev.h> | 12 | #include <linux/sysdev.h> |
13 | #include <linux/of.h> | ||
14 | #include <linux/of_irq.h> | ||
13 | 15 | ||
14 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
15 | #include <asm/mach/irq.h> | 17 | #include <asm/mach/irq.h> |
@@ -218,13 +220,26 @@ static void exynos4_gic_irq_fix_base(struct irq_data *d) | |||
218 | (gic_bank_offset * smp_processor_id()); | 220 | (gic_bank_offset * smp_processor_id()); |
219 | } | 221 | } |
220 | 222 | ||
223 | #ifdef CONFIG_OF | ||
224 | static const struct of_device_id exynos4_dt_irq_match[] = { | ||
225 | { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, | ||
226 | {}, | ||
227 | }; | ||
228 | #endif | ||
229 | |||
221 | void __init exynos4_init_irq(void) | 230 | void __init exynos4_init_irq(void) |
222 | { | 231 | { |
223 | int irq; | 232 | int irq; |
224 | 233 | ||
225 | gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000; | 234 | gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000; |
226 | 235 | ||
227 | gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); | 236 | if (!of_have_populated_dt()) |
237 | gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); | ||
238 | #ifdef CONFIG_OF | ||
239 | else | ||
240 | of_irq_init(exynos4_dt_irq_match); | ||
241 | #endif | ||
242 | |||
228 | gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base; | 243 | gic_arch_extn.irq_eoi = exynos4_gic_irq_fix_base; |
229 | gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base; | 244 | gic_arch_extn.irq_unmask = exynos4_gic_irq_fix_base; |
230 | gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base; | 245 | gic_arch_extn.irq_mask = exynos4_gic_irq_fix_base; |
diff --git a/arch/arm/mach-exynos/dma.c b/arch/arm/mach-exynos/dma.c index 9667c61e64fb..b10fcd270f07 100644 --- a/arch/arm/mach-exynos/dma.c +++ b/arch/arm/mach-exynos/dma.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/amba/bus.h> | 25 | #include <linux/amba/bus.h> |
26 | #include <linux/amba/pl330.h> | 26 | #include <linux/amba/pl330.h> |
27 | #include <linux/of.h> | ||
27 | 28 | ||
28 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
29 | #include <plat/devs.h> | 30 | #include <plat/devs.h> |
@@ -35,95 +36,42 @@ | |||
35 | 36 | ||
36 | static u64 dma_dmamask = DMA_BIT_MASK(32); | 37 | static u64 dma_dmamask = DMA_BIT_MASK(32); |
37 | 38 | ||
38 | struct dma_pl330_peri pdma0_peri[28] = { | 39 | u8 pdma0_peri[] = { |
39 | { | 40 | DMACH_PCM0_RX, |
40 | .peri_id = (u8)DMACH_PCM0_RX, | 41 | DMACH_PCM0_TX, |
41 | .rqtype = DEVTOMEM, | 42 | DMACH_PCM2_RX, |
42 | }, { | 43 | DMACH_PCM2_TX, |
43 | .peri_id = (u8)DMACH_PCM0_TX, | 44 | DMACH_MSM_REQ0, |
44 | .rqtype = MEMTODEV, | 45 | DMACH_MSM_REQ2, |
45 | }, { | 46 | DMACH_SPI0_RX, |
46 | .peri_id = (u8)DMACH_PCM2_RX, | 47 | DMACH_SPI0_TX, |
47 | .rqtype = DEVTOMEM, | 48 | DMACH_SPI2_RX, |
48 | }, { | 49 | DMACH_SPI2_TX, |
49 | .peri_id = (u8)DMACH_PCM2_TX, | 50 | DMACH_I2S0S_TX, |
50 | .rqtype = MEMTODEV, | 51 | DMACH_I2S0_RX, |
51 | }, { | 52 | DMACH_I2S0_TX, |
52 | .peri_id = (u8)DMACH_MSM_REQ0, | 53 | DMACH_I2S2_RX, |
53 | }, { | 54 | DMACH_I2S2_TX, |
54 | .peri_id = (u8)DMACH_MSM_REQ2, | 55 | DMACH_UART0_RX, |
55 | }, { | 56 | DMACH_UART0_TX, |
56 | .peri_id = (u8)DMACH_SPI0_RX, | 57 | DMACH_UART2_RX, |
57 | .rqtype = DEVTOMEM, | 58 | DMACH_UART2_TX, |
58 | }, { | 59 | DMACH_UART4_RX, |
59 | .peri_id = (u8)DMACH_SPI0_TX, | 60 | DMACH_UART4_TX, |
60 | .rqtype = MEMTODEV, | 61 | DMACH_SLIMBUS0_RX, |
61 | }, { | 62 | DMACH_SLIMBUS0_TX, |
62 | .peri_id = (u8)DMACH_SPI2_RX, | 63 | DMACH_SLIMBUS2_RX, |
63 | .rqtype = DEVTOMEM, | 64 | DMACH_SLIMBUS2_TX, |
64 | }, { | 65 | DMACH_SLIMBUS4_RX, |
65 | .peri_id = (u8)DMACH_SPI2_TX, | 66 | DMACH_SLIMBUS4_TX, |
66 | .rqtype = MEMTODEV, | 67 | DMACH_AC97_MICIN, |
67 | }, { | 68 | DMACH_AC97_PCMIN, |
68 | .peri_id = (u8)DMACH_I2S0S_TX, | 69 | DMACH_AC97_PCMOUT, |
69 | .rqtype = MEMTODEV, | ||
70 | }, { | ||
71 | .peri_id = (u8)DMACH_I2S0_RX, | ||
72 | .rqtype = DEVTOMEM, | ||
73 | }, { | ||
74 | .peri_id = (u8)DMACH_I2S0_TX, | ||
75 | .rqtype = MEMTODEV, | ||
76 | }, { | ||
77 | .peri_id = (u8)DMACH_UART0_RX, | ||
78 | .rqtype = DEVTOMEM, | ||
79 | }, { | ||
80 | .peri_id = (u8)DMACH_UART0_TX, | ||
81 | .rqtype = MEMTODEV, | ||
82 | }, { | ||
83 | .peri_id = (u8)DMACH_UART2_RX, | ||
84 | .rqtype = DEVTOMEM, | ||
85 | }, { | ||
86 | .peri_id = (u8)DMACH_UART2_TX, | ||
87 | .rqtype = MEMTODEV, | ||
88 | }, { | ||
89 | .peri_id = (u8)DMACH_UART4_RX, | ||
90 | .rqtype = DEVTOMEM, | ||
91 | }, { | ||
92 | .peri_id = (u8)DMACH_UART4_TX, | ||
93 | .rqtype = MEMTODEV, | ||
94 | }, { | ||
95 | .peri_id = (u8)DMACH_SLIMBUS0_RX, | ||
96 | .rqtype = DEVTOMEM, | ||
97 | }, { | ||
98 | .peri_id = (u8)DMACH_SLIMBUS0_TX, | ||
99 | .rqtype = MEMTODEV, | ||
100 | }, { | ||
101 | .peri_id = (u8)DMACH_SLIMBUS2_RX, | ||
102 | .rqtype = DEVTOMEM, | ||
103 | }, { | ||
104 | .peri_id = (u8)DMACH_SLIMBUS2_TX, | ||
105 | .rqtype = MEMTODEV, | ||
106 | }, { | ||
107 | .peri_id = (u8)DMACH_SLIMBUS4_RX, | ||
108 | .rqtype = DEVTOMEM, | ||
109 | }, { | ||
110 | .peri_id = (u8)DMACH_SLIMBUS4_TX, | ||
111 | .rqtype = MEMTODEV, | ||
112 | }, { | ||
113 | .peri_id = (u8)DMACH_AC97_MICIN, | ||
114 | .rqtype = DEVTOMEM, | ||
115 | }, { | ||
116 | .peri_id = (u8)DMACH_AC97_PCMIN, | ||
117 | .rqtype = DEVTOMEM, | ||
118 | }, { | ||
119 | .peri_id = (u8)DMACH_AC97_PCMOUT, | ||
120 | .rqtype = MEMTODEV, | ||
121 | }, | ||
122 | }; | 70 | }; |
123 | 71 | ||
124 | struct dma_pl330_platdata exynos4_pdma0_pdata = { | 72 | struct dma_pl330_platdata exynos4_pdma0_pdata = { |
125 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), | 73 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), |
126 | .peri = pdma0_peri, | 74 | .peri_id = pdma0_peri, |
127 | }; | 75 | }; |
128 | 76 | ||
129 | struct amba_device exynos4_device_pdma0 = { | 77 | struct amba_device exynos4_device_pdma0 = { |
@@ -142,86 +90,37 @@ struct amba_device exynos4_device_pdma0 = { | |||
142 | .periphid = 0x00041330, | 90 | .periphid = 0x00041330, |
143 | }; | 91 | }; |
144 | 92 | ||
145 | struct dma_pl330_peri pdma1_peri[25] = { | 93 | u8 pdma1_peri[] = { |
146 | { | 94 | DMACH_PCM0_RX, |
147 | .peri_id = (u8)DMACH_PCM0_RX, | 95 | DMACH_PCM0_TX, |
148 | .rqtype = DEVTOMEM, | 96 | DMACH_PCM1_RX, |
149 | }, { | 97 | DMACH_PCM1_TX, |
150 | .peri_id = (u8)DMACH_PCM0_TX, | 98 | DMACH_MSM_REQ1, |
151 | .rqtype = MEMTODEV, | 99 | DMACH_MSM_REQ3, |
152 | }, { | 100 | DMACH_SPI1_RX, |
153 | .peri_id = (u8)DMACH_PCM1_RX, | 101 | DMACH_SPI1_TX, |
154 | .rqtype = DEVTOMEM, | 102 | DMACH_I2S0S_TX, |
155 | }, { | 103 | DMACH_I2S0_RX, |
156 | .peri_id = (u8)DMACH_PCM1_TX, | 104 | DMACH_I2S0_TX, |
157 | .rqtype = MEMTODEV, | 105 | DMACH_I2S1_RX, |
158 | }, { | 106 | DMACH_I2S1_TX, |
159 | .peri_id = (u8)DMACH_MSM_REQ1, | 107 | DMACH_UART0_RX, |
160 | }, { | 108 | DMACH_UART0_TX, |
161 | .peri_id = (u8)DMACH_MSM_REQ3, | 109 | DMACH_UART1_RX, |
162 | }, { | 110 | DMACH_UART1_TX, |
163 | .peri_id = (u8)DMACH_SPI1_RX, | 111 | DMACH_UART3_RX, |
164 | .rqtype = DEVTOMEM, | 112 | DMACH_UART3_TX, |
165 | }, { | 113 | DMACH_SLIMBUS1_RX, |
166 | .peri_id = (u8)DMACH_SPI1_TX, | 114 | DMACH_SLIMBUS1_TX, |
167 | .rqtype = MEMTODEV, | 115 | DMACH_SLIMBUS3_RX, |
168 | }, { | 116 | DMACH_SLIMBUS3_TX, |
169 | .peri_id = (u8)DMACH_I2S0S_TX, | 117 | DMACH_SLIMBUS5_RX, |
170 | .rqtype = MEMTODEV, | 118 | DMACH_SLIMBUS5_TX, |
171 | }, { | ||
172 | .peri_id = (u8)DMACH_I2S0_RX, | ||
173 | .rqtype = DEVTOMEM, | ||
174 | }, { | ||
175 | .peri_id = (u8)DMACH_I2S0_TX, | ||
176 | .rqtype = MEMTODEV, | ||
177 | }, { | ||
178 | .peri_id = (u8)DMACH_I2S1_RX, | ||
179 | .rqtype = DEVTOMEM, | ||
180 | }, { | ||
181 | .peri_id = (u8)DMACH_I2S1_TX, | ||
182 | .rqtype = MEMTODEV, | ||
183 | }, { | ||
184 | .peri_id = (u8)DMACH_UART0_RX, | ||
185 | .rqtype = DEVTOMEM, | ||
186 | }, { | ||
187 | .peri_id = (u8)DMACH_UART0_TX, | ||
188 | .rqtype = MEMTODEV, | ||
189 | }, { | ||
190 | .peri_id = (u8)DMACH_UART1_RX, | ||
191 | .rqtype = DEVTOMEM, | ||
192 | }, { | ||
193 | .peri_id = (u8)DMACH_UART1_TX, | ||
194 | .rqtype = MEMTODEV, | ||
195 | }, { | ||
196 | .peri_id = (u8)DMACH_UART3_RX, | ||
197 | .rqtype = DEVTOMEM, | ||
198 | }, { | ||
199 | .peri_id = (u8)DMACH_UART3_TX, | ||
200 | .rqtype = MEMTODEV, | ||
201 | }, { | ||
202 | .peri_id = (u8)DMACH_SLIMBUS1_RX, | ||
203 | .rqtype = DEVTOMEM, | ||
204 | }, { | ||
205 | .peri_id = (u8)DMACH_SLIMBUS1_TX, | ||
206 | .rqtype = MEMTODEV, | ||
207 | }, { | ||
208 | .peri_id = (u8)DMACH_SLIMBUS3_RX, | ||
209 | .rqtype = DEVTOMEM, | ||
210 | }, { | ||
211 | .peri_id = (u8)DMACH_SLIMBUS3_TX, | ||
212 | .rqtype = MEMTODEV, | ||
213 | }, { | ||
214 | .peri_id = (u8)DMACH_SLIMBUS5_RX, | ||
215 | .rqtype = DEVTOMEM, | ||
216 | }, { | ||
217 | .peri_id = (u8)DMACH_SLIMBUS5_TX, | ||
218 | .rqtype = MEMTODEV, | ||
219 | }, | ||
220 | }; | 119 | }; |
221 | 120 | ||
222 | struct dma_pl330_platdata exynos4_pdma1_pdata = { | 121 | struct dma_pl330_platdata exynos4_pdma1_pdata = { |
223 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), | 122 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), |
224 | .peri = pdma1_peri, | 123 | .peri_id = pdma1_peri, |
225 | }; | 124 | }; |
226 | 125 | ||
227 | struct amba_device exynos4_device_pdma1 = { | 126 | struct amba_device exynos4_device_pdma1 = { |
@@ -242,7 +141,15 @@ struct amba_device exynos4_device_pdma1 = { | |||
242 | 141 | ||
243 | static int __init exynos4_dma_init(void) | 142 | static int __init exynos4_dma_init(void) |
244 | { | 143 | { |
144 | if (of_have_populated_dt()) | ||
145 | return 0; | ||
146 | |||
147 | dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask); | ||
148 | dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask); | ||
245 | amba_device_register(&exynos4_device_pdma0, &iomem_resource); | 149 | amba_device_register(&exynos4_device_pdma0, &iomem_resource); |
150 | |||
151 | dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask); | ||
152 | dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask); | ||
246 | amba_device_register(&exynos4_device_pdma1, &iomem_resource); | 153 | amba_device_register(&exynos4_device_pdma1, &iomem_resource); |
247 | 154 | ||
248 | return 0; | 155 | return 0; |
diff --git a/arch/arm/mach-exynos/include/mach/entry-macro.S b/arch/arm/mach-exynos/include/mach/entry-macro.S index f5e9fd8e37b4..d7dfcd7eb921 100644 --- a/arch/arm/mach-exynos/include/mach/entry-macro.S +++ b/arch/arm/mach-exynos/include/mach/entry-macro.S | |||
@@ -72,7 +72,6 @@ | |||
72 | cmpcc \irqnr, \irqnr | 72 | cmpcc \irqnr, \irqnr |
73 | cmpne \irqnr, \tmp | 73 | cmpne \irqnr, \tmp |
74 | cmpcs \irqnr, \irqnr | 74 | cmpcs \irqnr, \irqnr |
75 | addne \irqnr, \irqnr, #32 | ||
76 | 75 | ||
77 | .endm | 76 | .endm |
78 | 77 | ||
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index dfd4b7eecb90..713dd5251c64 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h | |||
@@ -17,13 +17,13 @@ | |||
17 | 17 | ||
18 | /* PPI: Private Peripheral Interrupt */ | 18 | /* PPI: Private Peripheral Interrupt */ |
19 | 19 | ||
20 | #define IRQ_PPI(x) S5P_IRQ(x+16) | 20 | #define IRQ_PPI(x) (x+16) |
21 | 21 | ||
22 | #define IRQ_MCT_LOCALTIMER IRQ_PPI(12) | 22 | #define IRQ_MCT_LOCALTIMER IRQ_PPI(12) |
23 | 23 | ||
24 | /* SPI: Shared Peripheral Interrupt */ | 24 | /* SPI: Shared Peripheral Interrupt */ |
25 | 25 | ||
26 | #define IRQ_SPI(x) S5P_IRQ(x+32) | 26 | #define IRQ_SPI(x) (x+32) |
27 | 27 | ||
28 | #define IRQ_EINT0 IRQ_SPI(16) | 28 | #define IRQ_EINT0 IRQ_SPI(16) |
29 | #define IRQ_EINT1 IRQ_SPI(17) | 29 | #define IRQ_EINT1 IRQ_SPI(17) |
@@ -163,7 +163,9 @@ | |||
163 | #define IRQ_GPIO2_NR_GROUPS 9 | 163 | #define IRQ_GPIO2_NR_GROUPS 9 |
164 | #define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT) | 164 | #define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT) |
165 | 165 | ||
166 | #define IRQ_TIMER_BASE (IRQ_GPIO_END + 64) | ||
167 | |||
166 | /* Set the default NR_IRQS */ | 168 | /* Set the default NR_IRQS */ |
167 | #define NR_IRQS (IRQ_GPIO_END + 64) | 169 | #define NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT) |
168 | 170 | ||
169 | #endif /* __ASM_ARCH_IRQS_H */ | 171 | #endif /* __ASM_ARCH_IRQS_H */ |
diff --git a/arch/arm/mach-exynos/init.c b/arch/arm/mach-exynos/init.c index a8a83e3881a4..5b35978029be 100644 --- a/arch/arm/mach-exynos/init.c +++ b/arch/arm/mach-exynos/init.c | |||
@@ -14,29 +14,14 @@ | |||
14 | #include <plat/devs.h> | 14 | #include <plat/devs.h> |
15 | #include <plat/regs-serial.h> | 15 | #include <plat/regs-serial.h> |
16 | 16 | ||
17 | static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = { | ||
18 | [0] = { | ||
19 | .name = "uclk1", | ||
20 | .divisor = 1, | ||
21 | .min_baud = 0, | ||
22 | .max_baud = 0, | ||
23 | }, | ||
24 | }; | ||
25 | |||
26 | /* uart registration process */ | 17 | /* uart registration process */ |
27 | void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 18 | void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
28 | { | 19 | { |
29 | struct s3c2410_uartcfg *tcfg = cfg; | 20 | struct s3c2410_uartcfg *tcfg = cfg; |
30 | u32 ucnt; | 21 | u32 ucnt; |
31 | 22 | ||
32 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | 23 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) |
33 | if (!tcfg->clocks) { | 24 | tcfg->has_fracval = 1; |
34 | tcfg->has_fracval = 1; | ||
35 | tcfg->clocks = exynos4_serial_clocks; | ||
36 | tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks); | ||
37 | } | ||
38 | tcfg->flags |= NO_NEED_CHECK_CLKSRC; | ||
39 | } | ||
40 | 25 | ||
41 | s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); | 26 | s3c24xx_init_uartdevs("exynos4210-uart", s5p_uart_resources, cfg, no); |
42 | } | 27 | } |
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c new file mode 100644 index 000000000000..85fa02767d67 --- /dev/null +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Samsung's Exynos4210 flattened device tree enabled machine | ||
3 | * | ||
4 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
5 | * http://www.samsung.com | ||
6 | * Copyright (c) 2010-2011 Linaro Ltd. | ||
7 | * www.linaro.org | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/of_platform.h> | ||
15 | #include <linux/serial_core.h> | ||
16 | |||
17 | #include <asm/mach/arch.h> | ||
18 | #include <mach/map.h> | ||
19 | |||
20 | #include <plat/cpu.h> | ||
21 | #include <plat/regs-serial.h> | ||
22 | #include <plat/exynos4.h> | ||
23 | |||
24 | /* | ||
25 | * The following lookup table is used to override device names when devices | ||
26 | * are registered from device tree. This is temporarily added to enable | ||
27 | * device tree support addition for the Exynos4 architecture. | ||
28 | * | ||
29 | * For drivers that require platform data to be provided from the machine | ||
30 | * file, a platform data pointer can also be supplied along with the | ||
31 | * devices names. Usually, the platform data elements that cannot be parsed | ||
32 | * from the device tree by the drivers (example: function pointers) are | ||
33 | * supplied. But it should be noted that this is a temporary mechanism and | ||
34 | * at some point, the drivers should be capable of parsing all the platform | ||
35 | * data from the device tree. | ||
36 | */ | ||
37 | static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = { | ||
38 | OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART0, | ||
39 | "exynos4210-uart.0", NULL), | ||
40 | OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART1, | ||
41 | "exynos4210-uart.1", NULL), | ||
42 | OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART2, | ||
43 | "exynos4210-uart.2", NULL), | ||
44 | OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART3, | ||
45 | "exynos4210-uart.3", NULL), | ||
46 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0), | ||
47 | "exynos4-sdhci.0", NULL), | ||
48 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1), | ||
49 | "exynos4-sdhci.1", NULL), | ||
50 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2), | ||
51 | "exynos4-sdhci.2", NULL), | ||
52 | OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3), | ||
53 | "exynos4-sdhci.3", NULL), | ||
54 | OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0), | ||
55 | "s3c2440-i2c.0", NULL), | ||
56 | OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL), | ||
57 | OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL), | ||
58 | {}, | ||
59 | }; | ||
60 | |||
61 | static void __init exynos4210_dt_map_io(void) | ||
62 | { | ||
63 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | ||
64 | s3c24xx_init_clocks(24000000); | ||
65 | } | ||
66 | |||
67 | static void __init exynos4210_dt_machine_init(void) | ||
68 | { | ||
69 | of_platform_populate(NULL, of_default_bus_match_table, | ||
70 | exynos4210_auxdata_lookup, NULL); | ||
71 | } | ||
72 | |||
73 | static char const *exynos4210_dt_compat[] __initdata = { | ||
74 | "samsung,exynos4210", | ||
75 | NULL | ||
76 | }; | ||
77 | |||
78 | DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | ||
79 | /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ | ||
80 | .init_irq = exynos4_init_irq, | ||
81 | .map_io = exynos4210_dt_map_io, | ||
82 | .init_machine = exynos4210_dt_machine_init, | ||
83 | .timer = &exynos4_timer, | ||
84 | .dt_compat = exynos4210_dt_compat, | ||
85 | MACHINE_END | ||
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index a20ae1ad4062..71b955877793 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c | |||
@@ -164,22 +164,6 @@ static struct map_desc bast_iodesc[] __initdata = { | |||
164 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | 164 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
165 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | 165 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
166 | 166 | ||
167 | static struct s3c24xx_uart_clksrc bast_serial_clocks[] = { | ||
168 | [0] = { | ||
169 | .name = "uclk", | ||
170 | .divisor = 1, | ||
171 | .min_baud = 0, | ||
172 | .max_baud = 0, | ||
173 | }, | ||
174 | [1] = { | ||
175 | .name = "pclk", | ||
176 | .divisor = 1, | ||
177 | .min_baud = 0, | ||
178 | .max_baud = 0, | ||
179 | } | ||
180 | }; | ||
181 | |||
182 | |||
183 | static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | 167 | static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { |
184 | [0] = { | 168 | [0] = { |
185 | .hwport = 0, | 169 | .hwport = 0, |
@@ -187,8 +171,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | |||
187 | .ucon = UCON, | 171 | .ucon = UCON, |
188 | .ulcon = ULCON, | 172 | .ulcon = ULCON, |
189 | .ufcon = UFCON, | 173 | .ufcon = UFCON, |
190 | .clocks = bast_serial_clocks, | ||
191 | .clocks_size = ARRAY_SIZE(bast_serial_clocks), | ||
192 | }, | 174 | }, |
193 | [1] = { | 175 | [1] = { |
194 | .hwport = 1, | 176 | .hwport = 1, |
@@ -196,8 +178,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | |||
196 | .ucon = UCON, | 178 | .ucon = UCON, |
197 | .ulcon = ULCON, | 179 | .ulcon = ULCON, |
198 | .ufcon = UFCON, | 180 | .ufcon = UFCON, |
199 | .clocks = bast_serial_clocks, | ||
200 | .clocks_size = ARRAY_SIZE(bast_serial_clocks), | ||
201 | }, | 181 | }, |
202 | /* port 2 is not actually used */ | 182 | /* port 2 is not actually used */ |
203 | [2] = { | 183 | [2] = { |
@@ -206,8 +186,6 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | |||
206 | .ucon = UCON, | 186 | .ucon = UCON, |
207 | .ulcon = ULCON, | 187 | .ulcon = ULCON, |
208 | .ufcon = UFCON, | 188 | .ufcon = UFCON, |
209 | .clocks = bast_serial_clocks, | ||
210 | .clocks_size = ARRAY_SIZE(bast_serial_clocks), | ||
211 | } | 189 | } |
212 | }; | 190 | }; |
213 | 191 | ||
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c index df47e8e90065..0f0a9a1795e9 100644 --- a/arch/arm/mach-s3c2410/mach-vr1000.c +++ b/arch/arm/mach-s3c2410/mach-vr1000.c | |||
@@ -109,23 +109,6 @@ static struct map_desc vr1000_iodesc[] __initdata = { | |||
109 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | 109 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
110 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | 110 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
111 | 111 | ||
112 | /* uart clock source(s) */ | ||
113 | |||
114 | static struct s3c24xx_uart_clksrc vr1000_serial_clocks[] = { | ||
115 | [0] = { | ||
116 | .name = "uclk", | ||
117 | .divisor = 1, | ||
118 | .min_baud = 0, | ||
119 | .max_baud = 0, | ||
120 | }, | ||
121 | [1] = { | ||
122 | .name = "pclk", | ||
123 | .divisor = 1, | ||
124 | .min_baud = 0, | ||
125 | .max_baud = 0. | ||
126 | } | ||
127 | }; | ||
128 | |||
129 | static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { | 112 | static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { |
130 | [0] = { | 113 | [0] = { |
131 | .hwport = 0, | 114 | .hwport = 0, |
@@ -133,8 +116,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { | |||
133 | .ucon = UCON, | 116 | .ucon = UCON, |
134 | .ulcon = ULCON, | 117 | .ulcon = ULCON, |
135 | .ufcon = UFCON, | 118 | .ufcon = UFCON, |
136 | .clocks = vr1000_serial_clocks, | ||
137 | .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), | ||
138 | }, | 119 | }, |
139 | [1] = { | 120 | [1] = { |
140 | .hwport = 1, | 121 | .hwport = 1, |
@@ -142,8 +123,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { | |||
142 | .ucon = UCON, | 123 | .ucon = UCON, |
143 | .ulcon = ULCON, | 124 | .ulcon = ULCON, |
144 | .ufcon = UFCON, | 125 | .ufcon = UFCON, |
145 | .clocks = vr1000_serial_clocks, | ||
146 | .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), | ||
147 | }, | 126 | }, |
148 | /* port 2 is not actually used */ | 127 | /* port 2 is not actually used */ |
149 | [2] = { | 128 | [2] = { |
@@ -152,9 +131,6 @@ static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { | |||
152 | .ucon = UCON, | 131 | .ucon = UCON, |
153 | .ulcon = ULCON, | 132 | .ulcon = ULCON, |
154 | .ufcon = UFCON, | 133 | .ufcon = UFCON, |
155 | .clocks = vr1000_serial_clocks, | ||
156 | .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), | ||
157 | |||
158 | } | 134 | } |
159 | }; | 135 | }; |
160 | 136 | ||
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index 3d7ebc557a72..af74927bca14 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c | |||
@@ -123,12 +123,18 @@ static struct clk s3c2410_armclk = { | |||
123 | .id = -1, | 123 | .id = -1, |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static struct clk_lookup s3c2410_clk_lookup[] = { | ||
127 | CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), | ||
128 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), | ||
129 | }; | ||
130 | |||
126 | void __init s3c2410_init_clocks(int xtal) | 131 | void __init s3c2410_init_clocks(int xtal) |
127 | { | 132 | { |
128 | s3c24xx_register_baseclocks(xtal); | 133 | s3c24xx_register_baseclocks(xtal); |
129 | s3c2410_setup_clocks(); | 134 | s3c2410_setup_clocks(); |
130 | s3c2410_baseclk_add(); | 135 | s3c2410_baseclk_add(); |
131 | s3c24xx_register_clock(&s3c2410_armclk); | 136 | s3c24xx_register_clock(&s3c2410_armclk); |
137 | clkdev_add_table(s3c2410_clk_lookup, ARRAY_SIZE(s3c2410_clk_lookup)); | ||
132 | } | 138 | } |
133 | 139 | ||
134 | struct sysdev_class s3c2410_sysclass = { | 140 | struct sysdev_class s3c2410_sysclass = { |
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c index 140711db6c89..cd50291931f7 100644 --- a/arch/arm/mach-s3c2412/clock.c +++ b/arch/arm/mach-s3c2412/clock.c | |||
@@ -659,6 +659,12 @@ static struct clk *clks[] __initdata = { | |||
659 | &clk_armclk, | 659 | &clk_armclk, |
660 | }; | 660 | }; |
661 | 661 | ||
662 | static struct clk_lookup s3c2412_clk_lookup[] = { | ||
663 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), | ||
664 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | ||
665 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_usysclk), | ||
666 | }; | ||
667 | |||
662 | int __init s3c2412_baseclk_add(void) | 668 | int __init s3c2412_baseclk_add(void) |
663 | { | 669 | { |
664 | unsigned long clkcon = __raw_readl(S3C2410_CLKCON); | 670 | unsigned long clkcon = __raw_readl(S3C2410_CLKCON); |
@@ -751,6 +757,7 @@ int __init s3c2412_baseclk_add(void) | |||
751 | s3c2412_clkcon_enable(clkp, 0); | 757 | s3c2412_clkcon_enable(clkp, 0); |
752 | } | 758 | } |
753 | 759 | ||
760 | clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup)); | ||
754 | s3c_pwmclk_init(); | 761 | s3c_pwmclk_init(); |
755 | return 0; | 762 | return 0; |
756 | } | 763 | } |
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c index f9e6bdaf41d2..c9879af42b08 100644 --- a/arch/arm/mach-s3c2440/clock.c +++ b/arch/arm/mach-s3c2440/clock.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/clk.h> | 35 | #include <linux/clk.h> |
36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
37 | #include <linux/serial_core.h> | ||
37 | 38 | ||
38 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
39 | #include <linux/atomic.h> | 40 | #include <linux/atomic.h> |
@@ -43,6 +44,7 @@ | |||
43 | 44 | ||
44 | #include <plat/clock.h> | 45 | #include <plat/clock.h> |
45 | #include <plat/cpu.h> | 46 | #include <plat/cpu.h> |
47 | #include <plat/regs-serial.h> | ||
46 | 48 | ||
47 | /* S3C2440 extended clock support */ | 49 | /* S3C2440 extended clock support */ |
48 | 50 | ||
@@ -108,6 +110,46 @@ static struct clk s3c2440_clk_ac97 = { | |||
108 | .ctrlbit = S3C2440_CLKCON_CAMERA, | 110 | .ctrlbit = S3C2440_CLKCON_CAMERA, |
109 | }; | 111 | }; |
110 | 112 | ||
113 | static unsigned long s3c2440_fclk_n_getrate(struct clk *clk) | ||
114 | { | ||
115 | unsigned long ucon0, ucon1, ucon2, divisor; | ||
116 | |||
117 | /* the fun of calculating the uart divisors on the s3c2440 */ | ||
118 | ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON); | ||
119 | ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON); | ||
120 | ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON); | ||
121 | |||
122 | ucon0 &= S3C2440_UCON0_DIVMASK; | ||
123 | ucon1 &= S3C2440_UCON1_DIVMASK; | ||
124 | ucon2 &= S3C2440_UCON2_DIVMASK; | ||
125 | |||
126 | if (ucon0 != 0) | ||
127 | divisor = (ucon0 >> S3C2440_UCON_DIVSHIFT) + 6; | ||
128 | else if (ucon1 != 0) | ||
129 | divisor = (ucon1 >> S3C2440_UCON_DIVSHIFT) + 21; | ||
130 | else if (ucon2 != 0) | ||
131 | divisor = (ucon2 >> S3C2440_UCON_DIVSHIFT) + 36; | ||
132 | else | ||
133 | /* manual calims 44, seems to be 9 */ | ||
134 | divisor = 9; | ||
135 | |||
136 | return clk_get_rate(clk->parent) / divisor; | ||
137 | } | ||
138 | |||
139 | static struct clk s3c2440_clk_fclk_n = { | ||
140 | .name = "fclk_n", | ||
141 | .parent = &clk_f, | ||
142 | .ops = &(struct clk_ops) { | ||
143 | .get_rate = s3c2440_fclk_n_getrate, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct clk_lookup s3c2440_clk_lookup[] = { | ||
148 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), | ||
149 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | ||
150 | CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), | ||
151 | }; | ||
152 | |||
111 | static int s3c2440_clk_add(struct sys_device *sysdev) | 153 | static int s3c2440_clk_add(struct sys_device *sysdev) |
112 | { | 154 | { |
113 | struct clk *clock_upll; | 155 | struct clk *clock_upll; |
@@ -126,10 +168,12 @@ static int s3c2440_clk_add(struct sys_device *sysdev) | |||
126 | s3c2440_clk_cam.parent = clock_h; | 168 | s3c2440_clk_cam.parent = clock_h; |
127 | s3c2440_clk_ac97.parent = clock_p; | 169 | s3c2440_clk_ac97.parent = clock_p; |
128 | s3c2440_clk_cam_upll.parent = clock_upll; | 170 | s3c2440_clk_cam_upll.parent = clock_upll; |
171 | s3c24xx_register_clock(&s3c2440_clk_fclk_n); | ||
129 | 172 | ||
130 | s3c24xx_register_clock(&s3c2440_clk_ac97); | 173 | s3c24xx_register_clock(&s3c2440_clk_ac97); |
131 | s3c24xx_register_clock(&s3c2440_clk_cam); | 174 | s3c24xx_register_clock(&s3c2440_clk_cam); |
132 | s3c24xx_register_clock(&s3c2440_clk_cam_upll); | 175 | s3c24xx_register_clock(&s3c2440_clk_cam_upll); |
176 | clkdev_add_table(s3c2440_clk_lookup, ARRAY_SIZE(s3c2440_clk_lookup)); | ||
133 | 177 | ||
134 | clk_disable(&s3c2440_clk_ac97); | 178 | clk_disable(&s3c2440_clk_ac97); |
135 | clk_disable(&s3c2440_clk_cam); | 179 | clk_disable(&s3c2440_clk_cam); |
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c index 74f92fc3fd04..d8f36c0a16ad 100644 --- a/arch/arm/mach-s3c2440/mach-anubis.c +++ b/arch/arm/mach-s3c2440/mach-anubis.c | |||
@@ -96,22 +96,6 @@ static struct map_desc anubis_iodesc[] __initdata = { | |||
96 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | 96 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
97 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | 97 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
98 | 98 | ||
99 | static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = { | ||
100 | [0] = { | ||
101 | .name = "uclk", | ||
102 | .divisor = 1, | ||
103 | .min_baud = 0, | ||
104 | .max_baud = 0, | ||
105 | }, | ||
106 | [1] = { | ||
107 | .name = "pclk", | ||
108 | .divisor = 1, | ||
109 | .min_baud = 0, | ||
110 | .max_baud = 0, | ||
111 | } | ||
112 | }; | ||
113 | |||
114 | |||
115 | static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = { | 99 | static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = { |
116 | [0] = { | 100 | [0] = { |
117 | .hwport = 0, | 101 | .hwport = 0, |
@@ -119,8 +103,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = { | |||
119 | .ucon = UCON, | 103 | .ucon = UCON, |
120 | .ulcon = ULCON, | 104 | .ulcon = ULCON, |
121 | .ufcon = UFCON, | 105 | .ufcon = UFCON, |
122 | .clocks = anubis_serial_clocks, | 106 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
123 | .clocks_size = ARRAY_SIZE(anubis_serial_clocks), | ||
124 | }, | 107 | }, |
125 | [1] = { | 108 | [1] = { |
126 | .hwport = 2, | 109 | .hwport = 2, |
@@ -128,8 +111,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = { | |||
128 | .ucon = UCON, | 111 | .ucon = UCON, |
129 | .ulcon = ULCON, | 112 | .ulcon = ULCON, |
130 | .ufcon = UFCON, | 113 | .ufcon = UFCON, |
131 | .clocks = anubis_serial_clocks, | 114 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
132 | .clocks_size = ARRAY_SIZE(anubis_serial_clocks), | ||
133 | }, | 115 | }, |
134 | }; | 116 | }; |
135 | 117 | ||
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c index 38887ee0c784..aa86ca8fa1e9 100644 --- a/arch/arm/mach-s3c2440/mach-at2440evb.c +++ b/arch/arm/mach-s3c2440/mach-at2440evb.c | |||
@@ -57,22 +57,6 @@ static struct map_desc at2440evb_iodesc[] __initdata = { | |||
57 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) | 57 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) |
58 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) | 58 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) |
59 | 59 | ||
60 | static struct s3c24xx_uart_clksrc at2440evb_serial_clocks[] = { | ||
61 | [0] = { | ||
62 | .name = "uclk", | ||
63 | .divisor = 1, | ||
64 | .min_baud = 0, | ||
65 | .max_baud = 0, | ||
66 | }, | ||
67 | [1] = { | ||
68 | .name = "pclk", | ||
69 | .divisor = 1, | ||
70 | .min_baud = 0, | ||
71 | .max_baud = 0, | ||
72 | } | ||
73 | }; | ||
74 | |||
75 | |||
76 | static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { | 60 | static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { |
77 | [0] = { | 61 | [0] = { |
78 | .hwport = 0, | 62 | .hwport = 0, |
@@ -80,8 +64,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { | |||
80 | .ucon = UCON, | 64 | .ucon = UCON, |
81 | .ulcon = ULCON, | 65 | .ulcon = ULCON, |
82 | .ufcon = UFCON, | 66 | .ufcon = UFCON, |
83 | .clocks = at2440evb_serial_clocks, | 67 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
84 | .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks), | ||
85 | }, | 68 | }, |
86 | [1] = { | 69 | [1] = { |
87 | .hwport = 1, | 70 | .hwport = 1, |
@@ -89,8 +72,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { | |||
89 | .ucon = UCON, | 72 | .ucon = UCON, |
90 | .ulcon = ULCON, | 73 | .ulcon = ULCON, |
91 | .ufcon = UFCON, | 74 | .ufcon = UFCON, |
92 | .clocks = at2440evb_serial_clocks, | 75 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
93 | .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks), | ||
94 | }, | 76 | }, |
95 | }; | 77 | }; |
96 | 78 | ||
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index dc142ebf8cba..d7e47b2b6ec9 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -100,21 +100,6 @@ static struct map_desc osiris_iodesc[] __initdata = { | |||
100 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB | 100 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
101 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | 101 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
102 | 102 | ||
103 | static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = { | ||
104 | [0] = { | ||
105 | .name = "uclk", | ||
106 | .divisor = 1, | ||
107 | .min_baud = 0, | ||
108 | .max_baud = 0, | ||
109 | }, | ||
110 | [1] = { | ||
111 | .name = "pclk", | ||
112 | .divisor = 1, | ||
113 | .min_baud = 0, | ||
114 | .max_baud = 0, | ||
115 | } | ||
116 | }; | ||
117 | |||
118 | static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { | 103 | static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { |
119 | [0] = { | 104 | [0] = { |
120 | .hwport = 0, | 105 | .hwport = 0, |
@@ -122,8 +107,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { | |||
122 | .ucon = UCON, | 107 | .ucon = UCON, |
123 | .ulcon = ULCON, | 108 | .ulcon = ULCON, |
124 | .ufcon = UFCON, | 109 | .ufcon = UFCON, |
125 | .clocks = osiris_serial_clocks, | 110 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
126 | .clocks_size = ARRAY_SIZE(osiris_serial_clocks), | ||
127 | }, | 111 | }, |
128 | [1] = { | 112 | [1] = { |
129 | .hwport = 1, | 113 | .hwport = 1, |
@@ -131,8 +115,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { | |||
131 | .ucon = UCON, | 115 | .ucon = UCON, |
132 | .ulcon = ULCON, | 116 | .ulcon = ULCON, |
133 | .ufcon = UFCON, | 117 | .ufcon = UFCON, |
134 | .clocks = osiris_serial_clocks, | 118 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
135 | .clocks_size = ARRAY_SIZE(osiris_serial_clocks), | ||
136 | }, | 119 | }, |
137 | [2] = { | 120 | [2] = { |
138 | .hwport = 2, | 121 | .hwport = 2, |
@@ -140,8 +123,7 @@ static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { | |||
140 | .ucon = UCON, | 123 | .ucon = UCON, |
141 | .ulcon = ULCON, | 124 | .ulcon = ULCON, |
142 | .ufcon = UFCON, | 125 | .ufcon = UFCON, |
143 | .clocks = osiris_serial_clocks, | 126 | .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, |
144 | .clocks_size = ARRAY_SIZE(osiris_serial_clocks), | ||
145 | } | 127 | } |
146 | }; | 128 | }; |
147 | 129 | ||
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c index 0d3453bf567c..4267cd56bfe7 100644 --- a/arch/arm/mach-s3c2440/mach-rx1950.c +++ b/arch/arm/mach-s3c2440/mach-rx1950.c | |||
@@ -68,15 +68,6 @@ | |||
68 | static struct map_desc rx1950_iodesc[] __initdata = { | 68 | static struct map_desc rx1950_iodesc[] __initdata = { |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct s3c24xx_uart_clksrc rx1950_serial_clocks[] = { | ||
72 | [0] = { | ||
73 | .name = "fclk", | ||
74 | .divisor = 0x0a, | ||
75 | .min_baud = 0, | ||
76 | .max_baud = 0, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { | 71 | static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { |
81 | [0] = { | 72 | [0] = { |
82 | .hwport = 0, | 73 | .hwport = 0, |
@@ -84,8 +75,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { | |||
84 | .ucon = 0x3c5, | 75 | .ucon = 0x3c5, |
85 | .ulcon = 0x03, | 76 | .ulcon = 0x03, |
86 | .ufcon = 0x51, | 77 | .ufcon = 0x51, |
87 | .clocks = rx1950_serial_clocks, | 78 | .clk_sel = S3C2410_UCON_CLKSEL3, |
88 | .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), | ||
89 | }, | 79 | }, |
90 | [1] = { | 80 | [1] = { |
91 | .hwport = 1, | 81 | .hwport = 1, |
@@ -93,8 +83,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { | |||
93 | .ucon = 0x3c5, | 83 | .ucon = 0x3c5, |
94 | .ulcon = 0x03, | 84 | .ulcon = 0x03, |
95 | .ufcon = 0x51, | 85 | .ufcon = 0x51, |
96 | .clocks = rx1950_serial_clocks, | 86 | .clk_sel = S3C2410_UCON_CLKSEL3, |
97 | .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), | ||
98 | }, | 87 | }, |
99 | /* IR port */ | 88 | /* IR port */ |
100 | [2] = { | 89 | [2] = { |
@@ -103,8 +92,7 @@ static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { | |||
103 | .ucon = 0x3c5, | 92 | .ucon = 0x3c5, |
104 | .ulcon = 0x43, | 93 | .ulcon = 0x43, |
105 | .ufcon = 0xf1, | 94 | .ufcon = 0xf1, |
106 | .clocks = rx1950_serial_clocks, | 95 | .clk_sel = S3C2410_UCON_CLKSEL3, |
107 | .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), | ||
108 | }, | 96 | }, |
109 | }; | 97 | }; |
110 | 98 | ||
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c index e19499c2f909..3d5e2e67971e 100644 --- a/arch/arm/mach-s3c2440/mach-rx3715.c +++ b/arch/arm/mach-s3c2440/mach-rx3715.c | |||
@@ -67,16 +67,6 @@ static struct map_desc rx3715_iodesc[] __initdata = { | |||
67 | }, | 67 | }, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | |||
71 | static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = { | ||
72 | [0] = { | ||
73 | .name = "fclk", | ||
74 | .divisor = 0, | ||
75 | .min_baud = 0, | ||
76 | .max_baud = 0, | ||
77 | } | ||
78 | }; | ||
79 | |||
80 | static struct s3c2410_uartcfg rx3715_uartcfgs[] = { | 70 | static struct s3c2410_uartcfg rx3715_uartcfgs[] = { |
81 | [0] = { | 71 | [0] = { |
82 | .hwport = 0, | 72 | .hwport = 0, |
@@ -84,8 +74,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = { | |||
84 | .ucon = 0x3c5, | 74 | .ucon = 0x3c5, |
85 | .ulcon = 0x03, | 75 | .ulcon = 0x03, |
86 | .ufcon = 0x51, | 76 | .ufcon = 0x51, |
87 | .clocks = rx3715_serial_clocks, | 77 | .clk_sel = S3C2410_UCON_CLKSEL3, |
88 | .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), | ||
89 | }, | 78 | }, |
90 | [1] = { | 79 | [1] = { |
91 | .hwport = 1, | 80 | .hwport = 1, |
@@ -93,8 +82,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = { | |||
93 | .ucon = 0x3c5, | 82 | .ucon = 0x3c5, |
94 | .ulcon = 0x03, | 83 | .ulcon = 0x03, |
95 | .ufcon = 0x00, | 84 | .ufcon = 0x00, |
96 | .clocks = rx3715_serial_clocks, | 85 | .clk_sel = S3C2410_UCON_CLKSEL3, |
97 | .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), | ||
98 | }, | 86 | }, |
99 | /* IR port */ | 87 | /* IR port */ |
100 | [2] = { | 88 | [2] = { |
@@ -103,8 +91,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = { | |||
103 | .ucon = 0x3c5, | 91 | .ucon = 0x3c5, |
104 | .ulcon = 0x43, | 92 | .ulcon = 0x43, |
105 | .ufcon = 0x51, | 93 | .ufcon = 0x51, |
106 | .clocks = rx3715_serial_clocks, | 94 | .clk_sel = S3C2410_UCON_CLKSEL3, |
107 | .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), | ||
108 | } | 95 | } |
109 | }; | 96 | }; |
110 | 97 | ||
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c index 39c238d7a3dc..2addd988141c 100644 --- a/arch/arm/mach-s3c64xx/clock.c +++ b/arch/arm/mach-s3c64xx/clock.c | |||
@@ -617,16 +617,6 @@ static struct clksrc_clk clksrcs[] = { | |||
617 | .sources = &clkset_uhost, | 617 | .sources = &clkset_uhost, |
618 | }, { | 618 | }, { |
619 | .clk = { | 619 | .clk = { |
620 | .name = "uclk1", | ||
621 | .ctrlbit = S3C_CLKCON_SCLK_UART, | ||
622 | .enable = s3c64xx_sclk_ctrl, | ||
623 | }, | ||
624 | .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 }, | ||
625 | .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 }, | ||
626 | .sources = &clkset_uart, | ||
627 | }, { | ||
628 | /* Where does UCLK0 come from? */ | ||
629 | .clk = { | ||
630 | .name = "spi-bus", | 620 | .name = "spi-bus", |
631 | .devname = "s3c64xx-spi.0", | 621 | .devname = "s3c64xx-spi.0", |
632 | .ctrlbit = S3C_CLKCON_SCLK_SPI0, | 622 | .ctrlbit = S3C_CLKCON_SCLK_SPI0, |
@@ -695,6 +685,18 @@ static struct clksrc_clk clksrcs[] = { | |||
695 | }, | 685 | }, |
696 | }; | 686 | }; |
697 | 687 | ||
688 | /* Where does UCLK0 come from? */ | ||
689 | static struct clksrc_clk clk_sclk_uclk = { | ||
690 | .clk = { | ||
691 | .name = "uclk1", | ||
692 | .ctrlbit = S3C_CLKCON_SCLK_UART, | ||
693 | .enable = s3c64xx_sclk_ctrl, | ||
694 | }, | ||
695 | .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 }, | ||
696 | .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 }, | ||
697 | .sources = &clkset_uart, | ||
698 | }; | ||
699 | |||
698 | /* Clock initialisation code */ | 700 | /* Clock initialisation code */ |
699 | 701 | ||
700 | static struct clksrc_clk *init_parents[] = { | 702 | static struct clksrc_clk *init_parents[] = { |
@@ -703,6 +705,15 @@ static struct clksrc_clk *init_parents[] = { | |||
703 | &clk_mout_mpll, | 705 | &clk_mout_mpll, |
704 | }; | 706 | }; |
705 | 707 | ||
708 | static struct clksrc_clk *clksrc_cdev[] = { | ||
709 | &clk_sclk_uclk, | ||
710 | }; | ||
711 | |||
712 | static struct clk_lookup s3c64xx_clk_lookup[] = { | ||
713 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | ||
714 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), | ||
715 | }; | ||
716 | |||
706 | #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) | 717 | #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) |
707 | 718 | ||
708 | void __init_or_cpufreq s3c6400_setup_clocks(void) | 719 | void __init_or_cpufreq s3c6400_setup_clocks(void) |
@@ -811,6 +822,8 @@ static struct clk *clks[] __initdata = { | |||
811 | void __init s3c64xx_register_clocks(unsigned long xtal, | 822 | void __init s3c64xx_register_clocks(unsigned long xtal, |
812 | unsigned armclk_divlimit) | 823 | unsigned armclk_divlimit) |
813 | { | 824 | { |
825 | unsigned int cnt; | ||
826 | |||
814 | armclk_mask = armclk_divlimit; | 827 | armclk_mask = armclk_divlimit; |
815 | 828 | ||
816 | s3c24xx_register_baseclocks(xtal); | 829 | s3c24xx_register_baseclocks(xtal); |
@@ -823,5 +836,9 @@ void __init s3c64xx_register_clocks(unsigned long xtal, | |||
823 | 836 | ||
824 | s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); | 837 | s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); |
825 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 838 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
839 | for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++) | ||
840 | s3c_register_clksrc(clksrc_cdev[cnt], 1); | ||
841 | clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup)); | ||
842 | |||
826 | s3c_pwmclk_init(); | 843 | s3c_pwmclk_init(); |
827 | } | 844 | } |
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c index c54c65d511f0..bfb1917ad0da 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6440.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c | |||
@@ -421,15 +421,6 @@ static struct clksrc_clk clksrcs[] = { | |||
421 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | 421 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, |
422 | }, { | 422 | }, { |
423 | .clk = { | 423 | .clk = { |
424 | .name = "uclk1", | ||
425 | .ctrlbit = (1 << 5), | ||
426 | .enable = s5p64x0_sclk_ctrl, | ||
427 | }, | ||
428 | .sources = &clkset_uart, | ||
429 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
430 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
431 | }, { | ||
432 | .clk = { | ||
433 | .name = "sclk_spi", | 424 | .name = "sclk_spi", |
434 | .devname = "s3c64xx-spi.0", | 425 | .devname = "s3c64xx-spi.0", |
435 | .ctrlbit = (1 << 20), | 426 | .ctrlbit = (1 << 20), |
@@ -487,6 +478,17 @@ static struct clksrc_clk clksrcs[] = { | |||
487 | }, | 478 | }, |
488 | }; | 479 | }; |
489 | 480 | ||
481 | static struct clksrc_clk clk_sclk_uclk = { | ||
482 | .clk = { | ||
483 | .name = "uclk1", | ||
484 | .ctrlbit = (1 << 5), | ||
485 | .enable = s5p64x0_sclk_ctrl, | ||
486 | }, | ||
487 | .sources = &clkset_uart, | ||
488 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
489 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
490 | }; | ||
491 | |||
490 | /* Clock initialization code */ | 492 | /* Clock initialization code */ |
491 | static struct clksrc_clk *sysclks[] = { | 493 | static struct clksrc_clk *sysclks[] = { |
492 | &clk_mout_apll, | 494 | &clk_mout_apll, |
@@ -505,6 +507,15 @@ static struct clk dummy_apb_pclk = { | |||
505 | .id = -1, | 507 | .id = -1, |
506 | }; | 508 | }; |
507 | 509 | ||
510 | static struct clksrc_clk *clksrc_cdev[] = { | ||
511 | &clk_sclk_uclk, | ||
512 | }; | ||
513 | |||
514 | static struct clk_lookup s5p6440_clk_lookup[] = { | ||
515 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk), | ||
516 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), | ||
517 | }; | ||
518 | |||
508 | void __init_or_cpufreq s5p6440_setup_clocks(void) | 519 | void __init_or_cpufreq s5p6440_setup_clocks(void) |
509 | { | 520 | { |
510 | struct clk *xtal_clk; | 521 | struct clk *xtal_clk; |
@@ -583,9 +594,12 @@ void __init s5p6440_register_clocks(void) | |||
583 | 594 | ||
584 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 595 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
585 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 596 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
597 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
598 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
586 | 599 | ||
587 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 600 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
588 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 601 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
602 | clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup)); | ||
589 | 603 | ||
590 | s3c24xx_register_clock(&dummy_apb_pclk); | 604 | s3c24xx_register_clock(&dummy_apb_pclk); |
591 | 605 | ||
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c index 2d04abfba12e..d132638c7b23 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6450.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c | |||
@@ -443,15 +443,6 @@ static struct clksrc_clk clksrcs[] = { | |||
443 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | 443 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, |
444 | }, { | 444 | }, { |
445 | .clk = { | 445 | .clk = { |
446 | .name = "uclk1", | ||
447 | .ctrlbit = (1 << 5), | ||
448 | .enable = s5p64x0_sclk_ctrl, | ||
449 | }, | ||
450 | .sources = &clkset_uart, | ||
451 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
452 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
453 | }, { | ||
454 | .clk = { | ||
455 | .name = "sclk_spi", | 446 | .name = "sclk_spi", |
456 | .devname = "s3c64xx-spi.0", | 447 | .devname = "s3c64xx-spi.0", |
457 | .ctrlbit = (1 << 20), | 448 | .ctrlbit = (1 << 20), |
@@ -536,6 +527,26 @@ static struct clksrc_clk clksrcs[] = { | |||
536 | }, | 527 | }, |
537 | }; | 528 | }; |
538 | 529 | ||
530 | static struct clksrc_clk clk_sclk_uclk = { | ||
531 | .clk = { | ||
532 | .name = "uclk1", | ||
533 | .ctrlbit = (1 << 5), | ||
534 | .enable = s5p64x0_sclk_ctrl, | ||
535 | }, | ||
536 | .sources = &clkset_uart, | ||
537 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
538 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
539 | }; | ||
540 | |||
541 | static struct clksrc_clk *clksrc_cdev[] = { | ||
542 | &clk_sclk_uclk, | ||
543 | }; | ||
544 | |||
545 | static struct clk_lookup s5p6450_clk_lookup[] = { | ||
546 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk), | ||
547 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), | ||
548 | }; | ||
549 | |||
539 | /* Clock initialization code */ | 550 | /* Clock initialization code */ |
540 | static struct clksrc_clk *sysclks[] = { | 551 | static struct clksrc_clk *sysclks[] = { |
541 | &clk_mout_apll, | 552 | &clk_mout_apll, |
@@ -634,9 +645,12 @@ void __init s5p6450_register_clocks(void) | |||
634 | 645 | ||
635 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 646 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
636 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 647 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
648 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
649 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
637 | 650 | ||
638 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 651 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
639 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 652 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
653 | clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup)); | ||
640 | 654 | ||
641 | s3c24xx_register_clock(&dummy_apb_pclk); | 655 | s3c24xx_register_clock(&dummy_apb_pclk); |
642 | 656 | ||
diff --git a/arch/arm/mach-s5p64x0/dma.c b/arch/arm/mach-s5p64x0/dma.c index 442dd4ad12da..f820c0744405 100644 --- a/arch/arm/mach-s5p64x0/dma.c +++ b/arch/arm/mach-s5p64x0/dma.c | |||
@@ -38,176 +38,74 @@ | |||
38 | 38 | ||
39 | static u64 dma_dmamask = DMA_BIT_MASK(32); | 39 | static u64 dma_dmamask = DMA_BIT_MASK(32); |
40 | 40 | ||
41 | struct dma_pl330_peri s5p6440_pdma_peri[22] = { | 41 | u8 s5p6440_pdma_peri[] = { |
42 | { | 42 | DMACH_UART0_RX, |
43 | .peri_id = (u8)DMACH_UART0_RX, | 43 | DMACH_UART0_TX, |
44 | .rqtype = DEVTOMEM, | 44 | DMACH_UART1_RX, |
45 | }, { | 45 | DMACH_UART1_TX, |
46 | .peri_id = (u8)DMACH_UART0_TX, | 46 | DMACH_UART2_RX, |
47 | .rqtype = MEMTODEV, | 47 | DMACH_UART2_TX, |
48 | }, { | 48 | DMACH_UART3_RX, |
49 | .peri_id = (u8)DMACH_UART1_RX, | 49 | DMACH_UART3_TX, |
50 | .rqtype = DEVTOMEM, | 50 | DMACH_MAX, |
51 | }, { | 51 | DMACH_MAX, |
52 | .peri_id = (u8)DMACH_UART1_TX, | 52 | DMACH_PCM0_TX, |
53 | .rqtype = MEMTODEV, | 53 | DMACH_PCM0_RX, |
54 | }, { | 54 | DMACH_I2S0_TX, |
55 | .peri_id = (u8)DMACH_UART2_RX, | 55 | DMACH_I2S0_RX, |
56 | .rqtype = DEVTOMEM, | 56 | DMACH_SPI0_TX, |
57 | }, { | 57 | DMACH_SPI0_RX, |
58 | .peri_id = (u8)DMACH_UART2_TX, | 58 | DMACH_MAX, |
59 | .rqtype = MEMTODEV, | 59 | DMACH_MAX, |
60 | }, { | 60 | DMACH_MAX, |
61 | .peri_id = (u8)DMACH_UART3_RX, | 61 | DMACH_MAX, |
62 | .rqtype = DEVTOMEM, | 62 | DMACH_SPI1_TX, |
63 | }, { | 63 | DMACH_SPI1_RX, |
64 | .peri_id = (u8)DMACH_UART3_TX, | ||
65 | .rqtype = MEMTODEV, | ||
66 | }, { | ||
67 | .peri_id = DMACH_MAX, | ||
68 | }, { | ||
69 | .peri_id = DMACH_MAX, | ||
70 | }, { | ||
71 | .peri_id = (u8)DMACH_PCM0_TX, | ||
72 | .rqtype = MEMTODEV, | ||
73 | }, { | ||
74 | .peri_id = (u8)DMACH_PCM0_RX, | ||
75 | .rqtype = DEVTOMEM, | ||
76 | }, { | ||
77 | .peri_id = (u8)DMACH_I2S0_TX, | ||
78 | .rqtype = MEMTODEV, | ||
79 | }, { | ||
80 | .peri_id = (u8)DMACH_I2S0_RX, | ||
81 | .rqtype = DEVTOMEM, | ||
82 | }, { | ||
83 | .peri_id = (u8)DMACH_SPI0_TX, | ||
84 | .rqtype = MEMTODEV, | ||
85 | }, { | ||
86 | .peri_id = (u8)DMACH_SPI0_RX, | ||
87 | .rqtype = DEVTOMEM, | ||
88 | }, { | ||
89 | .peri_id = (u8)DMACH_MAX, | ||
90 | }, { | ||
91 | .peri_id = (u8)DMACH_MAX, | ||
92 | }, { | ||
93 | .peri_id = (u8)DMACH_MAX, | ||
94 | }, { | ||
95 | .peri_id = (u8)DMACH_MAX, | ||
96 | }, { | ||
97 | .peri_id = (u8)DMACH_SPI1_TX, | ||
98 | .rqtype = MEMTODEV, | ||
99 | }, { | ||
100 | .peri_id = (u8)DMACH_SPI1_RX, | ||
101 | .rqtype = DEVTOMEM, | ||
102 | }, | ||
103 | }; | 64 | }; |
104 | 65 | ||
105 | struct dma_pl330_platdata s5p6440_pdma_pdata = { | 66 | struct dma_pl330_platdata s5p6440_pdma_pdata = { |
106 | .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri), | 67 | .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri), |
107 | .peri = s5p6440_pdma_peri, | 68 | .peri_id = s5p6440_pdma_peri, |
108 | }; | 69 | }; |
109 | 70 | ||
110 | struct dma_pl330_peri s5p6450_pdma_peri[32] = { | 71 | u8 s5p6450_pdma_peri[] = { |
111 | { | 72 | DMACH_UART0_RX, |
112 | .peri_id = (u8)DMACH_UART0_RX, | 73 | DMACH_UART0_TX, |
113 | .rqtype = DEVTOMEM, | 74 | DMACH_UART1_RX, |
114 | }, { | 75 | DMACH_UART1_TX, |
115 | .peri_id = (u8)DMACH_UART0_TX, | 76 | DMACH_UART2_RX, |
116 | .rqtype = MEMTODEV, | 77 | DMACH_UART2_TX, |
117 | }, { | 78 | DMACH_UART3_RX, |
118 | .peri_id = (u8)DMACH_UART1_RX, | 79 | DMACH_UART3_TX, |
119 | .rqtype = DEVTOMEM, | 80 | DMACH_UART4_RX, |
120 | }, { | 81 | DMACH_UART4_TX, |
121 | .peri_id = (u8)DMACH_UART1_TX, | 82 | DMACH_PCM0_TX, |
122 | .rqtype = MEMTODEV, | 83 | DMACH_PCM0_RX, |
123 | }, { | 84 | DMACH_I2S0_TX, |
124 | .peri_id = (u8)DMACH_UART2_RX, | 85 | DMACH_I2S0_RX, |
125 | .rqtype = DEVTOMEM, | 86 | DMACH_SPI0_TX, |
126 | }, { | 87 | DMACH_SPI0_RX, |
127 | .peri_id = (u8)DMACH_UART2_TX, | 88 | DMACH_PCM1_TX, |
128 | .rqtype = MEMTODEV, | 89 | DMACH_PCM1_RX, |
129 | }, { | 90 | DMACH_PCM2_TX, |
130 | .peri_id = (u8)DMACH_UART3_RX, | 91 | DMACH_PCM2_RX, |
131 | .rqtype = DEVTOMEM, | 92 | DMACH_SPI1_TX, |
132 | }, { | 93 | DMACH_SPI1_RX, |
133 | .peri_id = (u8)DMACH_UART3_TX, | 94 | DMACH_USI_TX, |
134 | .rqtype = MEMTODEV, | 95 | DMACH_USI_RX, |
135 | }, { | 96 | DMACH_MAX, |
136 | .peri_id = (u8)DMACH_UART4_RX, | 97 | DMACH_I2S1_TX, |
137 | .rqtype = DEVTOMEM, | 98 | DMACH_I2S1_RX, |
138 | }, { | 99 | DMACH_I2S2_TX, |
139 | .peri_id = (u8)DMACH_UART4_TX, | 100 | DMACH_I2S2_RX, |
140 | .rqtype = MEMTODEV, | 101 | DMACH_PWM, |
141 | }, { | 102 | DMACH_UART5_RX, |
142 | .peri_id = (u8)DMACH_PCM0_TX, | 103 | DMACH_UART5_TX, |
143 | .rqtype = MEMTODEV, | ||
144 | }, { | ||
145 | .peri_id = (u8)DMACH_PCM0_RX, | ||
146 | .rqtype = DEVTOMEM, | ||
147 | }, { | ||
148 | .peri_id = (u8)DMACH_I2S0_TX, | ||
149 | .rqtype = MEMTODEV, | ||
150 | }, { | ||
151 | .peri_id = (u8)DMACH_I2S0_RX, | ||
152 | .rqtype = DEVTOMEM, | ||
153 | }, { | ||
154 | .peri_id = (u8)DMACH_SPI0_TX, | ||
155 | .rqtype = MEMTODEV, | ||
156 | }, { | ||
157 | .peri_id = (u8)DMACH_SPI0_RX, | ||
158 | .rqtype = DEVTOMEM, | ||
159 | }, { | ||
160 | .peri_id = (u8)DMACH_PCM1_TX, | ||
161 | .rqtype = MEMTODEV, | ||
162 | }, { | ||
163 | .peri_id = (u8)DMACH_PCM1_RX, | ||
164 | .rqtype = DEVTOMEM, | ||
165 | }, { | ||
166 | .peri_id = (u8)DMACH_PCM2_TX, | ||
167 | .rqtype = MEMTODEV, | ||
168 | }, { | ||
169 | .peri_id = (u8)DMACH_PCM2_RX, | ||
170 | .rqtype = DEVTOMEM, | ||
171 | }, { | ||
172 | .peri_id = (u8)DMACH_SPI1_TX, | ||
173 | .rqtype = MEMTODEV, | ||
174 | }, { | ||
175 | .peri_id = (u8)DMACH_SPI1_RX, | ||
176 | .rqtype = DEVTOMEM, | ||
177 | }, { | ||
178 | .peri_id = (u8)DMACH_USI_TX, | ||
179 | .rqtype = MEMTODEV, | ||
180 | }, { | ||
181 | .peri_id = (u8)DMACH_USI_RX, | ||
182 | .rqtype = DEVTOMEM, | ||
183 | }, { | ||
184 | .peri_id = (u8)DMACH_MAX, | ||
185 | }, { | ||
186 | .peri_id = (u8)DMACH_I2S1_TX, | ||
187 | .rqtype = MEMTODEV, | ||
188 | }, { | ||
189 | .peri_id = (u8)DMACH_I2S1_RX, | ||
190 | .rqtype = DEVTOMEM, | ||
191 | }, { | ||
192 | .peri_id = (u8)DMACH_I2S2_TX, | ||
193 | .rqtype = MEMTODEV, | ||
194 | }, { | ||
195 | .peri_id = (u8)DMACH_I2S2_RX, | ||
196 | .rqtype = DEVTOMEM, | ||
197 | }, { | ||
198 | .peri_id = (u8)DMACH_PWM, | ||
199 | }, { | ||
200 | .peri_id = (u8)DMACH_UART5_RX, | ||
201 | .rqtype = DEVTOMEM, | ||
202 | }, { | ||
203 | .peri_id = (u8)DMACH_UART5_TX, | ||
204 | .rqtype = MEMTODEV, | ||
205 | }, | ||
206 | }; | 104 | }; |
207 | 105 | ||
208 | struct dma_pl330_platdata s5p6450_pdma_pdata = { | 106 | struct dma_pl330_platdata s5p6450_pdma_pdata = { |
209 | .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri), | 107 | .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri), |
210 | .peri = s5p6450_pdma_peri, | 108 | .peri_id = s5p6450_pdma_peri, |
211 | }; | 109 | }; |
212 | 110 | ||
213 | struct amba_device s5p64x0_device_pdma = { | 111 | struct amba_device s5p64x0_device_pdma = { |
@@ -227,10 +125,15 @@ struct amba_device s5p64x0_device_pdma = { | |||
227 | 125 | ||
228 | static int __init s5p64x0_dma_init(void) | 126 | static int __init s5p64x0_dma_init(void) |
229 | { | 127 | { |
230 | if (soc_is_s5p6450()) | 128 | if (soc_is_s5p6450()) { |
129 | dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask); | ||
130 | dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask); | ||
231 | s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata; | 131 | s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata; |
232 | else | 132 | } else { |
133 | dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask); | ||
134 | dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask); | ||
233 | s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata; | 135 | s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata; |
136 | } | ||
234 | 137 | ||
235 | amba_device_register(&s5p64x0_device_pdma, &iomem_resource); | 138 | amba_device_register(&s5p64x0_device_pdma, &iomem_resource); |
236 | 139 | ||
diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-s5p64x0/include/mach/irqs.h index 53982db9d259..5b845e849b30 100644 --- a/arch/arm/mach-s5p64x0/include/mach/irqs.h +++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h | |||
@@ -141,6 +141,8 @@ | |||
141 | 141 | ||
142 | #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) | 142 | #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) |
143 | 143 | ||
144 | #define IRQ_TIMER_BASE (11) | ||
145 | |||
144 | /* Set the default NR_IRQS */ | 146 | /* Set the default NR_IRQS */ |
145 | 147 | ||
146 | #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1) | 148 | #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1) |
diff --git a/arch/arm/mach-s5p64x0/init.c b/arch/arm/mach-s5p64x0/init.c index 79833caf8165..659a66c131a1 100644 --- a/arch/arm/mach-s5p64x0/init.c +++ b/arch/arm/mach-s5p64x0/init.c | |||
@@ -23,36 +23,7 @@ | |||
23 | #include <plat/s5p6450.h> | 23 | #include <plat/s5p6450.h> |
24 | #include <plat/regs-serial.h> | 24 | #include <plat/regs-serial.h> |
25 | 25 | ||
26 | static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = { | ||
27 | [0] = { | ||
28 | .name = "pclk_low", | ||
29 | .divisor = 1, | ||
30 | .min_baud = 0, | ||
31 | .max_baud = 0, | ||
32 | }, | ||
33 | [1] = { | ||
34 | .name = "uclk1", | ||
35 | .divisor = 1, | ||
36 | .min_baud = 0, | ||
37 | .max_baud = 0, | ||
38 | }, | ||
39 | }; | ||
40 | |||
41 | /* uart registration process */ | 26 | /* uart registration process */ |
42 | |||
43 | void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
44 | { | ||
45 | struct s3c2410_uartcfg *tcfg = cfg; | ||
46 | u32 ucnt; | ||
47 | |||
48 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | ||
49 | if (!tcfg->clocks) { | ||
50 | tcfg->clocks = s5p64x0_serial_clocks; | ||
51 | tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks); | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | |||
56 | void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 27 | void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
57 | { | 28 | { |
58 | int uart; | 29 | int uart; |
@@ -62,12 +33,10 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) | |||
62 | s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART; | 33 | s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART; |
63 | } | 34 | } |
64 | 35 | ||
65 | s5p64x0_common_init_uarts(cfg, no); | ||
66 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); | 36 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); |
67 | } | 37 | } |
68 | 38 | ||
69 | void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 39 | void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
70 | { | 40 | { |
71 | s5p64x0_common_init_uarts(cfg, no); | ||
72 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); | 41 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); |
73 | } | 42 | } |
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index 8d47709da713..9d644ece2604 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c | |||
@@ -962,16 +962,6 @@ static struct clksrc_clk clksrcs[] = { | |||
962 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 }, | 962 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 }, |
963 | }, { | 963 | }, { |
964 | .clk = { | 964 | .clk = { |
965 | .name = "uclk1", | ||
966 | .ctrlbit = (1 << 3), | ||
967 | .enable = s5pc100_sclk0_ctrl, | ||
968 | |||
969 | }, | ||
970 | .sources = &clk_src_group2, | ||
971 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 }, | ||
972 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, | ||
973 | }, { | ||
974 | .clk = { | ||
975 | .name = "sclk_mixer", | 965 | .name = "sclk_mixer", |
976 | .ctrlbit = (1 << 6), | 966 | .ctrlbit = (1 << 6), |
977 | .enable = s5pc100_sclk0_ctrl, | 967 | .enable = s5pc100_sclk0_ctrl, |
@@ -1098,6 +1088,17 @@ static struct clksrc_clk clksrcs[] = { | |||
1098 | }, | 1088 | }, |
1099 | }; | 1089 | }; |
1100 | 1090 | ||
1091 | static struct clksrc_clk clk_sclk_uart = { | ||
1092 | .clk = { | ||
1093 | .name = "uclk1", | ||
1094 | .ctrlbit = (1 << 3), | ||
1095 | .enable = s5pc100_sclk0_ctrl, | ||
1096 | }, | ||
1097 | .sources = &clk_src_group2, | ||
1098 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 }, | ||
1099 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, | ||
1100 | }; | ||
1101 | |||
1101 | /* Clock initialisation code */ | 1102 | /* Clock initialisation code */ |
1102 | static struct clksrc_clk *sysclks[] = { | 1103 | static struct clksrc_clk *sysclks[] = { |
1103 | &clk_mout_apll, | 1104 | &clk_mout_apll, |
@@ -1127,6 +1128,10 @@ static struct clksrc_clk *sysclks[] = { | |||
1127 | &clk_sclk_spdif, | 1128 | &clk_sclk_spdif, |
1128 | }; | 1129 | }; |
1129 | 1130 | ||
1131 | static struct clksrc_clk *clksrc_cdev[] = { | ||
1132 | &clk_sclk_uart, | ||
1133 | }; | ||
1134 | |||
1130 | void __init_or_cpufreq s5pc100_setup_clocks(void) | 1135 | void __init_or_cpufreq s5pc100_setup_clocks(void) |
1131 | { | 1136 | { |
1132 | unsigned long xtal; | 1137 | unsigned long xtal; |
@@ -1266,6 +1271,11 @@ static struct clk *clks[] __initdata = { | |||
1266 | &clk_pcmcdclk1, | 1271 | &clk_pcmcdclk1, |
1267 | }; | 1272 | }; |
1268 | 1273 | ||
1274 | static struct clk_lookup s5pc100_clk_lookup[] = { | ||
1275 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | ||
1276 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uart.clk), | ||
1277 | }; | ||
1278 | |||
1269 | void __init s5pc100_register_clocks(void) | 1279 | void __init s5pc100_register_clocks(void) |
1270 | { | 1280 | { |
1271 | int ptr; | 1281 | int ptr; |
@@ -1277,9 +1287,12 @@ void __init s5pc100_register_clocks(void) | |||
1277 | 1287 | ||
1278 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1288 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1279 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1289 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1290 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
1291 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
1280 | 1292 | ||
1281 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1293 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1282 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1294 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1295 | clkdev_add_table(s5pc100_clk_lookup, ARRAY_SIZE(s5pc100_clk_lookup)); | ||
1283 | 1296 | ||
1284 | s3c24xx_register_clock(&dummy_apb_pclk); | 1297 | s3c24xx_register_clock(&dummy_apb_pclk); |
1285 | 1298 | ||
diff --git a/arch/arm/mach-s5pc100/dma.c b/arch/arm/mach-s5pc100/dma.c index 065a087f5a8b..c841f4d313f2 100644 --- a/arch/arm/mach-s5pc100/dma.c +++ b/arch/arm/mach-s5pc100/dma.c | |||
@@ -35,100 +35,42 @@ | |||
35 | 35 | ||
36 | static u64 dma_dmamask = DMA_BIT_MASK(32); | 36 | static u64 dma_dmamask = DMA_BIT_MASK(32); |
37 | 37 | ||
38 | struct dma_pl330_peri pdma0_peri[30] = { | 38 | u8 pdma0_peri[] = { |
39 | { | 39 | DMACH_UART0_RX, |
40 | .peri_id = (u8)DMACH_UART0_RX, | 40 | DMACH_UART0_TX, |
41 | .rqtype = DEVTOMEM, | 41 | DMACH_UART1_RX, |
42 | }, { | 42 | DMACH_UART1_TX, |
43 | .peri_id = (u8)DMACH_UART0_TX, | 43 | DMACH_UART2_RX, |
44 | .rqtype = MEMTODEV, | 44 | DMACH_UART2_TX, |
45 | }, { | 45 | DMACH_UART3_RX, |
46 | .peri_id = (u8)DMACH_UART1_RX, | 46 | DMACH_UART3_TX, |
47 | .rqtype = DEVTOMEM, | 47 | DMACH_IRDA, |
48 | }, { | 48 | DMACH_I2S0_RX, |
49 | .peri_id = (u8)DMACH_UART1_TX, | 49 | DMACH_I2S0_TX, |
50 | .rqtype = MEMTODEV, | 50 | DMACH_I2S0S_TX, |
51 | }, { | 51 | DMACH_I2S1_RX, |
52 | .peri_id = (u8)DMACH_UART2_RX, | 52 | DMACH_I2S1_TX, |
53 | .rqtype = DEVTOMEM, | 53 | DMACH_I2S2_RX, |
54 | }, { | 54 | DMACH_I2S2_TX, |
55 | .peri_id = (u8)DMACH_UART2_TX, | 55 | DMACH_SPI0_RX, |
56 | .rqtype = MEMTODEV, | 56 | DMACH_SPI0_TX, |
57 | }, { | 57 | DMACH_SPI1_RX, |
58 | .peri_id = (u8)DMACH_UART3_RX, | 58 | DMACH_SPI1_TX, |
59 | .rqtype = DEVTOMEM, | 59 | DMACH_SPI2_RX, |
60 | }, { | 60 | DMACH_SPI2_TX, |
61 | .peri_id = (u8)DMACH_UART3_TX, | 61 | DMACH_AC97_MICIN, |
62 | .rqtype = MEMTODEV, | 62 | DMACH_AC97_PCMIN, |
63 | }, { | 63 | DMACH_AC97_PCMOUT, |
64 | .peri_id = DMACH_IRDA, | 64 | DMACH_EXTERNAL, |
65 | }, { | 65 | DMACH_PWM, |
66 | .peri_id = (u8)DMACH_I2S0_RX, | 66 | DMACH_SPDIF, |
67 | .rqtype = DEVTOMEM, | 67 | DMACH_HSI_RX, |
68 | }, { | 68 | DMACH_HSI_TX, |
69 | .peri_id = (u8)DMACH_I2S0_TX, | ||
70 | .rqtype = MEMTODEV, | ||
71 | }, { | ||
72 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
73 | .rqtype = MEMTODEV, | ||
74 | }, { | ||
75 | .peri_id = (u8)DMACH_I2S1_RX, | ||
76 | .rqtype = DEVTOMEM, | ||
77 | }, { | ||
78 | .peri_id = (u8)DMACH_I2S1_TX, | ||
79 | .rqtype = MEMTODEV, | ||
80 | }, { | ||
81 | .peri_id = (u8)DMACH_I2S2_RX, | ||
82 | .rqtype = DEVTOMEM, | ||
83 | }, { | ||
84 | .peri_id = (u8)DMACH_I2S2_TX, | ||
85 | .rqtype = MEMTODEV, | ||
86 | }, { | ||
87 | .peri_id = (u8)DMACH_SPI0_RX, | ||
88 | .rqtype = DEVTOMEM, | ||
89 | }, { | ||
90 | .peri_id = (u8)DMACH_SPI0_TX, | ||
91 | .rqtype = MEMTODEV, | ||
92 | }, { | ||
93 | .peri_id = (u8)DMACH_SPI1_RX, | ||
94 | .rqtype = DEVTOMEM, | ||
95 | }, { | ||
96 | .peri_id = (u8)DMACH_SPI1_TX, | ||
97 | .rqtype = MEMTODEV, | ||
98 | }, { | ||
99 | .peri_id = (u8)DMACH_SPI2_RX, | ||
100 | .rqtype = DEVTOMEM, | ||
101 | }, { | ||
102 | .peri_id = (u8)DMACH_SPI2_TX, | ||
103 | .rqtype = MEMTODEV, | ||
104 | }, { | ||
105 | .peri_id = (u8)DMACH_AC97_MICIN, | ||
106 | .rqtype = DEVTOMEM, | ||
107 | }, { | ||
108 | .peri_id = (u8)DMACH_AC97_PCMIN, | ||
109 | .rqtype = DEVTOMEM, | ||
110 | }, { | ||
111 | .peri_id = (u8)DMACH_AC97_PCMOUT, | ||
112 | .rqtype = MEMTODEV, | ||
113 | }, { | ||
114 | .peri_id = (u8)DMACH_EXTERNAL, | ||
115 | }, { | ||
116 | .peri_id = (u8)DMACH_PWM, | ||
117 | }, { | ||
118 | .peri_id = (u8)DMACH_SPDIF, | ||
119 | .rqtype = MEMTODEV, | ||
120 | }, { | ||
121 | .peri_id = (u8)DMACH_HSI_RX, | ||
122 | .rqtype = DEVTOMEM, | ||
123 | }, { | ||
124 | .peri_id = (u8)DMACH_HSI_TX, | ||
125 | .rqtype = MEMTODEV, | ||
126 | }, | ||
127 | }; | 69 | }; |
128 | 70 | ||
129 | struct dma_pl330_platdata s5pc100_pdma0_pdata = { | 71 | struct dma_pl330_platdata s5pc100_pdma0_pdata = { |
130 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), | 72 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), |
131 | .peri = pdma0_peri, | 73 | .peri_id = pdma0_peri, |
132 | }; | 74 | }; |
133 | 75 | ||
134 | struct amba_device s5pc100_device_pdma0 = { | 76 | struct amba_device s5pc100_device_pdma0 = { |
@@ -147,98 +89,42 @@ struct amba_device s5pc100_device_pdma0 = { | |||
147 | .periphid = 0x00041330, | 89 | .periphid = 0x00041330, |
148 | }; | 90 | }; |
149 | 91 | ||
150 | struct dma_pl330_peri pdma1_peri[30] = { | 92 | u8 pdma1_peri[] = { |
151 | { | 93 | DMACH_UART0_RX, |
152 | .peri_id = (u8)DMACH_UART0_RX, | 94 | DMACH_UART0_TX, |
153 | .rqtype = DEVTOMEM, | 95 | DMACH_UART1_RX, |
154 | }, { | 96 | DMACH_UART1_TX, |
155 | .peri_id = (u8)DMACH_UART0_TX, | 97 | DMACH_UART2_RX, |
156 | .rqtype = MEMTODEV, | 98 | DMACH_UART2_TX, |
157 | }, { | 99 | DMACH_UART3_RX, |
158 | .peri_id = (u8)DMACH_UART1_RX, | 100 | DMACH_UART3_TX, |
159 | .rqtype = DEVTOMEM, | 101 | DMACH_IRDA, |
160 | }, { | 102 | DMACH_I2S0_RX, |
161 | .peri_id = (u8)DMACH_UART1_TX, | 103 | DMACH_I2S0_TX, |
162 | .rqtype = MEMTODEV, | 104 | DMACH_I2S0S_TX, |
163 | }, { | 105 | DMACH_I2S1_RX, |
164 | .peri_id = (u8)DMACH_UART2_RX, | 106 | DMACH_I2S1_TX, |
165 | .rqtype = DEVTOMEM, | 107 | DMACH_I2S2_RX, |
166 | }, { | 108 | DMACH_I2S2_TX, |
167 | .peri_id = (u8)DMACH_UART2_TX, | 109 | DMACH_SPI0_RX, |
168 | .rqtype = MEMTODEV, | 110 | DMACH_SPI0_TX, |
169 | }, { | 111 | DMACH_SPI1_RX, |
170 | .peri_id = (u8)DMACH_UART3_RX, | 112 | DMACH_SPI1_TX, |
171 | .rqtype = DEVTOMEM, | 113 | DMACH_SPI2_RX, |
172 | }, { | 114 | DMACH_SPI2_TX, |
173 | .peri_id = (u8)DMACH_UART3_TX, | 115 | DMACH_PCM0_RX, |
174 | .rqtype = MEMTODEV, | 116 | DMACH_PCM0_TX, |
175 | }, { | 117 | DMACH_PCM1_RX, |
176 | .peri_id = DMACH_IRDA, | 118 | DMACH_PCM1_TX, |
177 | }, { | 119 | DMACH_MSM_REQ0, |
178 | .peri_id = (u8)DMACH_I2S0_RX, | 120 | DMACH_MSM_REQ1, |
179 | .rqtype = DEVTOMEM, | 121 | DMACH_MSM_REQ2, |
180 | }, { | 122 | DMACH_MSM_REQ3, |
181 | .peri_id = (u8)DMACH_I2S0_TX, | ||
182 | .rqtype = MEMTODEV, | ||
183 | }, { | ||
184 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
185 | .rqtype = MEMTODEV, | ||
186 | }, { | ||
187 | .peri_id = (u8)DMACH_I2S1_RX, | ||
188 | .rqtype = DEVTOMEM, | ||
189 | }, { | ||
190 | .peri_id = (u8)DMACH_I2S1_TX, | ||
191 | .rqtype = MEMTODEV, | ||
192 | }, { | ||
193 | .peri_id = (u8)DMACH_I2S2_RX, | ||
194 | .rqtype = DEVTOMEM, | ||
195 | }, { | ||
196 | .peri_id = (u8)DMACH_I2S2_TX, | ||
197 | .rqtype = MEMTODEV, | ||
198 | }, { | ||
199 | .peri_id = (u8)DMACH_SPI0_RX, | ||
200 | .rqtype = DEVTOMEM, | ||
201 | }, { | ||
202 | .peri_id = (u8)DMACH_SPI0_TX, | ||
203 | .rqtype = MEMTODEV, | ||
204 | }, { | ||
205 | .peri_id = (u8)DMACH_SPI1_RX, | ||
206 | .rqtype = DEVTOMEM, | ||
207 | }, { | ||
208 | .peri_id = (u8)DMACH_SPI1_TX, | ||
209 | .rqtype = MEMTODEV, | ||
210 | }, { | ||
211 | .peri_id = (u8)DMACH_SPI2_RX, | ||
212 | .rqtype = DEVTOMEM, | ||
213 | }, { | ||
214 | .peri_id = (u8)DMACH_SPI2_TX, | ||
215 | .rqtype = MEMTODEV, | ||
216 | }, { | ||
217 | .peri_id = (u8)DMACH_PCM0_RX, | ||
218 | .rqtype = DEVTOMEM, | ||
219 | }, { | ||
220 | .peri_id = (u8)DMACH_PCM1_TX, | ||
221 | .rqtype = MEMTODEV, | ||
222 | }, { | ||
223 | .peri_id = (u8)DMACH_PCM1_RX, | ||
224 | .rqtype = DEVTOMEM, | ||
225 | }, { | ||
226 | .peri_id = (u8)DMACH_PCM1_TX, | ||
227 | .rqtype = MEMTODEV, | ||
228 | }, { | ||
229 | .peri_id = (u8)DMACH_MSM_REQ0, | ||
230 | }, { | ||
231 | .peri_id = (u8)DMACH_MSM_REQ1, | ||
232 | }, { | ||
233 | .peri_id = (u8)DMACH_MSM_REQ2, | ||
234 | }, { | ||
235 | .peri_id = (u8)DMACH_MSM_REQ3, | ||
236 | }, | ||
237 | }; | 123 | }; |
238 | 124 | ||
239 | struct dma_pl330_platdata s5pc100_pdma1_pdata = { | 125 | struct dma_pl330_platdata s5pc100_pdma1_pdata = { |
240 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), | 126 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), |
241 | .peri = pdma1_peri, | 127 | .peri_id = pdma1_peri, |
242 | }; | 128 | }; |
243 | 129 | ||
244 | struct amba_device s5pc100_device_pdma1 = { | 130 | struct amba_device s5pc100_device_pdma1 = { |
@@ -259,7 +145,12 @@ struct amba_device s5pc100_device_pdma1 = { | |||
259 | 145 | ||
260 | static int __init s5pc100_dma_init(void) | 146 | static int __init s5pc100_dma_init(void) |
261 | { | 147 | { |
148 | dma_cap_set(DMA_SLAVE, s5pc100_pdma0_pdata.cap_mask); | ||
149 | dma_cap_set(DMA_CYCLIC, s5pc100_pdma0_pdata.cap_mask); | ||
262 | amba_device_register(&s5pc100_device_pdma0, &iomem_resource); | 150 | amba_device_register(&s5pc100_device_pdma0, &iomem_resource); |
151 | |||
152 | dma_cap_set(DMA_SLAVE, s5pc100_pdma1_pdata.cap_mask); | ||
153 | dma_cap_set(DMA_CYCLIC, s5pc100_pdma1_pdata.cap_mask); | ||
263 | amba_device_register(&s5pc100_device_pdma1, &iomem_resource); | 154 | amba_device_register(&s5pc100_device_pdma1, &iomem_resource); |
264 | 155 | ||
265 | return 0; | 156 | return 0; |
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h index d2eb4757381f..2870f12c7926 100644 --- a/arch/arm/mach-s5pc100/include/mach/irqs.h +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h | |||
@@ -97,6 +97,8 @@ | |||
97 | #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) | 97 | #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) |
98 | #define IRQ_VIC_END S5P_IRQ_VIC2(31) | 98 | #define IRQ_VIC_END S5P_IRQ_VIC2(31) |
99 | 99 | ||
100 | #define IRQ_TIMER_BASE (11) | ||
101 | |||
100 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) | 102 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) |
101 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) | 103 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) |
102 | 104 | ||
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 4c5ac7a69e9e..43a045d354ec 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -809,46 +809,6 @@ static struct clksrc_clk clksrcs[] = { | |||
809 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, | 809 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, |
810 | }, { | 810 | }, { |
811 | .clk = { | 811 | .clk = { |
812 | .name = "uclk1", | ||
813 | .devname = "s5pv210-uart.0", | ||
814 | .enable = s5pv210_clk_mask0_ctrl, | ||
815 | .ctrlbit = (1 << 12), | ||
816 | }, | ||
817 | .sources = &clkset_uart, | ||
818 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
819 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
820 | }, { | ||
821 | .clk = { | ||
822 | .name = "uclk1", | ||
823 | .devname = "s5pv210-uart.1", | ||
824 | .enable = s5pv210_clk_mask0_ctrl, | ||
825 | .ctrlbit = (1 << 13), | ||
826 | }, | ||
827 | .sources = &clkset_uart, | ||
828 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
829 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
830 | }, { | ||
831 | .clk = { | ||
832 | .name = "uclk1", | ||
833 | .devname = "s5pv210-uart.2", | ||
834 | .enable = s5pv210_clk_mask0_ctrl, | ||
835 | .ctrlbit = (1 << 14), | ||
836 | }, | ||
837 | .sources = &clkset_uart, | ||
838 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
839 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
840 | }, { | ||
841 | .clk = { | ||
842 | .name = "uclk1", | ||
843 | .devname = "s5pv210-uart.3", | ||
844 | .enable = s5pv210_clk_mask0_ctrl, | ||
845 | .ctrlbit = (1 << 15), | ||
846 | }, | ||
847 | .sources = &clkset_uart, | ||
848 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
849 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
850 | }, { | ||
851 | .clk = { | ||
852 | .name = "sclk_fimc", | 812 | .name = "sclk_fimc", |
853 | .devname = "s5pv210-fimc.0", | 813 | .devname = "s5pv210-fimc.0", |
854 | .enable = s5pv210_clk_mask1_ctrl, | 814 | .enable = s5pv210_clk_mask1_ctrl, |
@@ -1022,6 +982,61 @@ static struct clksrc_clk clksrcs[] = { | |||
1022 | }, | 982 | }, |
1023 | }; | 983 | }; |
1024 | 984 | ||
985 | static struct clksrc_clk clk_sclk_uart0 = { | ||
986 | .clk = { | ||
987 | .name = "uclk1", | ||
988 | .devname = "s5pv210-uart.0", | ||
989 | .enable = s5pv210_clk_mask0_ctrl, | ||
990 | .ctrlbit = (1 << 12), | ||
991 | }, | ||
992 | .sources = &clkset_uart, | ||
993 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
994 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
995 | }; | ||
996 | |||
997 | static struct clksrc_clk clk_sclk_uart1 = { | ||
998 | .clk = { | ||
999 | .name = "uclk1", | ||
1000 | .devname = "s5pv210-uart.1", | ||
1001 | .enable = s5pv210_clk_mask0_ctrl, | ||
1002 | .ctrlbit = (1 << 13), | ||
1003 | }, | ||
1004 | .sources = &clkset_uart, | ||
1005 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
1006 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
1007 | }; | ||
1008 | |||
1009 | static struct clksrc_clk clk_sclk_uart2 = { | ||
1010 | .clk = { | ||
1011 | .name = "uclk1", | ||
1012 | .devname = "s5pv210-uart.2", | ||
1013 | .enable = s5pv210_clk_mask0_ctrl, | ||
1014 | .ctrlbit = (1 << 14), | ||
1015 | }, | ||
1016 | .sources = &clkset_uart, | ||
1017 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
1018 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
1019 | }; | ||
1020 | |||
1021 | static struct clksrc_clk clk_sclk_uart3 = { | ||
1022 | .clk = { | ||
1023 | .name = "uclk1", | ||
1024 | .devname = "s5pv210-uart.3", | ||
1025 | .enable = s5pv210_clk_mask0_ctrl, | ||
1026 | .ctrlbit = (1 << 15), | ||
1027 | }, | ||
1028 | .sources = &clkset_uart, | ||
1029 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
1030 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
1031 | }; | ||
1032 | |||
1033 | static struct clksrc_clk *clksrc_cdev[] = { | ||
1034 | &clk_sclk_uart0, | ||
1035 | &clk_sclk_uart1, | ||
1036 | &clk_sclk_uart2, | ||
1037 | &clk_sclk_uart3, | ||
1038 | }; | ||
1039 | |||
1025 | /* Clock initialisation code */ | 1040 | /* Clock initialisation code */ |
1026 | static struct clksrc_clk *sysclks[] = { | 1041 | static struct clksrc_clk *sysclks[] = { |
1027 | &clk_mout_apll, | 1042 | &clk_mout_apll, |
@@ -1261,6 +1276,14 @@ static struct clk *clks[] __initdata = { | |||
1261 | &clk_pcmcdclk2, | 1276 | &clk_pcmcdclk2, |
1262 | }; | 1277 | }; |
1263 | 1278 | ||
1279 | static struct clk_lookup s5pv210_clk_lookup[] = { | ||
1280 | CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), | ||
1281 | CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk), | ||
1282 | CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk), | ||
1283 | CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk), | ||
1284 | CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk), | ||
1285 | }; | ||
1286 | |||
1264 | void __init s5pv210_register_clocks(void) | 1287 | void __init s5pv210_register_clocks(void) |
1265 | { | 1288 | { |
1266 | int ptr; | 1289 | int ptr; |
@@ -1273,11 +1296,15 @@ void __init s5pv210_register_clocks(void) | |||
1273 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | 1296 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) |
1274 | s3c_register_clksrc(sclk_tv[ptr], 1); | 1297 | s3c_register_clksrc(sclk_tv[ptr], 1); |
1275 | 1298 | ||
1299 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
1300 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
1301 | |||
1276 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1302 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1277 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1303 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1278 | 1304 | ||
1279 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1305 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1280 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1306 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1307 | clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup)); | ||
1281 | 1308 | ||
1282 | s3c24xx_register_clock(&dummy_apb_pclk); | 1309 | s3c24xx_register_clock(&dummy_apb_pclk); |
1283 | s3c_pwmclk_init(); | 1310 | s3c_pwmclk_init(); |
diff --git a/arch/arm/mach-s5pv210/dma.c b/arch/arm/mach-s5pv210/dma.c index 86b749c18b77..a6113e0267f2 100644 --- a/arch/arm/mach-s5pv210/dma.c +++ b/arch/arm/mach-s5pv210/dma.c | |||
@@ -35,90 +35,40 @@ | |||
35 | 35 | ||
36 | static u64 dma_dmamask = DMA_BIT_MASK(32); | 36 | static u64 dma_dmamask = DMA_BIT_MASK(32); |
37 | 37 | ||
38 | struct dma_pl330_peri pdma0_peri[28] = { | 38 | u8 pdma0_peri[] = { |
39 | { | 39 | DMACH_UART0_RX, |
40 | .peri_id = (u8)DMACH_UART0_RX, | 40 | DMACH_UART0_TX, |
41 | .rqtype = DEVTOMEM, | 41 | DMACH_UART1_RX, |
42 | }, { | 42 | DMACH_UART1_TX, |
43 | .peri_id = (u8)DMACH_UART0_TX, | 43 | DMACH_UART2_RX, |
44 | .rqtype = MEMTODEV, | 44 | DMACH_UART2_TX, |
45 | }, { | 45 | DMACH_UART3_RX, |
46 | .peri_id = (u8)DMACH_UART1_RX, | 46 | DMACH_UART3_TX, |
47 | .rqtype = DEVTOMEM, | 47 | DMACH_MAX, |
48 | }, { | 48 | DMACH_I2S0_RX, |
49 | .peri_id = (u8)DMACH_UART1_TX, | 49 | DMACH_I2S0_TX, |
50 | .rqtype = MEMTODEV, | 50 | DMACH_I2S0S_TX, |
51 | }, { | 51 | DMACH_I2S1_RX, |
52 | .peri_id = (u8)DMACH_UART2_RX, | 52 | DMACH_I2S1_TX, |
53 | .rqtype = DEVTOMEM, | 53 | DMACH_MAX, |
54 | }, { | 54 | DMACH_MAX, |
55 | .peri_id = (u8)DMACH_UART2_TX, | 55 | DMACH_SPI0_RX, |
56 | .rqtype = MEMTODEV, | 56 | DMACH_SPI0_TX, |
57 | }, { | 57 | DMACH_SPI1_RX, |
58 | .peri_id = (u8)DMACH_UART3_RX, | 58 | DMACH_SPI1_TX, |
59 | .rqtype = DEVTOMEM, | 59 | DMACH_MAX, |
60 | }, { | 60 | DMACH_MAX, |
61 | .peri_id = (u8)DMACH_UART3_TX, | 61 | DMACH_AC97_MICIN, |
62 | .rqtype = MEMTODEV, | 62 | DMACH_AC97_PCMIN, |
63 | }, { | 63 | DMACH_AC97_PCMOUT, |
64 | .peri_id = DMACH_MAX, | 64 | DMACH_MAX, |
65 | }, { | 65 | DMACH_PWM, |
66 | .peri_id = (u8)DMACH_I2S0_RX, | 66 | DMACH_SPDIF, |
67 | .rqtype = DEVTOMEM, | ||
68 | }, { | ||
69 | .peri_id = (u8)DMACH_I2S0_TX, | ||
70 | .rqtype = MEMTODEV, | ||
71 | }, { | ||
72 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
73 | .rqtype = MEMTODEV, | ||
74 | }, { | ||
75 | .peri_id = (u8)DMACH_I2S1_RX, | ||
76 | .rqtype = DEVTOMEM, | ||
77 | }, { | ||
78 | .peri_id = (u8)DMACH_I2S1_TX, | ||
79 | .rqtype = MEMTODEV, | ||
80 | }, { | ||
81 | .peri_id = (u8)DMACH_MAX, | ||
82 | }, { | ||
83 | .peri_id = (u8)DMACH_MAX, | ||
84 | }, { | ||
85 | .peri_id = (u8)DMACH_SPI0_RX, | ||
86 | .rqtype = DEVTOMEM, | ||
87 | }, { | ||
88 | .peri_id = (u8)DMACH_SPI0_TX, | ||
89 | .rqtype = MEMTODEV, | ||
90 | }, { | ||
91 | .peri_id = (u8)DMACH_SPI1_RX, | ||
92 | .rqtype = DEVTOMEM, | ||
93 | }, { | ||
94 | .peri_id = (u8)DMACH_SPI1_TX, | ||
95 | .rqtype = MEMTODEV, | ||
96 | }, { | ||
97 | .peri_id = (u8)DMACH_MAX, | ||
98 | }, { | ||
99 | .peri_id = (u8)DMACH_MAX, | ||
100 | }, { | ||
101 | .peri_id = (u8)DMACH_AC97_MICIN, | ||
102 | .rqtype = DEVTOMEM, | ||
103 | }, { | ||
104 | .peri_id = (u8)DMACH_AC97_PCMIN, | ||
105 | .rqtype = DEVTOMEM, | ||
106 | }, { | ||
107 | .peri_id = (u8)DMACH_AC97_PCMOUT, | ||
108 | .rqtype = MEMTODEV, | ||
109 | }, { | ||
110 | .peri_id = (u8)DMACH_MAX, | ||
111 | }, { | ||
112 | .peri_id = (u8)DMACH_PWM, | ||
113 | }, { | ||
114 | .peri_id = (u8)DMACH_SPDIF, | ||
115 | .rqtype = MEMTODEV, | ||
116 | }, | ||
117 | }; | 67 | }; |
118 | 68 | ||
119 | struct dma_pl330_platdata s5pv210_pdma0_pdata = { | 69 | struct dma_pl330_platdata s5pv210_pdma0_pdata = { |
120 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), | 70 | .nr_valid_peri = ARRAY_SIZE(pdma0_peri), |
121 | .peri = pdma0_peri, | 71 | .peri_id = pdma0_peri, |
122 | }; | 72 | }; |
123 | 73 | ||
124 | struct amba_device s5pv210_device_pdma0 = { | 74 | struct amba_device s5pv210_device_pdma0 = { |
@@ -137,102 +87,44 @@ struct amba_device s5pv210_device_pdma0 = { | |||
137 | .periphid = 0x00041330, | 87 | .periphid = 0x00041330, |
138 | }; | 88 | }; |
139 | 89 | ||
140 | struct dma_pl330_peri pdma1_peri[32] = { | 90 | u8 pdma1_peri[] = { |
141 | { | 91 | DMACH_UART0_RX, |
142 | .peri_id = (u8)DMACH_UART0_RX, | 92 | DMACH_UART0_TX, |
143 | .rqtype = DEVTOMEM, | 93 | DMACH_UART1_RX, |
144 | }, { | 94 | DMACH_UART1_TX, |
145 | .peri_id = (u8)DMACH_UART0_TX, | 95 | DMACH_UART2_RX, |
146 | .rqtype = MEMTODEV, | 96 | DMACH_UART2_TX, |
147 | }, { | 97 | DMACH_UART3_RX, |
148 | .peri_id = (u8)DMACH_UART1_RX, | 98 | DMACH_UART3_TX, |
149 | .rqtype = DEVTOMEM, | 99 | DMACH_MAX, |
150 | }, { | 100 | DMACH_I2S0_RX, |
151 | .peri_id = (u8)DMACH_UART1_TX, | 101 | DMACH_I2S0_TX, |
152 | .rqtype = MEMTODEV, | 102 | DMACH_I2S0S_TX, |
153 | }, { | 103 | DMACH_I2S1_RX, |
154 | .peri_id = (u8)DMACH_UART2_RX, | 104 | DMACH_I2S1_TX, |
155 | .rqtype = DEVTOMEM, | 105 | DMACH_I2S2_RX, |
156 | }, { | 106 | DMACH_I2S2_TX, |
157 | .peri_id = (u8)DMACH_UART2_TX, | 107 | DMACH_SPI0_RX, |
158 | .rqtype = MEMTODEV, | 108 | DMACH_SPI0_TX, |
159 | }, { | 109 | DMACH_SPI1_RX, |
160 | .peri_id = (u8)DMACH_UART3_RX, | 110 | DMACH_SPI1_TX, |
161 | .rqtype = DEVTOMEM, | 111 | DMACH_MAX, |
162 | }, { | 112 | DMACH_MAX, |
163 | .peri_id = (u8)DMACH_UART3_TX, | 113 | DMACH_PCM0_RX, |
164 | .rqtype = MEMTODEV, | 114 | DMACH_PCM0_TX, |
165 | }, { | 115 | DMACH_PCM1_RX, |
166 | .peri_id = DMACH_MAX, | 116 | DMACH_PCM1_TX, |
167 | }, { | 117 | DMACH_MSM_REQ0, |
168 | .peri_id = (u8)DMACH_I2S0_RX, | 118 | DMACH_MSM_REQ1, |
169 | .rqtype = DEVTOMEM, | 119 | DMACH_MSM_REQ2, |
170 | }, { | 120 | DMACH_MSM_REQ3, |
171 | .peri_id = (u8)DMACH_I2S0_TX, | 121 | DMACH_PCM2_RX, |
172 | .rqtype = MEMTODEV, | 122 | DMACH_PCM2_TX, |
173 | }, { | ||
174 | .peri_id = (u8)DMACH_I2S0S_TX, | ||
175 | .rqtype = MEMTODEV, | ||
176 | }, { | ||
177 | .peri_id = (u8)DMACH_I2S1_RX, | ||
178 | .rqtype = DEVTOMEM, | ||
179 | }, { | ||
180 | .peri_id = (u8)DMACH_I2S1_TX, | ||
181 | .rqtype = MEMTODEV, | ||
182 | }, { | ||
183 | .peri_id = (u8)DMACH_I2S2_RX, | ||
184 | .rqtype = DEVTOMEM, | ||
185 | }, { | ||
186 | .peri_id = (u8)DMACH_I2S2_TX, | ||
187 | .rqtype = MEMTODEV, | ||
188 | }, { | ||
189 | .peri_id = (u8)DMACH_SPI0_RX, | ||
190 | .rqtype = DEVTOMEM, | ||
191 | }, { | ||
192 | .peri_id = (u8)DMACH_SPI0_TX, | ||
193 | .rqtype = MEMTODEV, | ||
194 | }, { | ||
195 | .peri_id = (u8)DMACH_SPI1_RX, | ||
196 | .rqtype = DEVTOMEM, | ||
197 | }, { | ||
198 | .peri_id = (u8)DMACH_SPI1_TX, | ||
199 | .rqtype = MEMTODEV, | ||
200 | }, { | ||
201 | .peri_id = (u8)DMACH_MAX, | ||
202 | }, { | ||
203 | .peri_id = (u8)DMACH_MAX, | ||
204 | }, { | ||
205 | .peri_id = (u8)DMACH_PCM0_RX, | ||
206 | .rqtype = DEVTOMEM, | ||
207 | }, { | ||
208 | .peri_id = (u8)DMACH_PCM0_TX, | ||
209 | .rqtype = MEMTODEV, | ||
210 | }, { | ||
211 | .peri_id = (u8)DMACH_PCM1_RX, | ||
212 | .rqtype = DEVTOMEM, | ||
213 | }, { | ||
214 | .peri_id = (u8)DMACH_PCM1_TX, | ||
215 | .rqtype = MEMTODEV, | ||
216 | }, { | ||
217 | .peri_id = (u8)DMACH_MSM_REQ0, | ||
218 | }, { | ||
219 | .peri_id = (u8)DMACH_MSM_REQ1, | ||
220 | }, { | ||
221 | .peri_id = (u8)DMACH_MSM_REQ2, | ||
222 | }, { | ||
223 | .peri_id = (u8)DMACH_MSM_REQ3, | ||
224 | }, { | ||
225 | .peri_id = (u8)DMACH_PCM2_RX, | ||
226 | .rqtype = DEVTOMEM, | ||
227 | }, { | ||
228 | .peri_id = (u8)DMACH_PCM2_TX, | ||
229 | .rqtype = MEMTODEV, | ||
230 | }, | ||
231 | }; | 123 | }; |
232 | 124 | ||
233 | struct dma_pl330_platdata s5pv210_pdma1_pdata = { | 125 | struct dma_pl330_platdata s5pv210_pdma1_pdata = { |
234 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), | 126 | .nr_valid_peri = ARRAY_SIZE(pdma1_peri), |
235 | .peri = pdma1_peri, | 127 | .peri_id = pdma1_peri, |
236 | }; | 128 | }; |
237 | 129 | ||
238 | struct amba_device s5pv210_device_pdma1 = { | 130 | struct amba_device s5pv210_device_pdma1 = { |
@@ -253,7 +145,12 @@ struct amba_device s5pv210_device_pdma1 = { | |||
253 | 145 | ||
254 | static int __init s5pv210_dma_init(void) | 146 | static int __init s5pv210_dma_init(void) |
255 | { | 147 | { |
148 | dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask); | ||
149 | dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask); | ||
256 | amba_device_register(&s5pv210_device_pdma0, &iomem_resource); | 150 | amba_device_register(&s5pv210_device_pdma0, &iomem_resource); |
151 | |||
152 | dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask); | ||
153 | dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask); | ||
257 | amba_device_register(&s5pv210_device_pdma1, &iomem_resource); | 154 | amba_device_register(&s5pv210_device_pdma1, &iomem_resource); |
258 | 155 | ||
259 | return 0; | 156 | return 0; |
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index 5e0de3a31f3d..e777e010ed2e 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h | |||
@@ -118,6 +118,8 @@ | |||
118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) | 118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) |
119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) | 119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) |
120 | 120 | ||
121 | #define IRQ_TIMER_BASE (11) | ||
122 | |||
121 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) | 123 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) |
122 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) | 124 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) |
123 | 125 | ||
diff --git a/arch/arm/mach-s5pv210/init.c b/arch/arm/mach-s5pv210/init.c index 4865ae2c475a..468a5f886193 100644 --- a/arch/arm/mach-s5pv210/init.c +++ b/arch/arm/mach-s5pv210/init.c | |||
@@ -18,27 +18,8 @@ | |||
18 | #include <plat/s5pv210.h> | 18 | #include <plat/s5pv210.h> |
19 | #include <plat/regs-serial.h> | 19 | #include <plat/regs-serial.h> |
20 | 20 | ||
21 | static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = { | ||
22 | [0] = { | ||
23 | .name = "pclk", | ||
24 | .divisor = 1, | ||
25 | .min_baud = 0, | ||
26 | .max_baud = 0, | ||
27 | }, | ||
28 | }; | ||
29 | |||
30 | /* uart registration process */ | 21 | /* uart registration process */ |
31 | void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 22 | void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
32 | { | 23 | { |
33 | struct s3c2410_uartcfg *tcfg = cfg; | ||
34 | u32 ucnt; | ||
35 | |||
36 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | ||
37 | if (!tcfg->clocks) { | ||
38 | tcfg->clocks = s5pv210_serial_clocks; | ||
39 | tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks); | ||
40 | } | ||
41 | } | ||
42 | |||
43 | s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); | 24 | s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); |
44 | } | 25 | } |
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c index 5a21b15b2a97..4eab2cca2d92 100644 --- a/arch/arm/plat-s3c24xx/s3c2443-clock.c +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c | |||
@@ -297,13 +297,6 @@ static struct clksrc_clk clk_usb_bus_host = { | |||
297 | 297 | ||
298 | static struct clksrc_clk clksrc_clks[] = { | 298 | static struct clksrc_clk clksrc_clks[] = { |
299 | { | 299 | { |
300 | /* ART baud-rate clock sourced from esysclk via a divisor */ | ||
301 | .clk = { | ||
302 | .name = "uartclk", | ||
303 | .parent = &clk_esysclk.clk, | ||
304 | }, | ||
305 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, | ||
306 | }, { | ||
307 | /* camera interface bus-clock, divided down from esysclk */ | 300 | /* camera interface bus-clock, divided down from esysclk */ |
308 | .clk = { | 301 | .clk = { |
309 | .name = "camif-upll", /* same as 2440 name */ | 302 | .name = "camif-upll", /* same as 2440 name */ |
@@ -323,6 +316,15 @@ static struct clksrc_clk clksrc_clks[] = { | |||
323 | }, | 316 | }, |
324 | }; | 317 | }; |
325 | 318 | ||
319 | static struct clksrc_clk clk_esys_uart = { | ||
320 | /* ART baud-rate clock sourced from esysclk via a divisor */ | ||
321 | .clk = { | ||
322 | .name = "uartclk", | ||
323 | .parent = &clk_esysclk.clk, | ||
324 | }, | ||
325 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, | ||
326 | }; | ||
327 | |||
326 | static struct clk clk_i2s_ext = { | 328 | static struct clk clk_i2s_ext = { |
327 | .name = "i2s-ext", | 329 | .name = "i2s-ext", |
328 | }; | 330 | }; |
@@ -589,6 +591,12 @@ static struct clksrc_clk *clksrcs[] __initdata = { | |||
589 | &clk_arm, | 591 | &clk_arm, |
590 | }; | 592 | }; |
591 | 593 | ||
594 | static struct clk_lookup s3c2443_clk_lookup[] = { | ||
595 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), | ||
596 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | ||
597 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk), | ||
598 | }; | ||
599 | |||
592 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | 600 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, |
593 | unsigned int *divs, int nr_divs, | 601 | unsigned int *divs, int nr_divs, |
594 | int divmask) | 602 | int divmask) |
@@ -618,6 +626,7 @@ void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | |||
618 | /* See s3c2443/etc notes on disabling clocks at init time */ | 626 | /* See s3c2443/etc notes on disabling clocks at init time */ |
619 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 627 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
620 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 628 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
629 | clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup)); | ||
621 | 630 | ||
622 | s3c2443_common_setup_clocks(get_mpll); | 631 | s3c2443_common_setup_clocks(get_mpll); |
623 | } | 632 | } |
diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c index 93a994a5dd8f..2cded872f22b 100644 --- a/arch/arm/plat-samsung/dma-ops.c +++ b/arch/arm/plat-samsung/dma-ops.c | |||
@@ -18,23 +18,24 @@ | |||
18 | 18 | ||
19 | #include <mach/dma.h> | 19 | #include <mach/dma.h> |
20 | 20 | ||
21 | static inline bool pl330_filter(struct dma_chan *chan, void *param) | ||
22 | { | ||
23 | struct dma_pl330_peri *peri = chan->private; | ||
24 | return peri->peri_id == (unsigned)param; | ||
25 | } | ||
26 | |||
27 | static unsigned samsung_dmadev_request(enum dma_ch dma_ch, | 21 | static unsigned samsung_dmadev_request(enum dma_ch dma_ch, |
28 | struct samsung_dma_info *info) | 22 | struct samsung_dma_info *info) |
29 | { | 23 | { |
30 | struct dma_chan *chan; | 24 | struct dma_chan *chan; |
31 | dma_cap_mask_t mask; | 25 | dma_cap_mask_t mask; |
32 | struct dma_slave_config slave_config; | 26 | struct dma_slave_config slave_config; |
27 | void *filter_param; | ||
33 | 28 | ||
34 | dma_cap_zero(mask); | 29 | dma_cap_zero(mask); |
35 | dma_cap_set(info->cap, mask); | 30 | dma_cap_set(info->cap, mask); |
36 | 31 | ||
37 | chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch); | 32 | /* |
33 | * If a dma channel property of a device node from device tree is | ||
34 | * specified, use that as the fliter parameter. | ||
35 | */ | ||
36 | filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop : | ||
37 | (void *)dma_ch; | ||
38 | chan = dma_request_channel(mask, pl330_filter, filter_param); | ||
38 | 39 | ||
39 | if (info->direction == DMA_FROM_DEVICE) { | 40 | if (info->direction == DMA_FROM_DEVICE) { |
40 | memset(&slave_config, 0, sizeof(struct dma_slave_config)); | 41 | memset(&slave_config, 0, sizeof(struct dma_slave_config)); |
diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h index 4c1a363526cf..22eafc310bd7 100644 --- a/arch/arm/plat-samsung/include/plat/dma-ops.h +++ b/arch/arm/plat-samsung/include/plat/dma-ops.h | |||
@@ -31,6 +31,7 @@ struct samsung_dma_info { | |||
31 | enum dma_slave_buswidth width; | 31 | enum dma_slave_buswidth width; |
32 | dma_addr_t fifo; | 32 | dma_addr_t fifo; |
33 | struct s3c2410_dma_client *client; | 33 | struct s3c2410_dma_client *client; |
34 | struct property *dt_dmach_prop; | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | struct samsung_dma_ops { | 37 | struct samsung_dma_ops { |
diff --git a/arch/arm/plat-samsung/include/plat/dma-pl330.h b/arch/arm/plat-samsung/include/plat/dma-pl330.h index 2e55e5958674..c5eaad529de5 100644 --- a/arch/arm/plat-samsung/include/plat/dma-pl330.h +++ b/arch/arm/plat-samsung/include/plat/dma-pl330.h | |||
@@ -21,7 +21,8 @@ | |||
21 | * use these just as IDs. | 21 | * use these just as IDs. |
22 | */ | 22 | */ |
23 | enum dma_ch { | 23 | enum dma_ch { |
24 | DMACH_UART0_RX, | 24 | DMACH_DT_PROP = -1, |
25 | DMACH_UART0_RX = 0, | ||
25 | DMACH_UART0_TX, | 26 | DMACH_UART0_TX, |
26 | DMACH_UART1_RX, | 27 | DMACH_UART1_RX, |
27 | DMACH_UART1_TX, | 28 | DMACH_UART1_TX, |
diff --git a/arch/arm/plat-samsung/include/plat/irqs.h b/arch/arm/plat-samsung/include/plat/irqs.h index 08d1a7ef97b7..df46b776976a 100644 --- a/arch/arm/plat-samsung/include/plat/irqs.h +++ b/arch/arm/plat-samsung/include/plat/irqs.h | |||
@@ -44,13 +44,14 @@ | |||
44 | #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) | 44 | #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) |
45 | #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) | 45 | #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) |
46 | 46 | ||
47 | #define S5P_TIMER_IRQ(x) (11 + (x)) | 47 | #define S5P_TIMER_IRQ(x) (IRQ_TIMER_BASE + (x)) |
48 | 48 | ||
49 | #define IRQ_TIMER0 S5P_TIMER_IRQ(0) | 49 | #define IRQ_TIMER0 S5P_TIMER_IRQ(0) |
50 | #define IRQ_TIMER1 S5P_TIMER_IRQ(1) | 50 | #define IRQ_TIMER1 S5P_TIMER_IRQ(1) |
51 | #define IRQ_TIMER2 S5P_TIMER_IRQ(2) | 51 | #define IRQ_TIMER2 S5P_TIMER_IRQ(2) |
52 | #define IRQ_TIMER3 S5P_TIMER_IRQ(3) | 52 | #define IRQ_TIMER3 S5P_TIMER_IRQ(3) |
53 | #define IRQ_TIMER4 S5P_TIMER_IRQ(4) | 53 | #define IRQ_TIMER4 S5P_TIMER_IRQ(4) |
54 | #define IRQ_TIMER_COUNT (5) | ||
54 | 55 | ||
55 | #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ | 56 | #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ |
56 | : ((x) - 16 + S5P_EINT_BASE2)) | 57 | : ((x) - 16 + S5P_EINT_BASE2)) |
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h index 720734847027..29c26a818842 100644 --- a/arch/arm/plat-samsung/include/plat/regs-serial.h +++ b/arch/arm/plat-samsung/include/plat/regs-serial.h | |||
@@ -71,6 +71,7 @@ | |||
71 | #define S3C2410_LCON_IRM (1<<6) | 71 | #define S3C2410_LCON_IRM (1<<6) |
72 | 72 | ||
73 | #define S3C2440_UCON_CLKMASK (3<<10) | 73 | #define S3C2440_UCON_CLKMASK (3<<10) |
74 | #define S3C2440_UCON_CLKSHIFT (10) | ||
74 | #define S3C2440_UCON_PCLK (0<<10) | 75 | #define S3C2440_UCON_PCLK (0<<10) |
75 | #define S3C2440_UCON_UCLK (1<<10) | 76 | #define S3C2440_UCON_UCLK (1<<10) |
76 | #define S3C2440_UCON_PCLK2 (2<<10) | 77 | #define S3C2440_UCON_PCLK2 (2<<10) |
@@ -78,6 +79,7 @@ | |||
78 | #define S3C2443_UCON_EPLL (3<<10) | 79 | #define S3C2443_UCON_EPLL (3<<10) |
79 | 80 | ||
80 | #define S3C6400_UCON_CLKMASK (3<<10) | 81 | #define S3C6400_UCON_CLKMASK (3<<10) |
82 | #define S3C6400_UCON_CLKSHIFT (10) | ||
81 | #define S3C6400_UCON_PCLK (0<<10) | 83 | #define S3C6400_UCON_PCLK (0<<10) |
82 | #define S3C6400_UCON_PCLK2 (2<<10) | 84 | #define S3C6400_UCON_PCLK2 (2<<10) |
83 | #define S3C6400_UCON_UCLK0 (1<<10) | 85 | #define S3C6400_UCON_UCLK0 (1<<10) |
@@ -90,11 +92,14 @@ | |||
90 | #define S3C2440_UCON_DIVSHIFT (12) | 92 | #define S3C2440_UCON_DIVSHIFT (12) |
91 | 93 | ||
92 | #define S3C2412_UCON_CLKMASK (3<<10) | 94 | #define S3C2412_UCON_CLKMASK (3<<10) |
95 | #define S3C2412_UCON_CLKSHIFT (10) | ||
93 | #define S3C2412_UCON_UCLK (1<<10) | 96 | #define S3C2412_UCON_UCLK (1<<10) |
94 | #define S3C2412_UCON_USYSCLK (3<<10) | 97 | #define S3C2412_UCON_USYSCLK (3<<10) |
95 | #define S3C2412_UCON_PCLK (0<<10) | 98 | #define S3C2412_UCON_PCLK (0<<10) |
96 | #define S3C2412_UCON_PCLK2 (2<<10) | 99 | #define S3C2412_UCON_PCLK2 (2<<10) |
97 | 100 | ||
101 | #define S3C2410_UCON_CLKMASK (1 << 10) | ||
102 | #define S3C2410_UCON_CLKSHIFT (10) | ||
98 | #define S3C2410_UCON_UCLK (1<<10) | 103 | #define S3C2410_UCON_UCLK (1<<10) |
99 | #define S3C2410_UCON_SBREAK (1<<4) | 104 | #define S3C2410_UCON_SBREAK (1<<4) |
100 | 105 | ||
@@ -193,6 +198,7 @@ | |||
193 | 198 | ||
194 | /* Following are specific to S5PV210 */ | 199 | /* Following are specific to S5PV210 */ |
195 | #define S5PV210_UCON_CLKMASK (1<<10) | 200 | #define S5PV210_UCON_CLKMASK (1<<10) |
201 | #define S5PV210_UCON_CLKSHIFT (10) | ||
196 | #define S5PV210_UCON_PCLK (0<<10) | 202 | #define S5PV210_UCON_PCLK (0<<10) |
197 | #define S5PV210_UCON_UCLK (1<<10) | 203 | #define S5PV210_UCON_UCLK (1<<10) |
198 | 204 | ||
@@ -221,29 +227,24 @@ | |||
221 | #define S5PV210_UFSTAT_RXMASK (255<<0) | 227 | #define S5PV210_UFSTAT_RXMASK (255<<0) |
222 | #define S5PV210_UFSTAT_RXSHIFT (0) | 228 | #define S5PV210_UFSTAT_RXSHIFT (0) |
223 | 229 | ||
224 | #define NO_NEED_CHECK_CLKSRC 1 | 230 | #define S3C2410_UCON_CLKSEL0 (1 << 0) |
231 | #define S3C2410_UCON_CLKSEL1 (1 << 1) | ||
232 | #define S3C2410_UCON_CLKSEL2 (1 << 2) | ||
233 | #define S3C2410_UCON_CLKSEL3 (1 << 3) | ||
225 | 234 | ||
226 | #ifndef __ASSEMBLY__ | 235 | /* Default values for s5pv210 UCON and UFCON uart registers */ |
236 | #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | ||
237 | S3C2410_UCON_RXILEVEL | \ | ||
238 | S3C2410_UCON_TXIRQMODE | \ | ||
239 | S3C2410_UCON_RXIRQMODE | \ | ||
240 | S3C2410_UCON_RXFIFO_TOI | \ | ||
241 | S3C2443_UCON_RXERR_IRQEN) | ||
227 | 242 | ||
228 | /* struct s3c24xx_uart_clksrc | 243 | #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ |
229 | * | 244 | S5PV210_UFCON_TXTRIG4 | \ |
230 | * this structure defines a named clock source that can be used for the | 245 | S5PV210_UFCON_RXTRIG4) |
231 | * uart, so that the best clock can be selected for the requested baud | ||
232 | * rate. | ||
233 | * | ||
234 | * min_baud and max_baud define the range of baud-rates this clock is | ||
235 | * acceptable for, if they are both zero, it is assumed any baud rate that | ||
236 | * can be generated from this clock will be used. | ||
237 | * | ||
238 | * divisor gives the divisor from the clock to the one seen by the uart | ||
239 | */ | ||
240 | 246 | ||
241 | struct s3c24xx_uart_clksrc { | 247 | #ifndef __ASSEMBLY__ |
242 | const char *name; | ||
243 | unsigned int divisor; | ||
244 | unsigned int min_baud; | ||
245 | unsigned int max_baud; | ||
246 | }; | ||
247 | 248 | ||
248 | /* configuration structure for per-machine configurations for the | 249 | /* configuration structure for per-machine configurations for the |
249 | * serial port | 250 | * serial port |
@@ -257,15 +258,13 @@ struct s3c2410_uartcfg { | |||
257 | unsigned char unused; | 258 | unsigned char unused; |
258 | unsigned short flags; | 259 | unsigned short flags; |
259 | upf_t uart_flags; /* default uart flags */ | 260 | upf_t uart_flags; /* default uart flags */ |
261 | unsigned int clk_sel; | ||
260 | 262 | ||
261 | unsigned int has_fracval; | 263 | unsigned int has_fracval; |
262 | 264 | ||
263 | unsigned long ucon; /* value of ucon for port */ | 265 | unsigned long ucon; /* value of ucon for port */ |
264 | unsigned long ulcon; /* value of ulcon for port */ | 266 | unsigned long ulcon; /* value of ulcon for port */ |
265 | unsigned long ufcon; /* value of ufcon for port */ | 267 | unsigned long ufcon; /* value of ufcon for port */ |
266 | |||
267 | struct s3c24xx_uart_clksrc *clocks; | ||
268 | unsigned int clocks_size; | ||
269 | }; | 268 | }; |
270 | 269 | ||
271 | /* s3c24xx_uart_devs | 270 | /* s3c24xx_uart_devs |