Skip to content

Commit 5bc0a41

Browse files
committed
Merge pull request #1457 from anholt/rpi-4.4.y-vc4-hpd
Rpi 4.4.y: HDMI hotplug detection, overlay cleanup
2 parents c5ab39b + 7da44d0 commit 5bc0a41

File tree

7 files changed

+145
-84
lines changed

7 files changed

+145
-84
lines changed

arch/arm/boot/dts/bcm2708-rpi-b-plus.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
};
117117
};
118118

119+
&hdmi {
120+
hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
121+
};
122+
119123
/ {
120124
__overrides__ {
121125
uart0 = <&uart0>,"status";

arch/arm/boot/dts/bcm2708-rpi-b.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@
110110
};
111111
};
112112

113+
&hdmi {
114+
hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
115+
};
116+
113117
/ {
114118
__overrides__ {
115119
uart0 = <&uart0>,"status";

arch/arm/boot/dts/bcm2708_common.dtsi

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
#include "dt-bindings/clock/bcm2835.h"
12
#include <dt-bindings/clock/bcm2835-aux.h>
3+
#include "dt-bindings/power/raspberrypi-power.h"
4+
#include "dt-bindings/gpio/gpio.h"
25
#include "skeleton.dtsi"
36

47
/ {
@@ -170,6 +173,18 @@
170173
status = "disabled";
171174
};
172175

176+
pixelvalve0: pixelvalve@7e206000 {
177+
compatible = "brcm,bcm2835-pixelvalve0";
178+
reg = <0x7e206000 0x100>;
179+
status = "disabled";
180+
};
181+
182+
pixelvalve1: pixelvalve@7e207000 {
183+
compatible = "brcm,bcm2835-pixelvalve1";
184+
reg = <0x7e207000 0x100>;
185+
status = "disabled";
186+
};
187+
173188
pwm: pwm@7e20c000 {
174189
compatible = "brcm,bcm2835-pwm";
175190
reg = <0x7e20c000 0x28>;
@@ -227,6 +242,12 @@
227242
status = "disabled";
228243
};
229244

245+
hvs: hvs@7e400000 {
246+
compatible = "brcm,bcm2835-hvs";
247+
reg = <0x7e400000 0x6000>;
248+
status = "disabled";
249+
};
250+
230251
i2c1: i2c@7e804000 {
231252
compatible = "brcm,bcm2708-i2c";
232253
reg = <0x7e804000 0x1000>;
@@ -261,6 +282,25 @@
261282
status = "disabled";
262283
};
263284

285+
pixelvalve2: pixelvalve@7e807000 {
286+
compatible = "brcm,bcm2835-pixelvalve2";
287+
reg = <0x7e807000 0x100>;
288+
status = "disabled";
289+
};
290+
291+
hdmi: hdmi@7e902000 {
292+
compatible = "brcm,bcm2835-hdmi";
293+
reg = <0x7e902000 0x600>,
294+
<0x7e808000 0x100>;
295+
ddc = <&i2c2>;
296+
hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
297+
clocks = <&cprman BCM2835_PLLH_PIX>,
298+
<&cprman BCM2835_CLOCK_HSM>;
299+
clock-names = "pixel", "hdmi";
300+
power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
301+
status = "disabled";
302+
};
303+
264304
usb: usb@7e980000 {
265305
compatible = "brcm,bcm2708-usb";
266306
reg = <0x7e980000 0x10000>,
@@ -269,6 +309,12 @@
269309
<1 9>;
270310
};
271311

312+
v3d: v3d@7ec00000 {
313+
compatible = "brcm,vc4-v3d";
314+
reg = <0x7ec00000 0x1000>;
315+
status = "disabled";
316+
};
317+
272318
firmware: firmware {
273319
compatible = "raspberrypi,bcm2835-firmware";
274320
mboxes = <&mailbox>;
@@ -303,6 +349,11 @@
303349
firmware = <&firmware>;
304350
};
305351

352+
gpu: gpu {
353+
compatible = "brcm,bcm2835-vc4";
354+
status = "disabled";
355+
};
356+
306357
/* Onboard audio */
307358
audio: audio {
308359
compatible = "brcm,bcm2835-audio";

arch/arm/boot/dts/bcm2709-rpi-2-b.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
};
117117
};
118118

119+
&hdmi {
120+
hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
121+
};
122+
119123
/ {
120124
__overrides__ {
121125
uart0 = <&uart0>,"status";

arch/arm/boot/dts/bcm2710-rpi-3-b.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@
161161
};
162162
};
163163

164+
&hdmi {
165+
hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
166+
};
167+
164168
/ {
165169
chosen {
166170
bootargs = "8250.nr_uarts=1";

arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts

Lines changed: 78 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5,129 +5,125 @@
55
/dts-v1/;
66
/plugin/;
77

8-
#include "dt-bindings/clock/bcm2835.h"
9-
#include "dt-bindings/power/raspberrypi-power.h"
10-
#include "dt-bindings/gpio/gpio.h"
11-
128
/ {
139
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
1410

1511
fragment@0 {
12+
target-path = "/chosen";
13+
__overlay__ {
14+
bootargs = "cma=256M@256M";
15+
};
16+
};
17+
18+
fragment@1 {
19+
target-path = "/chosen";
20+
__dormant__ {
21+
bootargs = "cma=192M@256M";
22+
};
23+
};
24+
25+
fragment@2 {
26+
target-path = "/chosen";
27+
__dormant__ {
28+
bootargs = "cma=128M@128M";
29+
};
30+
};
31+
32+
fragment@3 {
33+
target-path = "/chosen";
34+
__dormant__ {
35+
bootargs = "cma=96M@128M";
36+
};
37+
};
38+
39+
fragment@4 {
40+
target-path = "/chosen";
41+
__dormant__ {
42+
bootargs = "cma=64M@64M";
43+
};
44+
};
45+
46+
fragment@5 {
1647
target = <&i2c2>;
1748
__overlay__ {
1849
status = "okay";
1950
};
2051
};
2152

22-
fragment@1 {
53+
fragment@6 {
2354
target = <&cprman>;
2455
__overlay__ {
2556
status = "okay";
2657
};
2758
};
2859

29-
fragment@2 {
60+
fragment@7 {
3061
target = <&fb>;
3162
__overlay__ {
3263
status = "disabled";
3364
};
3465
};
3566

36-
fragment@3 {
37-
target = <&soc>;
67+
fragment@8 {
68+
target = <&pixelvalve0>;
3869
__overlay__ {
39-
#address-cells = <1>;
40-
#size-cells = <1>;
41-
42-
pixelvalve@7e206000 {
43-
compatible = "brcm,bcm2835-pixelvalve0";
44-
reg = <0x7e206000 0x100>;
45-
interrupts = <2 13>; /* pwa0 */
46-
};
47-
48-
pixelvalve@7e207000 {
49-
compatible = "brcm,bcm2835-pixelvalve1";
50-
reg = <0x7e207000 0x100>;
51-
interrupts = <2 14>; /* pwa1 */
52-
};
53-
54-
hvs@7e400000 {
55-
compatible = "brcm,bcm2835-hvs";
56-
reg = <0x7e400000 0x6000>;
57-
interrupts = <2 1>;
58-
};
59-
60-
pixelvalve@7e807000 {
61-
compatible = "brcm,bcm2835-pixelvalve2";
62-
reg = <0x7e807000 0x100>;
63-
interrupts = <2 10>; /* pixelvalve */
64-
};
65-
66-
hdmi@7e902000 {
67-
compatible = "brcm,bcm2835-hdmi";
68-
reg = <0x7e902000 0x600>,
69-
<0x7e808000 0x100>;
70-
interrupts = <2 8>, <2 9>;
71-
ddc = <&i2c2>;
72-
hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
73-
clocks = <&cprman BCM2835_PLLH_PIX>,
74-
<&cprman BCM2835_CLOCK_HSM>;
75-
clock-names = "pixel", "hdmi";
76-
power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
77-
};
78-
79-
v3d@7ec00000 {
80-
compatible = "brcm,vc4-v3d";
81-
reg = <0x7ec00000 0x1000>;
82-
interrupts = <1 10>;
83-
};
84-
85-
gpu@7e4c0000 {
86-
compatible = "brcm,bcm2835-vc4";
87-
};
70+
interrupts = <2 13>; /* pwa0 */
71+
status = "okay";
8872
};
8973
};
9074

91-
fragment@4 {
92-
target-path = "/chosen";
93-
__overlay__ {
94-
bootargs = "cma=256M@256M";
75+
fragment@9 {
76+
target = <&pixelvalve1>;
77+
__overlay__ {
78+
interrupts = <2 14>; /* pwa1 */
79+
status = "okay";
9580
};
9681
};
9782

98-
fragment@5 {
99-
target-path = "/chosen";
100-
__dormant__ {
101-
bootargs = "cma=192M@256M";
83+
fragment@10 {
84+
target = <&pixelvalve2>;
85+
__overlay__ {
86+
interrupts = <2 10>; /* pixelvalve */
87+
status = "okay";
10288
};
10389
};
10490

105-
fragment@6 {
106-
target-path = "/chosen";
107-
__dormant__ {
108-
bootargs = "cma=128M@128M";
91+
fragment@11 {
92+
target = <&hvs>;
93+
__overlay__ {
94+
interrupts = <2 1>;
95+
status = "okay";
10996
};
11097
};
11198

112-
fragment@7 {
113-
target-path = "/chosen";
114-
__dormant__ {
115-
bootargs = "cma=96M@128M";
99+
fragment@12 {
100+
target = <&hdmi>;
101+
__overlay__ {
102+
interrupts = <2 8>, <2 9>;
103+
status = "okay";
116104
};
117105
};
118106

119-
fragment@8 {
120-
target-path = "/chosen";
121-
__dormant__ {
122-
bootargs = "cma=64M@64M";
107+
fragment@13 {
108+
target = <&v3d>;
109+
__overlay__ {
110+
interrupts = <1 10>;
111+
status = "okay";
112+
};
113+
};
114+
115+
fragment@14 {
116+
target = <&gpu>;
117+
__overlay__ {
118+
status = "okay";
123119
};
124120
};
125121

126122
__overrides__ {
127-
cma-256 = <0>,"+4-5-6-7-8";
128-
cma-192 = <0>,"-4+5-6-7-8";
129-
cma-128 = <0>,"-4-5+6-7-8";
130-
cma-96 = <0>,"-4-5-6+7-8";
131-
cma-64 = <0>,"-4-5-6-7+8";
123+
cma-256 = <0>,"+0-1-2-3-4";
124+
cma-192 = <0>,"-0+1-2-3-4";
125+
cma-128 = <0>,"-0-1+2-3-4";
126+
cma-96 = <0>,"-0-1-2+3-4";
127+
cma-64 = <0>,"-0-1-2-3+4";
132128
};
133129
};

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
166166
struct drm_device *dev = connector->dev;
167167
struct vc4_dev *vc4 = to_vc4_dev(dev);
168168

169-
return connector_status_connected;
170-
171169
if (vc4->hdmi->hpd_gpio) {
172170
if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
173171
vc4->hdmi->hpd_active_low)

0 commit comments

Comments
 (0)