pistachio: add 4.9 kernel support
[openwrt/openwrt.git] / target / linux / pistachio / patches-4.9 / 002-MIPS-DTS-img-add-device-tree-for-Marduk-board.patch
1 From a189771546b304250cf18b26748edfefb857adbf Mon Sep 17 00:00:00 2001
2 From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
3 Date: Fri, 14 Oct 2016 11:25:55 +0530
4 Subject: MIPS: DTS: img: add device tree for Marduk board
5
6 Add support for Imagination Technologies' Marduk board which is based
7 on Pistachio SoC. It is also known as Creator Ci40. Marduk is legacy
8 name and will be there for decades.
9
10 Documentation for this board can be found on
11 https://docs.creatordev.io/ci40/
12
13 This patch adds initial support for board with following peripherals:
14
15 * PWM based heartbeat LED
16 * GPIO based buttons
17 * SPI NOR flash on SPI1
18 * UART0 and UART1
19 * SD card
20 * Ethernet
21 * USB
22 * PWM
23 * ADC
24 * I2C
25
26 (apply from https://patchwork.linux-mips.org/project/linux-mips/list/?submitter=7165)
27
28 Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
29 Acked-by: Rob Herring <robh@kernel.org>
30 Acked-by: James Hartley <james.hartley@imgtec.com>
31 ---
32 .../bindings/mips/img/pistachio-marduk.txt | 10 ++
33 arch/mips/boot/dts/img/Makefile | 9 ++
34 arch/mips/boot/dts/img/pistachio_marduk.dts | 163 +++++++++++++++++++++
35 3 files changed, 182 insertions(+)
36 create mode 100644 Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
37 create mode 100644 arch/mips/boot/dts/img/Makefile
38 create mode 100644 arch/mips/boot/dts/img/pistachio_marduk.dts
39
40 diff --git a/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt b/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
41 new file mode 100644
42 index 0000000..2d5126d
43 --- /dev/null
44 +++ b/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
45 @@ -0,0 +1,10 @@
46 +Imagination Technologies' Pistachio SoC based Marduk Board
47 +==========================================================
48 +
49 +Compatible string must be "img,pistachio-marduk", "img,pistachio"
50 +
51 +Hardware and other related documentation is available at
52 +https://docs.creatordev.io/ci40/
53 +
54 +It is also known as Creator Ci40. Marduk is legacy name and will
55 +be there for decades.
56 diff --git a/arch/mips/boot/dts/img/Makefile b/arch/mips/boot/dts/img/Makefile
57 new file mode 100644
58 index 0000000..69a65f0
59 --- /dev/null
60 +++ b/arch/mips/boot/dts/img/Makefile
61 @@ -0,0 +1,9 @@
62 +dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
63 +
64 +obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
65 +
66 +# Force kbuild to make empty built-in.o if necessary
67 +obj- += dummy.o
68 +
69 +always := $(dtb-y)
70 +clean-files := *.dtb *.dtb.S
71 diff --git a/arch/mips/boot/dts/img/pistachio_marduk.dts b/arch/mips/boot/dts/img/pistachio_marduk.dts
72 new file mode 100644
73 index 0000000..cf9cebd
74 --- /dev/null
75 +++ b/arch/mips/boot/dts/img/pistachio_marduk.dts
76 @@ -0,0 +1,163 @@
77 +/*
78 + * Copyright (C) 2015, 2016 Imagination Technologies Ltd.
79 + *
80 + * This program is free software; you can redistribute it and/or modify
81 + * it under the terms of the GNU General Public License version 2 as
82 + * published by the Free Software Foundation.
83 + *
84 + * IMG Marduk board is also known as Creator Ci40.
85 + */
86 +
87 +/dts-v1/;
88 +
89 +#include "pistachio.dtsi"
90 +
91 +/ {
92 + model = "IMG Marduk (Creator Ci40)";
93 + compatible = "img,pistachio-marduk", "img,pistachio";
94 +
95 + aliases {
96 + serial0 = &uart0;
97 + serial1 = &uart1;
98 + ethernet0 = &enet;
99 + spi0 = &spfi0;
100 + spi1 = &spfi1;
101 + };
102 +
103 + chosen {
104 + bootargs = "root=/dev/sda1 rootwait ro lpj=723968";
105 + stdout-path = "serial1:115200";
106 + };
107 +
108 + memory {
109 + device_type = "memory";
110 + reg = <0x00000000 0x10000000>;
111 + };
112 +
113 + reg_1v8: fixed-regulator {
114 + compatible = "regulator-fixed";
115 + regulator-name = "aux_adc_vref";
116 + regulator-min-microvolt = <1800000>;
117 + regulator-max-microvolt = <1800000>;
118 + regulator-boot-on;
119 + };
120 +
121 + internal_dac_supply: internal-dac-supply {
122 + compatible = "regulator-fixed";
123 + regulator-name = "internal_dac_supply";
124 + regulator-min-microvolt = <1800000>;
125 + regulator-max-microvolt = <1800000>;
126 + };
127 +
128 + leds {
129 + compatible = "pwm-leds";
130 + heartbeat {
131 + label = "marduk:red:heartbeat";
132 + pwms = <&pwm 3 300000>;
133 + max-brightness = <255>;
134 + linux,default-trigger = "heartbeat";
135 + };
136 + };
137 +
138 + keys {
139 + compatible = "gpio-keys";
140 + button@1 {
141 + label = "Button 1";
142 + linux,code = <0x101>; /* BTN_1 */
143 + gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
144 + };
145 + button@2 {
146 + label = "Button 2";
147 + linux,code = <0x102>; /* BTN_2 */
148 + gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
149 + };
150 + };
151 +};
152 +
153 +&internal_dac {
154 + VDD-supply = <&internal_dac_supply>;
155 +};
156 +
157 +&spfi1 {
158 + status = "okay";
159 +
160 + pinctrl-0 = <&spim1_pins>, <&spim1_quad_pins>, <&spim1_cs0_pin>,
161 + <&spim1_cs1_pin>;
162 + pinctrl-names = "default";
163 + cs-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>;
164 +
165 + flash@0 {
166 + compatible = "spansion,s25fl016k", "jedec,spi-nor";
167 + reg = <0>;
168 + spi-max-frequency = <50000000>;
169 + };
170 +};
171 +
172 +&uart0 {
173 + status = "okay";
174 + assigned-clock-rates = <114278400>, <1843200>;
175 +};
176 +
177 +&uart1 {
178 + status = "okay";
179 +};
180 +
181 +&usb {
182 + status = "okay";
183 +};
184 +
185 +&enet {
186 + status = "okay";
187 +};
188 +
189 +&pin_enet {
190 + drive-strength = <2>;
191 +};
192 +
193 +&pin_enet_phy_clk {
194 + drive-strength = <2>;
195 +};
196 +
197 +&sdhost {
198 + status = "okay";
199 + bus-width = <4>;
200 + disable-wp;
201 +};
202 +
203 +&pin_sdhost_cmd {
204 + drive-strength = <2>;
205 +};
206 +
207 +&pin_sdhost_data {
208 + drive-strength = <2>;
209 +};
210 +
211 +&pwm {
212 + status = "okay";
213 +
214 + pinctrl-0 = <&pwmpdm0_pin>, <&pwmpdm1_pin>, <&pwmpdm2_pin>,
215 + <&pwmpdm3_pin>;
216 + pinctrl-names = "default";
217 +};
218 +
219 +&adc {
220 + status = "okay";
221 + vref-supply = <&reg_1v8>;
222 + adc-reserved-channels = <0x10>;
223 +};
224 +
225 +&i2c2 {
226 + status = "okay";
227 + clock-frequency = <400000>;
228 +
229 + tpm@20 {
230 + compatible = "infineon,slb9645tt";
231 + reg = <0x20>;
232 + };
233 +
234 +};
235 +
236 +&i2c3 {
237 + status = "okay";
238 + clock-frequency = <400000>;
239 +};
240 --
241 2.7.4
242