diff mbox series

clk: bcm: rpi: Add disp clock

Message ID 20240531092730.253484-1-iivanov@suse.de (mailing list archive)
State Changes Requested, archived
Headers show
Series clk: bcm: rpi: Add disp clock | expand

Commit Message

Ivan T . Ivanov May 31, 2024, 9:27 a.m. UTC
From: Maxime Ripard <maxime@cerno.tech>

BCM2712 has an extra clock exposed by the firmware called DISP, and used
by (at least) the HVS. Let's add it to the list of clocks to register in
Linux.

Without this new definition driver fails at probe on BCM2712.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
---
 drivers/clk/bcm/clk-raspberrypi.c          | 5 +++++
 include/soc/bcm2835/raspberrypi-firmware.h | 1 +
 2 files changed, 6 insertions(+)

Comments

Stefan Wahren May 31, 2024, 9:55 a.m. UTC | #1
Hi Ivan,

Am 31.05.24 um 11:27 schrieb Ivan T. Ivanov:
> From: Maxime Ripard <maxime@cerno.tech>
>
> BCM2712 has an extra clock exposed by the firmware called DISP, and used
> by (at least) the HVS. Let's add it to the list of clocks to register in
> Linux.
>
> Without this new definition driver fails at probe on BCM2712.
could you please explain the relation to Andrea's series [1]?

How can this occur, because there is no Raspberry Pi 5 support in Mainline?

