blob: 920cdb26743cf2b62371df568818684d5014d06e [file] [log] [blame]
Joachim Eastwood804a5dd2015-05-12 00:00:50 +02001/*
2 * Common base for NXP LPC18xx and LPC43xx devices.
3 *
4 * Copyright 2015 Joachim Eastwood <manabian@gmail.com>
5 *
6 * This code is released using a dual license strategy: BSD/GPL
7 * You can choose the licence that better fits your requirements.
8 *
9 * Released under the terms of 3-clause BSD License
10 * Released under the terms of GNU General Public License Version 2.0
11 *
12 */
13
14#include "armv7-m.dtsi"
15
Joachim Eastwoodba2db532015-04-01 14:42:00 +020016#include "dt-bindings/clock/lpc18xx-cgu.h"
17#include "dt-bindings/clock/lpc18xx-ccu.h"
18
Joachim Eastwood7836dce2015-04-27 23:59:30 +020019#define LPC_PIN(port, pin) (0x##port * 32 + pin)
20#define LPC_GPIO(port, pin) (port * 32 + pin)
21
Joachim Eastwood804a5dd2015-05-12 00:00:50 +020022/ {
23 cpus {
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 cpu@0 {
28 compatible = "arm,cortex-m3";
29 device_type = "cpu";
30 reg = <0x0>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +020031 clocks = <&ccu1 CLK_CPU_CORE>;
Joachim Eastwood804a5dd2015-05-12 00:00:50 +020032 };
33 };
34
35 clocks {
36 xtal: xtal {
37 compatible = "fixed-clock";
38 #clock-cells = <0>;
39 clock-frequency = <12000000>;
40 };
41
Joachim Eastwoodba2db532015-04-01 14:42:00 +020042 xtal32: xtal32 {
43 compatible = "fixed-clock";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +020044 #clock-cells = <0>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +020045 clock-frequency = <32768>;
46 };
47
48 enet_rx_clk: enet_rx_clk {
49 compatible = "fixed-clock";
50 #clock-cells = <0>;
51 clock-frequency = <0>;
52 clock-output-names = "enet_rx_clk";
53 };
54
55 enet_tx_clk: enet_tx_clk {
56 compatible = "fixed-clock";
57 #clock-cells = <0>;
58 clock-frequency = <0>;
59 clock-output-names = "enet_tx_clk";
60 };
61
62 gp_clkin: gp_clkin {
63 compatible = "fixed-clock";
64 #clock-cells = <0>;
65 clock-frequency = <0>;
66 clock-output-names = "gp_clkin";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +020067 };
68 };
69
70 soc {
Joachim Eastwoodba2db532015-04-01 14:42:00 +020071 cgu: clock-controller@40050000 {
72 compatible = "nxp,lpc1850-cgu";
73 reg = <0x40050000 0x1000>;
74 #clock-cells = <1>;
75 clocks = <&xtal>, <&xtal32>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>;
76 };
77
78 ccu1: clock-controller@40051000 {
79 compatible = "nxp,lpc1850-ccu";
80 reg = <0x40051000 0x1000>;
81 #clock-cells = <1>;
82 clocks = <&cgu BASE_APB3_CLK>, <&cgu BASE_APB1_CLK>,
83 <&cgu BASE_SPIFI_CLK>, <&cgu BASE_CPU_CLK>,
84 <&cgu BASE_PERIPH_CLK>, <&cgu BASE_USB0_CLK>,
85 <&cgu BASE_USB1_CLK>, <&cgu BASE_SPI_CLK>;
86 clock-names = "base_apb3_clk", "base_apb1_clk",
87 "base_spifi_clk", "base_cpu_clk",
88 "base_periph_clk", "base_usb0_clk",
89 "base_usb1_clk", "base_spi_clk";
90 };
91
92 ccu2: clock-controller@40052000 {
93 compatible = "nxp,lpc1850-ccu";
94 reg = <0x40052000 0x1000>;
95 #clock-cells = <1>;
96 clocks = <&cgu BASE_AUDIO_CLK>, <&cgu BASE_UART3_CLK>,
97 <&cgu BASE_UART2_CLK>, <&cgu BASE_UART1_CLK>,
98 <&cgu BASE_UART0_CLK>, <&cgu BASE_SSP1_CLK>,
99 <&cgu BASE_SSP0_CLK>, <&cgu BASE_SDIO_CLK>;
100 clock-names = "base_audio_clk", "base_uart3_clk",
101 "base_uart2_clk", "base_uart1_clk",
102 "base_uart0_clk", "base_ssp1_clk",
103 "base_ssp0_clk", "base_sdio_clk";
104 };
105
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200106 uart0: serial@40081000 {
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200107 compatible = "nxp,lpc1850-uart", "ns16550a";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200108 reg = <0x40081000 0x1000>;
109 reg-shift = <2>;
110 interrupts = <24>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200111 clocks = <&ccu2 CLK_APB0_UART0>, <&ccu1 CLK_CPU_UART0>;
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200112 clock-names = "uartclk", "reg";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200113 status = "disabled";
114 };
115
116 uart1: serial@40082000 {
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200117 compatible = "nxp,lpc1850-uart", "ns16550a";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200118 reg = <0x40082000 0x1000>;
119 reg-shift = <2>;
120 interrupts = <25>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200121 clocks = <&ccu2 CLK_APB0_UART1>, <&ccu1 CLK_CPU_UART1>;
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200122 clock-names = "uartclk", "reg";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200123 status = "disabled";
124 };
125
Joachim Eastwood5d2ea792015-04-01 14:41:06 +0200126 ssp0: spi@40083000 {
127 compatible = "arm,pl022", "arm,primecell";
128 reg = <0x40083000 0x1000>;
129 interrupts = <22>;
130 clocks = <&ccu2 CLK_APB0_SSP0>, <&ccu1 CLK_CPU_SSP0>;
131 clock-names = "sspclk", "apb_pclk";
132 #address-cells = <1>;
133 #size-cells = <0>;
134 status = "disabled";
135 };
136
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200137 timer0: timer@40084000 {
138 compatible = "nxp,lpc3220-timer";
139 reg = <0x40084000 0x1000>;
140 interrupts = <12>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200141 clocks = <&ccu1 CLK_CPU_TIMER0>;
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200142 clock-names = "timerclk";
143 };
144
145 timer1: timer@40085000 {
146 compatible = "nxp,lpc3220-timer";
147 reg = <0x40085000 0x1000>;
148 interrupts = <13>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200149 clocks = <&ccu1 CLK_CPU_TIMER1>;
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200150 clock-names = "timerclk";
151 };
152
Joachim Eastwoodd881f5e2015-04-02 05:40:13 +0200153 pinctrl: pinctrl@40086000 {
154 compatible = "nxp,lpc1850-scu";
155 reg = <0x40086000 0x1000>;
156 clocks = <&ccu1 CLK_CPU_SCU>;
157 };
158
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200159 uart2: serial@400c1000 {
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200160 compatible = "nxp,lpc1850-uart", "ns16550a";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200161 reg = <0x400c1000 0x1000>;
162 reg-shift = <2>;
163 interrupts = <26>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200164 clocks = <&ccu2 CLK_APB2_UART2>, <&ccu1 CLK_CPU_UART2>;
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200165 clock-names = "uartclk", "reg";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200166 status = "disabled";
167 };
168
169 uart3: serial@400c2000 {
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200170 compatible = "nxp,lpc1850-uart", "ns16550a";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200171 reg = <0x400c2000 0x1000>;
172 reg-shift = <2>;
173 interrupts = <27>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200174 clocks = <&ccu2 CLK_APB2_UART3>, <&ccu1 CLK_CPU_UART3>;
Joachim Eastwoodf2b1c502015-05-15 19:43:45 +0200175 clock-names = "uartclk", "reg";
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200176 status = "disabled";
177 };
178
179 timer2: timer@400c3000 {
180 compatible = "nxp,lpc3220-timer";
181 reg = <0x400c3000 0x1000>;
182 interrupts = <14>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200183 clocks = <&ccu1 CLK_CPU_TIMER2>;
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200184 clock-names = "timerclk";
185 };
186
187 timer3: timer@400c4000 {
188 compatible = "nxp,lpc3220-timer";
189 reg = <0x400c4000 0x1000>;
190 interrupts = <15>;
Joachim Eastwoodba2db532015-04-01 14:42:00 +0200191 clocks = <&ccu1 CLK_CPU_TIMER3>;
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200192 clock-names = "timerclk";
193 };
Joachim Eastwood7836dce2015-04-27 23:59:30 +0200194
Joachim Eastwood5d2ea792015-04-01 14:41:06 +0200195 ssp1: spi@400c5000 {
196 compatible = "arm,pl022", "arm,primecell";
197 reg = <0x400c5000 0x1000>;
198 interrupts = <23>;
199 clocks = <&ccu2 CLK_APB2_SSP1>, <&ccu1 CLK_CPU_SSP1>;
200 clock-names = "sspclk", "apb_pclk";
201 #address-cells = <1>;
202 #size-cells = <0>;
203 status = "disabled";
204 };
205
Joachim Eastwood7836dce2015-04-27 23:59:30 +0200206 gpio: gpio@400f4000 {
207 compatible = "nxp,lpc1850-gpio";
208 reg = <0x400f4000 0x4000>;
209 clocks = <&ccu1 CLK_CPU_GPIO>;
210 gpio-controller;
211 #gpio-cells = <2>;
212 gpio-ranges = <&pinctrl LPC_GPIO(0,0) LPC_PIN(0,0) 2>,
213 <&pinctrl LPC_GPIO(0,4) LPC_PIN(1,0) 1>,
214 <&pinctrl LPC_GPIO(0,8) LPC_PIN(1,1) 4>,
215 <&pinctrl LPC_GPIO(1,8) LPC_PIN(1,5) 2>,
216 <&pinctrl LPC_GPIO(1,0) LPC_PIN(1,7) 8>,
217 <&pinctrl LPC_GPIO(0,2) LPC_PIN(1,15) 2>,
218 <&pinctrl LPC_GPIO(0,12) LPC_PIN(1,17) 2>,
219 <&pinctrl LPC_GPIO(0,15) LPC_PIN(1,20) 1>,
220 <&pinctrl LPC_GPIO(5,0) LPC_PIN(2,0) 7>,
221 <&pinctrl LPC_GPIO(0,7) LPC_PIN(2,7) 1>,
222 <&pinctrl LPC_GPIO(5,7) LPC_PIN(2,8) 1>,
223 <&pinctrl LPC_GPIO(1,10) LPC_PIN(2,9) 1>,
224 <&pinctrl LPC_GPIO(0,14) LPC_PIN(2,10) 1>,
225 <&pinctrl LPC_GPIO(1,11) LPC_PIN(2,11) 3>,
226 <&pinctrl LPC_GPIO(5,8) LPC_PIN(3,1) 2>,
227 <&pinctrl LPC_GPIO(1,14) LPC_PIN(3,4) 2>,
228 <&pinctrl LPC_GPIO(0,6) LPC_PIN(3,6) 1>,
229 <&pinctrl LPC_GPIO(5,10) LPC_PIN(3,7) 2>,
230 <&pinctrl LPC_GPIO(2,0) LPC_PIN(4,0) 7>,
231 <&pinctrl LPC_GPIO(5,12) LPC_PIN(4,8) 3>,
232 <&pinctrl LPC_GPIO(2,9) LPC_PIN(5,0) 7>,
233 <&pinctrl LPC_GPIO(2,7) LPC_PIN(5,7) 1>,
234 <&pinctrl LPC_GPIO(3,0) LPC_PIN(6,1) 5>,
235 <&pinctrl LPC_GPIO(0,5) LPC_PIN(6,6) 1>,
236 <&pinctrl LPC_GPIO(5,15) LPC_PIN(6,7) 2>,
237 <&pinctrl LPC_GPIO(3,5) LPC_PIN(6,9) 3>,
238 <&pinctrl LPC_GPIO(2,8) LPC_PIN(6,12) 1>,
239 <&pinctrl LPC_GPIO(3,8) LPC_PIN(7,0) 8>,
240 <&pinctrl LPC_GPIO(4,0) LPC_PIN(8,0) 8>,
241 <&pinctrl LPC_GPIO(4,12) LPC_PIN(9,0) 4>,
242 <&pinctrl LPC_GPIO(5,17) LPC_PIN(9,4) 2>,
243 <&pinctrl LPC_GPIO(4,11) LPC_PIN(9,6) 1>,
244 <&pinctrl LPC_GPIO(4,8) LPC_PIN(a,1) 3>,
245 <&pinctrl LPC_GPIO(5,19) LPC_PIN(a,4) 1>,
246 <&pinctrl LPC_GPIO(5,20) LPC_PIN(b,0) 7>,
247 <&pinctrl LPC_GPIO(6,0) LPC_PIN(c,1) 14>,
248 <&pinctrl LPC_GPIO(6,14) LPC_PIN(d,0) 17>,
249 <&pinctrl LPC_GPIO(7,0) LPC_PIN(e,0) 16>,
250 <&pinctrl LPC_GPIO(7,16) LPC_PIN(f,1) 3>,
251 <&pinctrl LPC_GPIO(7,19) LPC_PIN(f,5) 7>;
252 };
Joachim Eastwood804a5dd2015-05-12 00:00:50 +0200253 };
254};