kernel: update kernel 4.9 to 4.9.17
[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 --- /dev/null
41 +++ b/Documentation/devicetree/bindings/mips/img/pistachio-marduk.txt
42 @@ -0,0 +1,10 @@
43 +Imagination Technologies' Pistachio SoC based Marduk Board
44 +==========================================================
45 +
46 +Compatible string must be "img,pistachio-marduk", "img,pistachio"
47 +
48 +Hardware and other related documentation is available at
49 +https://docs.creatordev.io/ci40/
50 +
51 +It is also known as Creator Ci40. Marduk is legacy name and will
52 +be there for decades.
53 --- /dev/null
54 +++ b/arch/mips/boot/dts/img/Makefile
55 @@ -0,0 +1,9 @@
56 +dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb
57 +
58 +obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
59 +
60 +# Force kbuild to make empty built-in.o if necessary
61 +obj- += dummy.o
62 +
63 +always := $(dtb-y)
64 +clean-files := *.dtb *.dtb.S
65 --- /dev/null
66 +++ b/arch/mips/boot/dts/img/pistachio_marduk.dts
67 @@ -0,0 +1,163 @@
68 +/*
69 + * Copyright (C) 2015, 2016 Imagination Technologies Ltd.
70 + *
71 + * This program is free software; you can redistribute it and/or modify
72 + * it under the terms of the GNU General Public License version 2 as
73 + * published by the Free Software Foundation.
74 + *
75 + * IMG Marduk board is also known as Creator Ci40.
76 + */
77 +
78 +/dts-v1/;
79 +
80 +#include "pistachio.dtsi"
81 +
82 +/ {
83 + model = "IMG Marduk (Creator Ci40)";
84 + compatible = "img,pistachio-marduk", "img,pistachio";
85 +
86 + aliases {
87 + serial0 = &uart0;
88 + serial1 = &uart1;
89 + ethernet0 = &enet;
90 + spi0 = &spfi0;
91 + spi1 = &spfi1;
92 + };
93 +
94 + chosen {
95 + bootargs = "root=/dev/sda1 rootwait ro lpj=723968";
96 + stdout-path = "serial1:115200";
97 + };
98 +
99 + memory {
100 + device_type = "memory";
101 + reg = <0x00000000 0x10000000>;
102 + };
103 +
104 + reg_1v8: fixed-regulator {
105 + compatible = "regulator-fixed";
106 + regulator-name = "aux_adc_vref";
107 + regulator-min-microvolt = <1800000>;
108 + regulator-max-microvolt = <1800000>;
109 + regulator-boot-on;
110 + };
111 +
112 + internal_dac_supply: internal-dac-supply {
113 + compatible = "regulator-fixed";
114 + regulator-name = "internal_dac_supply";
115 + regulator-min-microvolt = <1800000>;
116 + regulator-max-microvolt = <1800000>;
117 + };
118 +
119 + leds {
120 + compatible = "pwm-leds";
121 + heartbeat {
122 + label = "marduk:red:heartbeat";
123 + pwms = <&pwm 3 300000>;
124 + max-brightness = <255>;
125 + linux,default-trigger = "heartbeat";
126 + };
127 + };
128 +
129 + keys {
130 + compatible = "gpio-keys";
131 + button@1 {
132 + label = "Button 1";
133 + linux,code = <0x101>; /* BTN_1 */
134 + gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
135 + };
136 + button@2 {
137 + label = "Button 2";
138 + linux,code = <0x102>; /* BTN_2 */
139 + gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
140 + };
141 + };
142 +};
143 +
144 +&internal_dac {
145 + VDD-supply = <&internal_dac_supply>;
146 +};
147 +
148 +&spfi1 {
149 + status = "okay";
150 +
151 + pinctrl-0 = <&spim1_pins>, <&spim1_quad_pins>, <&spim1_cs0_pin>,
152 + <&spim1_cs1_pin>;
153 + pinctrl-names = "default";
154 + cs-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>, <&gpio0 1 GPIO_ACTIVE_HIGH>;
155 +
156 + flash@0 {
157 + compatible = "spansion,s25fl016k", "jedec,spi-nor";
158 + reg = <0>;
159 + spi-max-frequency = <50000000>;
160 + };
161 +};
162 +
163 +&uart0 {
164 + status = "okay";
165 + assigned-clock-rates = <114278400>, <1843200>;
166 +};
167 +
168 +&uart1 {
169 + status = "okay";
170 +};
171 +
172 +&usb {
173 + status = "okay";
174 +};
175 +
176 +&enet {
177 + status = "okay";
178 +};
179 +
180 +&pin_enet {
181 + drive-strength = <2>;
182 +};
183 +
184 +&pin_enet_phy_clk {
185 + drive-strength = <2>;
186 +};
187 +
188 +&sdhost {
189 + status = "okay";
190 + bus-width = <4>;
191 + disable-wp;
192 +};
193 +
194 +&pin_sdhost_cmd {
195 + drive-strength = <2>;
196 +};
197 +
198 +&pin_sdhost_data {
199 + drive-strength = <2>;
200 +};
201 +
202 +&pwm {
203 + status = "okay";
204 +
205 + pinctrl-0 = <&pwmpdm0_pin>, <&pwmpdm1_pin>, <&pwmpdm2_pin>,
206 + <&pwmpdm3_pin>;
207 + pinctrl-names = "default";
208 +};
209 +
210 +&adc {
211 + status = "okay";
212 + vref-supply = <&reg_1v8>;
213 + adc-reserved-channels = <0x10>;
214 +};
215 +
216 +&i2c2 {
217 + status = "okay";
218 + clock-frequency = <400000>;
219 +
220 + tpm@20 {
221 + compatible = "infineon,slb9645tt";
222 + reg = <0x20>;
223 + };
224 +
225 +};
226 +
227 +&i2c3 {
228 + status = "okay";
229 + clock-frequency = <400000>;
230 +};