Message ID | 20220422072841.2206452-17-s.hauer@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/rockchip: RK356x VOP2 support | expand |
Am Freitag, 22. April 2022, 09:28:33 CEST schrieb Sascha Hauer: > The VOP2 is the display output controller on the RK3568. Add the node > for it to the dtsi file along with the required display-subsystem node > and the iommu node. > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > Acked-by: Rob Herring <robh@kernel.org> > --- > > Notes: > Changes since v6: > - Change RK3568_ prefix to ROCKCHIP_ prefix > - start counting from one instead of zero > > Changes since v4: > - Add Robs Ack > > Changes since v3: > - Bring back gamma_lut regs > - Drop redundant _vop suffix from clock names > > arch/arm64/boot/dts/rockchip/rk3566.dtsi | 4 ++ > arch/arm64/boot/dts/rockchip/rk3568.dtsi | 4 ++ > arch/arm64/boot/dts/rockchip/rk356x.dtsi | 51 ++++++++++++++++++++++++ > include/dt-bindings/soc/rockchip,vop2.h | 14 +++++++ > 4 files changed, 73 insertions(+) > create mode 100644 include/dt-bindings/soc/rockchip,vop2.h > > diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > index 3839eef5e4f76..595fa2562cb8e 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi > @@ -18,3 +18,7 @@ power-domain@RK3568_PD_PIPE { > #power-domain-cells = <0>; > }; > }; > + > +&vop { > + compatible = "rockchip,rk3566-vop"; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > index 5b0f528d68180..4deab90e83834 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi > @@ -114,3 +114,7 @@ power-domain@RK3568_PD_PIPE { > #power-domain-cells = <0>; > }; > }; > + > +&vop { > + compatible = "rockchip,rk3568-vop"; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > index 7cdef800cb3ce..fdb7a9a6ca743 100644 > --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > @@ -129,6 +129,11 @@ opp-1800000000 { > }; > }; > > + display_subsystem: display-subsystem { > + compatible = "rockchip,display-subsystem"; > + ports = <&vop_out>; > + }; > + > firmware { > scmi: scmi { > compatible = "arm,scmi-smc"; > @@ -569,6 +574,52 @@ gmac1_mtl_tx_setup: tx-queues-config { > }; > }; > > + vop: vop@fe040000 { > + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; > + reg-names = "regs", "gamma_lut"; reg-names does not seem to be part of the dt-binding. Though now in the vop2-driver I see that the code uses that naming. I guess we might want to just go the vop1-way by using numbered platform-resources via a follow-up patch and drop the regnames here? Heiko > + interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>, <&cru DCLK_VOP0>, > + <&cru DCLK_VOP1>, <&cru DCLK_VOP2>; > + clock-names = "aclk", "hclk", "dclk_vp0", "dclk_vp1", "dclk_vp2"; > + iommus = <&vop_mmu>; > + power-domains = <&power RK3568_PD_VO>; > + rockchip,grf = <&grf>; > + status = "disabled"; > + > + vop_out: ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + vp0: port@0 { > + reg = <0>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + > + vp1: port@1 { > + reg = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + > + vp2: port@2 { > + reg = <2>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + }; > + }; > + > + vop_mmu: iommu@fe043e00 { > + compatible = "rockchip,rk3568-iommu"; > + reg = <0x0 0xfe043e00 0x0 0x100>, <0x0 0xfe043f00 0x0 0x100>; > + interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>; > + clock-names = "aclk", "iface"; > + #iommu-cells = <0>; > + status = "disabled"; > + }; > + > qos_gpu: qos@fe128000 { > compatible = "rockchip,rk3568-qos", "syscon"; > reg = <0x0 0xfe128000 0x0 0x20>; > diff --git a/include/dt-bindings/soc/rockchip,vop2.h b/include/dt-bindings/soc/rockchip,vop2.h > new file mode 100644 > index 0000000000000..6e66a802b96a5 > --- /dev/null > +++ b/include/dt-bindings/soc/rockchip,vop2.h > @@ -0,0 +1,14 @@ > +/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ > + > +#ifndef __DT_BINDINGS_ROCKCHIP_VOP2_H > +#define __DT_BINDINGS_ROCKCHIP_VOP2_H > + > +#define ROCKCHIP_VOP2_EP_RGB0 1 > +#define ROCKCHIP_VOP2_EP_HDMI0 2 > +#define ROCKCHIP_VOP2_EP_EDP0 3 > +#define ROCKCHIP_VOP2_EP_MIPI0 4 > +#define ROCKCHIP_VOP2_EP_LVDS0 5 > +#define ROCKCHIP_VOP2_EP_MIPI1 6 > +#define ROCKCHIP_VOP2_EP_LVDS1 7 > + > +#endif /* __DT_BINDINGS_ROCKCHIP_VOP2_H */ >
On Thu, May 05, 2022 at 02:28:24AM +0200, Heiko Stübner wrote: > Am Freitag, 22. April 2022, 09:28:33 CEST schrieb Sascha Hauer: > > The VOP2 is the display output controller on the RK3568. Add the node > > for it to the dtsi file along with the required display-subsystem node > > and the iommu node. > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > Acked-by: Rob Herring <robh@kernel.org> > > --- > > + vop: vop@fe040000 { > > + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; > > + reg-names = "regs", "gamma_lut"; > > reg-names does not seem to be part of the dt-binding. > Though now in the vop2-driver I see that the code uses that naming. > > I guess we might want to just go the vop1-way by using numbered > platform-resources via a follow-up patch and drop the regnames here? Or we could document the reg-names properties in a follow-up patch. Wouldn't that be better? Sascha
Am Donnerstag, 5. Mai 2022, 08:41:31 CEST schrieb Sascha Hauer: > On Thu, May 05, 2022 at 02:28:24AM +0200, Heiko Stübner wrote: > > Am Freitag, 22. April 2022, 09:28:33 CEST schrieb Sascha Hauer: > > > The VOP2 is the display output controller on the RK3568. Add the node > > > for it to the dtsi file along with the required display-subsystem node > > > and the iommu node. > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > > Acked-by: Rob Herring <robh@kernel.org> > > > --- > > > + vop: vop@fe040000 { > > > + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; > > > + reg-names = "regs", "gamma_lut"; > > > > reg-names does not seem to be part of the dt-binding. > > Though now in the vop2-driver I see that the code uses that naming. > > > > I guess we might want to just go the vop1-way by using numbered > > platform-resources via a follow-up patch and drop the regnames here? > > Or we could document the reg-names properties in a follow-up patch. > Wouldn't that be better? Also a possibility. Although that of course leads us into the naming bike-shed ;-) ... i.e. for reg-names I'd do "vop" + "gamme-lut" (dash instead of underscore) - instead of the ones used right now. While using numbered resources would keep the commonality between both vops
On Thu, May 05, 2022 at 09:23:03AM +0200, Heiko Stübner wrote: > Am Donnerstag, 5. Mai 2022, 08:41:31 CEST schrieb Sascha Hauer: > > On Thu, May 05, 2022 at 02:28:24AM +0200, Heiko Stübner wrote: > > > Am Freitag, 22. April 2022, 09:28:33 CEST schrieb Sascha Hauer: > > > > The VOP2 is the display output controller on the RK3568. Add the node > > > > for it to the dtsi file along with the required display-subsystem node > > > > and the iommu node. > > > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > > > Acked-by: Rob Herring <robh@kernel.org> > > > > --- > > > > + vop: vop@fe040000 { > > > > + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; > > > > + reg-names = "regs", "gamma_lut"; > > > > > > reg-names does not seem to be part of the dt-binding. > > > Though now in the vop2-driver I see that the code uses that naming. > > > > > > I guess we might want to just go the vop1-way by using numbered > > > platform-resources via a follow-up patch and drop the regnames here? > > > > Or we could document the reg-names properties in a follow-up patch. > > Wouldn't that be better? > > Also a possibility. Although that of course leads us into the naming > bike-shed ;-) ... i.e. for reg-names I'd do "vop" + "gamme-lut" (dash instead > of underscore) - instead of the ones used right now. I also like dashes better than underscores and "vop" describes it better than the generic "reg" name, so at least the two of us don't need to dive deeper into the naming bike-shed ;) > > While using numbered resources would keep the commonality between > both vops I like the named resources better, but I'll leave it up to you. You decide, I'll create fixup patches in either direction. Sascha
Am Freitag, 6. Mai 2022, 09:10:28 CEST schrieb Sascha Hauer: > On Thu, May 05, 2022 at 09:23:03AM +0200, Heiko Stübner wrote: > > Am Donnerstag, 5. Mai 2022, 08:41:31 CEST schrieb Sascha Hauer: > > > On Thu, May 05, 2022 at 02:28:24AM +0200, Heiko Stübner wrote: > > > > Am Freitag, 22. April 2022, 09:28:33 CEST schrieb Sascha Hauer: > > > > > The VOP2 is the display output controller on the RK3568. Add the node > > > > > for it to the dtsi file along with the required display-subsystem node > > > > > and the iommu node. > > > > > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > > > > Acked-by: Rob Herring <robh@kernel.org> > > > > > --- > > > > > + vop: vop@fe040000 { > > > > > + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; > > > > > + reg-names = "regs", "gamma_lut"; > > > > > > > > reg-names does not seem to be part of the dt-binding. > > > > Though now in the vop2-driver I see that the code uses that naming. > > > > > > > > I guess we might want to just go the vop1-way by using numbered > > > > platform-resources via a follow-up patch and drop the regnames here? > > > > > > Or we could document the reg-names properties in a follow-up patch. > > > Wouldn't that be better? > > > > Also a possibility. Although that of course leads us into the naming > > bike-shed ;-) ... i.e. for reg-names I'd do "vop" + "gamme-lut" (dash instead > > of underscore) - instead of the ones used right now. > > I also like dashes better than underscores and "vop" describes it better > than the generic "reg" name, so at least the two of us don't need to > dive deeper into the naming bike-shed ;) :-D ... one problem solved already > > While using numbered resources would keep the commonality between > > both vops > > I like the named resources better, but I'll leave it up to you. You > decide, I'll create fixup patches in either direction. ok, then let's go with the named-resources. As we'll need an Ack from DT-people, we should probably expedite this. Ideally I guess, do the dt-binding fixup + resend the fixed dt-node patches with it. From the original series those dt-nodes + the hdmi rate stuff is the only thing missing and the rates can be a separate thing. Heiko
diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi index 3839eef5e4f76..595fa2562cb8e 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi @@ -18,3 +18,7 @@ power-domain@RK3568_PD_PIPE { #power-domain-cells = <0>; }; }; + +&vop { + compatible = "rockchip,rk3566-vop"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi index 5b0f528d68180..4deab90e83834 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi @@ -114,3 +114,7 @@ power-domain@RK3568_PD_PIPE { #power-domain-cells = <0>; }; }; + +&vop { + compatible = "rockchip,rk3568-vop"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 7cdef800cb3ce..fdb7a9a6ca743 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -129,6 +129,11 @@ opp-1800000000 { }; }; + display_subsystem: display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop_out>; + }; + firmware { scmi: scmi { compatible = "arm,scmi-smc"; @@ -569,6 +574,52 @@ gmac1_mtl_tx_setup: tx-queues-config { }; }; + vop: vop@fe040000 { + reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>; + reg-names = "regs", "gamma_lut"; + interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>, <&cru DCLK_VOP0>, + <&cru DCLK_VOP1>, <&cru DCLK_VOP2>; + clock-names = "aclk", "hclk", "dclk_vp0", "dclk_vp1", "dclk_vp2"; + iommus = <&vop_mmu>; + power-domains = <&power RK3568_PD_VO>; + rockchip,grf = <&grf>; + status = "disabled"; + + vop_out: ports { + #address-cells = <1>; + #size-cells = <0>; + + vp0: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + vp1: port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + vp2: port@2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + vop_mmu: iommu@fe043e00 { + compatible = "rockchip,rk3568-iommu"; + reg = <0x0 0xfe043e00 0x0 0x100>, <0x0 0xfe043f00 0x0 0x100>; + interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + status = "disabled"; + }; + qos_gpu: qos@fe128000 { compatible = "rockchip,rk3568-qos", "syscon"; reg = <0x0 0xfe128000 0x0 0x20>; diff --git a/include/dt-bindings/soc/rockchip,vop2.h b/include/dt-bindings/soc/rockchip,vop2.h new file mode 100644 index 0000000000000..6e66a802b96a5 --- /dev/null +++ b/include/dt-bindings/soc/rockchip,vop2.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ + +#ifndef __DT_BINDINGS_ROCKCHIP_VOP2_H +#define __DT_BINDINGS_ROCKCHIP_VOP2_H + +#define ROCKCHIP_VOP2_EP_RGB0 1 +#define ROCKCHIP_VOP2_EP_HDMI0 2 +#define ROCKCHIP_VOP2_EP_EDP0 3 +#define ROCKCHIP_VOP2_EP_MIPI0 4 +#define ROCKCHIP_VOP2_EP_LVDS0 5 +#define ROCKCHIP_VOP2_EP_MIPI1 6 +#define ROCKCHIP_VOP2_EP_LVDS1 7 + +#endif /* __DT_BINDINGS_ROCKCHIP_VOP2_H */