diff options
author | Kevin Hilman <khilman@linaro.org> | 2013-10-14 16:52:59 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2013-10-14 16:53:12 -0400 |
commit | 7a093c74c7a81bd441d78cb4c6c6260284908bc3 (patch) | |
tree | 6c075e71658fa52125223b4ae8bb9d6a8ee8e5cd | |
parent | 0398436522b5deff4c1729ac3b47e4a2280e3ee7 (diff) | |
parent | 73c79afa61cdee2553461ee714bb4716372bdd55 (diff) |
Merge branch 'renesas/dt2' into next/dt
From Simon Horman:
* renesas/dt2: (21 commits)
ARM: shmobile: bockw: fixup ether node naming
ARM: shmobile: r8a7779: add irqpin default status on DTSI
ARM: shmobile: marzen: fixup SMSC IRQ number on DTS
ARM: shmobile: bockw: add SMSC support on DTS
ARM: shmobile: r8a7778: add renesas_intc_irqpin support on DTSI
ARM: shmobile: r8a7791 SMP device tree node
ARM: shmobile: r8a7791 Arch timer device tree node
ARM: shmobile: r8a7791 IRQC device tree node
ARM: shmobile: armadillo800eva-reference: add SDHI and MMCIF interfaces
ARM: shmobile: armadillo-reference: Add PWM backlight node to DT
ARM: shmobile: r8a73a4: add a DT node for the DMAC
ARM: shmobile: r8a7790: add I2C DT nodes
ARM: shmobile: only enable used I2C interfaces in DT on all Renesas boards
ARM: shmobile: r8a7778: add usb phy power control function
ARM: shmobile: r8a7778: add USBHS clock
ARM: shmobile: r8a7791 CMT support
ARM: shmobile: r8a7791 SCIF support
ARM: shmobile: Initial r8a7791 SoC support
ARM: shmobile: r8a7778: add SSI/SRU clock support
ARM: shmobile: r8a7790: Add DU and LVDS clocks
...
Signed-off-by: Kevin Hilman <khilman@linaro.org>
23 files changed, 828 insertions, 18 deletions
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts index 2b49b05ae2f4..9443e93d3cac 100644 --- a/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts +++ b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts | |||
@@ -62,6 +62,7 @@ | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | &i2c5 { | 64 | &i2c5 { |
65 | status = "okay"; | ||
65 | vdd_dvfs: max8973@1b { | 66 | vdd_dvfs: max8973@1b { |
66 | compatible = "maxim,max8973"; | 67 | compatible = "maxim,max8973"; |
67 | reg = <0x1b>; | 68 | reg = <0x1b>; |
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm.dts b/arch/arm/boot/dts/r8a73a4-ape6evm.dts index 72f867e65791..91436b58016f 100644 --- a/arch/arm/boot/dts/r8a73a4-ape6evm.dts +++ b/arch/arm/boot/dts/r8a73a4-ape6evm.dts | |||
@@ -52,6 +52,7 @@ | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | &i2c5 { | 54 | &i2c5 { |
55 | status = "okay"; | ||
55 | vdd_dvfs: max8973@1b { | 56 | vdd_dvfs: max8973@1b { |
56 | compatible = "maxim,max8973"; | 57 | compatible = "maxim,max8973"; |
57 | reg = <0x1b>; | 58 | reg = <0x1b>; |
diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi index 6c26caa880f2..8c81a0c21178 100644 --- a/arch/arm/boot/dts/r8a73a4.dtsi +++ b/arch/arm/boot/dts/r8a73a4.dtsi | |||
@@ -78,6 +78,49 @@ | |||
78 | <0 56 4>, <0 57 4>; | 78 | <0 56 4>, <0 57 4>; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | dmac: dma-multiplexer@0 { | ||
82 | compatible = "renesas,shdma-mux"; | ||
83 | #dma-cells = <1>; | ||
84 | dma-channels = <20>; | ||
85 | dma-requests = <256>; | ||
86 | #address-cells = <2>; | ||
87 | #size-cells = <2>; | ||
88 | ranges; | ||
89 | |||
90 | dma0: dma-controller@e6700020 { | ||
91 | compatible = "renesas,shdma-r8a73a4"; | ||
92 | reg = <0 0xe6700020 0 0x89e0>; | ||
93 | interrupt-parent = <&gic>; | ||
94 | interrupts = <0 220 4 | ||
95 | 0 200 4 | ||
96 | 0 201 4 | ||
97 | 0 202 4 | ||
98 | 0 203 4 | ||
99 | 0 204 4 | ||
100 | 0 205 4 | ||
101 | 0 206 4 | ||
102 | 0 207 4 | ||
103 | 0 208 4 | ||
104 | 0 209 4 | ||
105 | 0 210 4 | ||
106 | 0 211 4 | ||
107 | 0 212 4 | ||
108 | 0 213 4 | ||
109 | 0 214 4 | ||
110 | 0 215 4 | ||
111 | 0 216 4 | ||
112 | 0 217 4 | ||
113 | 0 218 4 | ||
114 | 0 219 4>; | ||
115 | interrupt-names = "error", | ||
116 | "ch0", "ch1", "ch2", "ch3", | ||
117 | "ch4", "ch5", "ch6", "ch7", | ||
118 | "ch8", "ch9", "ch10", "ch11", | ||
119 | "ch12", "ch13", "ch14", "ch15", | ||
120 | "ch16", "ch17", "ch18", "ch19"; | ||
121 | }; | ||
122 | }; | ||
123 | |||
81 | thermal@e61f0000 { | 124 | thermal@e61f0000 { |
82 | compatible = "renesas,rcar-thermal"; | 125 | compatible = "renesas,rcar-thermal"; |
83 | reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>, | 126 | reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>, |
@@ -93,6 +136,7 @@ | |||
93 | reg = <0 0xe6500000 0 0x428>; | 136 | reg = <0 0xe6500000 0 0x428>; |
94 | interrupt-parent = <&gic>; | 137 | interrupt-parent = <&gic>; |
95 | interrupts = <0 174 0x4>; | 138 | interrupts = <0 174 0x4>; |
139 | status = "disabled"; | ||
96 | }; | 140 | }; |
97 | 141 | ||
98 | i2c1: i2c@e6510000 { | 142 | i2c1: i2c@e6510000 { |
@@ -102,6 +146,7 @@ | |||
102 | reg = <0 0xe6510000 0 0x428>; | 146 | reg = <0 0xe6510000 0 0x428>; |
103 | interrupt-parent = <&gic>; | 147 | interrupt-parent = <&gic>; |
104 | interrupts = <0 175 0x4>; | 148 | interrupts = <0 175 0x4>; |
149 | status = "disabled"; | ||
105 | }; | 150 | }; |
106 | 151 | ||
107 | i2c2: i2c@e6520000 { | 152 | i2c2: i2c@e6520000 { |
@@ -111,6 +156,7 @@ | |||
111 | reg = <0 0xe6520000 0 0x428>; | 156 | reg = <0 0xe6520000 0 0x428>; |
112 | interrupt-parent = <&gic>; | 157 | interrupt-parent = <&gic>; |
113 | interrupts = <0 176 0x4>; | 158 | interrupts = <0 176 0x4>; |
159 | status = "disabled"; | ||
114 | }; | 160 | }; |
115 | 161 | ||
116 | i2c3: i2c@e6530000 { | 162 | i2c3: i2c@e6530000 { |
@@ -120,6 +166,7 @@ | |||
120 | reg = <0 0xe6530000 0 0x428>; | 166 | reg = <0 0xe6530000 0 0x428>; |
121 | interrupt-parent = <&gic>; | 167 | interrupt-parent = <&gic>; |
122 | interrupts = <0 177 0x4>; | 168 | interrupts = <0 177 0x4>; |
169 | status = "disabled"; | ||
123 | }; | 170 | }; |
124 | 171 | ||
125 | i2c4: i2c@e6540000 { | 172 | i2c4: i2c@e6540000 { |
@@ -129,6 +176,7 @@ | |||
129 | reg = <0 0xe6540000 0 0x428>; | 176 | reg = <0 0xe6540000 0 0x428>; |
130 | interrupt-parent = <&gic>; | 177 | interrupt-parent = <&gic>; |
131 | interrupts = <0 178 0x4>; | 178 | interrupts = <0 178 0x4>; |
179 | status = "disabled"; | ||
132 | }; | 180 | }; |
133 | 181 | ||
134 | i2c5: i2c@e60b0000 { | 182 | i2c5: i2c@e60b0000 { |
@@ -138,6 +186,7 @@ | |||
138 | reg = <0 0xe60b0000 0 0x428>; | 186 | reg = <0 0xe60b0000 0 0x428>; |
139 | interrupt-parent = <&gic>; | 187 | interrupt-parent = <&gic>; |
140 | interrupts = <0 179 0x4>; | 188 | interrupts = <0 179 0x4>; |
189 | status = "disabled"; | ||
141 | }; | 190 | }; |
142 | 191 | ||
143 | i2c6: i2c@e6550000 { | 192 | i2c6: i2c@e6550000 { |
@@ -147,6 +196,7 @@ | |||
147 | reg = <0 0xe6550000 0 0x428>; | 196 | reg = <0 0xe6550000 0 0x428>; |
148 | interrupt-parent = <&gic>; | 197 | interrupt-parent = <&gic>; |
149 | interrupts = <0 184 0x4>; | 198 | interrupts = <0 184 0x4>; |
199 | status = "disabled"; | ||
150 | }; | 200 | }; |
151 | 201 | ||
152 | i2c7: i2c@e6560000 { | 202 | i2c7: i2c@e6560000 { |
@@ -156,6 +206,7 @@ | |||
156 | reg = <0 0xe6560000 0 0x428>; | 206 | reg = <0 0xe6560000 0 0x428>; |
157 | interrupt-parent = <&gic>; | 207 | interrupt-parent = <&gic>; |
158 | interrupts = <0 185 0x4>; | 208 | interrupts = <0 185 0x4>; |
209 | status = "disabled"; | ||
159 | }; | 210 | }; |
160 | 211 | ||
161 | i2c8: i2c@e6570000 { | 212 | i2c8: i2c@e6570000 { |
@@ -165,6 +216,7 @@ | |||
165 | reg = <0 0xe6570000 0 0x428>; | 216 | reg = <0 0xe6570000 0 0x428>; |
166 | interrupt-parent = <&gic>; | 217 | interrupt-parent = <&gic>; |
167 | interrupts = <0 173 0x4>; | 218 | interrupts = <0 173 0x4>; |
219 | status = "disabled"; | ||
168 | }; | 220 | }; |
169 | 221 | ||
170 | mmcif0: mmcif@ee200000 { | 222 | mmcif0: mmcif@ee200000 { |
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts index c638e4ab91b8..1c56c5e56950 100644 --- a/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +++ b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | |||
@@ -11,6 +11,7 @@ | |||
11 | /dts-v1/; | 11 | /dts-v1/; |
12 | /include/ "r8a7740.dtsi" | 12 | /include/ "r8a7740.dtsi" |
13 | #include <dt-bindings/gpio/gpio.h> | 13 | #include <dt-bindings/gpio/gpio.h> |
14 | #include <dt-bindings/pwm/pwm.h> | ||
14 | 15 | ||
15 | / { | 16 | / { |
16 | model = "armadillo 800 eva reference"; | 17 | model = "armadillo 800 eva reference"; |
@@ -34,6 +35,33 @@ | |||
34 | regulator-boot-on; | 35 | regulator-boot-on; |
35 | }; | 36 | }; |
36 | 37 | ||
38 | vcc_sdhi0: regulator@1 { | ||
39 | compatible = "regulator-fixed"; | ||
40 | |||
41 | regulator-name = "SDHI0 Vcc"; | ||
42 | regulator-min-microvolt = <3300000>; | ||
43 | regulator-max-microvolt = <3300000>; | ||
44 | |||
45 | gpio = <&pfc 75 GPIO_ACTIVE_HIGH>; | ||
46 | enable-active-high; | ||
47 | }; | ||
48 | |||
49 | vccq_sdhi0: regulator@2 { | ||
50 | compatible = "regulator-gpio"; | ||
51 | |||
52 | regulator-name = "SDHI0 VccQ"; | ||
53 | regulator-min-microvolt = <1800000>; | ||
54 | regulator-max-microvolt = <3300000>; | ||
55 | vin-supply = <&vcc_sdhi0>; | ||
56 | |||
57 | enable-gpio = <&pfc 74 GPIO_ACTIVE_HIGH>; | ||
58 | gpios = <&pfc 17 GPIO_ACTIVE_HIGH>; | ||
59 | states = <3300000 0 | ||
60 | 1800000 1>; | ||
61 | |||
62 | enable-active-high; | ||
63 | }; | ||
64 | |||
37 | leds { | 65 | leds { |
38 | compatible = "gpio-leds"; | 66 | compatible = "gpio-leds"; |
39 | led1 { | 67 | led1 { |
@@ -49,9 +77,19 @@ | |||
49 | gpios = <&pfc 177 GPIO_ACTIVE_HIGH>; | 77 | gpios = <&pfc 177 GPIO_ACTIVE_HIGH>; |
50 | }; | 78 | }; |
51 | }; | 79 | }; |
80 | |||
81 | backlight { | ||
82 | compatible = "pwm-backlight"; | ||
83 | pwms = <&tpu 2 33333 PWM_POLARITY_INVERTED>; | ||
84 | brightness-levels = <0 1 2 4 8 16 32 64 128 255>; | ||
85 | default-brightness-level = <9>; | ||
86 | pinctrl-0 = <&backlight_pins>; | ||
87 | pinctrl-names = "default"; | ||
88 | }; | ||
52 | }; | 89 | }; |
53 | 90 | ||
54 | &i2c0 { | 91 | &i2c0 { |
92 | status = "okay"; | ||
55 | touchscreen: st1232@55 { | 93 | touchscreen: st1232@55 { |
56 | compatible = "sitronix,st1232"; | 94 | compatible = "sitronix,st1232"; |
57 | reg = <0x55>; | 95 | reg = <0x55>; |
@@ -76,4 +114,44 @@ | |||
76 | renesas,groups = "intc_irq10"; | 114 | renesas,groups = "intc_irq10"; |
77 | renesas,function = "intc"; | 115 | renesas,function = "intc"; |
78 | }; | 116 | }; |
117 | |||
118 | backlight_pins: backlight { | ||
119 | renesas,groups = "tpu0_to2_1"; | ||
120 | renesas,function = "tpu0"; | ||
121 | }; | ||
122 | |||
123 | mmc0_pins: mmc0 { | ||
124 | renesas,groups = "mmc0_data8_1", "mmc0_ctrl_1"; | ||
125 | renesas,function = "mmc0"; | ||
126 | }; | ||
127 | |||
128 | sdhi0_pins: sdhi0 { | ||
129 | renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_wp"; | ||
130 | renesas,function = "sdhi0"; | ||
131 | }; | ||
132 | }; | ||
133 | |||
134 | &tpu { | ||
135 | status = "okay"; | ||
136 | }; | ||
137 | |||
138 | &mmcif0 { | ||
139 | pinctrl-0 = <&mmc0_pins>; | ||
140 | pinctrl-names = "default"; | ||
141 | |||
142 | vmmc-supply = <®_3p3v>; | ||
143 | bus-width = <8>; | ||
144 | non-removable; | ||
145 | status = "okay"; | ||
146 | }; | ||
147 | |||
148 | &sdhi0 { | ||
149 | pinctrl-0 = <&sdhi0_pins>; | ||
150 | pinctrl-names = "default"; | ||
151 | |||
152 | vmmc-supply = <&vcc_sdhi0>; | ||
153 | vqmmc-supply = <&vccq_sdhi0>; | ||
154 | bus-width = <4>; | ||
155 | cd-gpios = <&pfc 167 GPIO_ACTIVE_LOW>; | ||
156 | status = "okay"; | ||
79 | }; | 157 | }; |
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi index 44d3d520e01f..ae1e230f711d 100644 --- a/arch/arm/boot/dts/r8a7740.dtsi +++ b/arch/arm/boot/dts/r8a7740.dtsi | |||
@@ -131,6 +131,7 @@ | |||
131 | 0 202 0x4 | 131 | 0 202 0x4 |
132 | 0 203 0x4 | 132 | 0 203 0x4 |
133 | 0 204 0x4>; | 133 | 0 204 0x4>; |
134 | status = "disabled"; | ||
134 | }; | 135 | }; |
135 | 136 | ||
136 | i2c1: i2c@e6c20000 { | 137 | i2c1: i2c@e6c20000 { |
@@ -143,6 +144,7 @@ | |||
143 | 0 71 0x4 | 144 | 0 71 0x4 |
144 | 0 72 0x4 | 145 | 0 72 0x4 |
145 | 0 73 0x4>; | 146 | 0 73 0x4>; |
147 | status = "disabled"; | ||
146 | }; | 148 | }; |
147 | 149 | ||
148 | pfc: pfc@e6050000 { | 150 | pfc: pfc@e6050000 { |
@@ -159,4 +161,37 @@ | |||
159 | status = "disabled"; | 161 | status = "disabled"; |
160 | #pwm-cells = <3>; | 162 | #pwm-cells = <3>; |
161 | }; | 163 | }; |
164 | |||
165 | mmcif0: mmcif@e6bd0000 { | ||
166 | compatible = "renesas,sh-mmcif"; | ||
167 | reg = <0xe6bd0000 0x100>; | ||
168 | interrupt-parent = <&gic>; | ||
169 | interrupts = <0 56 4 | ||
170 | 0 57 4>; | ||
171 | status = "disabled"; | ||
172 | }; | ||
173 | |||
174 | sdhi0: sdhi@e6850000 { | ||
175 | compatible = "renesas,sdhi-r8a7740"; | ||
176 | reg = <0xe6850000 0x100>; | ||
177 | interrupt-parent = <&gic>; | ||
178 | interrupts = <0 117 4 | ||
179 | 0 118 4 | ||
180 | 0 119 4>; | ||
181 | cap-sd-highspeed; | ||
182 | cap-sdio-irq; | ||
183 | status = "disabled"; | ||
184 | }; | ||
185 | |||
186 | sdhi1: sdhi@e6860000 { | ||
187 | compatible = "renesas,sdhi-r8a7740"; | ||
188 | reg = <0xe6860000 0x100>; | ||
189 | interrupt-parent = <&gic>; | ||
190 | interrupts = <0 121 4 | ||
191 | 0 122 4 | ||
192 | 0 123 4>; | ||
193 | cap-sd-highspeed; | ||
194 | cap-sdio-irq; | ||
195 | status = "disabled"; | ||
196 | }; | ||
162 | }; | 197 | }; |
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts index 9bb903a3230d..969e386e852c 100644 --- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts +++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts | |||
@@ -22,11 +22,36 @@ | |||
22 | compatible = "renesas,bockw-reference", "renesas,r8a7778"; | 22 | compatible = "renesas,bockw-reference", "renesas,r8a7778"; |
23 | 23 | ||
24 | chosen { | 24 | chosen { |
25 | bootargs = "console=ttySC0,115200 ignore_loglevel rw"; | 25 | bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp rw"; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | memory { | 28 | memory { |
29 | device_type = "memory"; | 29 | device_type = "memory"; |
30 | reg = <0x60000000 0x10000000>; | 30 | reg = <0x60000000 0x10000000>; |
31 | }; | 31 | }; |
32 | |||
33 | fixedregulator3v3: fixedregulator@0 { | ||
34 | compatible = "regulator-fixed"; | ||
35 | regulator-name = "fixed-3.3V"; | ||
36 | regulator-min-microvolt = <3300000>; | ||
37 | regulator-max-microvolt = <3300000>; | ||
38 | regulator-boot-on; | ||
39 | regulator-always-on; | ||
40 | }; | ||
41 | |||
42 | ethernet@18300000 { | ||
43 | compatible = "smsc,lan9220", "smsc,lan9115"; | ||
44 | reg = <0x18300000 0x1000>; | ||
45 | |||
46 | phy-mode = "mii"; | ||
47 | interrupt-parent = <&irqpin>; | ||
48 | interrupts = <0 0>; /* IRQ0: hwirq 0 on irqpin */ | ||
49 | reg-io-width = <4>; | ||
50 | vddvario-supply = <&fixedregulator3v3>; | ||
51 | vdd33a-supply = <&fixedregulator3v3>; | ||
52 | }; | ||
53 | }; | ||
54 | |||
55 | &irqpin { | ||
56 | status = "okay"; | ||
32 | }; | 57 | }; |
diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi index 45ac404ab6d8..5d08f1162e8c 100644 --- a/arch/arm/boot/dts/r8a7778.dtsi +++ b/arch/arm/boot/dts/r8a7778.dtsi | |||
@@ -33,6 +33,25 @@ | |||
33 | <0xfe430000 0x100>; | 33 | <0xfe430000 0x100>; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | /* irqpin: IRQ0 - IRQ3 */ | ||
37 | irqpin: irqpin@fe78001c { | ||
38 | compatible = "renesas,intc-irqpin"; | ||
39 | #interrupt-cells = <2>; | ||
40 | interrupt-controller; | ||
41 | status = "disabled"; /* default off */ | ||
42 | reg = <0xfe78001c 4>, | ||
43 | <0xfe780010 4>, | ||
44 | <0xfe780024 4>, | ||
45 | <0xfe780044 4>, | ||
46 | <0xfe780064 4>; | ||
47 | interrupt-parent = <&gic>; | ||
48 | interrupts = <0 27 0x4 | ||
49 | 0 28 0x4 | ||
50 | 0 29 0x4 | ||
51 | 0 30 0x4>; | ||
52 | sense-bitfield-width = <2>; | ||
53 | }; | ||
54 | |||
36 | gpio0: gpio@ffc40000 { | 55 | gpio0: gpio@ffc40000 { |
37 | compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar"; | 56 | compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar"; |
38 | reg = <0xffc40000 0x2c>; | 57 | reg = <0xffc40000 0x2c>; |
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts index 6d5508392252..ab4110aa3c3b 100644 --- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts +++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts | |||
@@ -42,8 +42,8 @@ | |||
42 | pinctrl-names = "default"; | 42 | pinctrl-names = "default"; |
43 | 43 | ||
44 | phy-mode = "mii"; | 44 | phy-mode = "mii"; |
45 | interrupt-parent = <&gic>; | 45 | interrupt-parent = <&irqpin0>; |
46 | interrupts = <0 28 0x4>; | 46 | interrupts = <1 0>; /* IRQ1: hwirq 1 on irqpin0 */ |
47 | reg-io-width = <4>; | 47 | reg-io-width = <4>; |
48 | vddvario-supply = <&fixedregulator3v3>; | 48 | vddvario-supply = <&fixedregulator3v3>; |
49 | vdd33a-supply = <&fixedregulator3v3>; | 49 | vdd33a-supply = <&fixedregulator3v3>; |
@@ -63,6 +63,10 @@ | |||
63 | }; | 63 | }; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | &irqpin0 { | ||
67 | status = "okay"; | ||
68 | }; | ||
69 | |||
66 | &pfc { | 70 | &pfc { |
67 | pinctrl-0 = <&scif2_pins &scif4_pins &sdhi0_pins>; | 71 | pinctrl-0 = <&scif2_pins &scif4_pins &sdhi0_pins>; |
68 | pinctrl-names = "default"; | 72 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi index 23a62447359c..c2fb49b54b4f 100644 --- a/arch/arm/boot/dts/r8a7779.dtsi +++ b/arch/arm/boot/dts/r8a7779.dtsi | |||
@@ -135,6 +135,7 @@ | |||
135 | irqpin0: irqpin@fe780010 { | 135 | irqpin0: irqpin@fe780010 { |
136 | compatible = "renesas,intc-irqpin"; | 136 | compatible = "renesas,intc-irqpin"; |
137 | #interrupt-cells = <2>; | 137 | #interrupt-cells = <2>; |
138 | status = "disabled"; | ||
138 | interrupt-controller; | 139 | interrupt-controller; |
139 | reg = <0xfe78001c 4>, | 140 | reg = <0xfe78001c 4>, |
140 | <0xfe780010 4>, | 141 | <0xfe780010 4>, |
@@ -156,6 +157,7 @@ | |||
156 | reg = <0xffc70000 0x1000>; | 157 | reg = <0xffc70000 0x1000>; |
157 | interrupt-parent = <&gic>; | 158 | interrupt-parent = <&gic>; |
158 | interrupts = <0 79 0x4>; | 159 | interrupts = <0 79 0x4>; |
160 | status = "disabled"; | ||
159 | }; | 161 | }; |
160 | 162 | ||
161 | i2c1: i2c@ffc71000 { | 163 | i2c1: i2c@ffc71000 { |
@@ -165,6 +167,7 @@ | |||
165 | reg = <0xffc71000 0x1000>; | 167 | reg = <0xffc71000 0x1000>; |
166 | interrupt-parent = <&gic>; | 168 | interrupt-parent = <&gic>; |
167 | interrupts = <0 82 0x4>; | 169 | interrupts = <0 82 0x4>; |
170 | status = "disabled"; | ||
168 | }; | 171 | }; |
169 | 172 | ||
170 | i2c2: i2c@ffc72000 { | 173 | i2c2: i2c@ffc72000 { |
@@ -174,6 +177,7 @@ | |||
174 | reg = <0xffc72000 0x1000>; | 177 | reg = <0xffc72000 0x1000>; |
175 | interrupt-parent = <&gic>; | 178 | interrupt-parent = <&gic>; |
176 | interrupts = <0 80 0x4>; | 179 | interrupts = <0 80 0x4>; |
180 | status = "disabled"; | ||
177 | }; | 181 | }; |
178 | 182 | ||
179 | i2c3: i2c@ffc73000 { | 183 | i2c3: i2c@ffc73000 { |
@@ -183,6 +187,7 @@ | |||
183 | reg = <0xffc73000 0x1000>; | 187 | reg = <0xffc73000 0x1000>; |
184 | interrupt-parent = <&gic>; | 188 | interrupt-parent = <&gic>; |
185 | interrupts = <0 81 0x4>; | 189 | interrupts = <0 81 0x4>; |
190 | status = "disabled"; | ||
186 | }; | 191 | }; |
187 | 192 | ||
188 | pfc: pfc@fffc0000 { | 193 | pfc: pfc@fffc0000 { |
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi index a0cfb6618884..47bc1cbfd075 100644 --- a/arch/arm/boot/dts/r8a7790.dtsi +++ b/arch/arm/boot/dts/r8a7790.dtsi | |||
@@ -176,6 +176,46 @@ | |||
176 | interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>; | 176 | interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>; |
177 | }; | 177 | }; |
178 | 178 | ||
179 | i2c0: i2c@e6508000 { | ||
180 | #address-cells = <1>; | ||
181 | #size-cells = <0>; | ||
182 | compatible = "renesas,i2c-r8a7790"; | ||
183 | reg = <0 0xe6508000 0 0x40>; | ||
184 | interrupt-parent = <&gic>; | ||
185 | interrupts = <0 287 0x4>; | ||
186 | status = "disabled"; | ||
187 | }; | ||
188 | |||
189 | i2c1: i2c@e6518000 { | ||
190 | #address-cells = <1>; | ||
191 | #size-cells = <0>; | ||
192 | compatible = "renesas,i2c-r8a7790"; | ||
193 | reg = <0 0xe6518000 0 0x40>; | ||
194 | interrupt-parent = <&gic>; | ||
195 | interrupts = <0 288 0x4>; | ||
196 | status = "disabled"; | ||
197 | }; | ||
198 | |||
199 | i2c2: i2c@e6530000 { | ||
200 | #address-cells = <1>; | ||
201 | #size-cells = <0>; | ||
202 | compatible = "renesas,i2c-r8a7790"; | ||
203 | reg = <0 0xe6530000 0 0x40>; | ||
204 | interrupt-parent = <&gic>; | ||
205 | interrupts = <0 286 0x4>; | ||
206 | status = "disabled"; | ||
207 | }; | ||
208 | |||
209 | i2c3: i2c@e6540000 { | ||
210 | #address-cells = <1>; | ||
211 | #size-cells = <0>; | ||
212 | compatible = "renesas,i2c-r8a7790"; | ||
213 | reg = <0 0xe6540000 0 0x40>; | ||
214 | interrupt-parent = <&gic>; | ||
215 | interrupts = <0 290 0x4>; | ||
216 | status = "disabled"; | ||
217 | }; | ||
218 | |||
179 | mmcif0: mmcif@ee200000 { | 219 | mmcif0: mmcif@ee200000 { |
180 | compatible = "renesas,sh-mmcif"; | 220 | compatible = "renesas,sh-mmcif"; |
181 | reg = <0 0xee200000 0 0x80>; | 221 | reg = <0 0xee200000 0 0x80>; |
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi new file mode 100644 index 000000000000..fea5cfef4691 --- /dev/null +++ b/arch/arm/boot/dts/r8a7791.dtsi | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Device Tree Source for the r8a7791 SoC | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Electronics Corporation | ||
5 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | / { | ||
13 | compatible = "renesas,r8a7791"; | ||
14 | interrupt-parent = <&gic>; | ||
15 | #address-cells = <2>; | ||
16 | #size-cells = <2>; | ||
17 | |||
18 | cpus { | ||
19 | #address-cells = <1>; | ||
20 | #size-cells = <0>; | ||
21 | |||
22 | cpu0: cpu@0 { | ||
23 | device_type = "cpu"; | ||
24 | compatible = "arm,cortex-a15"; | ||
25 | reg = <0>; | ||
26 | clock-frequency = <1300000000>; | ||
27 | }; | ||
28 | |||
29 | cpu1: cpu@1 { | ||
30 | device_type = "cpu"; | ||
31 | compatible = "arm,cortex-a15"; | ||
32 | reg = <1>; | ||
33 | clock-frequency = <1300000000>; | ||
34 | }; | ||
35 | }; | ||
36 | |||
37 | gic: interrupt-controller@f1001000 { | ||
38 | compatible = "arm,cortex-a15-gic"; | ||
39 | #interrupt-cells = <3>; | ||
40 | #address-cells = <0>; | ||
41 | interrupt-controller; | ||
42 | reg = <0 0xf1001000 0 0x1000>, | ||
43 | <0 0xf1002000 0 0x1000>, | ||
44 | <0 0xf1004000 0 0x2000>, | ||
45 | <0 0xf1006000 0 0x2000>; | ||
46 | interrupts = <1 9 0xf04>; | ||
47 | }; | ||
48 | |||
49 | timer { | ||
50 | compatible = "arm,armv7-timer"; | ||
51 | interrupts = <1 13 0xf08>, | ||
52 | <1 14 0xf08>, | ||
53 | <1 11 0xf08>, | ||
54 | <1 10 0xf08>; | ||
55 | }; | ||
56 | |||
57 | irqc0: interrupt-controller@e61c0000 { | ||
58 | compatible = "renesas,irqc"; | ||
59 | #interrupt-cells = <2>; | ||
60 | interrupt-controller; | ||
61 | reg = <0 0xe61c0000 0 0x200>; | ||
62 | interrupt-parent = <&gic>; | ||
63 | interrupts = <0 0 4>, | ||
64 | <0 1 4>, | ||
65 | <0 2 4>, | ||
66 | <0 3 4>, | ||
67 | <0 12 4>, | ||
68 | <0 13 4>, | ||
69 | <0 14 4>, | ||
70 | <0 15 4>, | ||
71 | <0 16 4>, | ||
72 | <0 17 4>; | ||
73 | }; | ||
74 | }; | ||
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts index 212230629f27..8ee06dd81799 100644 --- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts +++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts | |||
@@ -108,6 +108,7 @@ | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | &i2c0 { | 110 | &i2c0 { |
111 | status = "okay"; | ||
111 | as3711@40 { | 112 | as3711@40 { |
112 | compatible = "ams,as3711"; | 113 | compatible = "ams,as3711"; |
113 | reg = <0x40>; | 114 | reg = <0x40>; |
@@ -183,6 +184,7 @@ | |||
183 | &i2c3 { | 184 | &i2c3 { |
184 | pinctrl-0 = <&i2c3_pins>; | 185 | pinctrl-0 = <&i2c3_pins>; |
185 | pinctrl-names = "default"; | 186 | pinctrl-names = "default"; |
187 | status = "okay"; | ||
186 | }; | 188 | }; |
187 | 189 | ||
188 | &mmcif { | 190 | &mmcif { |
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index ba59a5875a10..f56665af1e42 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi | |||
@@ -135,6 +135,7 @@ | |||
135 | 0 168 0x4 | 135 | 0 168 0x4 |
136 | 0 169 0x4 | 136 | 0 169 0x4 |
137 | 0 170 0x4>; | 137 | 0 170 0x4>; |
138 | status = "disabled"; | ||
138 | }; | 139 | }; |
139 | 140 | ||
140 | i2c1: i2c@e6822000 { | 141 | i2c1: i2c@e6822000 { |
@@ -147,6 +148,7 @@ | |||
147 | 0 52 0x4 | 148 | 0 52 0x4 |
148 | 0 53 0x4 | 149 | 0 53 0x4 |
149 | 0 54 0x4>; | 150 | 0 54 0x4>; |
151 | status = "disabled"; | ||
150 | }; | 152 | }; |
151 | 153 | ||
152 | i2c2: i2c@e6824000 { | 154 | i2c2: i2c@e6824000 { |
@@ -159,6 +161,7 @@ | |||
159 | 0 172 0x4 | 161 | 0 172 0x4 |
160 | 0 173 0x4 | 162 | 0 173 0x4 |
161 | 0 174 0x4>; | 163 | 0 174 0x4>; |
164 | status = "disabled"; | ||
162 | }; | 165 | }; |
163 | 166 | ||
164 | i2c3: i2c@e6826000 { | 167 | i2c3: i2c@e6826000 { |
@@ -171,6 +174,7 @@ | |||
171 | 0 184 0x4 | 174 | 0 184 0x4 |
172 | 0 185 0x4 | 175 | 0 185 0x4 |
173 | 0 186 0x4>; | 176 | 0 186 0x4>; |
177 | status = "disabled"; | ||
174 | }; | 178 | }; |
175 | 179 | ||
176 | i2c4: i2c@e6828000 { | 180 | i2c4: i2c@e6828000 { |
@@ -183,6 +187,7 @@ | |||
183 | 0 188 0x4 | 187 | 0 188 0x4 |
184 | 0 189 0x4 | 188 | 0 189 0x4 |
185 | 0 190 0x4>; | 189 | 0 190 0x4>; |
190 | status = "disabled"; | ||
186 | }; | 191 | }; |
187 | 192 | ||
188 | mmcif: mmcif@e6bd0000 { | 193 | mmcif: mmcif@e6bd0000 { |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 1f94c310c477..b45240512ce0 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -101,6 +101,12 @@ config ARCH_R8A7790 | |||
101 | select SH_CLK_CPG | 101 | select SH_CLK_CPG |
102 | select RENESAS_IRQC | 102 | select RENESAS_IRQC |
103 | 103 | ||
104 | config ARCH_R8A7791 | ||
105 | bool "R-Car M2 (R8A77910)" | ||
106 | select ARM_GIC | ||
107 | select CPU_V7 | ||
108 | select SH_CLK_CPG | ||
109 | |||
104 | config ARCH_EMEV2 | 110 | config ARCH_EMEV2 |
105 | bool "Emma Mobile EV2" | 111 | bool "Emma Mobile EV2" |
106 | select ARCH_WANT_OPTIONAL_GPIOLIB | 112 | select ARCH_WANT_OPTIONAL_GPIOLIB |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 2705bfa8c113..228193cc9a38 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o | |||
15 | obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o | 15 | obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o |
16 | obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o | 16 | obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o |
17 | obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o | 17 | obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o |
18 | obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o | ||
18 | obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o | 19 | obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o |
19 | 20 | ||
20 | # Clock objects | 21 | # Clock objects |
@@ -27,6 +28,7 @@ obj-$(CONFIG_ARCH_R8A7740) += clock-r8a7740.o | |||
27 | obj-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o | 28 | obj-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o |
28 | obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o | 29 | obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o |
29 | obj-$(CONFIG_ARCH_R8A7790) += clock-r8a7790.o | 30 | obj-$(CONFIG_ARCH_R8A7790) += clock-r8a7790.o |
31 | obj-$(CONFIG_ARCH_R8A7791) += clock-r8a7791.o | ||
30 | obj-$(CONFIG_ARCH_EMEV2) += clock-emev2.o | 32 | obj-$(CONFIG_ARCH_EMEV2) += clock-emev2.o |
31 | endif | 33 | endif |
32 | 34 | ||
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index c4bf2d8fb111..fb6af83858e3 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c | |||
@@ -69,6 +69,15 @@ static struct clk extal_clk = { | |||
69 | .mapping = &cpg_mapping, | 69 | .mapping = &cpg_mapping, |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static struct clk audio_clk_a = { | ||
73 | }; | ||
74 | |||
75 | static struct clk audio_clk_b = { | ||
76 | }; | ||
77 | |||
78 | static struct clk audio_clk_c = { | ||
79 | }; | ||
80 | |||
72 | /* | 81 | /* |
73 | * clock ratio of these clock will be updated | 82 | * clock ratio of these clock will be updated |
74 | * on r8a7778_clock_init() | 83 | * on r8a7778_clock_init() |
@@ -100,18 +109,23 @@ static struct clk *main_clks[] = { | |||
100 | &p_clk, | 109 | &p_clk, |
101 | &g_clk, | 110 | &g_clk, |
102 | &z_clk, | 111 | &z_clk, |
112 | &audio_clk_a, | ||
113 | &audio_clk_b, | ||
114 | &audio_clk_c, | ||
103 | }; | 115 | }; |
104 | 116 | ||
105 | enum { | 117 | enum { |
106 | MSTP331, | 118 | MSTP331, |
107 | MSTP323, MSTP322, MSTP321, | 119 | MSTP323, MSTP322, MSTP321, |
120 | MSTP311, MSTP310, | ||
121 | MSTP309, MSTP308, MSTP307, | ||
108 | MSTP114, | 122 | MSTP114, |
109 | MSTP110, MSTP109, | 123 | MSTP110, MSTP109, |
110 | MSTP100, | 124 | MSTP100, |
111 | MSTP030, | 125 | MSTP030, |
112 | MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, | 126 | MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, |
113 | MSTP016, MSTP015, | 127 | MSTP016, MSTP015, MSTP012, MSTP011, MSTP010, |
114 | MSTP007, | 128 | MSTP009, MSTP008, MSTP007, |
115 | MSTP_NR }; | 129 | MSTP_NR }; |
116 | 130 | ||
117 | static struct clk mstp_clks[MSTP_NR] = { | 131 | static struct clk mstp_clks[MSTP_NR] = { |
@@ -119,6 +133,11 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
119 | [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */ | 133 | [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */ |
120 | [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */ | 134 | [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */ |
121 | [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */ | 135 | [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */ |
136 | [MSTP311] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 11, 0), /* SSI4 */ | ||
137 | [MSTP310] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 10, 0), /* SSI5 */ | ||
138 | [MSTP309] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 9, 0), /* SSI6 */ | ||
139 | [MSTP308] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 8, 0), /* SSI7 */ | ||
140 | [MSTP307] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 7, 0), /* SSI8 */ | ||
122 | [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */ | 141 | [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */ |
123 | [MSTP110] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 10, 0), /* VIN0 */ | 142 | [MSTP110] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 10, 0), /* VIN0 */ |
124 | [MSTP109] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 9, 0), /* VIN1 */ | 143 | [MSTP109] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 9, 0), /* VIN1 */ |
@@ -135,11 +154,20 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
135 | [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */ | 154 | [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */ |
136 | [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */ | 155 | [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */ |
137 | [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */ | 156 | [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */ |
157 | [MSTP012] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 12, 0), /* SSI0 */ | ||
158 | [MSTP011] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 11, 0), /* SSI1 */ | ||
159 | [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ | ||
160 | [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ | ||
161 | [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ | ||
138 | [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ | 162 | [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ |
139 | }; | 163 | }; |
140 | 164 | ||
141 | static struct clk_lookup lookups[] = { | 165 | static struct clk_lookup lookups[] = { |
142 | /* main */ | 166 | /* main */ |
167 | CLKDEV_CON_ID("audio_clk_a", &audio_clk_a), | ||
168 | CLKDEV_CON_ID("audio_clk_b", &audio_clk_b), | ||
169 | CLKDEV_CON_ID("audio_clk_c", &audio_clk_c), | ||
170 | CLKDEV_CON_ID("audio_clk_internal", &s1_clk), | ||
143 | CLKDEV_CON_ID("shyway_clk", &s_clk), | 171 | CLKDEV_CON_ID("shyway_clk", &s_clk), |
144 | CLKDEV_CON_ID("peripheral_clk", &p_clk), | 172 | CLKDEV_CON_ID("peripheral_clk", &p_clk), |
145 | 173 | ||
@@ -153,6 +181,7 @@ static struct clk_lookup lookups[] = { | |||
153 | CLKDEV_DEV_ID("r8a7778-vin.1", &mstp_clks[MSTP109]), /* VIN1 */ | 181 | CLKDEV_DEV_ID("r8a7778-vin.1", &mstp_clks[MSTP109]), /* VIN1 */ |
154 | CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ | 182 | CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ |
155 | CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ | 183 | CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ |
184 | CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP100]), /* USB FUNC */ | ||
156 | CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ | 185 | CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ |
157 | CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ | 186 | CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ |
158 | CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */ | 187 | CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */ |
@@ -168,6 +197,17 @@ static struct clk_lookup lookups[] = { | |||
168 | CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ | 197 | CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ |
169 | CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ | 198 | CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ |
170 | CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */ | 199 | CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */ |
200 | CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */ | ||
201 | |||
202 | CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]), | ||
203 | CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]), | ||
204 | CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]), | ||
205 | CLKDEV_ICK_ID("ssi.3", "rcar_sound", &mstp_clks[MSTP009]), | ||
206 | CLKDEV_ICK_ID("ssi.4", "rcar_sound", &mstp_clks[MSTP311]), | ||
207 | CLKDEV_ICK_ID("ssi.5", "rcar_sound", &mstp_clks[MSTP310]), | ||
208 | CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]), | ||
209 | CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]), | ||
210 | CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]), | ||
171 | }; | 211 | }; |
172 | 212 | ||
173 | void __init r8a7778_clock_init(void) | 213 | void __init r8a7778_clock_init(void) |
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index bd6ad922eb7e..1f7080fab0a5 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c | |||
@@ -200,7 +200,7 @@ static struct clk_lookup lookups[] = { | |||
200 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ | 200 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ |
201 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ | 201 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ |
202 | CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP320]), /* SDHI3 */ | 202 | CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP320]), /* SDHI3 */ |
203 | CLKDEV_DEV_ID("rcar-du.0", &mstp_clks[MSTP103]), /* DU */ | 203 | CLKDEV_DEV_ID("rcar-du-r8a7779", &mstp_clks[MSTP103]), /* DU */ |
204 | }; | 204 | }; |
205 | 205 | ||
206 | void __init r8a7779_clock_init(void) | 206 | void __init r8a7779_clock_init(void) |
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c index fc36d3db0b4d..d99b87bc76ea 100644 --- a/arch/arm/mach-shmobile/clock-r8a7790.c +++ b/arch/arm/mach-shmobile/clock-r8a7790.c | |||
@@ -182,7 +182,7 @@ static struct clk div6_clks[DIV6_NR] = { | |||
182 | /* MSTP */ | 182 | /* MSTP */ |
183 | enum { | 183 | enum { |
184 | MSTP813, | 184 | MSTP813, |
185 | MSTP721, MSTP720, | 185 | MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720, |
186 | MSTP717, MSTP716, | 186 | MSTP717, MSTP716, |
187 | MSTP522, | 187 | MSTP522, |
188 | MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304, | 188 | MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304, |
@@ -193,6 +193,11 @@ enum { | |||
193 | 193 | ||
194 | static struct clk mstp_clks[MSTP_NR] = { | 194 | static struct clk mstp_clks[MSTP_NR] = { |
195 | [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */ | 195 | [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */ |
196 | [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */ | ||
197 | [MSTP725] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 25, 0), /* LVDS1 */ | ||
198 | [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */ | ||
199 | [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */ | ||
200 | [MSTP722] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 22, 0), /* DU2 */ | ||
196 | [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ | 201 | [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ |
197 | [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ | 202 | [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ |
198 | [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */ | 203 | [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */ |
@@ -251,6 +256,11 @@ static struct clk_lookup lookups[] = { | |||
251 | CLKDEV_CON_ID("ssprs", &div6_clks[DIV6_SSPRS]), | 256 | CLKDEV_CON_ID("ssprs", &div6_clks[DIV6_SSPRS]), |
252 | 257 | ||
253 | /* MSTP */ | 258 | /* MSTP */ |
259 | CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7790", &mstp_clks[MSTP726]), | ||
260 | CLKDEV_ICK_ID("lvds.1", "rcar-du-r8a7790", &mstp_clks[MSTP725]), | ||
261 | CLKDEV_ICK_ID("du.0", "rcar-du-r8a7790", &mstp_clks[MSTP724]), | ||
262 | CLKDEV_ICK_ID("du.1", "rcar-du-r8a7790", &mstp_clks[MSTP723]), | ||
263 | CLKDEV_ICK_ID("du.2", "rcar-du-r8a7790", &mstp_clks[MSTP722]), | ||
254 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), | 264 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), |
255 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), | 265 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), |
256 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), | 266 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), |
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c new file mode 100644 index 000000000000..c9a26f16ce5b --- /dev/null +++ b/arch/arm/mach-shmobile/clock-r8a7791.c | |||
@@ -0,0 +1,237 @@ | |||
1 | /* | ||
2 | * r8a7791 clock framework support | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Electronics Corporation | ||
5 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
6 | * Copyright (C) 2013 Magnus Damm | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; version 2 of the License. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | */ | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/sh_clk.h> | ||
25 | #include <linux/clkdev.h> | ||
26 | #include <mach/clock.h> | ||
27 | #include <mach/common.h> | ||
28 | |||
29 | /* | ||
30 | * MD EXTAL PLL0 PLL1 PLL3 | ||
31 | * 14 13 19 (MHz) *1 *1 | ||
32 | *--------------------------------------------------- | ||
33 | * 0 0 0 15 x 1 x172/2 x208/2 x106 | ||
34 | * 0 0 1 15 x 1 x172/2 x208/2 x88 | ||
35 | * 0 1 0 20 x 1 x130/2 x156/2 x80 | ||
36 | * 0 1 1 20 x 1 x130/2 x156/2 x66 | ||
37 | * 1 0 0 26 / 2 x200/2 x240/2 x122 | ||
38 | * 1 0 1 26 / 2 x200/2 x240/2 x102 | ||
39 | * 1 1 0 30 / 2 x172/2 x208/2 x106 | ||
40 | * 1 1 1 30 / 2 x172/2 x208/2 x88 | ||
41 | * | ||
42 | * *1 : Table 7.6 indicates VCO ouput (PLLx = VCO/2) | ||
43 | * see "p1 / 2" on R8A7791_CLOCK_ROOT() below | ||
44 | */ | ||
45 | |||
46 | #define MD(nr) (1 << nr) | ||
47 | |||
48 | #define CPG_BASE 0xe6150000 | ||
49 | #define CPG_LEN 0x1000 | ||
50 | |||
51 | #define SMSTPCR0 0xE6150130 | ||
52 | #define SMSTPCR1 0xE6150134 | ||
53 | #define SMSTPCR2 0xe6150138 | ||
54 | #define SMSTPCR3 0xE615013C | ||
55 | #define SMSTPCR5 0xE6150144 | ||
56 | #define SMSTPCR7 0xe615014c | ||
57 | #define SMSTPCR8 0xE6150990 | ||
58 | #define SMSTPCR9 0xE6150994 | ||
59 | #define SMSTPCR10 0xE6150998 | ||
60 | #define SMSTPCR11 0xE615099C | ||
61 | |||
62 | #define MODEMR 0xE6160060 | ||
63 | #define SDCKCR 0xE6150074 | ||
64 | #define SD2CKCR 0xE6150078 | ||
65 | #define SD3CKCR 0xE615007C | ||
66 | #define MMC0CKCR 0xE6150240 | ||
67 | #define MMC1CKCR 0xE6150244 | ||
68 | #define SSPCKCR 0xE6150248 | ||
69 | #define SSPRSCKCR 0xE615024C | ||
70 | |||
71 | static struct clk_mapping cpg_mapping = { | ||
72 | .phys = CPG_BASE, | ||
73 | .len = CPG_LEN, | ||
74 | }; | ||
75 | |||
76 | static struct clk extal_clk = { | ||
77 | /* .rate will be updated on r8a7791_clock_init() */ | ||
78 | .mapping = &cpg_mapping, | ||
79 | }; | ||
80 | |||
81 | static struct sh_clk_ops followparent_clk_ops = { | ||
82 | .recalc = followparent_recalc, | ||
83 | }; | ||
84 | |||
85 | static struct clk main_clk = { | ||
86 | /* .parent will be set r8a73a4_clock_init */ | ||
87 | .ops = &followparent_clk_ops, | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * clock ratio of these clock will be updated | ||
92 | * on r8a7791_clock_init() | ||
93 | */ | ||
94 | SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1); | ||
95 | SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1); | ||
96 | |||
97 | /* fixed ratio clock */ | ||
98 | SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2); | ||
99 | SH_FIXED_RATIO_CLK_SET(cp_clk, extal_clk, 1, 2); | ||
100 | |||
101 | SH_FIXED_RATIO_CLK_SET(pll1_div2_clk, pll1_clk, 1, 2); | ||
102 | SH_FIXED_RATIO_CLK_SET(hp_clk, pll1_clk, 1, 12); | ||
103 | SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24); | ||
104 | SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024)); | ||
105 | SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15); | ||
106 | |||
107 | static struct clk *main_clks[] = { | ||
108 | &extal_clk, | ||
109 | &extal_div2_clk, | ||
110 | &main_clk, | ||
111 | &pll1_clk, | ||
112 | &pll1_div2_clk, | ||
113 | &pll3_clk, | ||
114 | &hp_clk, | ||
115 | &p_clk, | ||
116 | &rclk_clk, | ||
117 | &mp_clk, | ||
118 | &cp_clk, | ||
119 | }; | ||
120 | |||
121 | /* MSTP */ | ||
122 | enum { | ||
123 | MSTP721, MSTP720, | ||
124 | MSTP719, MSTP718, MSTP715, MSTP714, | ||
125 | MSTP216, MSTP207, MSTP206, | ||
126 | MSTP204, MSTP203, MSTP202, MSTP1105, MSTP1106, MSTP1107, | ||
127 | MSTP124, | ||
128 | MSTP_NR | ||
129 | }; | ||
130 | |||
131 | static struct clk mstp_clks[MSTP_NR] = { | ||
132 | [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ | ||
133 | [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ | ||
134 | [MSTP719] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 19, 0), /* SCIF2 */ | ||
135 | [MSTP718] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 18, 0), /* SCIF3 */ | ||
136 | [MSTP715] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 15, 0), /* SCIF4 */ | ||
137 | [MSTP714] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 14, 0), /* SCIF5 */ | ||
138 | [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */ | ||
139 | [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */ | ||
140 | [MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */ | ||
141 | [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */ | ||
142 | [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */ | ||
143 | [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */ | ||
144 | [MSTP1105] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 5, 0), /* SCIFA3 */ | ||
145 | [MSTP1106] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 6, 0), /* SCIFA4 */ | ||
146 | [MSTP1107] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 7, 0), /* SCIFA5 */ | ||
147 | [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */ | ||
148 | }; | ||
149 | |||
150 | static struct clk_lookup lookups[] = { | ||
151 | |||
152 | /* main clocks */ | ||
153 | CLKDEV_CON_ID("extal", &extal_clk), | ||
154 | CLKDEV_CON_ID("extal_div2", &extal_div2_clk), | ||
155 | CLKDEV_CON_ID("main", &main_clk), | ||
156 | CLKDEV_CON_ID("pll1", &pll1_clk), | ||
157 | CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk), | ||
158 | CLKDEV_CON_ID("pll3", &pll3_clk), | ||
159 | CLKDEV_CON_ID("hp", &hp_clk), | ||
160 | CLKDEV_CON_ID("p", &p_clk), | ||
161 | CLKDEV_CON_ID("rclk", &rclk_clk), | ||
162 | CLKDEV_CON_ID("mp", &mp_clk), | ||
163 | CLKDEV_CON_ID("cp", &cp_clk), | ||
164 | CLKDEV_CON_ID("peripheral_clk", &hp_clk), | ||
165 | |||
166 | /* MSTP */ | ||
167 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ | ||
168 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ | ||
169 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), /* SCIFB0 */ | ||
170 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP207]), /* SCIFB1 */ | ||
171 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]), /* SCIFB2 */ | ||
172 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]), /* SCIFA2 */ | ||
173 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]), /* SCIF0 */ | ||
174 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]), /* SCIF1 */ | ||
175 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP719]), /* SCIF2 */ | ||
176 | CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */ | ||
177 | CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */ | ||
178 | CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */ | ||
179 | CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */ | ||
180 | CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */ | ||
181 | CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */ | ||
182 | CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), | ||
183 | }; | ||
184 | |||
185 | #define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \ | ||
186 | extal_clk.rate = e * 1000 * 1000; \ | ||
187 | main_clk.parent = m; \ | ||
188 | SH_CLK_SET_RATIO(&pll1_clk_ratio, p1 / 2, 1); \ | ||
189 | if (mode & MD(19)) \ | ||
190 | SH_CLK_SET_RATIO(&pll3_clk_ratio, p31, 1); \ | ||
191 | else \ | ||
192 | SH_CLK_SET_RATIO(&pll3_clk_ratio, p30, 1) | ||
193 | |||
194 | |||
195 | void __init r8a7791_clock_init(void) | ||
196 | { | ||
197 | void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); | ||
198 | u32 mode; | ||
199 | int k, ret = 0; | ||
200 | |||
201 | BUG_ON(!modemr); | ||
202 | mode = ioread32(modemr); | ||
203 | iounmap(modemr); | ||
204 | |||
205 | switch (mode & (MD(14) | MD(13))) { | ||
206 | case 0: | ||
207 | R8A7791_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88); | ||
208 | break; | ||
209 | case MD(13): | ||
210 | R8A7791_CLOCK_ROOT(20, &extal_clk, 130, 156, 80, 66); | ||
211 | break; | ||
212 | case MD(14): | ||
213 | R8A7791_CLOCK_ROOT(26, &extal_div2_clk, 200, 240, 122, 102); | ||
214 | break; | ||
215 | case MD(13) | MD(14): | ||
216 | R8A7791_CLOCK_ROOT(30, &extal_div2_clk, 172, 208, 106, 88); | ||
217 | break; | ||
218 | } | ||
219 | |||
220 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) | ||
221 | ret = clk_register(main_clks[k]); | ||
222 | |||
223 | if (!ret) | ||
224 | ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); | ||
225 | |||
226 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
227 | |||
228 | if (!ret) | ||
229 | shmobile_clk_init(); | ||
230 | else | ||
231 | goto epanic; | ||
232 | |||
233 | return; | ||
234 | |||
235 | epanic: | ||
236 | panic("failed to setup r8a7791 clocks\n"); | ||
237 | } | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index adfcf51b163d..ea1dca6880f4 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h | |||
@@ -35,4 +35,6 @@ extern void r8a7778_clock_init(void); | |||
35 | extern void r8a7778_init_irq_extpin(int irlm); | 35 | extern void r8a7778_init_irq_extpin(int irlm); |
36 | extern void r8a7778_pinmux_init(void); | 36 | extern void r8a7778_pinmux_init(void); |
37 | 37 | ||
38 | extern int r8a7778_usb_phy_power(bool enable); | ||
39 | |||
38 | #endif /* __ASM_R8A7778_H__ */ | 40 | #endif /* __ASM_R8A7778_H__ */ |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h new file mode 100644 index 000000000000..2e6d66131083 --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_R8A7791_H__ | ||
2 | #define __ASM_R8A7791_H__ | ||
3 | |||
4 | void r8a7791_add_dt_devices(void); | ||
5 | void r8a7791_clock_init(void); | ||
6 | void r8a7791_init_early(void); | ||
7 | |||
8 | #endif /* __ASM_R8A7791_H__ */ | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 6a2657ebd197..e484d1420a01 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -95,29 +95,46 @@ static struct sh_timer_config sh_tmu1_platform_data __initdata = { | |||
95 | &sh_tmu##idx##_platform_data, \ | 95 | &sh_tmu##idx##_platform_data, \ |
96 | sizeof(sh_tmu##idx##_platform_data)) | 96 | sizeof(sh_tmu##idx##_platform_data)) |
97 | 97 | ||
98 | /* USB */ | 98 | int r8a7778_usb_phy_power(bool enable) |
99 | static struct usb_phy *phy; | 99 | { |
100 | static struct usb_phy *phy = NULL; | ||
101 | int ret = 0; | ||
102 | |||
103 | if (!phy) | ||
104 | phy = usb_get_phy(USB_PHY_TYPE_USB2); | ||
105 | |||
106 | if (IS_ERR(phy)) { | ||
107 | pr_err("kernel doesn't have usb phy driver\n"); | ||
108 | return PTR_ERR(phy); | ||
109 | } | ||
110 | |||
111 | if (enable) | ||
112 | ret = usb_phy_init(phy); | ||
113 | else | ||
114 | usb_phy_shutdown(phy); | ||
100 | 115 | ||
116 | return ret; | ||
117 | } | ||
118 | |||
119 | /* USB */ | ||
101 | static int usb_power_on(struct platform_device *pdev) | 120 | static int usb_power_on(struct platform_device *pdev) |
102 | { | 121 | { |
103 | if (IS_ERR(phy)) | 122 | int ret = r8a7778_usb_phy_power(true); |
104 | return PTR_ERR(phy); | 123 | |
124 | if (ret) | ||
125 | return ret; | ||
105 | 126 | ||
106 | pm_runtime_enable(&pdev->dev); | 127 | pm_runtime_enable(&pdev->dev); |
107 | pm_runtime_get_sync(&pdev->dev); | 128 | pm_runtime_get_sync(&pdev->dev); |
108 | 129 | ||
109 | usb_phy_init(phy); | ||
110 | |||
111 | return 0; | 130 | return 0; |
112 | } | 131 | } |
113 | 132 | ||
114 | static void usb_power_off(struct platform_device *pdev) | 133 | static void usb_power_off(struct platform_device *pdev) |
115 | { | 134 | { |
116 | if (IS_ERR(phy)) | 135 | if (r8a7778_usb_phy_power(false)) |
117 | return; | 136 | return; |
118 | 137 | ||
119 | usb_phy_shutdown(phy); | ||
120 | |||
121 | pm_runtime_put_sync(&pdev->dev); | 138 | pm_runtime_put_sync(&pdev->dev); |
122 | pm_runtime_disable(&pdev->dev); | 139 | pm_runtime_disable(&pdev->dev); |
123 | } | 140 | } |
@@ -353,8 +370,6 @@ void __init r8a7778_add_standard_devices(void) | |||
353 | 370 | ||
354 | void __init r8a7778_init_late(void) | 371 | void __init r8a7778_init_late(void) |
355 | { | 372 | { |
356 | phy = usb_get_phy(USB_PHY_TYPE_USB2); | ||
357 | |||
358 | platform_device_register_full(&ehci_info); | 373 | platform_device_register_full(&ehci_info); |
359 | platform_device_register_full(&ohci_info); | 374 | platform_device_register_full(&ohci_info); |
360 | } | 375 | } |
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c new file mode 100644 index 000000000000..b56399d2e1de --- /dev/null +++ b/arch/arm/mach-shmobile/setup-r8a7791.c | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | * r8a7791 processor support | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Electronics Corporation | ||
5 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
6 | * Copyright (C) 2013 Magnus Damm | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; version 2 of the License. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/irq.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/of_platform.h> | ||
25 | #include <linux/serial_sci.h> | ||
26 | #include <linux/sh_timer.h> | ||
27 | #include <mach/common.h> | ||
28 | #include <mach/irqs.h> | ||
29 | #include <mach/r8a7791.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | |||
32 | #define SCIF_COMMON(scif_type, baseaddr, irq) \ | ||
33 | .type = scif_type, \ | ||
34 | .mapbase = baseaddr, \ | ||
35 | .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ | ||
36 | .irqs = SCIx_IRQ_MUXED(irq) | ||
37 | |||
38 | #define SCIFA_DATA(index, baseaddr, irq) \ | ||
39 | [index] = { \ | ||
40 | SCIF_COMMON(PORT_SCIFA, baseaddr, irq), \ | ||
41 | .scbrr_algo_id = SCBRR_ALGO_4, \ | ||
42 | .scscr = SCSCR_RE | SCSCR_TE, \ | ||
43 | } | ||
44 | |||
45 | #define SCIFB_DATA(index, baseaddr, irq) \ | ||
46 | [index] = { \ | ||
47 | SCIF_COMMON(PORT_SCIFB, baseaddr, irq), \ | ||
48 | .scbrr_algo_id = SCBRR_ALGO_4, \ | ||
49 | .scscr = SCSCR_RE | SCSCR_TE, \ | ||
50 | } | ||
51 | |||
52 | #define SCIF_DATA(index, baseaddr, irq) \ | ||
53 | [index] = { \ | ||
54 | SCIF_COMMON(PORT_SCIF, baseaddr, irq), \ | ||
55 | .scbrr_algo_id = SCBRR_ALGO_2, \ | ||
56 | .scscr = SCSCR_RE | SCSCR_TE, \ | ||
57 | } | ||
58 | |||
59 | #define HSCIF_DATA(index, baseaddr, irq) \ | ||
60 | [index] = { \ | ||
61 | SCIF_COMMON(PORT_HSCIF, baseaddr, irq), \ | ||
62 | .scbrr_algo_id = SCBRR_ALGO_6, \ | ||
63 | .scscr = SCSCR_RE | SCSCR_TE, \ | ||
64 | } | ||
65 | |||
66 | enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFA2, SCIF0, SCIF1, | ||
67 | SCIF2, SCIF3, SCIF4, SCIF5, SCIFA3, SCIFA4, SCIFA5 }; | ||
68 | |||
69 | static const struct plat_sci_port scif[] __initconst = { | ||
70 | SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */ | ||
71 | SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */ | ||
72 | SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */ | ||
73 | SCIFB_DATA(SCIFB1, 0xe6c30000, gic_spi(149)), /* SCIFB1 */ | ||
74 | SCIFB_DATA(SCIFB2, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */ | ||
75 | SCIFA_DATA(SCIFA2, 0xe6c60000, gic_spi(151)), /* SCIFA2 */ | ||
76 | SCIF_DATA(SCIF0, 0xe6e60000, gic_spi(152)), /* SCIF0 */ | ||
77 | SCIF_DATA(SCIF1, 0xe6e68000, gic_spi(153)), /* SCIF1 */ | ||
78 | SCIF_DATA(SCIF2, 0xe6e58000, gic_spi(22)), /* SCIF2 */ | ||
79 | SCIF_DATA(SCIF3, 0xe6ea8000, gic_spi(23)), /* SCIF3 */ | ||
80 | SCIF_DATA(SCIF4, 0xe6ee0000, gic_spi(24)), /* SCIF4 */ | ||
81 | SCIF_DATA(SCIF5, 0xe6ee8000, gic_spi(25)), /* SCIF5 */ | ||
82 | SCIFA_DATA(SCIFA3, 0xe6c70000, gic_spi(29)), /* SCIFA3 */ | ||
83 | SCIFA_DATA(SCIFA4, 0xe6c78000, gic_spi(30)), /* SCIFA4 */ | ||
84 | SCIFA_DATA(SCIFA5, 0xe6c80000, gic_spi(31)), /* SCIFA5 */ | ||
85 | }; | ||
86 | |||
87 | static inline void r8a7791_register_scif(int idx) | ||
88 | { | ||
89 | platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx], | ||
90 | sizeof(struct plat_sci_port)); | ||
91 | } | ||
92 | |||
93 | static const struct sh_timer_config cmt00_platform_data __initconst = { | ||
94 | .name = "CMT00", | ||
95 | .timer_bit = 0, | ||
96 | .clockevent_rating = 80, | ||
97 | }; | ||
98 | |||
99 | static const struct resource cmt00_resources[] __initconst = { | ||
100 | DEFINE_RES_MEM(0xffca0510, 0x0c), | ||
101 | DEFINE_RES_MEM(0xffca0500, 0x04), | ||
102 | DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ | ||
103 | }; | ||
104 | |||
105 | #define r8a7791_register_cmt(idx) \ | ||
106 | platform_device_register_resndata(&platform_bus, "sh_cmt", \ | ||
107 | idx, cmt##idx##_resources, \ | ||
108 | ARRAY_SIZE(cmt##idx##_resources), \ | ||
109 | &cmt##idx##_platform_data, \ | ||
110 | sizeof(struct sh_timer_config)) | ||
111 | |||
112 | void __init r8a7791_add_dt_devices(void) | ||
113 | { | ||
114 | r8a7791_register_scif(SCIFA0); | ||
115 | r8a7791_register_scif(SCIFA1); | ||
116 | r8a7791_register_scif(SCIFB0); | ||
117 | r8a7791_register_scif(SCIFB1); | ||
118 | r8a7791_register_scif(SCIFB2); | ||
119 | r8a7791_register_scif(SCIFA2); | ||
120 | r8a7791_register_scif(SCIF0); | ||
121 | r8a7791_register_scif(SCIF1); | ||
122 | r8a7791_register_scif(SCIF2); | ||
123 | r8a7791_register_scif(SCIF3); | ||
124 | r8a7791_register_scif(SCIF4); | ||
125 | r8a7791_register_scif(SCIF5); | ||
126 | r8a7791_register_scif(SCIFA3); | ||
127 | r8a7791_register_scif(SCIFA4); | ||
128 | r8a7791_register_scif(SCIFA5); | ||
129 | r8a7791_register_cmt(00); | ||
130 | } | ||
131 | |||
132 | void __init r8a7791_init_early(void) | ||
133 | { | ||
134 | #ifndef CONFIG_ARM_ARCH_TIMER | ||
135 | shmobile_setup_delay(1300, 2, 4); /* Cortex-A15 @ 1300MHz */ | ||
136 | #endif | ||
137 | } | ||
138 | |||
139 | #ifdef CONFIG_USE_OF | ||
140 | static const char *r8a7791_boards_compat_dt[] __initdata = { | ||
141 | "renesas,r8a7791", | ||
142 | NULL, | ||
143 | }; | ||
144 | |||
145 | DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") | ||
146 | .init_early = r8a7791_init_early, | ||
147 | .dt_compat = r8a7791_boards_compat_dt, | ||
148 | MACHINE_END | ||
149 | #endif /* CONFIG_USE_OF */ | ||