42067a7816be19823bddaf8507a4af88b7042ec8
[openwrt/staging/wigyori.git] / target / linux / bcm27xx / patches-5.4 / 950-0670-ARM-dts-Create-bcm2708-rpi-b-rev1.dts.patch
1 From bd291f0ff613ad270a7c9352f3f27a09c058553f Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Tue, 21 Apr 2020 17:34:27 +0100
4 Subject: [PATCH] ARM: dts: Create bcm2708-rpi-b-rev1.dts
5
6 The first revision of the Pi Model B used I2C0 to address the camera
7 and I2C0 was available for user applications on the 26-pin header.
8 The second revision switched the roles, kept I2C0 on the 26-pin header
9 and added I2C1 on a new 8-way header (P5).
10
11 Up to now, downstream DTS has used a single file for both revisions of
12 the board, with a small amount of patching from the firmware. With the
13 introduction of an I2C mux to share I2C0 between the camera/display
14 connectors and the IDC headers, the difference between the two versions
15 becomes too great to comfortably manage with tweaking, hence this split.
16
17 Upstream DTS files already have bcm2835-rpi-b.dts and
18 bcm2835-rpi-b-rev2.dts, but for backwards compatibility the new file is
19 being added as bcm2708-rpi-b-rev1.dts, rather than renaming the old
20 shared version to bcm2708-rpi-b-rev2.dts.
21
22 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
23 ---
24 arch/arm/boot/dts/Makefile | 1 +
25 arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts | 127 +++++++++++++++++++++++
26 arch/arm/boot/dts/bcm270x-rpi.dtsi | 4 +
27 3 files changed, 132 insertions(+)
28 create mode 100644 arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts
29
30 --- a/arch/arm/boot/dts/Makefile
31 +++ b/arch/arm/boot/dts/Makefile
32 @@ -2,6 +2,7 @@
33
34 dtb-$(CONFIG_ARCH_BCM2835) += \
35 bcm2708-rpi-b.dtb \
36 + bcm2708-rpi-b-rev1.dtb \
37 bcm2708-rpi-b-plus.dtb \
38 bcm2708-rpi-cm.dtb \
39 bcm2708-rpi-zero.dtb \
40 --- /dev/null
41 +++ b/arch/arm/boot/dts/bcm2708-rpi-b-rev1.dts
42 @@ -0,0 +1,127 @@
43 +/dts-v1/;
44 +
45 +#include "bcm2708.dtsi"
46 +#include "bcm2708-rpi.dtsi"
47 +#include "bcm283x-rpi-smsc9512.dtsi"
48 +#include "bcm283x-rpi-csi1-2lane.dtsi"
49 +
50 +/ {
51 + compatible = "raspberrypi,model-b", "brcm,bcm2835";
52 + model = "Raspberry Pi Model B";
53 +};
54 +
55 +&gpio {
56 + spi0_pins: spi0_pins {
57 + brcm,pins = <9 10 11>;
58 + brcm,function = <4>; /* alt0 */
59 + };
60 +
61 + spi0_cs_pins: spi0_cs_pins {
62 + brcm,pins = <8 7>;
63 + brcm,function = <1>; /* output */
64 + };
65 +
66 + i2c0_pins: i2c0 {
67 + brcm,pins = <0 1>;
68 + brcm,function = <4>;
69 + };
70 +
71 + i2c1_pins: i2c1 {
72 + brcm,pins = <2 3>;
73 + brcm,function = <4>;
74 + };
75 +
76 + i2s_pins: i2s {
77 + brcm,pins = <28 29 30 31>;
78 + brcm,function = <6>; /* alt2 */
79 + };
80 +
81 + audio_pins: audio_pins {
82 + brcm,pins = <40 45>;
83 + brcm,function = <4>;
84 + };
85 +};
86 +
87 +&uart0 {
88 + status = "okay";
89 +};
90 +
91 +&spi0 {
92 + pinctrl-names = "default";
93 + pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
94 + cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
95 +
96 + spidev0: spidev@0{
97 + compatible = "spidev";
98 + reg = <0>; /* CE0 */
99 + #address-cells = <1>;
100 + #size-cells = <0>;
101 + spi-max-frequency = <125000000>;
102 + };
103 +
104 + spidev1: spidev@1{
105 + compatible = "spidev";
106 + reg = <1>; /* CE1 */
107 + #address-cells = <1>;
108 + #size-cells = <0>;
109 + spi-max-frequency = <125000000>;
110 + };
111 +};
112 +
113 +/delete-node/ &i2c0mux;
114 +
115 +i2c0: &i2c0if {
116 + pinctrl-names = "default";
117 + pinctrl-0 = <&i2c0_pins>;
118 + clock-frequency = <100000>;
119 +};
120 +
121 +i2c_csi_dsi: &i2c1 {
122 + pinctrl-names = "default";
123 + pinctrl-0 = <&i2c1_pins>;
124 + clock-frequency = <100000>;
125 +};
126 +
127 +/ {
128 + aliases {
129 + i2c0 = &i2c0;
130 + };
131 +
132 + __overrides__ {
133 + i2c0 = <&i2c0>, "status";
134 + };
135 +};
136 +
137 +&i2c2 {
138 + clock-frequency = <100000>;
139 +};
140 +
141 +&i2s {
142 + pinctrl-names = "default";
143 + pinctrl-0 = <&i2s_pins>;
144 +};
145 +
146 +&leds {
147 + act_led: act {
148 + label = "led0";
149 + linux,default-trigger = "mmc0";
150 + gpios = <&gpio 16 1>;
151 + };
152 +};
153 +
154 +&hdmi {
155 + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
156 +};
157 +
158 +&audio {
159 + pinctrl-names = "default";
160 + pinctrl-0 = <&audio_pins>;
161 +};
162 +
163 +/ {
164 + __overrides__ {
165 + act_led_gpio = <&act_led>,"gpios:4";
166 + act_led_activelow = <&act_led>,"gpios:8";
167 + act_led_trigger = <&act_led>,"linux,default-trigger";
168 + };
169 +};
170 --- a/arch/arm/boot/dts/bcm270x-rpi.dtsi
171 +++ b/arch/arm/boot/dts/bcm270x-rpi.dtsi
172 @@ -110,6 +110,10 @@
173 status = "disabled";
174 };
175
176 +&i2c0mux {
177 + status = "disabled";
178 +};
179 +
180 &i2c1 {
181 status = "disabled";
182 };