From: Maxime Ripard <hidden> Date: 2021-01-11 14:24:18
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
Here is the cec-compliance output:
pi@raspberrypi:~$ cec-ctl --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec0:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
pi@raspberrypi:~$ cec-ctl -d1 --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance -d1
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec1:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
And for the hotplug detect test:
pi@raspberrypi:~$ cec-ctl --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9182.611s
pi@raspberrypi:~$ cec-ctl -d1 --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -d1 -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9207.191s
With the pulse-eight side reporting:
$ sudo cec-ctl -M
Driver Info:
Driver Name : pulse8-cec
Adapter Name : serio0
Capabilities : 0x0000003f
Physical Address
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 5.9.16
Available Logical Addresses: 1
Connector Info : None
Physical Address : 0.0.0.0
Logical Address Mask : 0x0001
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'TV '
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 0 (TV)
Primary Device Type : TV
Logical Address Type : TV
All Device Types : TV
RC TV Profile : None
Device Features :
None
Initial Event: State Change: PA: 0.0.0.0, LA mask: 0x0001, Conn Info: no
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Let me know what you think,
Maxime
Changes from v1:
- Removed the irqchip patch in favor of a select in mach-bcm
- Fixed HDMI1 interrupt numbers
- Removed redundant call to drm_connector_update_edid_property
- Fixed the condition in vc4_hdmi_connector_detect
- Added the tags
- Rebased on top of drm-misc-next-2021-01-06
Dom Cobley (5):
drm/vc4: hdmi: Move hdmi reset to bind
drm/vc4: hdmi: Fix register offset with longer CEC messages
drm/vc4: hdmi: Fix up CEC registers
drm/vc4: hdmi: Restore cec physical address on reconnect
drm/vc4: hdmi: Remove cec_available flag
Maxime Ripard (10):
ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
drm/vc4: hdmi: Introduce a CEC clock
drm/vc4: hdmi: Split the interrupt handlers
drm/vc4: hdmi: Support BCM2711 CEC interrupt setup
drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
ARM: dts: bcm2711: Add the BSC interrupt controller
ARM: dts: bcm2711: Add the CEC interrupt controller
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 +-
arch/arm/boot/dts/bcm2711.dtsi | 30 +++
arch/arm/mach-bcm/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
drivers/gpu/drm/vc4/vc4_hdmi.c | 223 ++++++++++++++----
drivers/gpu/drm/vc4/vc4_hdmi.h | 11 +-
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +-
7 files changed, 234 insertions(+), 56 deletions(-)
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-01-11 14:24:01
The BCM2711 has a number of instances of interrupt controllers handled
by the driver behind the BRCMSTB_L2_IRQ Kconfig option (irq-brcmstb-l2).
Let's select that driver as part of the ARCH_BCM2835 Kconfig option.
Signed-off-by: Maxime Ripard <redacted>
---
arch/arm/mach-bcm/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
2 files changed, 2 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:24:18
From: Dom Cobley <redacted>
The hdmi reset got moved to a later point in the commit 9045e91a476b
("drm/vc4: hdmi: Add reset callback").
However, the reset now occurs after vc4_hdmi_cec_init and so tramples
the setup of registers like HDMI_CEC_CNTRL_1
This only affects pi0-3 as on pi4 the cec registers are in a separate
block
Fixes: 9045e91a476b ("drm/vc4: hdmi: Add reset callback")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:00
From: Dom Cobley <redacted>
The commit 311e305fdb4e ("drm/vc4: hdmi: Implement a register layout
abstraction") forgot one CEC register, and made a copy and paste mistake
for another one. Fix those mistakes.
Fixes: 311e305fdb4e ("drm/vc4: hdmi: Implement a register layout abstraction")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:00
From: Dom Cobley <redacted>
The code prior to 311e305fdb4e ("drm/vc4: hdmi: Implement a register
layout abstraction") was relying on the fact that the register offset
was incremented by 4 for each readl call. That worked since the register
width is 4 bytes.
However, since that commit the HDMI_READ macro is now taking an enum,
and the offset doesn't increment by 4 but 1 now. Divide the index by 4
to fix this.
Fixes: 311e305fdb4e ("drm/vc4: hdmi: Implement a register layout abstraction")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
@@ -1443,13 +1443,20 @@ static irqreturn_t vc4_cec_irq_handler_thread(int irq, void *priv)staticvoidvc4_cec_read_msg(structvc4_hdmi*vc4_hdmi,u32cntrl1){+structdrm_device*dev=vc4_hdmi->connector.dev;structcec_msg*msg=&vc4_hdmi->cec_rx_msg;unsignedinti;msg->len=1+((cntrl1&VC4_HDMI_CEC_REC_WRD_CNT_MASK)>>VC4_HDMI_CEC_REC_WRD_CNT_SHIFT);++if(msg->len>16){+drm_err(dev,"Attempting to read too much data (%d)\n",msg->len);+return;+}+for(i=0;i<msg->len;i+=4){-u32val=HDMI_READ(HDMI_CEC_RX_DATA_1+i);+u32val=HDMI_READ(HDMI_CEC_RX_DATA_1+(i>>2));msg->msg[i]=val&0xff;msg->msg[i+1]=(val>>8)&0xff;
@@ -1542,11 +1549,17 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,u32signal_free_time,structcec_msg*msg){structvc4_hdmi*vc4_hdmi=cec_get_drvdata(adap);+structdrm_device*dev=vc4_hdmi->connector.dev;u32val;unsignedinti;+if(msg->len>16){+drm_err(dev,"Attempting to transmit too much data (%d)\n",msg->len);+return-ENOMEM;+}+for(i=0;i<msg->len;i+=4)-HDMI_WRITE(HDMI_CEC_TX_DATA_1+i,+HDMI_WRITE(HDMI_CEC_TX_DATA_1+(i>>2),(msg->msg[i])|(msg->msg[i+1]<<8)|(msg->msg[i+2]<<16)|
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:00
The BCM2711 has two different interrupt sources to transmit and receive
CEC messages, provided through an external interrupt chip shared between
the two HDMI interrupt controllers.
The rest of the CEC controller is identical though so we need to change
a bit the code organisation to share the code as much as possible, yet
still allowing to register independant handlers.
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 86 +++++++++++++++++++++++++---------
1 file changed, 65 insertions(+), 21 deletions(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:01
As part of the enable sequence we might change the HSM clock rate if the
pixel rate is different than the one we were already dealing with.
On the BCM2835 however, the CEC clock derives from the HSM clock so any
rate change will need to be reflected in the CEC clock divider to output
40kHz.
Fixes: cd4cb49dc5bb ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 39 +++++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 10 deletions(-)
@@ -1598,7 +1621,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi){structcec_connector_infoconn_info;structplatform_device*pdev=vc4_hdmi->pdev;-u16clk_cnt;u32value;intret;
@@ -1617,17 +1639,14 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi)cec_s_conn_info(vc4_hdmi->cec_adap,&conn_info);HDMI_WRITE(HDMI_CEC_CPU_MASK_SET,0xffffffff);+value=HDMI_READ(HDMI_CEC_CNTRL_1);-value&=~VC4_HDMI_CEC_DIV_CLK_CNT_MASK;-/*-*SetthelogicaladdresstoUnregisteredandsettheclock-*divider:thehsm_clockrateandthisdividersettingwill-*givea40kHzCECclock.-*/-clk_cnt=clk_get_rate(vc4_hdmi->hsm_clock)/CEC_CLOCK_FREQ;-value|=VC4_HDMI_CEC_ADDR_MASK|-(clk_cnt<<VC4_HDMI_CEC_DIV_CLK_CNT_SHIFT);+/* Set the logical address to Unregistered */+value|=VC4_HDMI_CEC_ADDR_MASK;HDMI_WRITE(HDMI_CEC_CNTRL_1,value);++vc4_hdmi_cec_update_clk_div(vc4_hdmi);+ret=devm_request_threaded_irq(&pdev->dev,platform_get_irq(pdev,0),vc4_cec_irq_handler,vc4_cec_irq_handler_thread,0,
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:37
From: Dom Cobley <redacted>
Currently we call cec_phys_addr_invalidate on a hotplug deassert.
That may be due to a TV power cycling, or an AVR being switched
on (and switching edid).
This makes CEC unusable since our controller wouldn't have a physical
address anymore.
Set it back up again on the hotplug assert.
Fixes: 15b4511a4af6 ("drm/vc4: add HDMI CEC support")
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:37
While the BCM2835 had the CEC clock derived from the HSM clock, the
BCM2711 has a dedicated parent clock for it.
Let's introduce a separate clock for it so that we can handle both
cases.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ++++++++-
drivers/gpu/drm/vc4/vc4_hdmi.h | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
@@ -1752,6 +1752,7 @@ static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)returnPTR_ERR(vc4_hdmi->hsm_clock);}vc4_hdmi->audio_clock=vc4_hdmi->hsm_clock;+vc4_hdmi->cec_clock=vc4_hdmi->hsm_clock;return0;}
@@ -1845,6 +1846,12 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)returnPTR_ERR(vc4_hdmi->audio_clock);}+vc4_hdmi->cec_clock=devm_clk_get(dev,"cec");+if(IS_ERR(vc4_hdmi->cec_clock)){+DRM_ERROR("Failed to get CEC clock\n");+returnPTR_ERR(vc4_hdmi->cec_clock);+}+vc4_hdmi->reset=devm_reset_control_get(dev,NULL);if(IS_ERR(vc4_hdmi->reset)){DRM_ERROR("Failed to get HDMI reset line\n");
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:38
We introduced the BCM2711 support to the vc4 HDMI controller with 5.10,
but this was lacking any of the interrupts of the CEC controller so we
have to deal with the backward compatibility.
Do so by simply ignoring the CEC setup if the DT doesn't have the
interrupts property.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++++
1 file changed, 6 insertions(+)
@@ -1667,9 +1667,15 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi){structcec_connector_infoconn_info;structplatform_device*pdev=vc4_hdmi->pdev;+structdevice*dev=&pdev->dev;u32value;intret;+if(!of_find_property(dev->of_node,"interrupts",NULL)){+dev_warn(dev,"'interrupts' DT property is missing, no CEC\n");+return0;+}+vc4_hdmi->cec_adap=cec_allocate_adapter(&vc4_hdmi_cec_adap_ops,vc4_hdmi,"vc4",CEC_CAP_DEFAULTS|
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:38
The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.
Signed-off-by: Maxime Ripard <redacted>
---
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:38
From: Dom Cobley <redacted>
Now that our HDMI controller supports CEC for the BCM2711, let's remove
that flag.
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ----
drivers/gpu/drm/vc4/vc4_hdmi.h | 3 ---
2 files changed, 7 deletions(-)
@@ -42,9 +42,6 @@ struct vc4_hdmi_variant {/* Filename to expose the registers in debugfs */constchar*debugfs_name;-/* Set to true when the CEC support is available */-boolcec_available;-/* Maximum pixel clock supported by the controller (in Hz) */unsignedlonglongmax_pixel_clock;
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-01-11 14:25:38
The CEC and hotplug interrupts go through an interrupt controller shared
between the two HDMI controllers.
Let's add that interrupt controller and the interrupts for both HDMI
controllers
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <redacted>
---
arch/arm/boot/dts/bcm2711.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:26:10
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <redacted>
---
arch/arm/boot/dts/bcm2711.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:26:10
The CEC clock divider needs to output a frequency of 40kHz from the HSM
rate on the BCM2835. The driver used to have a fixed frequency for it,
but that changed for the BCM2711 and we now need to compute it
dynamically to maintain the proper rate.
Fixes: cd4cb49dc5bb ("drm/vc4: hdmi: Adjust HSM clock rate depending on pixel rate")
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Maxime Ripard <hidden> Date: 2021-01-11 14:26:10
The HDMI controller found in the BCM2711 has an external interrupt
controller for the CEC and hotplug interrupt shared between the two
instances.
Let's add a variant flag to register a single interrupt handler and
deals with the interrupt handler setup, or two interrupt handlers
relying on an external irqchip.
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 42 ++++++++++++++++++++++++++--------
drivers/gpu/drm/vc4/vc4_hdmi.h | 7 ++++++
2 files changed, 39 insertions(+), 10 deletions(-)
@@ -1682,8 +1684,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi)cec_fill_conn_info_from_drm(&conn_info,&vc4_hdmi->connector);cec_s_conn_info(vc4_hdmi->cec_adap,&conn_info);-HDMI_WRITE(HDMI_CEC_CPU_MASK_SET,0xffffffff);-value=HDMI_READ(HDMI_CEC_CNTRL_1);/* Set the logical address to Unregistered */value|=VC4_HDMI_CEC_ADDR_MASK;
@@ -64,6 +64,13 @@ struct vc4_hdmi_variant {/* The BCM2711 cannot deal with odd horizontal pixel timings */boolunsupported_odd_h_timings;+/*+*TheBCM2711CEC/hotplugIRQcontrollerissharedbetweenthe+*twoHDMIcontrollers,andwehaveaproperirqchipdriverfor+*it.+*/+boolexternal_irq_controller;+/* Callback to get the resources (memory region, interrupts,*clocks,etc)forthatvariant.*/
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
The BCM2711 has a number of instances of interrupt controllers handled
by the driver behind the BRCMSTB_L2_IRQ Kconfig option (irq-brcmstb-l2).
Let's select that driver as part of the ARCH_BCM2835 Kconfig option.
Signed-off-by: Maxime Ripard <redacted>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Nicolas, I suppose you will be taking patches 1 and 14, 15 through the
SoC pull request, right?
--
Florian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Nicolas Saenz Julienne <hidden> Date: 2021-01-11 17:13:24
@Maxime it seems you forgot to CC me on the series :)
On Mon, 2021-01-11 at 08:54 -0800, Florian Fainelli wrote:
On 1/11/2021 6:22 AM, Maxime Ripard wrote:
quoted
The BCM2711 has a number of instances of interrupt controllers handled
by the driver behind the BRCMSTB_L2_IRQ Kconfig option (irq-brcmstb-l2).
Let's select that driver as part of the ARCH_BCM2835 Kconfig option.
Signed-off-by: Maxime Ripard <redacted>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Nicolas, I suppose you will be taking patches 1 and 14, 15 through the
SoC pull request, right?
Yes, that's about right. But I think it'd be nice to wait a bit to see if RobH
has something to say.
Regards,
Nicolas
From: Hans Verkuil <hidden> Date: 2021-01-12 15:25:37
Hi Maxime,
On 11/01/2021 15:22, Maxime Ripard wrote:
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
Thank you for this series, I plan to test this later this week.
Regards,
Hans
Here is the cec-compliance output:
pi@raspberrypi:~$ cec-ctl --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec0:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
pi@raspberrypi:~$ cec-ctl -d1 --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance -d1
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec1:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
And for the hotplug detect test:
pi@raspberrypi:~$ cec-ctl --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9182.611s
pi@raspberrypi:~$ cec-ctl -d1 --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -d1 -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9207.191s
With the pulse-eight side reporting:
$ sudo cec-ctl -M
Driver Info:
Driver Name : pulse8-cec
Adapter Name : serio0
Capabilities : 0x0000003f
Physical Address
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 5.9.16
Available Logical Addresses: 1
Connector Info : None
Physical Address : 0.0.0.0
Logical Address Mask : 0x0001
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'TV '
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 0 (TV)
Primary Device Type : TV
Logical Address Type : TV
All Device Types : TV
RC TV Profile : None
Device Features :
None
Initial Event: State Change: PA: 0.0.0.0, LA mask: 0x0001, Conn Info: no
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Let me know what you think,
Maxime
Changes from v1:
- Removed the irqchip patch in favor of a select in mach-bcm
- Fixed HDMI1 interrupt numbers
- Removed redundant call to drm_connector_update_edid_property
- Fixed the condition in vc4_hdmi_connector_detect
- Added the tags
- Rebased on top of drm-misc-next-2021-01-06
Dom Cobley (5):
drm/vc4: hdmi: Move hdmi reset to bind
drm/vc4: hdmi: Fix register offset with longer CEC messages
drm/vc4: hdmi: Fix up CEC registers
drm/vc4: hdmi: Restore cec physical address on reconnect
drm/vc4: hdmi: Remove cec_available flag
Maxime Ripard (10):
ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
drm/vc4: hdmi: Introduce a CEC clock
drm/vc4: hdmi: Split the interrupt handlers
drm/vc4: hdmi: Support BCM2711 CEC interrupt setup
drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
ARM: dts: bcm2711: Add the BSC interrupt controller
ARM: dts: bcm2711: Add the CEC interrupt controller
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 +-
arch/arm/boot/dts/bcm2711.dtsi | 30 +++
arch/arm/mach-bcm/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
drivers/gpu/drm/vc4/vc4_hdmi.c | 223 ++++++++++++++----
drivers/gpu/drm/vc4/vc4_hdmi.h | 11 +-
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +-
7 files changed, 234 insertions(+), 56 deletions(-)
From: Hans Verkuil <hidden> Date: 2021-01-18 13:58:11
On 12/01/2021 16:24, Hans Verkuil wrote:
Hi Maxime,
On 11/01/2021 15:22, Maxime Ripard wrote:
quoted
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
Thank you for this series, I plan to test this later this week.
Testing is delayed: my microHDMI to HDMI adapter has problems with the CEC pin
(possibly not connected at all). I've ordered adapter cables (hopefully of better
quality), but those haven't arrived yet. I expect them later this week.
Regards,
Hans
Regards,
Hans
quoted
Here is the cec-compliance output:
pi@raspberrypi:~$ cec-ctl --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec0:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
pi@raspberrypi:~$ cec-ctl -d1 --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance -d1
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec1:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
And for the hotplug detect test:
pi@raspberrypi:~$ cec-ctl --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9182.611s
pi@raspberrypi:~$ cec-ctl -d1 --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -d1 -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9207.191s
With the pulse-eight side reporting:
$ sudo cec-ctl -M
Driver Info:
Driver Name : pulse8-cec
Adapter Name : serio0
Capabilities : 0x0000003f
Physical Address
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 5.9.16
Available Logical Addresses: 1
Connector Info : None
Physical Address : 0.0.0.0
Logical Address Mask : 0x0001
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'TV '
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 0 (TV)
Primary Device Type : TV
Logical Address Type : TV
All Device Types : TV
RC TV Profile : None
Device Features :
None
Initial Event: State Change: PA: 0.0.0.0, LA mask: 0x0001, Conn Info: no
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Let me know what you think,
Maxime
Changes from v1:
- Removed the irqchip patch in favor of a select in mach-bcm
- Fixed HDMI1 interrupt numbers
- Removed redundant call to drm_connector_update_edid_property
- Fixed the condition in vc4_hdmi_connector_detect
- Added the tags
- Rebased on top of drm-misc-next-2021-01-06
Dom Cobley (5):
drm/vc4: hdmi: Move hdmi reset to bind
drm/vc4: hdmi: Fix register offset with longer CEC messages
drm/vc4: hdmi: Fix up CEC registers
drm/vc4: hdmi: Restore cec physical address on reconnect
drm/vc4: hdmi: Remove cec_available flag
Maxime Ripard (10):
ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
drm/vc4: hdmi: Introduce a CEC clock
drm/vc4: hdmi: Split the interrupt handlers
drm/vc4: hdmi: Support BCM2711 CEC interrupt setup
drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
ARM: dts: bcm2711: Add the BSC interrupt controller
ARM: dts: bcm2711: Add the CEC interrupt controller
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 +-
arch/arm/boot/dts/bcm2711.dtsi | 30 +++
arch/arm/mach-bcm/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
drivers/gpu/drm/vc4/vc4_hdmi.c | 223 ++++++++++++++----
drivers/gpu/drm/vc4/vc4_hdmi.h | 11 +-
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +-
7 files changed, 234 insertions(+), 56 deletions(-)
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-01-22 10:38:15
Hi Maxime
Sorry for the slow reply on these patches.
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
From: Dom Cobley <redacted>
Currently we call cec_phys_addr_invalidate on a hotplug deassert.
That may be due to a TV power cycling, or an AVR being switched
on (and switching edid).
This makes CEC unusable since our controller wouldn't have a physical
address anymore.
Set it back up again on the hotplug assert.
Fixes: 15b4511a4af6 ("drm/vc4: add HDMI CEC support")
Signed-off-by: Dom Cobley <redacted>
Signed-off-by: Maxime Ripard <redacted>
I follow the logic, and trust Dom that it works, but I don't know if
that is the correct thing within CEC.
Ideally Hans will comment as the original author of the CEC code - I
believe he's testing the series anyway.
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-01-22 13:03:35
Hi Maxime
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
The BCM2711 has two different interrupt sources to transmit and receive
CEC messages, provided through an external interrupt chip shared between
the two HDMI interrupt controllers.
The rest of the CEC controller is identical though so we need to change
a bit the code organisation to share the code as much as possible, yet
still allowing to register independant handlers.
s/independant/independent
Signed-off-by: Maxime Ripard <redacted>
With that
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-01-22 13:12:09
Hi Maxime
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
The HDMI controller found in the BCM2711 has an external interrupt
controller for the CEC and hotplug interrupt shared between the two
instances.
Let's add a variant flag to register a single interrupt handler and
deals with the interrupt handler setup, or two interrupt handlers
relying on an external irqchip.
Signed-off-by: Maxime Ripard <redacted>
Looks good
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@@ -1682,8 +1684,6 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi)cec_fill_conn_info_from_drm(&conn_info,&vc4_hdmi->connector);cec_s_conn_info(vc4_hdmi->cec_adap,&conn_info);-HDMI_WRITE(HDMI_CEC_CPU_MASK_SET,0xffffffff);-value=HDMI_READ(HDMI_CEC_CNTRL_1);/* Set the logical address to Unregistered */value|=VC4_HDMI_CEC_ADDR_MASK;
@@ -64,6 +64,13 @@ struct vc4_hdmi_variant {/* The BCM2711 cannot deal with odd horizontal pixel timings */boolunsupported_odd_h_timings;+/*+*TheBCM2711CEC/hotplugIRQcontrollerissharedbetweenthe+*twoHDMIcontrollers,andwehaveaproperirqchipdriverfor+*it.+*/+boolexternal_irq_controller;+/* Callback to get the resources (memory region, interrupts,*clocks,etc)forthatvariant.*/--
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-01-22 13:31:30
Hi Maxime
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.
Signed-off-by: Maxime Ripard <redacted>
Looks reasonable to me, but I'm not a DT bindings expert
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
From: Nicolas Saenz Julienne <hidden> Date: 2021-01-25 21:10:22
Hi,
On Mon, 2021-01-11 at 15:22 +0100, Maxime Ripard wrote:
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
I applied patches #1 and #14 for-next. I'm waiting on Hans' testing for #15.
Regards,
Nicolas
From: Hans Verkuil <hidden> Date: 2021-01-27 15:31:02
On 18/01/2021 14:55, Hans Verkuil wrote:
On 12/01/2021 16:24, Hans Verkuil wrote:
quoted
Hi Maxime,
On 11/01/2021 15:22, Maxime Ripard wrote:
quoted
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
Thank you for this series, I plan to test this later this week.
Testing is delayed: my microHDMI to HDMI adapter has problems with the CEC pin
(possibly not connected at all). I've ordered adapter cables (hopefully of better
quality), but those haven't arrived yet. I expect them later this week.
After testing this you can add my:
Acked-by: Hans Verkuil <redacted>
Tested-by: Hans Verkuil <redacted>
for the patches in this series.
Thank you for working on this!
Regards,
Hans
Regards,
Hans
quoted
Regards,
Hans
quoted
Here is the cec-compliance output:
pi@raspberrypi:~$ cec-ctl --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec0:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
pi@raspberrypi:~$ cec-ctl -d1 --tuner -p 1.0.0.0
The CEC adapter doesn't allow setting the physical address manually, ignore this option.
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-compliance -d1
cec-compliance SHA : not available
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : 1.0.0.0
Logical Address Mask : 0x0008
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Tuner
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 3 (Tuner 1)
Primary Device Type : Tuner
Logical Address Type : Tuner
All Device Types : Tuner
RC TV Profile : None
Device Features :
None
Compliance test for device /dev/cec1:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the device.
OK (Presumed) Presumably supported. Manually check to confirm.
OK (Unexpected) Supported correctly but is not expected to be supported for this device.
OK (Refused) Supported by the device, but was refused.
FAIL Failed and was expected to be supported by this device.
Find remote devices:
Polling: OK
Network topology:
System Information for device 0 (TV) from device 3 (Tuner 1):
CEC Version : 2.0
Physical Address : 0.0.0.0
Primary Device Type : TV
Vendor ID : 0x000c03
OSD Name : 'TV '
Power Status : Tx, OK, Rx, OK, Feature Abort
Total: 1, Succeeded: 1, Failed: 0, Warnings: 0
And for the hotplug detect test:
pi@raspberrypi:~$ cec-ctl --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9182.611s
pi@raspberrypi:~$ cec-ctl -d1 --playback
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
pi@raspberrypi:~$ cec-ctl -d1 -t0 --image-view-on
Driver Info:
Driver Name : vc4_hdmi
Adapter Name : vc4
Capabilities : 0x0000010e
Logical Addresses
Transmit
Passthrough
Driver version : 5.10.0
Available Logical Addresses: 1
Physical Address : f.f.f.f
Logical Address Mask : 0x0000
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : Playback
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : Not Allocated
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Transmit from Unregistered to TV (15 to 0):
CEC_MSG_IMAGE_VIEW_ON (0x04)
Sequence: 1 Tx Timestamp: 9207.191s
With the pulse-eight side reporting:
$ sudo cec-ctl -M
Driver Info:
Driver Name : pulse8-cec
Adapter Name : serio0
Capabilities : 0x0000003f
Physical Address
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 5.9.16
Available Logical Addresses: 1
Connector Info : None
Physical Address : 0.0.0.0
Logical Address Mask : 0x0001
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'TV '
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 0 (TV)
Primary Device Type : TV
Logical Address Type : TV
All Device Types : TV
RC TV Profile : None
Device Features :
None
Initial Event: State Change: PA: 0.0.0.0, LA mask: 0x0001, Conn Info: no
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Received from Unregistered to TV (15 to 0): IMAGE_VIEW_ON (0x04)
Let me know what you think,
Maxime
Changes from v1:
- Removed the irqchip patch in favor of a select in mach-bcm
- Fixed HDMI1 interrupt numbers
- Removed redundant call to drm_connector_update_edid_property
- Fixed the condition in vc4_hdmi_connector_detect
- Added the tags
- Rebased on top of drm-misc-next-2021-01-06
Dom Cobley (5):
drm/vc4: hdmi: Move hdmi reset to bind
drm/vc4: hdmi: Fix register offset with longer CEC messages
drm/vc4: hdmi: Fix up CEC registers
drm/vc4: hdmi: Restore cec physical address on reconnect
drm/vc4: hdmi: Remove cec_available flag
Maxime Ripard (10):
ARM: bcm: Select BRCMSTB_L2_IRQ for bcm2835
drm/vc4: hdmi: Compute the CEC clock divider from the clock rate
drm/vc4: hdmi: Update the CEC clock divider on HSM rate change
drm/vc4: hdmi: Introduce a CEC clock
drm/vc4: hdmi: Split the interrupt handlers
drm/vc4: hdmi: Support BCM2711 CEC interrupt setup
drm/vc4: hdmi: Don't register the CEC adapter if there's no interrupts
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
ARM: dts: bcm2711: Add the BSC interrupt controller
ARM: dts: bcm2711: Add the CEC interrupt controller
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 +-
arch/arm/boot/dts/bcm2711.dtsi | 30 +++
arch/arm/mach-bcm/Kconfig | 1 +
arch/arm64/Kconfig.platforms | 1 +
drivers/gpu/drm/vc4/vc4_hdmi.c | 223 ++++++++++++++----
drivers/gpu/drm/vc4/vc4_hdmi.h | 11 +-
drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 4 +-
7 files changed, 234 insertions(+), 56 deletions(-)
From: Maxime Ripard <hidden> Date: 2021-01-28 09:51:05
Hi!
On Mon, Jan 25, 2021 at 10:03:44PM +0100, Nicolas Saenz Julienne wrote:
Hi,
On Mon, 2021-01-11 at 15:22 +0100, Maxime Ripard wrote:
quoted
Hi,
Here's a series introducing the CEC support for the BCM2711 found on the
RaspberryPi4.
The BCM2711 HDMI controller uses a similar layout for the CEC registers, the
main difference being that the interrupt handling part is now shared between
both HDMI controllers.
This series is mainly about fixing a couple of bugs, reworking the driver to
support having two different interrupts, one for each direction, provided by an
external irqchip, and enables the irqchip driver for the controller we have.
This has been tested on an RPi3 and RPi4, but requires the latest firmware.
It's is based on the 10 and 12 bpc series.
I applied patches #1 and #14 for-next. I'm waiting on Hans' testing for #15.
I've applied to drm-misc-next the patches 2 to 13
Maxime
From: Nicolas Saenz Julienne <hidden> Date: 2021-01-28 14:55:02
On Mon, 2021-01-11 at 15:23 +0100, Maxime Ripard wrote:
The CEC and hotplug interrupts go through an interrupt controller shared
between the two HDMI controllers.
Let's add that interrupt controller and the interrupts for both HDMI
controllers
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Maxime Ripard <redacted>
---
From: Rob Herring <robh@kernel.org> Date: 2021-02-01 18:57:20
On Mon, Jan 11, 2021 at 8:27 AM Maxime Ripard [off-list ref] wrote:
quoted hunk
The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.
Signed-off-by: Maxime Ripard <redacted>
---
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml:
'additionalProperties' is a required property
And you missed the DT list, so no checks ran.
Rob
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-02-09 09:52:30
Hi Maxime
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Thanks
Dave
From: Maxime Ripard <hidden> Date: 2021-02-10 14:41:39
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
Thanks!
Maxime
From: Marc Zyngier <maz@kernel.org> Date: 2021-02-10 15:31:37
Hi Maxime,
On 2021-02-10 14:40, Maxime Ripard wrote:
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
quoted
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
No, not really. That's because the chained handler is actually an
interrupt flow, and not a normal handler. IRQF_SHARED acts at the wrong
level for that.
I can see two possibilities:
- the l2-intc gets turned into a normal handler, and does the demux
from there. Horrible stuff.
- the i2c controller gets parented to the l2c-int as a fake interrupt,
and gets called from there. Horrible stuff.
Pick your poison... :-/
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Dave Stevenson <dave.stevenson@raspberrypi.com> Date: 2021-02-10 15:50:10
Hi Marc.
On Wed, 10 Feb 2021 at 15:30, Marc Zyngier [off-list ref] wrote:
Hi Maxime,
On 2021-02-10 14:40, Maxime Ripard wrote:
quoted
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
quoted
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
No, not really. That's because the chained handler is actually an
interrupt flow, and not a normal handler. IRQF_SHARED acts at the wrong
level for that.
I can see two possibilities:
- the l2-intc gets turned into a normal handler, and does the demux
from there. Horrible stuff.
- the i2c controller gets parented to the l2c-int as a fake interrupt,
and gets called from there. Horrible stuff.
Pick your poison... :-/
Thanks for the info.
Option 3 - remove l2-intc and drop back to polling the i2c-brcmstb
blocks (which the driver supports anyway).
HDMI I2C generally isn't heavily used once displays are connected, so
I'd be OK with that.
(We can keep the l2-intc that handles CEC and HPD as that is on a
unique GIC interrupt).
Dave
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Marc.
On Wed, 10 Feb 2021 at 15:30, Marc Zyngier [off-list ref] wrote:
quoted
Hi Maxime,
On 2021-02-10 14:40, Maxime Ripard wrote:
quoted
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
quoted
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
No, not really. That's because the chained handler is actually an
interrupt flow, and not a normal handler. IRQF_SHARED acts at the wrong
level for that.
I can see two possibilities:
- the l2-intc gets turned into a normal handler, and does the demux
from there. Horrible stuff.
- the i2c controller gets parented to the l2c-int as a fake interrupt,
and gets called from there. Horrible stuff.
Pick your poison... :-/
Thanks for the info.
Option 3 - remove l2-intc and drop back to polling the i2c-brcmstb
blocks (which the driver supports anyway).
HDMI I2C generally isn't heavily used once displays are connected, so
I'd be OK with that.
(We can keep the l2-intc that handles CEC and HPD as that is on a
unique GIC interrupt).
Agreed, Maxime or Nicolas do you want me to send a revert of this patch?
--
Florian
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Nicolas Saenz Julienne <hidden> Date: 2021-02-12 11:22:45
On Wed, 2021-02-10 at 10:49 -0800, Florian Fainelli wrote:
On 2/10/21 7:49 AM, Dave Stevenson wrote:
quoted
Hi Marc.
On Wed, 10 Feb 2021 at 15:30, Marc Zyngier [off-list ref] wrote:
quoted
Hi Maxime,
On 2021-02-10 14:40, Maxime Ripard wrote:
quoted
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
quoted
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
No, not really. That's because the chained handler is actually an
interrupt flow, and not a normal handler. IRQF_SHARED acts at the wrong
level for that.
I can see two possibilities:
- the l2-intc gets turned into a normal handler, and does the demux
from there. Horrible stuff.
- the i2c controller gets parented to the l2c-int as a fake interrupt,
and gets called from there. Horrible stuff.
Pick your poison... :-/
Thanks for the info.
Option 3 - remove l2-intc and drop back to polling the i2c-brcmstb
blocks (which the driver supports anyway).
HDMI I2C generally isn't heavily used once displays are connected, so
I'd be OK with that.
(We can keep the l2-intc that handles CEC and HPD as that is on a
unique GIC interrupt).
Agreed, Maxime or Nicolas do you want me to send a revert of this patch?
Reverting seems the safe move, but I'll defer to whatever Maxime says.
Regards,
Nicolas
From: Maxime Ripard <hidden> Date: 2021-02-12 11:35:34
On Fri, Feb 12, 2021 at 12:20:14PM +0100, Nicolas Saenz Julienne wrote:
On Wed, 2021-02-10 at 10:49 -0800, Florian Fainelli wrote:
quoted
On 2/10/21 7:49 AM, Dave Stevenson wrote:
quoted
Hi Marc.
On Wed, 10 Feb 2021 at 15:30, Marc Zyngier [off-list ref] wrote:
quoted
Hi Maxime,
On 2021-02-10 14:40, Maxime Ripard wrote:
quoted
Hi Dave,
On Tue, Feb 09, 2021 at 09:49:05AM +0000, Dave Stevenson wrote:
quoted
On Mon, 11 Jan 2021 at 14:23, Maxime Ripard [off-list ref] wrote:
quoted
The BSC controllers used for the HDMI DDC have an interrupt controller
shared between both instances. Let's add it to avoid polling.
This seems to have unintended side effects.
GIC interrupt 117 is shared between the standard I2C controllers
(i2c-bcm2835) and the l2-intc block handling the HDMI I2C interrupts.
Whilst i2c-bcm2835 requests the interrupt with IRQF_SHARED, that
doesn't appear to be an option for l2-intc registering as an interrupt
controller. i2c-bcm2835 therefore loses out and fails to register for
the interrupt.
Is there an equivalent flag that an interrupt controller can add to
say that the parent interrupt is shared? Is that even supported?
Indeed, it looks like setting an equivalent to IRQF_SHARED would be the
solution, but I couldn't find anything that would allow us to in the
irqchip code.
Marc, Thomas, is it something that is allowed?
No, not really. That's because the chained handler is actually an
interrupt flow, and not a normal handler. IRQF_SHARED acts at the wrong
level for that.
I can see two possibilities:
- the l2-intc gets turned into a normal handler, and does the demux
from there. Horrible stuff.
- the i2c controller gets parented to the l2c-int as a fake interrupt,
and gets called from there. Horrible stuff.
Pick your poison... :-/
Thanks for the info.
Option 3 - remove l2-intc and drop back to polling the i2c-brcmstb
blocks (which the driver supports anyway).
HDMI I2C generally isn't heavily used once displays are connected, so
I'd be OK with that.
(We can keep the l2-intc that handles CEC and HPD as that is on a
unique GIC interrupt).
Agreed, Maxime or Nicolas do you want me to send a revert of this patch?
Reverting seems the safe move, but I'll defer to whatever Maxime says.
Yes, reverting it seems like the easiest way forward. If you can send it
Florian that would be great :)
Maxime
From: Rob Herring <robh@kernel.org> Date: 2021-02-18 17:42:35
On Mon, Feb 1, 2021 at 12:56 PM Rob Herring [off-list ref] wrote:
On Mon, Jan 11, 2021 at 8:27 AM Maxime Ripard [off-list ref] wrote:
quoted
The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.
Signed-off-by: Maxime Ripard <redacted>
---
.../bindings/display/brcm,bcm2711-hdmi.yaml | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/display/brcm,bcm2711-hdmi.yaml:
'additionalProperties' is a required property
And you missed the DT list, so no checks ran.