aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/spear300-evb.dts179
-rw-r--r--arch/arm/boot/dts/spear300.dtsi72
-rw-r--r--arch/arm/boot/dts/spear310-evb.dts107
-rw-r--r--arch/arm/boot/dts/spear310.dtsi75
-rw-r--r--arch/arm/boot/dts/spear320-evb.dts108
-rw-r--r--arch/arm/boot/dts/spear320.dtsi90
-rw-r--r--arch/arm/boot/dts/spear3xx.dtsi136
-rw-r--r--arch/arm/mach-spear3xx/Kconfig34
-rw-r--r--arch/arm/mach-spear3xx/Makefile13
-rw-r--r--arch/arm/mach-spear3xx/Makefile.boot4
-rw-r--r--arch/arm/mach-spear3xx/clock.c103
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h29
-rw-r--r--arch/arm/mach-spear3xx/include/mach/hardware.h3
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear.h9
-rw-r--r--arch/arm/mach-spear3xx/spear300.c97
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c75
-rw-r--r--arch/arm/mach-spear3xx/spear310.c126
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c81
-rw-r--r--arch/arm/mach-spear3xx/spear320.c127
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c79
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c127
-rw-r--r--arch/arm/plat-spear/Kconfig3
22 files changed, 1197 insertions, 480 deletions
diff --git a/arch/arm/boot/dts/spear300-evb.dts b/arch/arm/boot/dts/spear300-evb.dts
new file mode 100644
index 000000000000..f2ee991705a4
--- /dev/null
+++ b/arch/arm/boot/dts/spear300-evb.dts
@@ -0,0 +1,179 @@
1/*
2 * DTS file for SPEAr300 Evaluation Baord
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15/include/ "spear300.dtsi"
16
17/ {
18 model = "ST SPEAr300 Evaluation Board";
19 compatible = "st,spear300-evb", "st,spear300";
20 #address-cells = <1>;
21 #size-cells = <1>;
22
23 memory {
24 reg = <0 0x40000000>;
25 };
26
27 ahb {
28 clcd@60000000 {
29 status = "okay";
30 };
31
32 fsmc: flash@94000000 {
33 status = "okay";
34 };
35
36 gmac: eth@e0800000 {
37 status = "okay";
38 };
39
40 sdhci@70000000 {
41 int-gpio = <&gpio1 0 0>;
42 power-gpio = <&gpio1 2 1>;
43 status = "okay";
44 };
45
46 smi: flash@fc000000 {
47 status = "okay";
48 };
49
50 spi0: spi@d0100000 {
51 status = "okay";
52 };
53
54 ehci@e1800000 {
55 status = "okay";
56 };
57
58 ohci@e1900000 {
59 status = "okay";
60 };
61
62 ohci@e2100000 {
63 status = "okay";
64 };
65
66 apb {
67 gpio0: gpio@fc980000 {
68 status = "okay";
69 };
70
71 gpio1: gpio@a9000000 {
72 status = "okay";
73 };
74
75 i2c0: i2c@d0180000 {
76 status = "okay";
77 };
78
79 kbd@a0000000 {
80 linux,keymap = < 0x00010000
81 0x00020100
82 0x00030200
83 0x00040300
84 0x00050400
85 0x00060500
86 0x00070600
87 0x00080700
88 0x00090800
89 0x000a0001
90 0x000c0101
91 0x000d0201
92 0x000e0301
93 0x000f0401
94 0x00100501
95 0x00110601
96 0x00120701
97 0x00130801
98 0x00140002
99 0x00150102
100 0x00160202
101 0x00170302
102 0x00180402
103 0x00190502
104 0x001a0602
105 0x001b0702
106 0x001c0802
107 0x001d0003
108 0x001e0103
109 0x001f0203
110 0x00200303
111 0x00210403
112 0x00220503
113 0x00230603
114 0x00240703
115 0x00250803
116 0x00260004
117 0x00270104
118 0x00280204
119 0x00290304
120 0x002a0404
121 0x002b0504
122 0x002c0604
123 0x002d0704
124 0x002e0804
125 0x002f0005
126 0x00300105
127 0x00310205
128 0x00320305
129 0x00330405
130 0x00340505
131 0x00350605
132 0x00360705
133 0x00370805
134 0x00380006
135 0x00390106
136 0x003a0206
137 0x003b0306
138 0x003c0406
139 0x003d0506
140 0x003e0606
141 0x003f0706
142 0x00400806
143 0x00410007
144 0x00420107
145 0x00430207
146 0x00440307
147 0x00450407
148 0x00460507
149 0x00470607
150 0x00480707
151 0x00490807
152 0x004a0008
153 0x004b0108
154 0x004c0208
155 0x004d0308
156 0x004e0408
157 0x004f0508
158 0x00500608
159 0x00510708
160 0x00520808 >;
161 autorepeat;
162 st,mode = <0>;
163 status = "okay";
164 };
165
166 rtc@fc900000 {
167 status = "okay";
168 };
169
170 serial@d0000000 {
171 status = "okay";
172 };
173
174 wdt@fc880000 {
175 status = "okay";
176 };
177 };
178 };
179};
diff --git a/arch/arm/boot/dts/spear300.dtsi b/arch/arm/boot/dts/spear300.dtsi
new file mode 100644
index 000000000000..f9fcbf4f477b
--- /dev/null
+++ b/arch/arm/boot/dts/spear300.dtsi
@@ -0,0 +1,72 @@
1/*
2 * DTS file for SPEAr300 SoC
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/include/ "spear3xx.dtsi"
15
16/ {
17 ahb {
18 #address-cells = <1>;
19 #size-cells = <1>;
20 compatible = "simple-bus";
21 ranges = <0x60000000 0x60000000 0x50000000
22 0xd0000000 0xd0000000 0x30000000>;
23
24 clcd@60000000 {
25 compatible = "arm,clcd-pl110", "arm,primecell";
26 reg = <0x60000000 0x1000>;
27 interrupts = <30>;
28 status = "disabled";
29 };
30
31 fsmc: flash@94000000 {
32 compatible = "st,spear600-fsmc-nand";
33 #address-cells = <1>;
34 #size-cells = <1>;
35 reg = <0x94000000 0x1000 /* FSMC Register */
36 0x80000000 0x0010>; /* NAND Base */
37 reg-names = "fsmc_regs", "nand_data";
38 st,ale-off = <0x20000>;
39 st,cle-off = <0x10000>;
40 status = "disabled";
41 };
42
43 sdhci@70000000 {
44 compatible = "st,sdhci-spear";
45 reg = <0x70000000 0x100>;
46 interrupts = <1>;
47 status = "disabled";
48 };
49
50 apb {
51 #address-cells = <1>;
52 #size-cells = <1>;
53 compatible = "simple-bus";
54 ranges = <0xa0000000 0xa0000000 0x10000000
55 0xd0000000 0xd0000000 0x30000000>;
56
57 gpio1: gpio@a9000000 {
58 #gpio-cells = <2>;
59 compatible = "arm,pl061", "arm,primecell";
60 gpio-controller;
61 reg = <0xa9000000 0x1000>;
62 status = "disabled";
63 };
64
65 kbd@a0000000 {
66 compatible = "st,spear300-kbd";
67 reg = <0xa0000000 0x1000>;
68 status = "disabled";
69 };
70 };
71 };
72};
diff --git a/arch/arm/boot/dts/spear310-evb.dts b/arch/arm/boot/dts/spear310-evb.dts
new file mode 100644
index 000000000000..ec19d7b9795a
--- /dev/null
+++ b/arch/arm/boot/dts/spear310-evb.dts
@@ -0,0 +1,107 @@
1/*
2 * DTS file for SPEAr310 Evaluation Baord
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15/include/ "spear310.dtsi"
16
17/ {
18 model = "ST SPEAr310 Evaluation Board";
19 compatible = "st,spear310-evb", "st,spear310";
20 #address-cells = <1>;
21 #size-cells = <1>;
22
23 memory {
24 reg = <0 0x40000000>;
25 };
26
27 ahb {
28 fsmc: flash@44000000 {
29 status = "okay";
30 };
31
32 gmac: eth@e0800000 {
33 status = "okay";
34 };
35
36 smi: flash@fc000000 {
37 status = "okay";
38 clock-rate=<50000000>;
39
40 flash@f8000000 {
41 label = "m25p64";
42 reg = <0xf8000000 0x800000>;
43 #address-cells = <1>;
44 #size-cells = <1>;
45 st,smi-fast-mode;
46 };
47 };
48
49 spi0: spi@d0100000 {
50 status = "okay";
51 };
52
53 ehci@e1800000 {
54 status = "okay";
55 };
56
57 ohci@e1900000 {
58 status = "okay";
59 };
60
61 ohci@e2100000 {
62 status = "okay";
63 };
64
65 apb {
66 gpio0: gpio@fc980000 {
67 status = "okay";
68 };
69
70 i2c0: i2c@d0180000 {
71 status = "okay";
72 };
73
74 rtc@fc900000 {
75 status = "okay";
76 };
77
78 serial@d0000000 {
79 status = "okay";
80 };
81
82 serial@b2000000 {
83 status = "okay";
84 };
85
86 serial@b2080000 {
87 status = "okay";
88 };
89
90 serial@b2100000 {
91 status = "okay";
92 };
93
94 serial@b2180000 {
95 status = "okay";
96 };
97
98 serial@b2200000 {
99 status = "okay";
100 };
101
102 wdt@fc880000 {
103 status = "okay";
104 };
105 };
106 };
107};
diff --git a/arch/arm/boot/dts/spear310.dtsi b/arch/arm/boot/dts/spear310.dtsi
new file mode 100644
index 000000000000..dc7fa14da846
--- /dev/null
+++ b/arch/arm/boot/dts/spear310.dtsi
@@ -0,0 +1,75 @@
1/*
2 * DTS file for SPEAr310 SoC
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/include/ "spear3xx.dtsi"
15
16/ {
17 ahb {
18 #address-cells = <1>;
19 #size-cells = <1>;
20 compatible = "simple-bus";
21 ranges = <0x40000000 0x40000000 0x10000000
22 0xb0000000 0xb0000000 0x10000000
23 0xd0000000 0xd0000000 0x30000000>;
24
25 fsmc: flash@44000000 {
26 compatible = "st,spear600-fsmc-nand";
27 #address-cells = <1>;
28 #size-cells = <1>;
29 reg = <0x44000000 0x1000 /* FSMC Register */
30 0x40000000 0x0010>; /* NAND Base */
31 reg-names = "fsmc_regs", "nand_data";
32 st,ale-off = <0x10000>;
33 st,cle-off = <0x20000>;
34 status = "disabled";
35 };
36
37 apb {
38 #address-cells = <1>;
39 #size-cells = <1>;
40 compatible = "simple-bus";
41 ranges = <0xb0000000 0xb0000000 0x10000000
42 0xd0000000 0xd0000000 0x30000000>;
43
44 serial@b2000000 {
45 compatible = "arm,pl011", "arm,primecell";
46 reg = <0xb2000000 0x1000>;
47 status = "disabled";
48 };
49
50 serial@b2080000 {
51 compatible = "arm,pl011", "arm,primecell";
52 reg = <0xb2080000 0x1000>;
53 status = "disabled";
54 };
55
56 serial@b2100000 {
57 compatible = "arm,pl011", "arm,primecell";
58 reg = <0xb2100000 0x1000>;
59 status = "disabled";
60 };
61
62 serial@b2180000 {
63 compatible = "arm,pl011", "arm,primecell";
64 reg = <0xb2180000 0x1000>;
65 status = "disabled";
66 };
67
68 serial@b2200000 {
69 compatible = "arm,pl011", "arm,primecell";
70 reg = <0xb2200000 0x1000>;
71 status = "disabled";
72 };
73 };
74 };
75};
diff --git a/arch/arm/boot/dts/spear320-evb.dts b/arch/arm/boot/dts/spear320-evb.dts
new file mode 100644
index 000000000000..5681a974d9d5
--- /dev/null
+++ b/arch/arm/boot/dts/spear320-evb.dts
@@ -0,0 +1,108 @@
1/*
2 * DTS file for SPEAr320 Evaluation Baord
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15/include/ "spear320.dtsi"
16
17/ {
18 model = "ST SPEAr300 Evaluation Board";
19 compatible = "st,spear300-evb", "st,spear300";
20 #address-cells = <1>;
21 #size-cells = <1>;
22
23 memory {
24 reg = <0 0x40000000>;
25 };
26
27 ahb {
28 clcd@90000000 {
29 status = "okay";
30 };
31
32 fsmc: flash@4c000000 {
33 status = "okay";
34 };
35
36 gmac: eth@e0800000 {
37 status = "okay";
38 };
39
40 sdhci@70000000 {
41 power-gpio = <&gpio0 2 1>;
42 power_always_enb;
43 status = "okay";
44 };
45
46 smi: flash@fc000000 {
47 status = "okay";
48 };
49
50 spi0: spi@d0100000 {
51 status = "okay";
52 };
53
54 spi1: spi@a5000000 {
55 status = "okay";
56 };
57
58 spi2: spi@a6000000 {
59 status = "okay";
60 };
61
62 ehci@e1800000 {
63 status = "okay";
64 };
65
66 ohci@e1900000 {
67 status = "okay";
68 };
69
70 ohci@e2100000 {
71 status = "okay";
72 };
73
74 apb {
75 gpio0: gpio@fc980000 {
76 status = "okay";
77 };
78
79 i2c0: i2c@d0180000 {
80 status = "okay";
81 };
82
83 i2c1: i2c@a7000000 {
84 status = "okay";
85 };
86
87 rtc@fc900000 {
88 status = "okay";
89 };
90
91 serial@d0000000 {
92 status = "okay";
93 };
94
95 serial@a3000000 {
96 status = "okay";
97 };
98
99 serial@a4000000 {
100 status = "okay";
101 };
102
103 wdt@fc880000 {
104 status = "okay";
105 };
106 };
107 };
108};
diff --git a/arch/arm/boot/dts/spear320.dtsi b/arch/arm/boot/dts/spear320.dtsi
new file mode 100644
index 000000000000..9a0267a5a0b7
--- /dev/null
+++ b/arch/arm/boot/dts/spear320.dtsi
@@ -0,0 +1,90 @@
1/*
2 * DTS file for SPEAr320 SoC
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/include/ "spear3xx.dtsi"
15
16/ {
17 ahb {
18 #address-cells = <1>;
19 #size-cells = <1>;
20 compatible = "simple-bus";
21 ranges = <0x40000000 0x40000000 0x70000000
22 0xd0000000 0xd0000000 0x30000000>;
23
24 clcd@90000000 {
25 compatible = "arm,clcd-pl110", "arm,primecell";
26 reg = <0x90000000 0x1000>;
27 interrupts = <33>;
28 status = "disabled";
29 };
30
31 fsmc: flash@4c000000 {
32 compatible = "st,spear600-fsmc-nand";
33 #address-cells = <1>;
34 #size-cells = <1>;
35 reg = <0x4c000000 0x1000 /* FSMC Register */
36 0x50000000 0x0010>; /* NAND Base */
37 reg-names = "fsmc_regs", "nand_data";
38 st,ale-off = <0x20000>;
39 st,cle-off = <0x10000>;
40 status = "disabled";
41 };
42
43 sdhci@70000000 {
44 compatible = "st,sdhci-spear";
45 reg = <0x70000000 0x100>;
46 interrupts = <29>;
47 status = "disabled";
48 };
49
50 spi1: spi@a5000000 {
51 compatible = "arm,pl022", "arm,primecell";
52 reg = <0xa5000000 0x1000>;
53 status = "disabled";
54 };
55
56 spi2: spi@a6000000 {
57 compatible = "arm,pl022", "arm,primecell";
58 reg = <0xa6000000 0x1000>;
59 status = "disabled";
60 };
61
62 apb {
63 #address-cells = <1>;
64 #size-cells = <1>;
65 compatible = "simple-bus";
66 ranges = <0xa0000000 0xa0000000 0x10000000
67 0xd0000000 0xd0000000 0x30000000>;
68
69 i2c1: i2c@a7000000 {
70 #address-cells = <1>;
71 #size-cells = <0>;
72 compatible = "snps,designware-i2c";
73 reg = <0xa7000000 0x1000>;
74 status = "disabled";
75 };
76
77 serial@a3000000 {
78 compatible = "arm,pl011", "arm,primecell";
79 reg = <0xa3000000 0x1000>;
80 status = "disabled";
81 };
82
83 serial@a4000000 {
84 compatible = "arm,pl011", "arm,primecell";
85 reg = <0xa4000000 0x1000>;
86 status = "disabled";
87 };
88 };
89 };
90};
diff --git a/arch/arm/boot/dts/spear3xx.dtsi b/arch/arm/boot/dts/spear3xx.dtsi
new file mode 100644
index 000000000000..924a6f67ed05
--- /dev/null
+++ b/arch/arm/boot/dts/spear3xx.dtsi
@@ -0,0 +1,136 @@
1/*
2 * DTS file for all SPEAr3xx SoCs
3 *
4 * Copyright 2012 Viresh Kumar <viresh.kumar@st.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/include/ "skeleton.dtsi"
15
16/ {
17 interrupt-parent = <&vic>;
18
19 cpus {
20 cpu@0 {
21 compatible = "arm,arm926ejs";
22 };
23 };
24
25 memory {
26 device_type = "memory";
27 reg = <0 0x40000000>;
28 };
29
30 ahb {
31 #address-cells = <1>;
32 #size-cells = <1>;
33 compatible = "simple-bus";
34 ranges = <0xd0000000 0xd0000000 0x30000000>;
35
36 vic: interrupt-controller@f1100000 {
37 compatible = "arm,pl190-vic";
38 interrupt-controller;
39 reg = <0xf1100000 0x1000>;
40 #interrupt-cells = <1>;
41 };
42
43 gmac: eth@e0800000 {
44 compatible = "st,spear600-gmac";
45 reg = <0xe0800000 0x8000>;
46 interrupts = <23 22>;
47 interrupt-names = "macirq", "eth_wake_irq";
48 status = "disabled";
49 };
50
51 smi: flash@fc000000 {
52 compatible = "st,spear600-smi";
53 #address-cells = <1>;
54 #size-cells = <1>;
55 reg = <0xfc000000 0x1000>;
56 interrupts = <9>;
57 status = "disabled";
58 };
59
60 spi0: spi@d0100000 {
61 compatible = "arm,pl022", "arm,primecell";
62 reg = <0xd0100000 0x1000>;
63 interrupts = <20>;
64 status = "disabled";
65 };
66
67 ehci@e1800000 {
68 compatible = "st,spear600-ehci", "usb-ehci";
69 reg = <0xe1800000 0x1000>;
70 interrupts = <26>;
71 status = "disabled";
72 };
73
74 ohci@e1900000 {
75 compatible = "st,spear600-ohci", "usb-ohci";
76 reg = <0xe1900000 0x1000>;
77 interrupts = <25>;
78 status = "disabled";
79 };
80
81 ohci@e2100000 {
82 compatible = "st,spear600-ohci", "usb-ohci";
83 reg = <0xe2100000 0x1000>;
84 interrupts = <27>;
85 status = "disabled";
86 };
87
88 apb {
89 #address-cells = <1>;
90 #size-cells = <1>;
91 compatible = "simple-bus";
92 ranges = <0xd0000000 0xd0000000 0x30000000>;
93
94 gpio0: gpio@fc980000 {
95 compatible = "arm,pl061", "arm,primecell";
96 reg = <0xfc980000 0x1000>;
97 interrupts = <11>;
98 gpio-controller;
99 #gpio-cells = <2>;
100 interrupt-controller;
101 #interrupt-cells = <2>;
102 status = "disabled";
103 };
104
105 i2c0: i2c@d0180000 {
106 #address-cells = <1>;
107 #size-cells = <0>;
108 compatible = "snps,designware-i2c";
109 reg = <0xd0180000 0x1000>;
110 interrupts = <21>;
111 status = "disabled";
112 };
113
114 rtc@fc900000 {
115 compatible = "st,spear-rtc";
116 reg = <0xfc900000 0x1000>;
117 interrupts = <10>;
118 status = "disabled";
119 };
120
121 serial@d0000000 {
122 compatible = "arm,pl011", "arm,primecell";
123 reg = <0xd0000000 0x1000>;
124 interrupts = <19>;
125 status = "disabled";
126 };
127
128 wdt@fc880000 {
129 compatible = "arm,sp805", "arm,primecell";
130 reg = <0xfc880000 0x1000>;
131 interrupts = <12>;
132 status = "disabled";
133 };
134 };
135 };
136};
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig
index 2cee6b0de371..d9fe11cb6f16 100644
--- a/arch/arm/mach-spear3xx/Kconfig
+++ b/arch/arm/mach-spear3xx/Kconfig
@@ -5,39 +5,19 @@
5if ARCH_SPEAR3XX 5if ARCH_SPEAR3XX
6 6
7menu "SPEAr3xx Implementations" 7menu "SPEAr3xx Implementations"
8config BOARD_SPEAR300_EVB
9 bool "SPEAr300 Evaluation Board"
10 select MACH_SPEAR300
11 help
12 Supports ST SPEAr300 Evaluation Board
13
14config BOARD_SPEAR310_EVB
15 bool "SPEAr310 Evaluation Board"
16 select MACH_SPEAR310
17 help
18 Supports ST SPEAr310 Evaluation Board
19
20config BOARD_SPEAR320_EVB
21 bool "SPEAr320 Evaluation Board"
22 select MACH_SPEAR320
23 help
24 Supports ST SPEAr320 Evaluation Board
25
26endmenu
27
28config MACH_SPEAR300 8config MACH_SPEAR300
29 bool "SPEAr300" 9 bool "SPEAr300 Machine support with Device Tree"
30 help 10 help
31 Supports ST SPEAr300 Machine 11 Supports ST SPEAr300 machine configured via the device-tree
32 12
33config MACH_SPEAR310 13config MACH_SPEAR310
34 bool "SPEAr310" 14 bool "SPEAr310 Machine support with Device Tree"
35 help 15 help
36 Supports ST SPEAr310 Machine 16 Supports ST SPEAr310 machine configured via the device-tree
37 17
38config MACH_SPEAR320 18config MACH_SPEAR320
39 bool "SPEAr320" 19 bool "SPEAr320 Machine support with Device Tree"
40 help 20 help
41 Supports ST SPEAr320 Machine 21 Supports ST SPEAr320 machine configured via the device-tree
42 22endmenu
43endif #ARCH_SPEAR3XX 23endif #ARCH_SPEAR3XX
diff --git a/arch/arm/mach-spear3xx/Makefile b/arch/arm/mach-spear3xx/Makefile
index b24862489704..17b5d83cf2d5 100644
--- a/arch/arm/mach-spear3xx/Makefile
+++ b/arch/arm/mach-spear3xx/Makefile
@@ -3,24 +3,13 @@
3# 3#
4 4
5# common files 5# common files
6obj-y += spear3xx.o clock.o 6obj-$(CONFIG_ARCH_SPEAR3XX) += spear3xx.o clock.o
7 7
8# spear300 specific files 8# spear300 specific files
9obj-$(CONFIG_MACH_SPEAR300) += spear300.o 9obj-$(CONFIG_MACH_SPEAR300) += spear300.o
10 10
11# spear300 boards files
12obj-$(CONFIG_BOARD_SPEAR300_EVB) += spear300_evb.o
13
14
15# spear310 specific files 11# spear310 specific files
16obj-$(CONFIG_MACH_SPEAR310) += spear310.o 12obj-$(CONFIG_MACH_SPEAR310) += spear310.o
17 13
18# spear310 boards files
19obj-$(CONFIG_BOARD_SPEAR310_EVB) += spear310_evb.o
20
21
22# spear320 specific files 14# spear320 specific files
23obj-$(CONFIG_MACH_SPEAR320) += spear320.o 15obj-$(CONFIG_MACH_SPEAR320) += spear320.o
24
25# spear320 boards files
26obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot
index 4674a4c221db..d93e2177e6ec 100644
--- a/arch/arm/mach-spear3xx/Makefile.boot
+++ b/arch/arm/mach-spear3xx/Makefile.boot
@@ -1,3 +1,7 @@
1zreladdr-y += 0x00008000 1zreladdr-y += 0x00008000
2params_phys-y := 0x00000100 2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4
5dtb-$(CONFIG_MACH_SPEAR300) += spear300-evb.dtb
6dtb-$(CONFIG_MACH_SPEAR310) += spear310-evb.dtb
7dtb-$(CONFIG_MACH_SPEAR320) += spear320-evb.dtb
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c
index 47d4535b6f59..9293c144b24a 100644
--- a/arch/arm/mach-spear3xx/clock.c
+++ b/arch/arm/mach-spear3xx/clock.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/of_platform.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <plat/clock.h> 20#include <plat/clock.h>
20#include <mach/misc_regs.h> 21#include <mach/misc_regs.h>
@@ -673,11 +674,11 @@ static struct clk_lookup spear_clk_lookups[] = {
673 CLKDEV_INIT(NULL, "osc_32k_clk", &osc_32k_clk), 674 CLKDEV_INIT(NULL, "osc_32k_clk", &osc_32k_clk),
674 CLKDEV_INIT(NULL, "osc_24m_clk", &osc_24m_clk), 675 CLKDEV_INIT(NULL, "osc_24m_clk", &osc_24m_clk),
675 /* clock derived from 32 KHz osc clk */ 676 /* clock derived from 32 KHz osc clk */
676 CLKDEV_INIT("rtc-spear", NULL, &rtc_clk), 677 CLKDEV_INIT("fc900000.rtc", NULL, &rtc_clk),
677 /* clock derived from 24 MHz osc clk */ 678 /* clock derived from 24 MHz osc clk */
678 CLKDEV_INIT(NULL, "pll1_clk", &pll1_clk), 679 CLKDEV_INIT(NULL, "pll1_clk", &pll1_clk),
679 CLKDEV_INIT(NULL, "pll3_48m_clk", &pll3_48m_clk), 680 CLKDEV_INIT(NULL, "pll3_48m_clk", &pll3_48m_clk),
680 CLKDEV_INIT("wdt", NULL, &wdt_clk), 681 CLKDEV_INIT("fc880000.wdt", NULL, &wdt_clk),
681 /* clock derived from pll1 clk */ 682 /* clock derived from pll1 clk */
682 CLKDEV_INIT(NULL, "cpu_clk", &cpu_clk), 683 CLKDEV_INIT(NULL, "cpu_clk", &cpu_clk),
683 CLKDEV_INIT(NULL, "ahb_clk", &ahb_clk), 684 CLKDEV_INIT(NULL, "ahb_clk", &ahb_clk),
@@ -686,7 +687,7 @@ static struct clk_lookup spear_clk_lookups[] = {
686 CLKDEV_INIT(NULL, "gpt0_synth_clk", &gpt0_synth_clk), 687 CLKDEV_INIT(NULL, "gpt0_synth_clk", &gpt0_synth_clk),
687 CLKDEV_INIT(NULL, "gpt1_synth_clk", &gpt1_synth_clk), 688 CLKDEV_INIT(NULL, "gpt1_synth_clk", &gpt1_synth_clk),
688 CLKDEV_INIT(NULL, "gpt2_synth_clk", &gpt2_synth_clk), 689 CLKDEV_INIT(NULL, "gpt2_synth_clk", &gpt2_synth_clk),
689 CLKDEV_INIT("uart", NULL, &uart_clk), 690 CLKDEV_INIT("d0000000.serial", NULL, &uart_clk),
690 CLKDEV_INIT("firda", NULL, &firda_clk), 691 CLKDEV_INIT("firda", NULL, &firda_clk),
691 CLKDEV_INIT("gpt0", NULL, &gpt0_clk), 692 CLKDEV_INIT("gpt0", NULL, &gpt0_clk),
692 CLKDEV_INIT("gpt1", NULL, &gpt1_clk), 693 CLKDEV_INIT("gpt1", NULL, &gpt1_clk),
@@ -699,81 +700,95 @@ static struct clk_lookup spear_clk_lookups[] = {
699 CLKDEV_INIT(NULL, "usbh.1_clk", &usbh1_clk), 700 CLKDEV_INIT(NULL, "usbh.1_clk", &usbh1_clk),
700 /* clock derived from ahb clk */ 701 /* clock derived from ahb clk */
701 CLKDEV_INIT(NULL, "apb_clk", &apb_clk), 702 CLKDEV_INIT(NULL, "apb_clk", &apb_clk),
702 CLKDEV_INIT("i2c_designware.0", NULL, &i2c_clk), 703 CLKDEV_INIT("d0180000.i2c", NULL, &i2c_clk),
703 CLKDEV_INIT("dma", NULL, &dma_clk), 704 CLKDEV_INIT("dma", NULL, &dma_clk),
704 CLKDEV_INIT("jpeg", NULL, &jpeg_clk), 705 CLKDEV_INIT("jpeg", NULL, &jpeg_clk),
705 CLKDEV_INIT("gmac", NULL, &gmac_clk), 706 CLKDEV_INIT("e0800000.eth", NULL, &gmac_clk),
706 CLKDEV_INIT("smi", NULL, &smi_clk), 707 CLKDEV_INIT("fc000000.flash", NULL, &smi_clk),
707 CLKDEV_INIT("c3", NULL, &c3_clk), 708 CLKDEV_INIT("c3", NULL, &c3_clk),
708 /* clock derived from apb clk */ 709 /* clock derived from apb clk */
709 CLKDEV_INIT("adc", NULL, &adc_clk), 710 CLKDEV_INIT("adc", NULL, &adc_clk),
710 CLKDEV_INIT("ssp-pl022.0", NULL, &ssp0_clk), 711 CLKDEV_INIT("d0100000.spi", NULL, &ssp0_clk),
711 CLKDEV_INIT("gpio", NULL, &gpio_clk), 712 CLKDEV_INIT("fc980000.gpio", NULL, &gpio_clk),
712}; 713};
713 714
714/* array of all spear 300 clock lookups */ 715/* array of all spear 300 clock lookups */
715#ifdef CONFIG_MACH_SPEAR300 716#ifdef CONFIG_MACH_SPEAR300
716static struct clk_lookup spear300_clk_lookups[] = { 717static struct clk_lookup spear300_clk_lookups[] = {
717 CLKDEV_INIT("clcd", NULL, &clcd_clk), 718 CLKDEV_INIT("60000000.clcd", NULL, &clcd_clk),
718 CLKDEV_INIT("fsmc", NULL, &fsmc_clk), 719 CLKDEV_INIT("94000000.flash", NULL, &fsmc_clk),
719 CLKDEV_INIT("gpio1", NULL, &gpio1_clk), 720 CLKDEV_INIT("a9000000.gpio", NULL, &gpio1_clk),
720 CLKDEV_INIT("keyboard", NULL, &kbd_clk), 721 CLKDEV_INIT("a0000000.kbd", NULL, &kbd_clk),
721 CLKDEV_INIT("sdhci", NULL, &sdhci_clk), 722 CLKDEV_INIT("70000000.sdhci", NULL, &sdhci_clk),
722}; 723};
724
725void __init spear300_clk_init(void)
726{
727 int i;
728
729 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
730 clk_register(&spear_clk_lookups[i]);
731
732 for (i = 0; i < ARRAY_SIZE(spear300_clk_lookups); i++)
733 clk_register(&spear300_clk_lookups[i]);
734
735 clk_init();
736}
723#endif 737#endif
724 738
725/* array of all spear 310 clock lookups */ 739/* array of all spear 310 clock lookups */
726#ifdef CONFIG_MACH_SPEAR310 740#ifdef CONFIG_MACH_SPEAR310
727static struct clk_lookup spear310_clk_lookups[] = { 741static struct clk_lookup spear310_clk_lookups[] = {
728 CLKDEV_INIT("fsmc", NULL, &fsmc_clk), 742 CLKDEV_INIT("44000000.flash", NULL, &fsmc_clk),
729 CLKDEV_INIT(NULL, "emi", &emi_clk), 743 CLKDEV_INIT(NULL, "emi", &emi_clk),
730 CLKDEV_INIT("uart1", NULL, &uart1_clk), 744 CLKDEV_INIT("b2000000.serial", NULL, &uart1_clk),
731 CLKDEV_INIT("uart2", NULL, &uart2_clk), 745 CLKDEV_INIT("b2080000.serial", NULL, &uart2_clk),
732 CLKDEV_INIT("uart3", NULL, &uart3_clk), 746 CLKDEV_INIT("b2100000.serial", NULL, &uart3_clk),
733 CLKDEV_INIT("uart4", NULL, &uart4_clk), 747 CLKDEV_INIT("b2180000.serial", NULL, &uart4_clk),
734 CLKDEV_INIT("uart5", NULL, &uart5_clk), 748 CLKDEV_INIT("b2200000.serial", NULL, &uart5_clk),
735}; 749};
750
751void __init spear310_clk_init(void)
752{
753 int i;
754
755 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
756 clk_register(&spear_clk_lookups[i]);
757
758 for (i = 0; i < ARRAY_SIZE(spear310_clk_lookups); i++)
759 clk_register(&spear310_clk_lookups[i]);
760
761 clk_init();
762}
736#endif 763#endif
737 764
738/* array of all spear 320 clock lookups */ 765/* array of all spear 320 clock lookups */
739#ifdef CONFIG_MACH_SPEAR320 766#ifdef CONFIG_MACH_SPEAR320
740static struct clk_lookup spear320_clk_lookups[] = { 767static struct clk_lookup spear320_clk_lookups[] = {
741 CLKDEV_INIT("clcd", NULL, &clcd_clk), 768 CLKDEV_INIT("90000000.clcd", NULL, &clcd_clk),
742 CLKDEV_INIT("fsmc", NULL, &fsmc_clk), 769 CLKDEV_INIT("4c000000.flash", NULL, &fsmc_clk),
743 CLKDEV_INIT("i2c_designware.1", NULL, &i2c1_clk), 770 CLKDEV_INIT("a7000000.i2c", NULL, &i2c1_clk),
744 CLKDEV_INIT(NULL, "emi", &emi_clk), 771 CLKDEV_INIT(NULL, "emi", &emi_clk),
745 CLKDEV_INIT("pwm", NULL, &pwm_clk), 772 CLKDEV_INIT("pwm", NULL, &pwm_clk),
746 CLKDEV_INIT("sdhci", NULL, &sdhci_clk), 773 CLKDEV_INIT("70000000.sdhci", NULL, &sdhci_clk),
747 CLKDEV_INIT("c_can_platform.0", NULL, &can0_clk), 774 CLKDEV_INIT("c_can_platform.0", NULL, &can0_clk),
748 CLKDEV_INIT("c_can_platform.1", NULL, &can1_clk), 775 CLKDEV_INIT("c_can_platform.1", NULL, &can1_clk),
749 CLKDEV_INIT("ssp-pl022.1", NULL, &ssp1_clk), 776 CLKDEV_INIT("a5000000.spi", NULL, &ssp1_clk),
750 CLKDEV_INIT("ssp-pl022.2", NULL, &ssp2_clk), 777 CLKDEV_INIT("a6000000.spi", NULL, &ssp2_clk),
751 CLKDEV_INIT("uart1", NULL, &uart1_clk), 778 CLKDEV_INIT("a3000000.serial", NULL, &uart1_clk),
752 CLKDEV_INIT("uart2", NULL, &uart2_clk), 779 CLKDEV_INIT("a4000000.serial", NULL, &uart2_clk),
753}; 780};
754#endif
755 781
756void __init spear3xx_clk_init(void) 782void __init spear320_clk_init(void)
757{ 783{
758 int i, cnt; 784 int i;
759 struct clk_lookup *lookups;
760
761 if (machine_is_spear300()) {
762 cnt = ARRAY_SIZE(spear300_clk_lookups);
763 lookups = spear300_clk_lookups;
764 } else if (machine_is_spear310()) {
765 cnt = ARRAY_SIZE(spear310_clk_lookups);
766 lookups = spear310_clk_lookups;
767 } else {
768 cnt = ARRAY_SIZE(spear320_clk_lookups);
769 lookups = spear320_clk_lookups;
770 }
771 785
772 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) 786 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
773 clk_register(&spear_clk_lookups[i]); 787 clk_register(&spear_clk_lookups[i]);
774 788
775 for (i = 0; i < cnt; i++) 789 for (i = 0; i < ARRAY_SIZE(spear320_clk_lookups); i++)
776 clk_register(&lookups[i]); 790 clk_register(&spear320_clk_lookups[i]);
777 791
778 clk_init(); 792 clk_init();
779} 793}
794#endif
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index 14276e5a98d2..84ee2bbf1338 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -31,16 +31,13 @@
31#define SPEAR_GPT0_CHAN1_IRQ SPEAR3XX_IRQ_CPU_GPT1_2 31#define SPEAR_GPT0_CHAN1_IRQ SPEAR3XX_IRQ_CPU_GPT1_2
32 32
33/* Add spear3xx family device structure declarations here */ 33/* Add spear3xx family device structure declarations here */
34extern struct amba_device spear3xx_gpio_device;
35extern struct amba_device spear3xx_uart_device;
36extern struct sys_timer spear3xx_timer; 34extern struct sys_timer spear3xx_timer;
35extern struct pl022_ssp_controller pl022_plat_data;
37 36
38/* Add spear3xx family function declarations here */ 37/* Add spear3xx family function declarations here */
39void __init spear3xx_clk_init(void);
40void __init spear_setup_timer(void); 38void __init spear_setup_timer(void);
41void __init spear3xx_map_io(void); 39void __init spear3xx_map_io(void);
42void __init spear3xx_init_irq(void); 40void __init spear3xx_dt_init_irq(void);
43void __init spear3xx_init(void);
44 41
45void spear_restart(char, const char *); 42void spear_restart(char, const char *);
46 43
@@ -99,9 +96,6 @@ extern struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50;
99 96
100/* spear300 declarations */ 97/* spear300 declarations */
101#ifdef CONFIG_MACH_SPEAR300 98#ifdef CONFIG_MACH_SPEAR300
102/* Add spear300 machine device structure declarations here */
103extern struct amba_device spear300_gpio1_device;
104
105/* pad mux modes */ 99/* pad mux modes */
106extern struct pmx_mode spear300_nand_mode; 100extern struct pmx_mode spear300_nand_mode;
107extern struct pmx_mode spear300_nor_mode; 101extern struct pmx_mode spear300_nor_mode;
@@ -133,16 +127,13 @@ extern struct pmx_dev spear300_pmx_telecom_sdhci_4bit;
133extern struct pmx_dev spear300_pmx_telecom_sdhci_8bit; 127extern struct pmx_dev spear300_pmx_telecom_sdhci_8bit;
134extern struct pmx_dev spear300_pmx_gpio1; 128extern struct pmx_dev spear300_pmx_gpio1;
135 129
136/* Add spear300 machine function declarations here */ 130/* Add spear300 machine declarations here */
137void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, 131void __init spear300_clk_init(void);
138 u8 pmx_dev_count);
139 132
140#endif /* CONFIG_MACH_SPEAR300 */ 133#endif /* CONFIG_MACH_SPEAR300 */
141 134
142/* spear310 declarations */ 135/* spear310 declarations */
143#ifdef CONFIG_MACH_SPEAR310 136#ifdef CONFIG_MACH_SPEAR310
144/* Add spear310 machine device structure declarations here */
145
146/* pad mux devices */ 137/* pad mux devices */
147extern struct pmx_dev spear310_pmx_emi_cs_0_1_4_5; 138extern struct pmx_dev spear310_pmx_emi_cs_0_1_4_5;
148extern struct pmx_dev spear310_pmx_emi_cs_2_3; 139extern struct pmx_dev spear310_pmx_emi_cs_2_3;
@@ -153,16 +144,13 @@ extern struct pmx_dev spear310_pmx_fsmc;
153extern struct pmx_dev spear310_pmx_rs485_0_1; 144extern struct pmx_dev spear310_pmx_rs485_0_1;
154extern struct pmx_dev spear310_pmx_tdm0; 145extern struct pmx_dev spear310_pmx_tdm0;
155 146
156/* Add spear310 machine function declarations here */ 147/* Add spear310 machine declarations here */
157void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, 148void __init spear310_clk_init(void);
158 u8 pmx_dev_count);
159 149
160#endif /* CONFIG_MACH_SPEAR310 */ 150#endif /* CONFIG_MACH_SPEAR310 */
161 151
162/* spear320 declarations */ 152/* spear320 declarations */
163#ifdef CONFIG_MACH_SPEAR320 153#ifdef CONFIG_MACH_SPEAR320
164/* Add spear320 machine device structure declarations here */
165
166/* pad mux modes */ 154/* pad mux modes */
167extern struct pmx_mode spear320_auto_net_smii_mode; 155extern struct pmx_mode spear320_auto_net_smii_mode;
168extern struct pmx_mode spear320_auto_net_mii_mode; 156extern struct pmx_mode spear320_auto_net_mii_mode;
@@ -193,9 +181,8 @@ extern struct pmx_dev spear320_pmx_smii0;
193extern struct pmx_dev spear320_pmx_smii1; 181extern struct pmx_dev spear320_pmx_smii1;
194extern struct pmx_dev spear320_pmx_i2c1; 182extern struct pmx_dev spear320_pmx_i2c1;
195 183
196/* Add spear320 machine function declarations here */ 184/* Add spear320 machine declarations here */
197void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, 185void __init spear320_clk_init(void);
198 u8 pmx_dev_count);
199 186
200#endif /* CONFIG_MACH_SPEAR320 */ 187#endif /* CONFIG_MACH_SPEAR320 */
201 188
diff --git a/arch/arm/mach-spear3xx/include/mach/hardware.h b/arch/arm/mach-spear3xx/include/mach/hardware.h
index 4660c0d8ec0d..defa374f5bee 100644
--- a/arch/arm/mach-spear3xx/include/mach/hardware.h
+++ b/arch/arm/mach-spear3xx/include/mach/hardware.h
@@ -17,7 +17,4 @@
17#include <plat/hardware.h> 17#include <plat/hardware.h>
18#include <mach/spear.h> 18#include <mach/spear.h>
19 19
20/* Vitual to physical translation of statically mapped space */
21#define IO_ADDRESS(x) (x | 0xF0000000)
22
23#endif /* __MACH_HARDWARE_H */ 20#endif /* __MACH_HARDWARE_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear.h b/arch/arm/mach-spear3xx/include/mach/spear.h
index 63fd98356919..8e3900aa0d45 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear.h
@@ -25,8 +25,9 @@
25 25
26/* ICM1 - Low speed connection */ 26/* ICM1 - Low speed connection */
27#define SPEAR3XX_ICM1_2_BASE UL(0xD0000000) 27#define SPEAR3XX_ICM1_2_BASE UL(0xD0000000)
28#define VA_SPEAR3XX_ICM1_2_BASE UL(0xFD000000)
28#define SPEAR3XX_ICM1_UART_BASE UL(0xD0000000) 29#define SPEAR3XX_ICM1_UART_BASE UL(0xD0000000)
29#define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE) 30#define VA_SPEAR3XX_ICM1_UART_BASE (VA_SPEAR3XX_ICM1_2_BASE | SPEAR3XX_ICM1_UART_BASE)
30#define SPEAR3XX_ICM1_ADC_BASE UL(0xD0080000) 31#define SPEAR3XX_ICM1_ADC_BASE UL(0xD0080000)
31#define SPEAR3XX_ICM1_SSP_BASE UL(0xD0100000) 32#define SPEAR3XX_ICM1_SSP_BASE UL(0xD0100000)
32#define SPEAR3XX_ICM1_I2C_BASE UL(0xD0180000) 33#define SPEAR3XX_ICM1_I2C_BASE UL(0xD0180000)
@@ -53,11 +54,11 @@
53#define SPEAR3XX_ICM3_ML1_2_BASE UL(0xF0000000) 54#define SPEAR3XX_ICM3_ML1_2_BASE UL(0xF0000000)
54#define SPEAR3XX_ML1_TMR_BASE UL(0xF0000000) 55#define SPEAR3XX_ML1_TMR_BASE UL(0xF0000000)
55#define SPEAR3XX_ML1_VIC_BASE UL(0xF1100000) 56#define SPEAR3XX_ML1_VIC_BASE UL(0xF1100000)
56#define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE)
57 57
58/* ICM3 - Basic Subsystem */ 58/* ICM3 - Basic Subsystem */
59#define SPEAR3XX_ICM3_SMEM_BASE UL(0xF8000000) 59#define SPEAR3XX_ICM3_SMEM_BASE UL(0xF8000000)
60#define SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000) 60#define SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000)
61#define VA_SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000)
61#define SPEAR3XX_ICM3_DMA_BASE UL(0xFC400000) 62#define SPEAR3XX_ICM3_DMA_BASE UL(0xFC400000)
62#define SPEAR3XX_ICM3_SDRAM_CTRL_BASE UL(0xFC600000) 63#define SPEAR3XX_ICM3_SDRAM_CTRL_BASE UL(0xFC600000)
63#define SPEAR3XX_ICM3_TMR0_BASE UL(0xFC800000) 64#define SPEAR3XX_ICM3_TMR0_BASE UL(0xFC800000)
@@ -65,9 +66,9 @@
65#define SPEAR3XX_ICM3_RTC_BASE UL(0xFC900000) 66#define SPEAR3XX_ICM3_RTC_BASE UL(0xFC900000)
66#define SPEAR3XX_ICM3_GPIO_BASE UL(0xFC980000) 67#define SPEAR3XX_ICM3_GPIO_BASE UL(0xFC980000)
67#define SPEAR3XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000) 68#define SPEAR3XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000)
68#define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE) 69#define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE (VA_SPEAR3XX_ICM3_SMI_CTRL_BASE | SPEAR3XX_ICM3_SYS_CTRL_BASE)
69#define SPEAR3XX_ICM3_MISC_REG_BASE UL(0xFCA80000) 70#define SPEAR3XX_ICM3_MISC_REG_BASE UL(0xFCA80000)
70#define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE) 71#define VA_SPEAR3XX_ICM3_MISC_REG_BASE (VA_SPEAR3XX_ICM3_SMI_CTRL_BASE | SPEAR3XX_ICM3_MISC_REG_BASE)
71#define SPEAR3XX_ICM3_TMR1_BASE UL(0xFCB00000) 72#define SPEAR3XX_ICM3_TMR1_BASE UL(0xFCB00000)
72 73
73/* Debug uart for linux, will be used for debug and uncompress messages */ 74/* Debug uart for linux, will be used for debug and uncompress messages */
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
index adee72bb68ec..c876c6a2caad 100644
--- a/arch/arm/mach-spear3xx/spear300.c
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * SPEAr300 machine source file 4 * SPEAr300 machine source file
5 * 5 *
6 * Copyright (C) 2009 ST Microelectronics 6 * Copyright (C) 2009-2012 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.kumar@st.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
@@ -13,10 +13,9 @@
13 13
14#define pr_fmt(fmt) "SPEAr300: " fmt 14#define pr_fmt(fmt) "SPEAr300: " fmt
15 15
16#include <linux/types.h> 16#include <linux/of_platform.h>
17#include <linux/amba/pl061.h> 17#include <asm/hardware/vic.h>
18#include <linux/ptrace.h> 18#include <asm/mach/arch.h>
19#include <asm/irq.h>
20#include <plat/shirq.h> 19#include <plat/shirq.h>
21#include <mach/generic.h> 20#include <mach/generic.h>
22#include <mach/hardware.h> 21#include <mach/hardware.h>
@@ -425,24 +424,35 @@ static struct spear_shirq shirq_ras1 = {
425 }, 424 },
426}; 425};
427 426
428/* Add spear300 specific devices here */ 427/* padmux devices to enable */
429/* arm gpio1 device registration */ 428static struct pmx_dev *spear300_evb_pmx_devs[] = {
430static struct pl061_platform_data gpio1_plat_data = { 429 /* spear3xx specific devices */
431 .gpio_base = 8, 430 &spear3xx_pmx_i2c,
432 .irq_base = SPEAR300_GPIO1_INT_BASE, 431 &spear3xx_pmx_ssp_cs,
432 &spear3xx_pmx_ssp,
433 &spear3xx_pmx_mii,
434 &spear3xx_pmx_uart0,
435
436 /* spear300 specific devices */
437 &spear300_pmx_fsmc_2_chips,
438 &spear300_pmx_clcd,
439 &spear300_pmx_telecom_sdhci_4bit,
440 &spear300_pmx_gpio1,
433}; 441};
434 442
435AMBA_APB_DEVICE(spear300_gpio1, "gpio1", 0, SPEAR300_GPIO_BASE, 443/* Add SPEAr300 auxdata to pass platform data */
436 {SPEAR300_VIRQ_GPIO1}, &gpio1_plat_data); 444static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = {
445 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
446 &pl022_plat_data),
447 {}
448};
437 449
438/* spear300 routines */ 450static void __init spear300_dt_init(void)
439void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
440 u8 pmx_dev_count)
441{ 451{
442 int ret = 0; 452 int ret = -EINVAL;
443 453
444 /* call spear3xx family common init function */ 454 of_platform_populate(NULL, of_default_bus_match_table,
445 spear3xx_init(); 455 spear300_auxdata_lookup, NULL);
446 456
447 /* shared irq registration */ 457 /* shared irq registration */
448 shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K); 458 shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K);
@@ -452,18 +462,45 @@ void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
452 pr_err("Error registering Shared IRQ\n"); 462 pr_err("Error registering Shared IRQ\n");
453 } 463 }
454 464
455 /* pmx initialization */ 465 if (of_machine_is_compatible("st,spear300-evb")) {
456 pmx_driver.mode = pmx_mode; 466 /* pmx initialization */
457 pmx_driver.devs = pmx_devs; 467 pmx_driver.mode = &spear300_photo_frame_mode;
458 pmx_driver.devs_count = pmx_dev_count; 468 pmx_driver.devs = spear300_evb_pmx_devs;
469 pmx_driver.devs_count = ARRAY_SIZE(spear300_evb_pmx_devs);
470
471 pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
472 if (pmx_driver.base) {
473 ret = pmx_register(&pmx_driver);
474 if (ret)
475 pr_err("padmux: registration failed. err no: %d\n",
476 ret);
477 /* Free Mapping, device selection already done */
478 iounmap(pmx_driver.base);
479 }
459 480
460 pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
461 if (pmx_driver.base) {
462 ret = pmx_register(&pmx_driver);
463 if (ret) 481 if (ret)
464 pr_err("padmux: registration failed. err no: %d\n", 482 pr_err("Initialization Failed");
465 ret);
466 /* Free Mapping, device selection already done */
467 iounmap(pmx_driver.base);
468 } 483 }
469} 484}
485
486static const char * const spear300_dt_board_compat[] = {
487 "st,spear300",
488 "st,spear300-evb",
489 NULL,
490};
491
492static void __init spear300_map_io(void)
493{
494 spear3xx_map_io();
495 spear300_clk_init();
496}
497
498DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree")
499 .map_io = spear300_map_io,
500 .init_irq = spear3xx_dt_init_irq,
501 .handle_irq = vic_handle_irq,
502 .timer = &spear3xx_timer,
503 .init_machine = spear300_dt_init,
504 .restart = spear_restart,
505 .dt_compat = spear300_dt_board_compat,
506MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
deleted file mode 100644
index 3462ab9d6122..000000000000
--- a/arch/arm/mach-spear3xx/spear300_evb.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * arch/arm/mach-spear3xx/spear300_evb.c
3 *
4 * SPEAr300 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/hardware/vic.h>
15#include <asm/mach/arch.h>
16#include <asm/mach-types.h>
17#include <mach/generic.h>
18#include <mach/hardware.h>
19
20/* padmux devices to enable */
21static struct pmx_dev *pmx_devs[] = {
22 /* spear3xx specific devices */
23 &spear3xx_pmx_i2c,
24 &spear3xx_pmx_ssp_cs,
25 &spear3xx_pmx_ssp,
26 &spear3xx_pmx_mii,
27 &spear3xx_pmx_uart0,
28
29 /* spear300 specific devices */
30 &spear300_pmx_fsmc_2_chips,
31 &spear300_pmx_clcd,
32 &spear300_pmx_telecom_sdhci_4bit,
33 &spear300_pmx_gpio1,
34};
35
36static struct amba_device *amba_devs[] __initdata = {
37 /* spear3xx specific devices */
38 &spear3xx_gpio_device,
39 &spear3xx_uart_device,
40
41 /* spear300 specific devices */
42 &spear300_gpio1_device,
43};
44
45static struct platform_device *plat_devs[] __initdata = {
46 /* spear3xx specific devices */
47
48 /* spear300 specific devices */
49};
50
51static void __init spear300_evb_init(void)
52{
53 unsigned int i;
54
55 /* call spear300 machine init function */
56 spear300_init(&spear300_photo_frame_mode, pmx_devs,
57 ARRAY_SIZE(pmx_devs));
58
59 /* Add Platform Devices */
60 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
61
62 /* Add Amba Devices */
63 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
64 amba_device_register(amba_devs[i], &iomem_resource);
65}
66
67MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
68 .atag_offset = 0x100,
69 .map_io = spear3xx_map_io,
70 .init_irq = spear3xx_init_irq,
71 .handle_irq = vic_handle_irq,
72 .timer = &spear3xx_timer,
73 .init_machine = spear300_evb_init,
74 .restart = spear_restart,
75MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
index b7c28764df92..641fd4cf6bc7 100644
--- a/arch/arm/mach-spear3xx/spear310.c
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * SPEAr310 machine source file 4 * SPEAr310 machine source file
5 * 5 *
6 * Copyright (C) 2009 ST Microelectronics 6 * Copyright (C) 2009-2012 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.kumar@st.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
@@ -13,8 +13,11 @@
13 13
14#define pr_fmt(fmt) "SPEAr310: " fmt 14#define pr_fmt(fmt) "SPEAr310: " fmt
15 15
16#include <linux/ptrace.h> 16#include <linux/amba/pl08x.h>
17#include <asm/irq.h> 17#include <linux/amba/serial.h>
18#include <linux/of_platform.h>
19#include <asm/hardware/vic.h>
20#include <asm/mach/arch.h>
18#include <plat/shirq.h> 21#include <plat/shirq.h>
19#include <mach/generic.h> 22#include <mach/generic.h>
20#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -257,17 +260,79 @@ static struct spear_shirq shirq_intrcomm_ras = {
257 }, 260 },
258}; 261};
259 262
260/* Add spear310 specific devices here */ 263/* padmux devices to enable */
264static struct pmx_dev *spear310_evb_pmx_devs[] = {
265 /* spear3xx specific devices */
266 &spear3xx_pmx_i2c,
267 &spear3xx_pmx_ssp,
268 &spear3xx_pmx_gpio_pin0,
269 &spear3xx_pmx_gpio_pin1,
270 &spear3xx_pmx_gpio_pin2,
271 &spear3xx_pmx_gpio_pin3,
272 &spear3xx_pmx_gpio_pin4,
273 &spear3xx_pmx_gpio_pin5,
274 &spear3xx_pmx_uart0,
275
276 /* spear310 specific devices */
277 &spear310_pmx_emi_cs_0_1_4_5,
278 &spear310_pmx_emi_cs_2_3,
279 &spear310_pmx_uart1,
280 &spear310_pmx_uart2,
281 &spear310_pmx_uart3_4_5,
282 &spear310_pmx_fsmc,
283 &spear310_pmx_rs485_0_1,
284 &spear310_pmx_tdm0,
285};
286
287/* uart devices plat data */
288static struct amba_pl011_data spear310_uart_data[] = {
289 {
290 .dma_filter = pl08x_filter_id,
291 .dma_tx_param = "uart1_tx",
292 .dma_rx_param = "uart1_rx",
293 }, {
294 .dma_filter = pl08x_filter_id,
295 .dma_tx_param = "uart2_tx",
296 .dma_rx_param = "uart2_rx",
297 }, {
298 .dma_filter = pl08x_filter_id,
299 .dma_tx_param = "uart3_tx",
300 .dma_rx_param = "uart3_rx",
301 }, {
302 .dma_filter = pl08x_filter_id,
303 .dma_tx_param = "uart4_tx",
304 .dma_rx_param = "uart4_rx",
305 }, {
306 .dma_filter = pl08x_filter_id,
307 .dma_tx_param = "uart5_tx",
308 .dma_rx_param = "uart5_rx",
309 },
310};
261 311
262/* spear310 routines */ 312/* Add SPEAr310 auxdata to pass platform data */
263void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, 313static struct of_dev_auxdata spear310_auxdata_lookup[] __initdata = {
264 u8 pmx_dev_count) 314 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
315 &pl022_plat_data),
316 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE, NULL,
317 &spear310_uart_data[0]),
318 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE, NULL,
319 &spear310_uart_data[1]),
320 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE, NULL,
321 &spear310_uart_data[2]),
322 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE, NULL,
323 &spear310_uart_data[3]),
324 OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE, NULL,
325 &spear310_uart_data[4]),
326 {}
327};
328
329static void __init spear310_dt_init(void)
265{ 330{
266 void __iomem *base; 331 void __iomem *base;
267 int ret = 0; 332 int ret = 0;
268 333
269 /* call spear3xx family common init function */ 334 of_platform_populate(NULL, of_default_bus_match_table,
270 spear3xx_init(); 335 spear310_auxdata_lookup, NULL);
271 336
272 /* shared irq registration */ 337 /* shared irq registration */
273 base = ioremap(SPEAR310_SOC_CONFIG_BASE, SZ_4K); 338 base = ioremap(SPEAR310_SOC_CONFIG_BASE, SZ_4K);
@@ -297,13 +362,38 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
297 pr_err("Error registering Shared IRQ 4\n"); 362 pr_err("Error registering Shared IRQ 4\n");
298 } 363 }
299 364
300 /* pmx initialization */ 365 if (of_machine_is_compatible("st,spear310-evb")) {
301 pmx_driver.base = base; 366 /* pmx initialization */
302 pmx_driver.mode = pmx_mode; 367 pmx_driver.base = base;
303 pmx_driver.devs = pmx_devs; 368 pmx_driver.mode = NULL;
304 pmx_driver.devs_count = pmx_dev_count; 369 pmx_driver.devs = spear310_evb_pmx_devs;
370 pmx_driver.devs_count = ARRAY_SIZE(spear310_evb_pmx_devs);
305 371
306 ret = pmx_register(&pmx_driver); 372 ret = pmx_register(&pmx_driver);
307 if (ret) 373 if (ret)
308 pr_err("padmux: registration failed. err no: %d\n", ret); 374 pr_err("padmux: registration failed. err no: %d\n",
375 ret);
376 }
309} 377}
378
379static const char * const spear310_dt_board_compat[] = {
380 "st,spear310",
381 "st,spear310-evb",
382 NULL,
383};
384
385static void __init spear310_map_io(void)
386{
387 spear3xx_map_io();
388 spear310_clk_init();
389}
390
391DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree")
392 .map_io = spear310_map_io,
393 .init_irq = spear3xx_dt_init_irq,
394 .handle_irq = vic_handle_irq,
395 .timer = &spear3xx_timer,
396 .init_machine = spear310_dt_init,
397 .restart = spear_restart,
398 .dt_compat = spear310_dt_board_compat,
399MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
deleted file mode 100644
index f92c4993f65a..000000000000
--- a/arch/arm/mach-spear3xx/spear310_evb.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * arch/arm/mach-spear3xx/spear310_evb.c
3 *
4 * SPEAr310 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/hardware/vic.h>
15#include <asm/mach/arch.h>
16#include <asm/mach-types.h>
17#include <mach/generic.h>
18#include <mach/hardware.h>
19
20/* padmux devices to enable */
21static struct pmx_dev *pmx_devs[] = {
22 /* spear3xx specific devices */
23 &spear3xx_pmx_i2c,
24 &spear3xx_pmx_ssp,
25 &spear3xx_pmx_gpio_pin0,
26 &spear3xx_pmx_gpio_pin1,
27 &spear3xx_pmx_gpio_pin2,
28 &spear3xx_pmx_gpio_pin3,
29 &spear3xx_pmx_gpio_pin4,
30 &spear3xx_pmx_gpio_pin5,
31 &spear3xx_pmx_uart0,
32
33 /* spear310 specific devices */
34 &spear310_pmx_emi_cs_0_1_4_5,
35 &spear310_pmx_emi_cs_2_3,
36 &spear310_pmx_uart1,
37 &spear310_pmx_uart2,
38 &spear310_pmx_uart3_4_5,
39 &spear310_pmx_fsmc,
40 &spear310_pmx_rs485_0_1,
41 &spear310_pmx_tdm0,
42};
43
44static struct amba_device *amba_devs[] __initdata = {
45 /* spear3xx specific devices */
46 &spear3xx_gpio_device,
47 &spear3xx_uart_device,
48
49 /* spear310 specific devices */
50};
51
52static struct platform_device *plat_devs[] __initdata = {
53 /* spear3xx specific devices */
54
55 /* spear310 specific devices */
56};
57
58static void __init spear310_evb_init(void)
59{
60 unsigned int i;
61
62 /* call spear310 machine init function */
63 spear310_init(NULL, pmx_devs, ARRAY_SIZE(pmx_devs));
64
65 /* Add Platform Devices */
66 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
67
68 /* Add Amba Devices */
69 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
70 amba_device_register(amba_devs[i], &iomem_resource);
71}
72
73MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
74 .atag_offset = 0x100,
75 .map_io = spear3xx_map_io,
76 .init_irq = spear3xx_init_irq,
77 .handle_irq = vic_handle_irq,
78 .timer = &spear3xx_timer,
79 .init_machine = spear310_evb_init,
80 .restart = spear_restart,
81MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
index 7bd39c0032bd..9c571d0f20c3 100644
--- a/arch/arm/mach-spear3xx/spear320.c
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * SPEAr320 machine source file 4 * SPEAr320 machine source file
5 * 5 *
6 * Copyright (C) 2009 ST Microelectronics 6 * Copyright (C) 2009-2012 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.kumar@st.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
@@ -13,8 +13,12 @@
13 13
14#define pr_fmt(fmt) "SPEAr320: " fmt 14#define pr_fmt(fmt) "SPEAr320: " fmt
15 15
16#include <linux/ptrace.h> 16#include <linux/amba/pl022.h>
17#include <asm/irq.h> 17#include <linux/amba/pl08x.h>
18#include <linux/amba/serial.h>
19#include <linux/of_platform.h>
20#include <asm/hardware/vic.h>
21#include <asm/mach/arch.h>
18#include <plat/shirq.h> 22#include <plat/shirq.h>
19#include <mach/generic.h> 23#include <mach/generic.h>
20#include <mach/hardware.h> 24#include <mach/hardware.h>
@@ -510,17 +514,79 @@ static struct spear_shirq shirq_intrcomm_ras = {
510 }, 514 },
511}; 515};
512 516
513/* Add spear320 specific devices here */ 517/* padmux devices to enable */
518static struct pmx_dev *spear320_evb_pmx_devs[] = {
519 /* spear3xx specific devices */
520 &spear3xx_pmx_i2c,
521 &spear3xx_pmx_ssp,
522 &spear3xx_pmx_mii,
523 &spear3xx_pmx_uart0,
524
525 /* spear320 specific devices */
526 &spear320_pmx_fsmc,
527 &spear320_pmx_sdhci,
528 &spear320_pmx_i2s,
529 &spear320_pmx_uart1,
530 &spear320_pmx_uart2,
531 &spear320_pmx_can,
532 &spear320_pmx_pwm0,
533 &spear320_pmx_pwm1,
534 &spear320_pmx_pwm2,
535 &spear320_pmx_mii1,
536};
537
538static struct pl022_ssp_controller spear320_ssp_data[] = {
539 {
540 .bus_id = 1,
541 .enable_dma = 1,
542 .dma_filter = pl08x_filter_id,
543 .dma_tx_param = "ssp1_tx",
544 .dma_rx_param = "ssp1_rx",
545 .num_chipselect = 2,
546 }, {
547 .bus_id = 2,
548 .enable_dma = 1,
549 .dma_filter = pl08x_filter_id,
550 .dma_tx_param = "ssp2_tx",
551 .dma_rx_param = "ssp2_rx",
552 .num_chipselect = 2,
553 }
554};
555
556static struct amba_pl011_data spear320_uart_data[] = {
557 {
558 .dma_filter = pl08x_filter_id,
559 .dma_tx_param = "uart1_tx",
560 .dma_rx_param = "uart1_rx",
561 }, {
562 .dma_filter = pl08x_filter_id,
563 .dma_tx_param = "uart2_tx",
564 .dma_rx_param = "uart2_rx",
565 },
566};
514 567
515/* spear320 routines */ 568/* Add SPEAr310 auxdata to pass platform data */
516void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, 569static struct of_dev_auxdata spear320_auxdata_lookup[] __initdata = {
517 u8 pmx_dev_count) 570 OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
571 &pl022_plat_data),
572 OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP0_BASE, NULL,
573 &spear320_ssp_data[0]),
574 OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP1_BASE, NULL,
575 &spear320_ssp_data[1]),
576 OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART1_BASE, NULL,
577 &spear320_uart_data[0]),
578 OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART2_BASE, NULL,
579 &spear320_uart_data[1]),
580 {}
581};
582
583static void __init spear320_dt_init(void)
518{ 584{
519 void __iomem *base; 585 void __iomem *base;
520 int ret = 0; 586 int ret = 0;
521 587
522 /* call spear3xx family common init function */ 588 of_platform_populate(NULL, of_default_bus_match_table,
523 spear3xx_init(); 589 spear320_auxdata_lookup, NULL);
524 590
525 /* shared irq registration */ 591 /* shared irq registration */
526 base = ioremap(SPEAR320_SOC_CONFIG_BASE, SZ_4K); 592 base = ioremap(SPEAR320_SOC_CONFIG_BASE, SZ_4K);
@@ -544,13 +610,38 @@ void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
544 pr_err("Error registering Shared IRQ 4\n"); 610 pr_err("Error registering Shared IRQ 4\n");
545 } 611 }
546 612
547 /* pmx initialization */ 613 if (of_machine_is_compatible("st,spear320-evb")) {
548 pmx_driver.base = base; 614 /* pmx initialization */
549 pmx_driver.mode = pmx_mode; 615 pmx_driver.base = base;
550 pmx_driver.devs = pmx_devs; 616 pmx_driver.mode = &spear320_auto_net_mii_mode;
551 pmx_driver.devs_count = pmx_dev_count; 617 pmx_driver.devs = spear320_evb_pmx_devs;
618 pmx_driver.devs_count = ARRAY_SIZE(spear320_evb_pmx_devs);
552 619
553 ret = pmx_register(&pmx_driver); 620 ret = pmx_register(&pmx_driver);
554 if (ret) 621 if (ret)
555 pr_err("padmux: registration failed. err no: %d\n", ret); 622 pr_err("padmux: registration failed. err no: %d\n",
623 ret);
624 }
556} 625}
626
627static const char * const spear320_dt_board_compat[] = {
628 "st,spear320",
629 "st,spear320-evb",
630 NULL,
631};
632
633static void __init spear320_map_io(void)
634{
635 spear3xx_map_io();
636 spear320_clk_init();
637}
638
639DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree")
640 .map_io = spear320_map_io,
641 .init_irq = spear3xx_dt_init_irq,
642 .handle_irq = vic_handle_irq,
643 .timer = &spear3xx_timer,
644 .init_machine = spear320_dt_init,
645 .restart = spear_restart,
646 .dt_compat = spear320_dt_board_compat,
647MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
deleted file mode 100644
index 105334ab7021..000000000000
--- a/arch/arm/mach-spear3xx/spear320_evb.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * arch/arm/mach-spear3xx/spear320_evb.c
3 *
4 * SPEAr320 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/hardware/vic.h>
15#include <asm/mach/arch.h>
16#include <asm/mach-types.h>
17#include <mach/generic.h>
18#include <mach/hardware.h>
19
20/* padmux devices to enable */
21static struct pmx_dev *pmx_devs[] = {
22 /* spear3xx specific devices */
23 &spear3xx_pmx_i2c,
24 &spear3xx_pmx_ssp,
25 &spear3xx_pmx_mii,
26 &spear3xx_pmx_uart0,
27
28 /* spear320 specific devices */
29 &spear320_pmx_fsmc,
30 &spear320_pmx_sdhci,
31 &spear320_pmx_i2s,
32 &spear320_pmx_uart1,
33 &spear320_pmx_uart2,
34 &spear320_pmx_can,
35 &spear320_pmx_pwm0,
36 &spear320_pmx_pwm1,
37 &spear320_pmx_pwm2,
38 &spear320_pmx_mii1,
39};
40
41static struct amba_device *amba_devs[] __initdata = {
42 /* spear3xx specific devices */
43 &spear3xx_gpio_device,
44 &spear3xx_uart_device,
45
46 /* spear320 specific devices */
47};
48
49static struct platform_device *plat_devs[] __initdata = {
50 /* spear3xx specific devices */
51
52 /* spear320 specific devices */
53};
54
55static void __init spear320_evb_init(void)
56{
57 unsigned int i;
58
59 /* call spear320 machine init function */
60 spear320_init(&spear320_auto_net_mii_mode, pmx_devs,
61 ARRAY_SIZE(pmx_devs));
62
63 /* Add Platform Devices */
64 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
65
66 /* Add Amba Devices */
67 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
68 amba_device_register(amba_devs[i], &iomem_resource);
69}
70
71MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
72 .atag_offset = 0x100,
73 .map_io = spear3xx_map_io,
74 .init_irq = spear3xx_init_irq,
75 .handle_irq = vic_handle_irq,
76 .timer = &spear3xx_timer,
77 .init_machine = spear320_evb_init,
78 .restart = spear_restart,
79MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index a236925e13b3..a94d8c12ed99 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * SPEAr3XX machines common source file 4 * SPEAr3XX machines common source file
5 * 5 *
6 * Copyright (C) 2009 ST Microelectronics 6 * Copyright (C) 2009-2012 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.kumar@st.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
@@ -13,76 +13,14 @@
13 13
14#define pr_fmt(fmt) "SPEAr3xx: " fmt 14#define pr_fmt(fmt) "SPEAr3xx: " fmt
15 15
16#include <linux/types.h> 16#include <linux/amba/pl022.h>
17#include <linux/amba/pl061.h> 17#include <linux/amba/pl08x.h>
18#include <linux/ptrace.h> 18#include <linux/of_irq.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/hardware/vic.h> 20#include <asm/hardware/vic.h>
21#include <asm/irq.h>
22#include <asm/mach/arch.h>
23#include <mach/generic.h> 21#include <mach/generic.h>
24#include <mach/hardware.h> 22#include <mach/hardware.h>
25 23
26/* Add spear3xx machines common devices here */
27/* gpio device registration */
28static struct pl061_platform_data gpio_plat_data = {
29 .gpio_base = 0,
30 .irq_base = SPEAR3XX_GPIO_INT_BASE,
31};
32
33AMBA_APB_DEVICE(spear3xx_gpio, "gpio", 0, SPEAR3XX_ICM3_GPIO_BASE,
34 {SPEAR3XX_IRQ_BASIC_GPIO}, &gpio_plat_data);
35
36/* uart device registration */
37AMBA_APB_DEVICE(spear3xx_uart, "uart", 0, SPEAR3XX_ICM1_UART_BASE,
38 {SPEAR3XX_IRQ_UART}, NULL);
39
40/* Do spear3xx familiy common initialization part here */
41void __init spear3xx_init(void)
42{
43 /* nothing to do for now */
44}
45
46/* This will initialize vic */
47void __init spear3xx_init_irq(void)
48{
49 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
50}
51
52/* Following will create static virtual/physical mappings */
53struct map_desc spear3xx_io_desc[] __initdata = {
54 {
55 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
56 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
57 .length = SZ_4K,
58 .type = MT_DEVICE
59 }, {
60 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
61 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
62 .length = SZ_4K,
63 .type = MT_DEVICE
64 }, {
65 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
66 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
67 .length = SZ_4K,
68 .type = MT_DEVICE
69 }, {
70 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
71 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
72 .length = SZ_4K,
73 .type = MT_DEVICE
74 },
75};
76
77/* This will create static memory mapping for selected devices */
78void __init spear3xx_map_io(void)
79{
80 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
81
82 /* This will initialize clock framework */
83 spear3xx_clk_init();
84}
85
86/* pad multiplexing support */ 24/* pad multiplexing support */
87/* devices */ 25/* devices */
88static struct pmx_dev_mode pmx_firda_modes[] = { 26static struct pmx_dev_mode pmx_firda_modes[] = {
@@ -508,6 +446,51 @@ struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50 = {
508}; 446};
509#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */ 447#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
510 448
449/* ssp device registration */
450struct pl022_ssp_controller pl022_plat_data = {
451 .bus_id = 0,
452 .enable_dma = 1,
453 .dma_filter = pl08x_filter_id,
454 .dma_tx_param = "ssp0_tx",
455 .dma_rx_param = "ssp0_rx",
456 /*
457 * This is number of spi devices that can be connected to spi. There are
458 * two type of chipselects on which slave devices can work. One is chip
459 * select provided by spi masters other is controlled through external
460 * gpio's. We can't use chipselect provided from spi master (because as
461 * soon as FIFO becomes empty, CS is disabled and transfer ends). So
462 * this number now depends on number of gpios available for spi. each
463 * slave on each master requires a separate gpio pin.
464 */
465 .num_chipselect = 2,
466};
467
468/*
469 * Following will create 16MB static virtual/physical mappings
470 * PHYSICAL VIRTUAL
471 * 0xD0000000 0xFD000000
472 * 0xFC000000 0xFC000000
473 */
474struct map_desc spear3xx_io_desc[] __initdata = {
475 {
476 .virtual = VA_SPEAR3XX_ICM1_2_BASE,
477 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_2_BASE),
478 .length = SZ_16M,
479 .type = MT_DEVICE
480 }, {
481 .virtual = VA_SPEAR3XX_ICM3_SMI_CTRL_BASE,
482 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SMI_CTRL_BASE),
483 .length = SZ_16M,
484 .type = MT_DEVICE
485 },
486};
487
488/* This will create static memory mapping for selected devices */
489void __init spear3xx_map_io(void)
490{
491 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
492}
493
511static void __init spear3xx_timer_init(void) 494static void __init spear3xx_timer_init(void)
512{ 495{
513 char pclk_name[] = "pll3_48m_clk"; 496 char pclk_name[] = "pll3_48m_clk";
@@ -538,3 +521,13 @@ static void __init spear3xx_timer_init(void)
538struct sys_timer spear3xx_timer = { 521struct sys_timer spear3xx_timer = {
539 .init = spear3xx_timer_init, 522 .init = spear3xx_timer_init,
540}; 523};
524
525static const struct of_device_id vic_of_match[] __initconst = {
526 { .compatible = "arm,pl190-vic", .data = vic_of_init, },
527 { /* Sentinel */ }
528};
529
530void __init spear3xx_dt_init_irq(void)
531{
532 of_irq_init(vic_of_match);
533}
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
index 1bb3dbce8810..6c066fcb2979 100644
--- a/arch/arm/plat-spear/Kconfig
+++ b/arch/arm/plat-spear/Kconfig
@@ -9,9 +9,10 @@ choice
9 default ARCH_SPEAR3XX 9 default ARCH_SPEAR3XX
10 10
11config ARCH_SPEAR3XX 11config ARCH_SPEAR3XX
12 bool "SPEAr3XX" 12 bool "ST SPEAr3xx with Device Tree"
13 select ARM_VIC 13 select ARM_VIC
14 select CPU_ARM926T 14 select CPU_ARM926T
15 select USE_OF
15 help 16 help
16 Supports for ARM's SPEAR3XX family 17 Supports for ARM's SPEAR3XX family
17 18