[1] -
https://lore.kernel.org/linux-arm-kernel/cover.1717061147.git.andrea.porta@suse.com/
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
> ---
>   drivers/clk/bcm/clk-raspberrypi.c          | 5 +++++
>   include/soc/bcm2835/raspberrypi-firmware.h | 1 +
>   2 files changed, 6 insertions(+)
>
> diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> index 4d411408e4af..fabd5595e9cd 100644
> --- a/drivers/clk/bcm/clk-raspberrypi.c
> +++ b/drivers/clk/bcm/clk-raspberrypi.c
> @@ -34,6 +34,7 @@ static char *rpi_firmware_clk_names[] = {
>   	[RPI_FIRMWARE_M2MC_CLK_ID]	= "m2mc",
>   	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID]	= "pixel-bvb",
>   	[RPI_FIRMWARE_VEC_CLK_ID]	= "vec",
> +	[RPI_FIRMWARE_DISP_CLK_ID]	= "disp",
>   };
>
>   #define RPI_FIRMWARE_STATE_ENABLE_BIT	BIT(0)
> @@ -124,6 +125,10 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
>   	[RPI_FIRMWARE_VEC_CLK_ID] = {
>   		.export = true,
>   	},
> +	[RPI_FIRMWARE_DISP_CLK_ID] = {
> +		.export = true,
> +		.minimize = true,
> +	},
>   };
>
>   /*
> diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
> index 73cac8d0287e..e1f87fbfe554 100644
> --- a/include/soc/bcm2835/raspberrypi-firmware.h
> +++ b/include/soc/bcm2835/raspberrypi-firmware.h
> @@ -152,6 +152,7 @@ enum rpi_firmware_clk_id {
>   	RPI_FIRMWARE_M2MC_CLK_ID,
>   	RPI_FIRMWARE_PIXEL_BVB_CLK_ID,
>   	RPI_FIRMWARE_VEC_CLK_ID,
> +	RPI_FIRMWARE_DISP_CLK_ID,
>   	RPI_FIRMWARE_NUM_CLK_ID,
>   };
>
Ivan T . Ivanov May 31, 2024, 10:20 a.m. UTC | #2
Hi,

On 05-31 11:55, Stefan Wahren wrote:
> 
> Hi Ivan,
> 
> Am 31.05.24 um 11:27 schrieb Ivan T. Ivanov:
> > From: Maxime Ripard <maxime@cerno.tech>
> > 
> > BCM2712 has an extra clock exposed by the firmware called DISP, and used
> > by (at least) the HVS. Let's add it to the list of clocks to register in
> > Linux.
> > 
> > Without this new definition driver fails at probe on BCM2712.
> could you please explain the relation to Andrea's series [1]?
> 
> How can this occur, because there is no Raspberry Pi 5 support in Mainline?

I am using few out-of-tree drivers on top of the Andrea's patch-set
and noticed the failure, so decided to prepare the road for RPi5.

I am not entirely sure what are you asking.

Regards,
Ivan
Stefan Wahren May 31, 2024, 11:06 a.m. UTC | #3
Hi Ivan,

Am 31.05.24 um 12:20 schrieb Ivan T. Ivanov:
> Hi,
>
> On 05-31 11:55, Stefan Wahren wrote:
>> Hi Ivan,
>>
>> Am 31.05.24 um 11:27 schrieb Ivan T. Ivanov:
>>> From: Maxime Ripard <maxime@cerno.tech>
>>>
>>> BCM2712 has an extra clock exposed by the firmware called DISP, and used
>>> by (at least) the HVS. Let's add it to the list of clocks to register in
>>> Linux.
>>>
>>> Without this new definition driver fails at probe on BCM2712.
>> could you please explain the relation to Andrea's series [1]?
>>
>> How can this occur, because there is no Raspberry Pi 5 support in Mainline?
> I am using few out-of-tree drivers on top of the Andrea's patch-set
> and noticed the failure, so decided to prepare the road for RPi5.
okay and did you use the vendor DTB or Andreas' version?
> I am not entirely sure what are you asking.
Because Andreas DTS shouldn't require this patch and we usually don't
include changes which are not testable with Mainline Kernel.

Without a broader context this commit message is not self-explaining.

Best regards
>
> Regards,
> Ivan
>
Ivan T . Ivanov May 31, 2024, 11:18 a.m. UTC | #4
On 05-31 13:06, Stefan Wahren wrote:
> 
> Hi Ivan,
> 
> Am 31.05.24 um 12:20 schrieb Ivan T. Ivanov:
> > Hi,
> > 
> > On 05-31 11:55, Stefan Wahren wrote:
> > > Hi Ivan,
> > > 
> > > Am 31.05.24 um 11:27 schrieb Ivan T. Ivanov:
> > > > From: Maxime Ripard <maxime@cerno.tech>
> > > > 
> > > > BCM2712 has an extra clock exposed by the firmware called DISP, and used
> > > > by (at least) the HVS. Let's add it to the list of clocks to register in
> > > > Linux.
> > > > 
> > > > Without this new definition driver fails at probe on BCM2712.
> > > could you please explain the relation to Andrea's series [1]?
> > > 
> > > How can this occur, because there is no Raspberry Pi 5 support in Mainline?
> > I am using few out-of-tree drivers on top of the Andrea's patch-set
> > and noticed the failure, so decided to prepare the road for RPi5.
> okay and did you use the vendor DTB or Andreas' version?

Patches from Andrea don't have "raspberrypi,firmware-clocks" node.

> > I am not entirely sure what are you asking.
> Because Andreas DTS shouldn't require this patch and we usually don't
> include changes which are not testable with Mainline Kernel.
> 

So I should wait Andreas' patch set to be merged in before I can post
anything about RPi5?

Regards,
Ivan
Stefan Wahren May 31, 2024, 12:14 p.m. UTC | #5
Am 31.05.24 um 13:18 schrieb Ivan T. Ivanov:
> On 05-31 13:06, Stefan Wahren wrote:
>> Hi Ivan,
>>
>> Am 31.05.24 um 12:20 schrieb Ivan T. Ivanov:
>>> Hi,
>>>
>>> On 05-31 11:55, Stefan Wahren wrote:
>>>> Hi Ivan,
>>>>
>>>> Am 31.05.24 um 11:27 schrieb Ivan T. Ivanov:
>>>>> From: Maxime Ripard <maxime@cerno.tech>
>>>>>
>>>>> BCM2712 has an extra clock exposed by the firmware called DISP, and used
>>>>> by (at least) the HVS. Let's add it to the list of clocks to register in
>>>>> Linux.
>>>>>
>>>>> Without this new definition driver fails at probe on BCM2712.
>>>> could you please explain the relation to Andrea's series [1]?
>>>>
>>>> How can this occur, because there is no Raspberry Pi 5 support in Mainline?
>>> I am using few out-of-tree drivers on top of the Andrea's patch-set
>>> and noticed the failure, so decided to prepare the road for RPi5.
>> okay and did you use the vendor DTB or Andreas' version?
> Patches from Andrea don't have "raspberrypi,firmware-clocks" node.
That's the reason i'm asking :-)
>
>>> I am not entirely sure what are you asking.
>> Because Andreas DTS shouldn't require this patch and we usually don't
>> include changes which are not testable with Mainline Kernel.
>>
> So I should wait Andreas' patch set to be merged in before I can post
> anything about RPi5?
No, but it would be extremely helpful for the maintainers to know, which
patches (directly or indirectly) depend on which pending series. So a
comment below the commit message (at the same place as the patch
changelog) about this would be nice in this case.
>
> Regards,
> Ivan
>
diff mbox series

Patch

diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
index 4d411408e4af..fabd5595e9cd 100644
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -34,6 +34,7 @@  static char *rpi_firmware_clk_names[] = {
 	[RPI_FIRMWARE_M2MC_CLK_ID]	= "m2mc",
 	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID]	= "pixel-bvb",
 	[RPI_FIRMWARE_VEC_CLK_ID]	= "vec",
+	[RPI_FIRMWARE_DISP_CLK_ID]	= "disp",
 };
 
 #define RPI_FIRMWARE_STATE_ENABLE_BIT	BIT(0)
@@ -124,6 +125,10 @@  raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
 	[RPI_FIRMWARE_VEC_CLK_ID] = {
 		.export = true,
 	},
+	[RPI_FIRMWARE_DISP_CLK_ID] = {
+		.export = true,
+		.minimize = true,
+	},
 };
 
 /*
diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
index 73cac8d0287e..e1f87fbfe554 100644
--- a/include/soc/bcm2835/raspberrypi-firmware.h
+++ b/include/soc/bcm2835/raspberrypi-firmware.h
@@ -152,6 +152,7 @@  enum rpi_firmware_clk_id {
 	RPI_FIRMWARE_M2MC_CLK_ID,
 	RPI_FIRMWARE_PIXEL_BVB_CLK_ID,
 	RPI_FIRMWARE_VEC_CLK_ID,
+	RPI_FIRMWARE_DISP_CLK_ID,
 	RPI_FIRMWARE_NUM_CLK_ID,
 };