aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi-b.dts16
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi44
-rw-r--r--arch/arm/boot/dts/da850-evm.dts11
-rw-r--r--arch/arm/boot/dts/da850.dtsi51
-rw-r--r--arch/arm/boot/dts/ste-nomadik-s8815.dts30
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi256
-rw-r--r--arch/arm/configs/da8xx_omapl_defconfig1
-rw-r--r--arch/arm/mach-davinci/Kconfig1
-rw-r--r--arch/arm/mach-nomadik/Kconfig10
-rw-r--r--arch/arm/mach-nomadik/Makefile6
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c353
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c358
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.h4
-rw-r--r--arch/arm/mach-nomadik/i2c-8815nhk.c88
-rw-r--r--arch/arm/mach-nomadik/include/mach/hardware.h90
-rw-r--r--arch/arm/mach-nomadik/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-nomadik/include/mach/uncompress.h1
19 files changed, 675 insertions, 650 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 22bfac3e6975..b70ee954f69f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -901,10 +901,12 @@ config ARCH_NOMADIK
901 select ARCH_REQUIRE_GPIOLIB 901 select ARCH_REQUIRE_GPIOLIB
902 select ARM_AMBA 902 select ARM_AMBA
903 select ARM_VIC 903 select ARM_VIC
904 select CLKSRC_NOMADIK_MTU
904 select COMMON_CLK 905 select COMMON_CLK
905 select CPU_ARM926T 906 select CPU_ARM926T
906 select GENERIC_CLOCKEVENTS 907 select GENERIC_CLOCKEVENTS
907 select MIGHT_HAVE_CACHE_L2X0 908 select MIGHT_HAVE_CACHE_L2X0
909 select USE_OF
908 select PINCTRL 910 select PINCTRL
909 select PINCTRL_STN8815 911 select PINCTRL_STN8815
910 select SPARSE_IRQ 912 select SPARSE_IRQ
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 2e7a7e2de11a..ca683a66b498 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -101,6 +101,7 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
101 imx28-m28evk.dtb \ 101 imx28-m28evk.dtb \
102 imx28-sps1.dtb \ 102 imx28-sps1.dtb \
103 imx28-tx28.dtb 103 imx28-tx28.dtb
104dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
104dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ 105dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
105 omap3-beagle.dtb \ 106 omap3-beagle.dtb \
106 omap3-beagle-xm.dtb \ 107 omap3-beagle-xm.dtb \
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 9b72054a0bc0..aafda174a605 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -1,5 +1,4 @@
1/dts-v1/; 1/dts-v1/;
2/memreserve/ 0x0c000000 0x04000000;
3/include/ "bcm2835.dtsi" 2/include/ "bcm2835.dtsi"
4 3
5/ { 4/ {
@@ -25,3 +24,18 @@
25 brcm,function = <7>; /* alt3 */ 24 brcm,function = <7>; /* alt3 */
26 }; 25 };
27}; 26};
27
28&i2c0 {
29 status = "okay";
30 clock-frequency = <100000>;
31};
32
33&i2c1 {
34 status = "okay";
35 clock-frequency = <100000>;
36};
37
38&sdhci {
39 status = "okay";
40 bus-width = <4>;
41};
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 8917550fd1bb..4bf2a8774aa7 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -63,5 +63,49 @@
63 interrupt-controller; 63 interrupt-controller;
64 #interrupt-cells = <2>; 64 #interrupt-cells = <2>;
65 }; 65 };
66
67 i2c0: i2c@20205000 {
68 compatible = "brcm,bcm2835-i2c";
69 reg = <0x7e205000 0x1000>;
70 interrupts = <2 21>;
71 clocks = <&clk_i2c>;
72 status = "disabled";
73 };
74
75 i2c1: i2c@20804000 {
76 compatible = "brcm,bcm2835-i2c";
77 reg = <0x7e804000 0x1000>;
78 interrupts = <2 21>;
79 clocks = <&clk_i2c>;
80 status = "disabled";
81 };
82
83 sdhci: sdhci {
84 compatible = "brcm,bcm2835-sdhci";
85 reg = <0x7e300000 0x100>;
86 interrupts = <2 30>;
87 clocks = <&clk_mmc>;
88 status = "disabled";
89 };
90 };
91
92 clocks {
93 compatible = "simple-bus";
94 #address-cells = <1>;
95 #size-cells = <0>;
96
97 clk_mmc: mmc {
98 compatible = "fixed-clock";
99 reg = <0>;
100 #clock-cells = <0>;
101 clock-frequency = <100000000>;
102 };
103
104 clk_i2c: i2c {
105 compatible = "fixed-clock";
106 reg = <1>;
107 #clock-cells = <0>;
108 clock-frequency = <150000000>;
109 };
66 }; 110 };
67}; 111};
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 37dc5a3243b8..fa04152b24bf 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -15,6 +15,9 @@
15 model = "DA850/AM1808/OMAP-L138 EVM"; 15 model = "DA850/AM1808/OMAP-L138 EVM";
16 16
17 soc { 17 soc {
18 pmx_core: pinmux@1c14120 {
19 status = "okay";
20 };
18 serial0: serial@1c42000 { 21 serial0: serial@1c42000 {
19 status = "okay"; 22 status = "okay";
20 }; 23 };
@@ -24,5 +27,13 @@
24 serial2: serial@1d0d000 { 27 serial2: serial@1d0d000 {
25 status = "okay"; 28 status = "okay";
26 }; 29 };
30 rtc0: rtc@1c23000 {
31 status = "okay";
32 };
33 };
34 nand_cs3@62000000 {
35 status = "okay";
36 pinctrl-names = "default";
37 pinctrl-0 = <&nand_cs3_pins>;
27 }; 38 };
28}; 39};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 640ab75c20db..8dd15c0426a8 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -28,14 +28,41 @@
28 #address-cells = <1>; 28 #address-cells = <1>;
29 #size-cells = <1>; 29 #size-cells = <1>;
30 ranges = <0x0 0x01c00000 0x400000>; 30 ranges = <0x0 0x01c00000 0x400000>;
31 interrupt-parent = <&intc>;
31 32
33 pmx_core: pinmux@1c14120 {
34 compatible = "pinctrl-single";
35 reg = <0x14120 0x50>;
36 #address-cells = <1>;
37 #size-cells = <0>;
38 pinctrl-single,bit-per-mux;
39 pinctrl-single,register-width = <32>;
40 pinctrl-single,function-mask = <0xffffffff>;
41 status = "disabled";
42
43 nand_cs3_pins: pinmux_nand_pins {
44 pinctrl-single,bits = <
45 /* EMA_OE, EMA_WE */
46 0x1c 0x00110000 0x00ff0000
47 /* EMA_CS[4],EMA_CS[3]*/
48 0x1c 0x00000110 0x00000ff0
49 /*
50 * EMA_D[0], EMA_D[1], EMA_D[2],
51 * EMA_D[3], EMA_D[4], EMA_D[5],
52 * EMA_D[6], EMA_D[7]
53 */
54 0x24 0x11111111 0xffffffff
55 /* EMA_A[1], EMA_A[2] */
56 0x30 0x01100000 0x0ff00000
57 >;
58 };
59 };
32 serial0: serial@1c42000 { 60 serial0: serial@1c42000 {
33 compatible = "ns16550a"; 61 compatible = "ns16550a";
34 reg = <0x42000 0x100>; 62 reg = <0x42000 0x100>;
35 clock-frequency = <150000000>; 63 clock-frequency = <150000000>;
36 reg-shift = <2>; 64 reg-shift = <2>;
37 interrupts = <25>; 65 interrupts = <25>;
38 interrupt-parent = <&intc>;
39 status = "disabled"; 66 status = "disabled";
40 }; 67 };
41 serial1: serial@1d0c000 { 68 serial1: serial@1d0c000 {
@@ -44,7 +71,6 @@
44 clock-frequency = <150000000>; 71 clock-frequency = <150000000>;
45 reg-shift = <2>; 72 reg-shift = <2>;
46 interrupts = <53>; 73 interrupts = <53>;
47 interrupt-parent = <&intc>;
48 status = "disabled"; 74 status = "disabled";
49 }; 75 };
50 serial2: serial@1d0d000 { 76 serial2: serial@1d0d000 {
@@ -53,8 +79,27 @@
53 clock-frequency = <150000000>; 79 clock-frequency = <150000000>;
54 reg-shift = <2>; 80 reg-shift = <2>;
55 interrupts = <61>; 81 interrupts = <61>;
56 interrupt-parent = <&intc>;
57 status = "disabled"; 82 status = "disabled";
58 }; 83 };
84 rtc0: rtc@1c23000 {
85 compatible = "ti,da830-rtc";
86 reg = <0x23000 0x1000>;
87 interrupts = <19
88 19>;
89 status = "disabled";
90 };
91 };
92 nand_cs3@62000000 {
93 compatible = "ti,davinci-nand";
94 reg = <0x62000000 0x807ff
95 0x68000000 0x8000>;
96 ti,davinci-chipselect = <1>;
97 ti,davinci-mask-ale = <0>;
98 ti,davinci-mask-cle = <0>;
99 ti,davinci-mask-chipsel = <0>;
100 ti,davinci-ecc-mode = "hw";
101 ti,davinci-ecc-bits = <4>;
102 ti,davinci-nand-use-bbt;
103 status = "disabled";
59 }; 104 };
60}; 105};
diff --git a/arch/arm/boot/dts/ste-nomadik-s8815.dts b/arch/arm/boot/dts/ste-nomadik-s8815.dts
new file mode 100644
index 000000000000..b28fbf3408e3
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-s8815.dts
@@ -0,0 +1,30 @@
1/*
2 * Device Tree for the ST-Ericsson Nomadik S8815 board
3 * Produced by Calao Systems
4 */
5
6/dts-v1/;
7/include/ "ste-nomadik-stn8815.dtsi"
8
9/ {
10 model = "Calao Systems USB-S8815";
11 compatible = "calaosystems,usb-s8815";
12
13 chosen {
14 bootargs = "root=/dev/ram0 console=ttyAMA1,115200n8 earlyprintk";
15 };
16
17 /* Custom board node with GPIO pins to active etc */
18 usb-s8815 {
19 /* The S8815 is using this very GPIO pin for the SMSC91x IRQs */
20 ethernet-gpio {
21 gpios = <&gpio3 19 0x1>;
22 interrupts = <19 0x1>;
23 interrupt-parent = <&gpio3>;
24 };
25 /* This will bias the MMC/SD card detect line */
26 mmcsd-gpio {
27 gpios = <&gpio3 16 0x1>;
28 };
29 };
30};
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
new file mode 100644
index 000000000000..4a4aab395141
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -0,0 +1,256 @@
1/*
2 * Device Tree for the ST-Ericsson Nomadik 8815 STn8815 SoC
3 */
4/include/ "skeleton.dtsi"
5
6/ {
7 #address-cells = <1>;
8 #size-cells = <1>;
9
10 memory {
11 reg = <0x00000000 0x04000000>,
12 <0x08000000 0x04000000>;
13 };
14
15 L2: l2-cache {
16 compatible = "arm,l210-cache";
17 reg = <0x10210000 0x1000>;
18 interrupt-parent = <&vica>;
19 interrupts = <30>;
20 cache-unified;
21 cache-level = <2>;
22 };
23
24 mtu0 {
25 /* Nomadik system timer */
26 reg = <0x101e2000 0x1000>;
27 interrupt-parent = <&vica>;
28 interrupts = <4>;
29 };
30
31 mtu1 {
32 /* Secondary timer */
33 reg = <0x101e3000 0x1000>;
34 interrupt-parent = <&vica>;
35 interrupts = <5>;
36 };
37
38 gpio0: gpio@101e4000 {
39 compatible = "st,nomadik-gpio";
40 reg = <0x101e4000 0x80>;
41 interrupt-parent = <&vica>;
42 interrupts = <6>;
43 interrupt-controller;
44 #interrupt-cells = <2>;
45 gpio-controller;
46 #gpio-cells = <2>;
47 gpio-bank = <0>;
48 };
49
50 gpio1: gpio@101e5000 {
51 compatible = "st,nomadik-gpio";
52 reg = <0x101e5000 0x80>;
53 interrupt-parent = <&vica>;
54 interrupts = <7>;
55 interrupt-controller;
56 #interrupt-cells = <2>;
57 gpio-controller;
58 #gpio-cells = <2>;
59 gpio-bank = <1>;
60 };
61
62 gpio2: gpio@101e6000 {
63 compatible = "st,nomadik-gpio";
64 reg = <0x101e6000 0x80>;
65 interrupt-parent = <&vica>;
66 interrupts = <8>;
67 interrupt-controller;
68 #interrupt-cells = <2>;
69 gpio-controller;
70 #gpio-cells = <2>;
71 gpio-bank = <2>;
72 };
73
74 gpio3: gpio@101e7000 {
75 compatible = "st,nomadik-gpio";
76 reg = <0x101e7000 0x80>;
77 interrupt-parent = <&vica>;
78 interrupts = <9>;
79 interrupt-controller;
80 #interrupt-cells = <2>;
81 gpio-controller;
82 #gpio-cells = <2>;
83 gpio-bank = <3>;
84 };
85
86 pinctrl {
87 compatible = "stericsson,nmk-pinctrl-stn8815";
88 };
89
90 /* A NAND flash of 128 MiB */
91 fsmc: flash@40000000 {
92 compatible = "stericsson,fsmc-nand";
93 #address-cells = <1>;
94 #size-cells = <1>;
95 reg = <0x10100000 0x1000>, /* FSMC Register*/
96 <0x40000000 0x2000>, /* NAND Base DATA */
97 <0x41000000 0x2000>, /* NAND Base ADDR */
98 <0x40800000 0x2000>; /* NAND Base CMD */
99 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
100 status = "okay";
101
102 partition@0 {
103 label = "X-Loader(NAND)";
104 reg = <0x0 0x40000>;
105 };
106 partition@40000 {
107 label = "MemInit(NAND)";
108 reg = <0x40000 0x40000>;
109 };
110 partition@80000 {
111 label = "BootLoader(NAND)";
112 reg = <0x80000 0x200000>;
113 };
114 partition@280000 {
115 label = "Kernel zImage(NAND)";
116 reg = <0x280000 0x300000>;
117 };
118 partition@580000 {
119 label = "Root Filesystem(NAND)";
120 reg = <0x580000 0x1600000>;
121 };
122 partition@1b80000 {
123 label = "User Filesystem(NAND)";
124 reg = <0x1b80000 0x6480000>;
125 };
126 };
127
128 external-bus@34000000 {
129 compatible = "simple-bus";
130 reg = <0x34000000 0x1000000>;
131 #address-cells = <1>;
132 #size-cells = <1>;
133 ranges = <0 0x34000000 0x1000000>;
134 ethernet@300 {
135 compatible = "smsc,lan91c111";
136 reg = <0x300 0x0fd00>;
137 };
138 };
139
140 /* I2C0 connected to the STw4811 power management chip */
141 i2c0 {
142 compatible = "i2c-gpio";
143 gpios = <&gpio1 31 0>, /* sda */
144 <&gpio1 30 0>; /* scl */
145 #address-cells = <1>;
146 #size-cells = <0>;
147
148 stw4811@2d {
149 compatible = "st,stw4811";
150 reg = <0x2d>;
151 };
152 };
153
154 /* I2C1 connected to various sensors */
155 i2c1 {
156 compatible = "i2c-gpio";
157 gpios = <&gpio1 22 0>, /* sda */
158 <&gpio1 21 0>; /* scl */
159 #address-cells = <1>;
160 #size-cells = <0>;
161
162 camera@2d {
163 compatible = "st,camera";
164 reg = <0x10>;
165 };
166 stw5095@1a {
167 compatible = "st,stw5095";
168 reg = <0x1a>;
169 };
170 lis3lv02dl@1d {
171 compatible = "st,lis3lv02dl";
172 reg = <0x1d>;
173 };
174 };
175
176 /* I2C2 connected to the USB portions of the STw4811 only */
177 i2c2 {
178 compatible = "i2c-gpio";
179 gpios = <&gpio2 10 0>, /* sda */
180 <&gpio2 9 0>; /* scl */
181 #address-cells = <1>;
182 #size-cells = <0>;
183 stw4811@2d {
184 compatible = "st,stw4811-usb";
185 reg = <0x2d>;
186 };
187 };
188
189 amba {
190 compatible = "arm,amba-bus";
191 #address-cells = <1>;
192 #size-cells = <1>;
193 ranges;
194
195 vica: intc@0x10140000 {
196 compatible = "arm,versatile-vic";
197 interrupt-controller;
198 #interrupt-cells = <1>;
199 reg = <0x10140000 0x20>;
200 };
201
202 vicb: intc@0x10140020 {
203 compatible = "arm,versatile-vic";
204 interrupt-controller;
205 #interrupt-cells = <1>;
206 reg = <0x10140020 0x20>;
207 };
208
209 uart0: uart@101fd000 {
210 compatible = "arm,pl011", "arm,primecell";
211 reg = <0x101fd000 0x1000>;
212 interrupt-parent = <&vica>;
213 interrupts = <12>;
214 };
215
216 uart1: uart@101fb000 {
217 compatible = "arm,pl011", "arm,primecell";
218 reg = <0x101fb000 0x1000>;
219 interrupt-parent = <&vica>;
220 interrupts = <17>;
221 };
222
223 uart2: uart@101f2000 {
224 compatible = "arm,pl011", "arm,primecell";
225 reg = <0x101f2000 0x1000>;
226 interrupt-parent = <&vica>;
227 interrupts = <28>;
228 status = "disabled";
229 };
230
231 rng: rng@101b0000 {
232 compatible = "arm,primecell";
233 reg = <0x101b0000 0x1000>;
234 };
235
236 rtc: rtc@101e8000 {
237 compatible = "arm,pl031", "arm,primecell";
238 reg = <0x101e8000 0x1000>;
239 interrupt-parent = <&vica>;
240 interrupts = <10>;
241 };
242
243 mmcsd: sdi@101f6000 {
244 compatible = "arm,pl18x", "arm,primecell";
245 reg = <0x101f6000 0x1000>;
246 interrupt-parent = <&vica>;
247 interrupts = <22>;
248 max-frequency = <48000000>;
249 bus-width = <4>;
250 mmc-cap-mmc-highspeed;
251 mmc-cap-sd-highspeed;
252 cd-gpios = <&gpio3 15 0x1>;
253 cd-inverted;
254 };
255 };
256};
diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig
index f29223954af8..0892db4346e9 100644
--- a/arch/arm/configs/da8xx_omapl_defconfig
+++ b/arch/arm/configs/da8xx_omapl_defconfig
@@ -81,6 +81,7 @@ CONFIG_SERIAL_OF_PLATFORM=y
81CONFIG_I2C=y 81CONFIG_I2C=y
82CONFIG_I2C_CHARDEV=y 82CONFIG_I2C_CHARDEV=y
83CONFIG_I2C_DAVINCI=y 83CONFIG_I2C_DAVINCI=y
84CONFIG_PINCTRL_SINGLE=y
84# CONFIG_HWMON is not set 85# CONFIG_HWMON is not set
85CONFIG_WATCHDOG=y 86CONFIG_WATCHDOG=y
86CONFIG_REGULATOR=y 87CONFIG_REGULATOR=y
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 0153950f6068..a075b3e0c5c7 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -62,6 +62,7 @@ config MACH_DA8XX_DT
62 bool "Support DA8XX platforms using device tree" 62 bool "Support DA8XX platforms using device tree"
63 default y 63 default y
64 depends on ARCH_DAVINCI_DA8XX 64 depends on ARCH_DAVINCI_DA8XX
65 select PINCTRL
65 help 66 help
66 Say y here to include support for TI DaVinci DA850 based using 67 Say y here to include support for TI DaVinci DA850 based using
67 Flattened Device Tree. More information at Documentation/devicetree 68 Flattened Device Tree. More information at Documentation/devicetree
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 706dc5727bbe..82226a5d60ef 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -4,19 +4,13 @@ menu "Nomadik boards"
4 4
5config MACH_NOMADIK_8815NHK 5config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" 6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select CLKSRC_NOMADIK_MTU
8 select NOMADIK_8815 7 select NOMADIK_8815
8 select I2C
9 select I2C_ALGOBIT
9 10
10endmenu 11endmenu
11 12
12config NOMADIK_8815 13config NOMADIK_8815
13 bool 14 bool
14 15
15config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK
18 depends on PINCTRL_NOMADIK
19 default y
20 select I2C_ALGOBIT
21
22endif 16endif
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
index a42c9a33d3bf..1071c3b04d1a 100644
--- a/arch/arm/mach-nomadik/Makefile
+++ b/arch/arm/mach-nomadik/Makefile
@@ -9,9 +9,3 @@
9 9
10# Cpu revision 10# Cpu revision
11obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o 11obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
12
13# Specific board support
14obj-$(CONFIG_MACH_NOMADIK_8815NHK) += board-nhk8815.o
15
16# Nomadik extra devices
17obj-$(CONFIG_I2C_BITBANG_8815NHK) += i2c-8815nhk.o
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
deleted file mode 100644
index aaed48d94374..000000000000
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ /dev/null
@@ -1,353 +0,0 @@
1/*
2 * linux/arch/arm/mach-nomadik/board-8815nhk.c
3 *
4 * Copyright (C) STMicroelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * NHK15 board specifc driver definition
11 */
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/amba/bus.h>
17#include <linux/amba/mmci.h>
18#include <linux/interrupt.h>
19#include <linux/gpio.h>
20#include <linux/mtd/mtd.h>
21#include <linux/mtd/nand.h>
22#include <linux/mtd/fsmc.h>
23#include <linux/mtd/onenand.h>
24#include <linux/mtd/partitions.h>
25#include <linux/i2c.h>
26#include <linux/io.h>
27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/pinctrl-nomadik.h>
29#include <linux/platform_data/clocksource-nomadik-mtu.h>
30#include <asm/sizes.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/flash.h>
34#include <asm/mach/time.h>
35#include <mach/irqs.h>
36
37#include "cpu-8815.h"
38
39/* Initial value for SRC control register: all timers use MXTAL/8 source */
40#define SRC_CR_INIT_MASK 0x00007fff
41#define SRC_CR_INIT_VAL 0x2aaa8000
42
43#define ALE_OFF 0x1000000
44#define CLE_OFF 0x800000
45
46/* These addresses span 16MB, so use three individual pages */
47static struct resource nhk8815_nand_resources[] = {
48 {
49 .name = "nand_data",
50 .start = 0x40000000,
51 .end = 0x40000000 + SZ_16K - 1,
52 .flags = IORESOURCE_MEM,
53 }, {
54 .name = "nand_addr",
55 .start = 0x40000000 + ALE_OFF,
56 .end = 0x40000000 +ALE_OFF + SZ_16K - 1,
57 .flags = IORESOURCE_MEM,
58 }, {
59 .name = "nand_cmd",
60 .start = 0x40000000 + CLE_OFF,
61 .end = 0x40000000 + CLE_OFF + SZ_16K - 1,
62 .flags = IORESOURCE_MEM,
63 }, {
64 .name = "fsmc_regs",
65 .start = NOMADIK_FSMC_BASE,
66 .end = NOMADIK_FSMC_BASE + SZ_4K - 1,
67 .flags = IORESOURCE_MEM,
68 },
69};
70
71/*
72 * These partitions are the same as those used in the 2.6.20 release
73 * shipped by the vendor; the first two partitions are mandated
74 * by the boot ROM, and the bootloader area is somehow oversized...
75 */
76static struct mtd_partition nhk8815_partitions[] = {
77 {
78 .name = "X-Loader(NAND)",
79 .offset = 0,
80 .size = SZ_256K,
81 }, {
82 .name = "MemInit(NAND)",
83 .offset = MTDPART_OFS_APPEND,
84 .size = SZ_256K,
85 }, {
86 .name = "BootLoader(NAND)",
87 .offset = MTDPART_OFS_APPEND,
88 .size = SZ_2M,
89 }, {
90 .name = "Kernel zImage(NAND)",
91 .offset = MTDPART_OFS_APPEND,
92 .size = 3 * SZ_1M,
93 }, {
94 .name = "Root Filesystem(NAND)",
95 .offset = MTDPART_OFS_APPEND,
96 .size = 22 * SZ_1M,
97 }, {
98 .name = "User Filesystem(NAND)",
99 .offset = MTDPART_OFS_APPEND,
100 .size = MTDPART_SIZ_FULL,
101 }
102};
103
104static struct fsmc_nand_timings nhk8815_nand_timings = {
105 .thiz = 0,
106 .thold = 0x10,
107 .twait = 0x0A,
108 .tset = 0,
109};
110
111static struct fsmc_nand_platform_data nhk8815_nand_platform_data = {
112 .nand_timings = &nhk8815_nand_timings,
113 .partitions = nhk8815_partitions,
114 .nr_partitions = ARRAY_SIZE(nhk8815_partitions),
115 .width = FSMC_NAND_BW8,
116};
117
118static struct platform_device nhk8815_nand_device = {
119 .name = "fsmc-nand",
120 .id = -1,
121 .resource = nhk8815_nand_resources,
122 .num_resources = ARRAY_SIZE(nhk8815_nand_resources),
123 .dev = {
124 .platform_data = &nhk8815_nand_platform_data,
125 },
126};
127
128/* These are the partitions for the OneNand device, different from above */
129static struct mtd_partition nhk8815_onenand_partitions[] = {
130 {
131 .name = "X-Loader(OneNAND)",
132 .offset = 0,
133 .size = SZ_256K,
134 }, {
135 .name = "MemInit(OneNAND)",
136 .offset = MTDPART_OFS_APPEND,
137 .size = SZ_256K,
138 }, {
139 .name = "BootLoader(OneNAND)",
140 .offset = MTDPART_OFS_APPEND,
141 .size = SZ_2M-SZ_256K,
142 }, {
143 .name = "SysImage(OneNAND)",
144 .offset = MTDPART_OFS_APPEND,
145 .size = 4 * SZ_1M,
146 }, {
147 .name = "Root Filesystem(OneNAND)",
148 .offset = MTDPART_OFS_APPEND,
149 .size = 22 * SZ_1M,
150 }, {
151 .name = "User Filesystem(OneNAND)",
152 .offset = MTDPART_OFS_APPEND,
153 .size = MTDPART_SIZ_FULL,
154 }
155};
156
157static struct onenand_platform_data nhk8815_onenand_data = {
158 .parts = nhk8815_onenand_partitions,
159 .nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions),
160};
161
162static struct resource nhk8815_onenand_resource[] = {
163 {
164 .start = 0x30000000,
165 .end = 0x30000000 + SZ_128K - 1,
166 .flags = IORESOURCE_MEM,
167 },
168};
169
170static struct platform_device nhk8815_onenand_device = {
171 .name = "onenand-flash",
172 .id = -1,
173 .dev = {
174 .platform_data = &nhk8815_onenand_data,
175 },
176 .resource = nhk8815_onenand_resource,
177 .num_resources = ARRAY_SIZE(nhk8815_onenand_resource),
178};
179
180/* bus control reg. and bus timing reg. for CS0..CS3 */
181#define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3))
182#define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04)
183
184static void __init nhk8815_onenand_init(void)
185{
186#ifdef CONFIG_MTD_ONENAND
187 /* Set up SMCS0 for OneNand */
188 writel(0x000030db, FSMC_BCR(0));
189 writel(0x02100551, FSMC_BTR(0));
190#endif
191}
192
193static struct mmci_platform_data mmcsd_plat_data = {
194 .ocr_mask = MMC_VDD_29_30,
195 .f_max = 48000000,
196 .gpio_wp = -1,
197 .gpio_cd = 111,
198 .cd_invert = true,
199 .capabilities = MMC_CAP_MMC_HIGHSPEED |
200 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA,
201};
202
203static int __init nhk8815_mmcsd_init(void)
204{
205 int ret;
206
207 ret = gpio_request(112, "card detect bias");
208 if (ret)
209 return ret;
210 gpio_direction_output(112, 0);
211 amba_apb_device_add(NULL, "mmci", NOMADIK_SDI_BASE, SZ_4K, IRQ_SDMMC, 0, &mmcsd_plat_data, 0x10180180);
212 return 0;
213}
214module_init(nhk8815_mmcsd_init);
215
216static struct resource nhk8815_eth_resources[] = {
217 {
218 .name = "smc91x-regs",
219 .start = 0x34000000 + 0x300,
220 .end = 0x34000000 + SZ_64K - 1,
221 .flags = IORESOURCE_MEM,
222 }, {
223 .start = NOMADIK_GPIO_TO_IRQ(115),
224 .end = NOMADIK_GPIO_TO_IRQ(115),
225 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
226 }
227};
228
229static struct platform_device nhk8815_eth_device = {
230 .name = "smc91x",
231 .resource = nhk8815_eth_resources,
232 .num_resources = ARRAY_SIZE(nhk8815_eth_resources),
233};
234
235static int __init nhk8815_eth_init(void)
236{
237 int gpio_nr = 115; /* hardwired in the board */
238 int err;
239
240 err = gpio_request(gpio_nr, "eth_irq");
241 if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO);
242 if (!err) err = gpio_direction_input(gpio_nr);
243 if (err)
244 pr_err("Error %i in %s\n", err, __func__);
245 return err;
246}
247device_initcall(nhk8815_eth_init);
248
249static struct platform_device *nhk8815_platform_devices[] __initdata = {
250 &nhk8815_nand_device,
251 &nhk8815_onenand_device,
252 &nhk8815_eth_device,
253 /* will add more devices */
254};
255
256static void __init nomadik_timer_init(void)
257{
258 u32 src_cr;
259
260 /* Configure timer sources in "system reset controller" ctrl reg */
261 src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
262 src_cr &= SRC_CR_INIT_MASK;
263 src_cr |= SRC_CR_INIT_VAL;
264 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
265
266 nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0);
267}
268
269static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = {
270 {
271 I2C_BOARD_INFO("stw4811", 0x2d),
272 },
273};
274
275static struct i2c_board_info __initdata nhk8815_i2c1_devices[] = {
276 {
277 I2C_BOARD_INFO("camera", 0x10),
278 },
279 {
280 I2C_BOARD_INFO("stw5095", 0x1a),
281 },
282 {
283 I2C_BOARD_INFO("lis3lv02dl", 0x1d),
284 },
285};
286
287static struct i2c_board_info __initdata nhk8815_i2c2_devices[] = {
288 {
289 I2C_BOARD_INFO("stw4811-usb", 0x2d),
290 },
291};
292
293static unsigned long out_low[] = { PIN_OUTPUT_LOW };
294static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
295static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
296static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
297
298static struct pinctrl_map __initdata nhk8815_pinmap[] = {
299 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
300 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
301 /* Hog in MMC/SD card mux */
302 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
303 /* MCCLK */
304 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
305 /* MCCMD */
306 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
307 /* MCCMDDIR */
308 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
309 /* MCDAT3-0 */
310 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
311 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
312 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
313 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
314 /* MCDAT0DIR */
315 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
316 /* MCDAT31DIR */
317 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
318 /* MCMSFBCLK */
319 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
320 /* CD input GPIO */
321 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
322 /* CD bias drive */
323 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
324};
325
326static void __init nhk8815_platform_init(void)
327{
328 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
329 cpu8815_platform_init();
330 nhk8815_onenand_init();
331 platform_add_devices(nhk8815_platform_devices,
332 ARRAY_SIZE(nhk8815_platform_devices));
333
334 amba_apb_device_add(NULL, "uart0", NOMADIK_UART0_BASE, SZ_4K, IRQ_UART0, 0, NULL, 0);
335 amba_apb_device_add(NULL, "uart1", NOMADIK_UART1_BASE, SZ_4K, IRQ_UART1, 0, NULL, 0);
336
337 i2c_register_board_info(0, nhk8815_i2c0_devices,
338 ARRAY_SIZE(nhk8815_i2c0_devices));
339 i2c_register_board_info(1, nhk8815_i2c1_devices,
340 ARRAY_SIZE(nhk8815_i2c1_devices));
341 i2c_register_board_info(2, nhk8815_i2c2_devices,
342 ARRAY_SIZE(nhk8815_i2c2_devices));
343}
344
345MACHINE_START(NOMADIK, "NHK8815")
346 /* Maintainer: ST MicroElectronics */
347 .atag_offset = 0x100,
348 .map_io = cpu8815_map_io,
349 .init_irq = cpu8815_init_irq,
350 .init_time = nomadik_timer_init,
351 .init_machine = nhk8815_platform_init,
352 .restart = cpu8815_restart,
353MACHINE_END
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 351404673f6c..21c1aa512640 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -25,138 +25,308 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/irqchip/arm-vic.h> 28#include <linux/irqchip.h>
29#include <linux/platform_data/clk-nomadik.h> 29#include <linux/platform_data/clk-nomadik.h>
30#include <linux/platform_data/pinctrl-nomadik.h> 30#include <linux/platform_data/pinctrl-nomadik.h>
31#include <linux/pinctrl/machine.h>
32#include <linux/platform_data/clocksource-nomadik-mtu.h>
33#include <linux/of_irq.h>
34#include <linux/of_gpio.h>
35#include <linux/of_address.h>
36#include <linux/of_platform.h>
37#include <linux/mtd/fsmc.h>
38#include <linux/gpio.h>
39#include <linux/amba/mmci.h>
31 40
32#include <mach/hardware.h>
33#include <mach/irqs.h> 41#include <mach/irqs.h>
42#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/mach/time.h>
45#include <asm/mach-types.h>
35 46
36#include <asm/cacheflush.h> 47#include <asm/cacheflush.h>
37#include <asm/hardware/cache-l2x0.h> 48#include <asm/hardware/cache-l2x0.h>
38 49
39#include "cpu-8815.h" 50/*
51 * These are the only hard-coded address offsets we still have to use.
52 */
53#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
54#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
55#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
56#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
57#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
58#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
59#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
60#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
61#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
62#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
63#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
64#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
65#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
66#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
67#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
68#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
69#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
70#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
71#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
72#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
73#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
74#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
75#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
76#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
77#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
78#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
79#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
80#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
81#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
82#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
83#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
84#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
85#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
86#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
87#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
88#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
89#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
90#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
91#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
92#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
93#define NOMADIK_UART1_VBASE 0xF01FB000
40 94
41/* The 8815 has 4 GPIO blocks, let's register them immediately */ 95static unsigned long out_low[] = { PIN_OUTPUT_LOW };
42static resource_size_t __initdata cpu8815_gpio_base[] = { 96static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
43 NOMADIK_GPIO0_BASE, 97static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
44 NOMADIK_GPIO1_BASE, 98static unsigned long in_pullup[] = { PIN_INPUT_PULLUP };
45 NOMADIK_GPIO2_BASE, 99
46 NOMADIK_GPIO3_BASE, 100static struct pinctrl_map __initdata nhk8815_pinmap[] = {
101 PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-stn8815", "u0_a_1", "u0"),
102 PIN_MAP_MUX_GROUP_DEFAULT("uart1", "pinctrl-stn8815", "u1_a_1", "u1"),
103 /* Hog in MMC/SD card mux */
104 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-stn8815", "mmcsd_a_1", "mmcsd"),
105 /* MCCLK */
106 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO8_B10", out_low),
107 /* MCCMD */
108 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO9_A10", in_pullup),
109 /* MCCMDDIR */
110 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO10_C11", out_high),
111 /* MCDAT3-0 */
112 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO11_B11", in_pullup),
113 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO12_A11", in_pullup),
114 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO13_C12", in_pullup),
115 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO14_B12", in_pullup),
116 /* MCDAT0DIR */
117 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO15_A12", out_high),
118 /* MCDAT31DIR */
119 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO16_C13", out_high),
120 /* MCMSFBCLK */
121 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO24_C15", in_pullup),
122 /* CD input GPIO */
123 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO111_H21", in_nopull),
124 /* CD bias drive */
125 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO112_J21", out_low),
126 /* I2C0 */
127 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO62_D3", in_pullup),
128 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO63_D2", in_pullup),
129 /* I2C1 */
130 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO53_L4", in_pullup),
131 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO54_L3", in_pullup),
132 /* I2C2 */
133 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO73_C21", in_pullup),
134 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
47}; 135};
48 136
49static struct platform_device * 137/* This is needed for LL-debug/earlyprintk/debug-macro.S */
50cpu8815_add_gpio(int id, resource_size_t addr, int irq, 138static struct map_desc cpu8815_io_desc[] __initdata = {
51 struct nmk_gpio_platform_data *pdata) 139 {
140 .virtual = NOMADIK_UART1_VBASE,
141 .pfn = __phys_to_pfn(NOMADIK_UART1_BASE),
142 .length = SZ_4K,
143 .type = MT_DEVICE,
144 },
145};
146
147static void __init cpu8815_map_io(void)
52{ 148{
53 struct resource resources[] = { 149 iotable_init(cpu8815_io_desc, ARRAY_SIZE(cpu8815_io_desc));
54 {
55 .start = addr,
56 .end = addr + 127,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .start = irq,
61 .end = irq,
62 .flags = IORESOURCE_IRQ,
63 }
64 };
65
66 return platform_device_register_resndata(NULL, "gpio", id,
67 resources, ARRAY_SIZE(resources),
68 pdata, sizeof(*pdata));
69} 150}
70 151
71void cpu8815_add_gpios(resource_size_t *base, int num, int irq, 152static void cpu8815_restart(char mode, const char *cmd)
72 struct nmk_gpio_platform_data *pdata)
73{ 153{
74 int first = 0; 154 void __iomem *srcbase = ioremap(NOMADIK_SRC_BASE, SZ_4K);
75 int i;
76 155
77 for (i = 0; i < num; i++, first += 32, irq++) { 156 /* FIXME: use egpio when implemented */
78 pdata->first_gpio = first;
79 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
80 pdata->num_gpio = 32;
81 157
82 cpu8815_add_gpio(i, base[i], irq, pdata); 158 /* Write anything to Reset status register */
83 } 159 writel(1, srcbase + 0x18);
84} 160}
85 161
86static inline void 162/* Initial value for SRC control register: all timers use MXTAL/8 source */
87cpu8815_add_pinctrl(struct device *parent, const char *name) 163#define SRC_CR_INIT_MASK 0x00007fff
164#define SRC_CR_INIT_VAL 0x2aaa8000
165
166static void __init cpu8815_timer_init_of(void)
88{ 167{
89 struct platform_device_info pdevinfo = { 168 struct device_node *mtu;
90 .parent = parent, 169 void __iomem *base;
91 .name = name, 170 int irq;
92 .id = -1, 171 u32 src_cr;
93 }; 172
173 /* We need this to be up now */
174 nomadik_clk_init();
175
176 mtu = of_find_node_by_path("/mtu0");
177 if (!mtu)
178 return;
179 base = of_iomap(mtu, 0);
180 if (WARN_ON(!base))
181 return;
182 irq = irq_of_parse_and_map(mtu, 0);
94 183
95 platform_device_register_full(&pdevinfo); 184 pr_info("Remapped MTU @ %p, irq: %d\n", base, irq);
185
186 /* Configure timer sources in "system reset controller" ctrl reg */
187 src_cr = readl(base);
188 src_cr &= SRC_CR_INIT_MASK;
189 src_cr |= SRC_CR_INIT_VAL;
190 writel(src_cr, base);
191
192 nmdk_timer_init(base, irq);
96} 193}
97 194
98static int __init cpu8815_init(void) 195static struct fsmc_nand_timings cpu8815_nand_timings = {
196 .thiz = 0,
197 .thold = 0x10,
198 .twait = 0x0A,
199 .tset = 0,
200};
201
202static struct fsmc_nand_platform_data cpu8815_nand_data = {
203 .nand_timings = &cpu8815_nand_timings,
204};
205
206/*
207 * The SMSC911x IRQ is connected to a GPIO pin, but the driver expects
208 * to simply request an IRQ passed as a resource. So the GPIO pin needs
209 * to be requested by this hog and set as input.
210 */
211static int __init cpu8815_eth_init(void)
99{ 212{
100 struct nmk_gpio_platform_data pdata = { 213 struct device_node *eth;
101 /* No custom data yet */ 214 int gpio, irq, err;
102 }; 215
103 216 eth = of_find_node_by_path("/usb-s8815/ethernet-gpio");
104 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base), 217 if (!eth) {
105 IRQ_GPIO0, &pdata); 218 pr_info("could not find any ethernet GPIO\n");
106 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815"); 219 return 0;
107 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0); 220 }
108 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0); 221 gpio = of_get_gpio(eth, 0);
222 err = gpio_request(gpio, "eth_irq");
223 if (err) {
224 pr_info("failed to request ethernet GPIO\n");
225 return -ENODEV;
226 }
227 err = gpio_direction_input(gpio);
228 if (err) {
229 pr_info("failed to set ethernet GPIO as input\n");
230 return -ENODEV;
231 }
232 irq = gpio_to_irq(gpio);
233 pr_info("enabled USB-S8815 ethernet GPIO %d, IRQ %d\n", gpio, irq);
109 return 0; 234 return 0;
110} 235}
111arch_initcall(cpu8815_init); 236device_initcall(cpu8815_eth_init);
112 237
113/* All SoC devices live in the same area (see hardware.h) */ 238/*
114static struct map_desc nomadik_io_desc[] __initdata = { 239 * TODO:
115 { 240 * cannot be set from device tree, convert to a proper DT
116 .virtual = NOMADIK_IO_VIRTUAL, 241 * binding.
117 .pfn = __phys_to_pfn(NOMADIK_IO_PHYSICAL), 242 */
118 .length = NOMADIK_IO_SIZE, 243static struct mmci_platform_data mmcsd_plat_data = {
119 .type = MT_DEVICE, 244 .ocr_mask = MMC_VDD_29_30,
120 }
121 /* static ram and secured ram may be added later */
122}; 245};
123 246
124void __init cpu8815_map_io(void) 247/*
248 * This GPIO pin turns on a line that is used to detect card insertion
249 * on this board.
250 */
251static int __init cpu8815_mmcsd_init(void)
125{ 252{
126 iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc)); 253 struct device_node *cdbias;
127} 254 int gpio, err;
128 255
129void __init cpu8815_init_irq(void) 256 cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio");
130{ 257 if (!cdbias) {
131 /* This modified VIC cell has two register blocks, at 0 and 0x20 */ 258 pr_info("could not find MMC/SD card detect bias node\n");
132 vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0); 259 return 0;
133 vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0); 260 }
134 261 gpio = of_get_gpio(cdbias, 0);
135 /* 262 if (gpio < 0) {
136 * Init clocks here so that they are available for system timer 263 pr_info("could not obtain MMC/SD card detect bias GPIO\n");
137 * initialization. 264 return 0;
138 */ 265 }
139 nomadik_clk_init(); 266 err = gpio_request(gpio, "card detect bias");
267 if (err) {
268 pr_info("failed to request card detect bias GPIO %d\n", gpio);
269 return -ENODEV;
270 }
271 err = gpio_direction_output(gpio, 0);
272 if (err){
273 pr_info("failed to set GPIO %d as output, low\n", gpio);
274 return err;
275 }
276 pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio);
277 return 0;
140} 278}
279device_initcall(cpu8815_mmcsd_init);
141 280
142/* 281
143 * This function is called from the board init ("init_machine"). 282/* These are mostly to get the right device names for the clock lookups */
144 */ 283static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
145 void __init cpu8815_platform_init(void) 284 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
285 "gpio.0", NULL),
286 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO1_BASE,
287 "gpio.1", NULL),
288 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO2_BASE,
289 "gpio.2", NULL),
290 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO3_BASE,
291 "gpio.3", NULL),
292 OF_DEV_AUXDATA("stericsson,nmk-pinctrl-stn8815", 0,
293 "pinctrl-stn8815", NULL),
294 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART0_BASE,
295 "uart0", NULL),
296 OF_DEV_AUXDATA("arm,primecell", NOMADIK_UART1_BASE,
297 "uart1", NULL),
298 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RNG_BASE,
299 "rng", NULL),
300 OF_DEV_AUXDATA("arm,primecell", NOMADIK_RTC_BASE,
301 "rtc-pl031", NULL),
302 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
303 "fsmc-nand", &cpu8815_nand_data),
304 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
305 "mmci", &mmcsd_plat_data),
306 { /* sentinel */ },
307};
308
309static void __init cpu8815_init_of(void)
146{ 310{
147#ifdef CONFIG_CACHE_L2X0 311#ifdef CONFIG_CACHE_L2X0
148 /* At full speed latency must be >=2, so 0x249 in low bits */ 312 /* At full speed latency must be >=2, so 0x249 in low bits */
149 l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff); 313 l2x0_of_init(0x00730249, 0xfe000fff);
150#endif 314#endif
151 return; 315 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
316 of_platform_populate(NULL, of_default_bus_match_table,
317 cpu8815_auxdata_lookup, NULL);
152} 318}
153 319
154void cpu8815_restart(char mode, const char *cmd) 320static const char * cpu8815_board_compat[] = {
155{ 321 "calaosystems,usb-s8815",
156 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18); 322 NULL,
157 323};
158 /* FIXME: use egpio when implemented */
159 324
160 /* Write anything to Reset status register */ 325DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815")
161 writel(1, src_rstsr); 326 .map_io = cpu8815_map_io,
162} 327 .init_irq = irqchip_init,
328 .init_time = cpu8815_timer_init_of,
329 .init_machine = cpu8815_init_of,
330 .restart = cpu8815_restart,
331 .dt_compat = cpu8815_board_compat,
332MACHINE_END
diff --git a/arch/arm/mach-nomadik/cpu-8815.h b/arch/arm/mach-nomadik/cpu-8815.h
deleted file mode 100644
index 71c21e8a11dc..000000000000
--- a/arch/arm/mach-nomadik/cpu-8815.h
+++ /dev/null
@@ -1,4 +0,0 @@
1extern void cpu8815_map_io(void);
2extern void cpu8815_platform_init(void);
3extern void cpu8815_init_irq(void);
4extern void cpu8815_restart(char, const char *);
diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c
deleted file mode 100644
index 0c2f6628299a..000000000000
--- a/arch/arm/mach-nomadik/i2c-8815nhk.c
+++ /dev/null
@@ -1,88 +0,0 @@
1#include <linux/module.h>
2#include <linux/init.h>
3#include <linux/i2c.h>
4#include <linux/i2c-algo-bit.h>
5#include <linux/i2c-gpio.h>
6#include <linux/platform_device.h>
7#include <linux/platform_data/pinctrl-nomadik.h>
8
9/*
10 * There are two busses in the 8815NHK.
11 * They could, in theory, be driven by the hardware component, but we
12 * use bit-bang through GPIO by now, to keep things simple
13 */
14
15/* I2C0 connected to the STw4811 power management chip */
16static struct i2c_gpio_platform_data nhk8815_i2c_data0 = {
17 /* keep defaults for timeouts; pins are push-pull bidirectional */
18 .scl_pin = 62,
19 .sda_pin = 63,
20};
21
22/* I2C1 connected to various sensors */
23static struct i2c_gpio_platform_data nhk8815_i2c_data1 = {
24 /* keep defaults for timeouts; pins are push-pull bidirectional */
25 .scl_pin = 53,
26 .sda_pin = 54,
27};
28
29/* I2C2 connected to the USB portions of the STw4811 only */
30static struct i2c_gpio_platform_data nhk8815_i2c_data2 = {
31 /* keep defaults for timeouts; pins are push-pull bidirectional */
32 .scl_pin = 73,
33 .sda_pin = 74,
34};
35
36static struct platform_device nhk8815_i2c_dev0 = {
37 .name = "i2c-gpio",
38 .id = 0,
39 .dev = {
40 .platform_data = &nhk8815_i2c_data0,
41 },
42};
43
44static struct platform_device nhk8815_i2c_dev1 = {
45 .name = "i2c-gpio",
46 .id = 1,
47 .dev = {
48 .platform_data = &nhk8815_i2c_data1,
49 },
50};
51
52static struct platform_device nhk8815_i2c_dev2 = {
53 .name = "i2c-gpio",
54 .id = 2,
55 .dev = {
56 .platform_data = &nhk8815_i2c_data2,
57 },
58};
59
60static pin_cfg_t cpu8815_pins_i2c[] = {
61 PIN_CFG_INPUT(62, GPIO, PULLUP),
62 PIN_CFG_INPUT(63, GPIO, PULLUP),
63 PIN_CFG_INPUT(53, GPIO, PULLUP),
64 PIN_CFG_INPUT(54, GPIO, PULLUP),
65 PIN_CFG_INPUT(73, GPIO, PULLUP),
66 PIN_CFG_INPUT(74, GPIO, PULLUP),
67};
68
69static int __init nhk8815_i2c_init(void)
70{
71 nmk_config_pins(cpu8815_pins_i2c, ARRAY_SIZE(cpu8815_pins_i2c));
72 platform_device_register(&nhk8815_i2c_dev0);
73 platform_device_register(&nhk8815_i2c_dev1);
74 platform_device_register(&nhk8815_i2c_dev2);
75
76 return 0;
77}
78
79static void __exit nhk8815_i2c_exit(void)
80{
81 platform_device_unregister(&nhk8815_i2c_dev0);
82 platform_device_unregister(&nhk8815_i2c_dev1);
83 platform_device_unregister(&nhk8815_i2c_dev2);
84 return;
85}
86
87module_init(nhk8815_i2c_init);
88module_exit(nhk8815_i2c_exit);
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h
deleted file mode 100644
index 02035e459f50..000000000000
--- a/arch/arm/mach-nomadik/include/mach/hardware.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * This file contains the hardware definitions of the Nomadik.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * YOU should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef __ASM_ARCH_HARDWARE_H
19#define __ASM_ARCH_HARDWARE_H
20
21/* Nomadik registers live from 0x1000.0000 to 0x1023.0000 -- currently */
22#define NOMADIK_IO_VIRTUAL 0xF0000000 /* VA of IO */
23#define NOMADIK_IO_PHYSICAL 0x10000000 /* PA of IO */
24#define NOMADIK_IO_SIZE 0x00300000 /* 3MB for all regs */
25
26/* used in C code, so cast to proper type */
27#define io_p2v(x) ((void __iomem *)(x) \
28 - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
29#define io_v2p(x) ((unsigned long)(x) \
30 - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL)
31
32/* used in asm code, so no casts */
33#define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
34
35/*
36 * Base address defination for Nomadik Onchip Logic Block
37 */
38#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
39#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
40#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
41#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
42#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
43#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
44#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
45#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
46#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
47#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
48#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
49#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
50#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
51#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
52#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
53#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
54#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
55#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
56#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
57#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
58#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
59#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
60#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
61#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
62#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
63#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
64#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
65#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
66#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
67#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
68#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
69#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
70#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
71#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
72#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
73#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
74#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
75#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
76#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
77#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
78
79/* Other ranges, not for p2v/v2p */
80#define NOMADIK_BACKUP_RAM 0x80010000
81#define NOMADIK_EBROM 0x80000000 /* Embedded boot ROM */
82#define NOMADIK_HAMACV_DMEM_BASE 0xA0100000 /* HAMACV Data Memory Start */
83#define NOMADIK_HAMACV_DMEM_END 0xA01FFFFF /* HAMACV Data Memory End */
84#define NOMADIK_HAMACA_DMEM 0xA0200000 /* HAMACA Data Memory Space */
85
86#define NOMADIK_FSMC_VA IO_ADDRESS(NOMADIK_FSMC_BASE)
87#define NOMADIK_MTU0_VA IO_ADDRESS(NOMADIK_MTU0_BASE)
88#define NOMADIK_MTU1_VA IO_ADDRESS(NOMADIK_MTU1_BASE)
89
90#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h
index 215f8cdb4004..90ac965a92fe 100644
--- a/arch/arm/mach-nomadik/include/mach/irqs.h
+++ b/arch/arm/mach-nomadik/include/mach/irqs.h
@@ -20,8 +20,6 @@
20#ifndef __ASM_ARCH_IRQS_H 20#ifndef __ASM_ARCH_IRQS_H
21#define __ASM_ARCH_IRQS_H 21#define __ASM_ARCH_IRQS_H
22 22
23#include <mach/hardware.h>
24
25#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */ 23#define IRQ_VIC_START 32 /* first VIC interrupt is 1 */
26 24
27/* 25/*
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 7d4687e9cbdf..f793ace27d29 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -21,7 +21,6 @@
21 21
22#include <asm/setup.h> 22#include <asm/setup.h>
23#include <asm/io.h> 23#include <asm/io.h>
24#include <mach/hardware.h>
25 24
26/* we need the constants in amba/serial.h, but it refers to amba_device */ 25/* we need the constants in amba/serial.h, but it refers to amba_device */
27struct amba_device; 26struct amba_device;