Add support for AM62L DSS
Subsystems (5)
v2 cover Add support for AM62L DSS
This adds support for DSS subsystem present in TI's AM62L SoC which supports single display pipeline with DPI output which is also routed to DSI Tx controller within the SoC.
Change Log:
V2:
- Fix incorrect format of compatible string (comma instead of hyphen) for AM62L SoC
- Use separate register space and helper functions for AM62L due to minor differences in register offset/bit position differences for first plane
Rangediff:V1->V2
- https://gist.github.com/devarsht/11d47f25ca9fea6976e6284330ddf443
NOTE: This series needs to be applied on top of AM62A dt-binding fix:
https://lore.kernel.org/all/[email protected]/
Devarsh Thakkar (2):
dt-bindings: display: ti,am65x-dss: Add support for AM62L DSS drm/tidss: Add support for AM62L display subsystem
.../bindings/display/ti/ti,am65x-dss.yaml | 25 +++- drivers/gpu/drm/tidss/tidss_dispc.c | 140 ++++++++++++++++++ drivers/gpu/drm/tidss/tidss_dispc.h | 2 + drivers/gpu/drm/tidss/tidss_drv.c | 1 + 4 files changed, 167 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.1
PATCH v2 1/2 dt-bindings: display: ti,am65x-dss: Add support for AM62L DSS
The DSS controller on TI's AM62L SoC is an update from that on TI's AM625/AM65x/AM62A7 SoC. The AM62L DSS [1] only supports a single display pipeline using a single overlay manager, single video port and a single video lite pipeline which does not support scaling.
The output of video port is routed to SoC boundary via DPI interface and the DPI signals from the video port are also routed to DSI Tx controller present within the SoC.
[1]: Section 11.7 (Display Subsystem and Peripherals)
---
- Add Reviewed-by
- s/ti,am62l,dss/ti,am62l-dss
NOTE: This patch needs to be applied on top of AM62A dt-binding fix:
https://lore.kernel.org/all/[email protected]/
.../bindings/display/ti/ti,am65x-dss.yaml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml +24 -1
@@ -12,18 +12,29 @@ maintainers: - Tomi Valkeinen <[email protected]> description: | - The AM625 and AM65x TI Keystone Display SubSystem with two output + The AM625 and AM65x TI Keystone Display SubSystem has two output ports and two video planes. In AM65x DSS, the first video port supports 1 OLDI TX and in AM625 DSS, the first video port output is internally routed to 2 OLDI TXes. The second video port supports DPI format. The first plane is full video plane with all features and the second is a "lite plane" without scaling support. + The AM62A7 display subsystem has a single output port supporting DPI format + although similar to AM625 and AM65x Socs, it has two video planes where first + is full video plane with all features and second is a video "lite" plane which + does not support scaling. + The AM62L display subsystem also has a single output port which supports DPI + format but it only supports single video "lite plane" which does not support + scaling. The output port is routed to SoC boundary via DPI interface and same + DPI signals are also routed internally to DSI Tx controller present within the + SoC. Due to clocking limitations only one of the interface i.e. either DSI or + DPI can be used at once. properties: compatible: enum: - ti,am625-dss - ti,am62a7-dss + - ti,am62l-dss - ti,am65x-dss reg:
@@ -91,6 +102,8 @@ properties: For AM625 DSS, the internal DPI output port node from video port 1. For AM62A7 DSS, the port is tied off inside the SoC. + For AM62L DSS, the DSS DPI output port node from video port 1 + or DSI Tx controller node connected to video port 1. port@1: $ref: /schemas/graph.yaml#/properties/port
@@ -123,6 +136,16 @@ allOf: ports: properties: port@0: false + - if: + properties: + compatible: + contains: + const: ti,am62l-dss + then: + properties: + ports: + properties: + port@1: false required: - compatible
Signature · 1 line
2.39.1
Re: [PATCH v2 1/2] dt-bindings: display: ti,am65x-dss: Add support for AM62L DSS
Hi,
Quoted 34 lines · Devarsh Thakkar
The DSS controller on TI's AM62L SoC is an update from that on TI's AM625/AM65x/AM62A7 SoC. The AM62L DSS [1] only supports a single display pipeline using a single overlay manager, single video port and a single video lite pipeline which does not support scaling.
The output of video port is routed to SoC boundary via DPI interface and the DPI signals from the video port are also routed to DSI Tx controller present within the SoC.
[1]: Section 11.7 (Display Subsystem and Peripherals)
Reviewed-by Krzysztof Kozlowski <[email protected]>Reviewed-by Jayesh Choudhary <[email protected]>Signed-off-by Devarsh Thakkar <[email protected]>---
- Add Reviewed-by
- s/ti,am62l,dss/ti,am62l-dssNOTE: This patch needs to be applied on top of AM62A dt-binding fix:
https://lore.kernel.org/all/[email protected]/.../bindings/display/ti/ti,am65x-dss.yaml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml +0
-1@@ -12,18 +12,29 @@ maintainers: - Tomi Valkeinen <[email protected]> description: | - The AM625 and AM65x TI Keystone Display SubSystem with two output
Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml maintainers: · line 24
Quoted 10 lines
Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml +5
-0+ The AM625 and AM65x TI Keystone Display SubSystem has two output ports and two video planes. In AM65x DSS, the first video port supports 1 OLDI TX and in AM625 DSS, the first video port output is internally routed to 2 OLDI TXes. The second video port supports DPI format. The first plane is full video plane with all features and the second is a "lite plane" without scaling support. + The AM62A7 display subsystem has a single output port supporting DPI format + although similar to AM625 and AM65x Socs, it has two video planes where first + is full video plane with all features and second is a video "lite" plane which + does not support scaling.
The part above doesn't belong into "add AM62L" patch. It's also quite confusing. "although similar to..."? Maybe drop the text "although similar to AM625 and AM65x Socs, ", and start a new sentence from "it"?
For the AM62L parts:
Tomi
Quoted 42 lines
Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml +19
-0+ The AM62L display subsystem also has a single output port which supports DPI + format but it only supports single video "lite plane" which does not support + scaling. The output port is routed to SoC boundary via DPI interface and same + DPI signals are also routed internally to DSI Tx controller present within the + SoC. Due to clocking limitations only one of the interface i.e. either DSI or + DPI can be used at once. properties: compatible: enum: - ti,am625-dss - ti,am62a7-dss + - ti,am62l-dss - ti,am65x-dss reg:@@ -91,6 +102,8 @@ properties: For AM625 DSS, the internal DPI output port node from video port 1. For AM62A7 DSS, the port is tied off inside the SoC. + For AM62L DSS, the DSS DPI output port node from video port 1 + or DSI Tx controller node connected to video port 1. port@1: $ref: /schemas/graph.yaml#/properties/port@@ -123,6 +136,16 @@ allOf: ports: properties: port@0: false + - if: + properties: + compatible: + contains: + const: ti,am62l-dss + then: + properties: + ports: + properties: + port@1: false required: - compatible
Re: [PATCH v2 1/2] dt-bindings: display: ti,am65x-dss: Add support for AM62L DSS
Hi Tomi,
Thanks for the review.
On 04/02/25 19:25, Tomi Valkeinen wrote:
<snip>
Quoted 15 lines
Quoted 6 lines
description: |
- The AM625 and AM65x TI Keystone Display SubSystem with two output + The AM625 and AM65x TI Keystone Display SubSystem has two output ports and two video planes. In AM65x DSS, the first video port supports 1 OLDI TX and in AM625 DSS, the first video port output is internally routed to 2 OLDI TXes. The second video port supports DPIQuoted 8 lines
format. The first plane is full video plane with all features and the second is a "lite plane" without scaling support.
+ The AM62A7 display subsystem has a single output port supporting DPI format + although similar to AM625 and AM65x Socs, it has two video planes where first
+ is full video plane with all features and second is a video "lite" plane which
+ does not support scaling.
Quoted 4 lines
The part above doesn't belong into "add AM62L" patch. It's also quite confusing. "although similar to..."? Maybe drop the text "although similar to AM625 and AM65x Socs, ", and start a new sentence from "it"?
Sure, I will split the patch for AM62A and correct above too.
Quoted 5 lines
For the AM62L parts:
Reviewed-by Tomi Valkeinen <[email protected]>Tomi
Regards
Devarsh
PATCH v2 2/2 drm/tidss: Add support for AM62L display subsystem
In reply to Devarsh ThakkarEnable display for AM62L DSS [1] which supports only a single display pipeline using a single overlay manager, single video port and a single video lite pipeline which does not support scaling.
The output of video port is routed to SoC boundary via DPI interface and the DPI signals from the video port are also routed to DSI Tx controller present within the SoC.
Use separate register space for AM62L since the DISPC_VID* regions for the first and only video lite pipeline start from a different offset than other existing K3 SoCs.
Use separate helper functions for enabling/disabling video pipeline interrupts and reading/clearing video pipeline interrupts since AM62L has a different start bit position for controlling these interrupts in context of first and only video lite pipeline compared to other existing K3 SoCs.
Also use separate function to set overlay attributes for AM62L as input channel value needs to be mandatorily set as 1 for the first and only video lite pipeline for this SoC.
[1]: Section 11.7 (Display Subsystem and Peripherals)
---
V2:
- Add separate common reg space for AM62L
- Add separate irq enable/disable/read/clear helpers for AM62L
- Use separate helper function for setting overlay attributes
- Drop Reviewed-by: Tomi Valkeinen <[email protected]> due to additional changes made in V2.
- Rangediff:
https://gist.github.com/devarsht/11d47f25ca9fea6976e6284330ddf443
drivers/gpu/drm/tidss/tidss_dispc.c | 140 ++++++++++++++++++++++++++++ drivers/gpu/drm/tidss/tidss_dispc.h | 2 + drivers/gpu/drm/tidss/tidss_drv.c | 1 + 3 files changed, 143 insertions(+)
drivers/gpu/drm/tidss/tidss_dispc.c +140 -0
@@ -136,6 +136,29 @@ static const u16 tidss_am65x_common_regs[DISPC_COMMON_REG_TABLE_LEN] = { [DISPC_SECURE_DISABLE_OFF] = 0xac, }; +static const u16 tidss_am62l_common_regs[DISPC_COMMON_REG_TABLE_LEN ] = { + [DSS_REVISION_OFF ] =0x4 , + [DSS_SYSCONFIG_OFF ] =0x8 , + [DSS_SYSSTATUS_OFF ] =0x20 , + [DISPC_IRQ_EOI_OFF ] =0x24 , + [DISPC_IRQSTATUS_RAW_OFF ] =0x28 , + [DISPC_IRQSTATUS_OFF ] =0x2c , + [DISPC_IRQENABLE_SET_OFF ] =0x30 , + [DISPC_IRQENABLE_CLR_OFF ] =0x40 , + [DISPC_VID_IRQENABLE_OFF ] =0x48 , + [DISPC_VID_IRQSTATUS_OFF ] =0x5c , + [DISPC_VP_IRQENABLE_OFF ] =0x70 , + [DISPC_VP_IRQSTATUS_OFF ] =0x7c , + + [DISPC_GLOBAL_MFLAG_ATTRIBUTE_OFF ] =0x90 , + [DISPC_GLOBAL_OUTPUT_ENABLE_OFF ] =0x94 , + [DSS_CBA_CFG_OFF ] =0x9c , + [DISPC_DBG_CONTROL_OFF ] =0xa0 , + [DISPC_DBG_STATUS_OFF ] =0xa4 , + [DISPC_CLKGATING_DISABLE_OFF ] =0xa8 , + [DISPC_SECURE_DISABLE_OFF ] =0xac , +}; +const struct dispc_features dispc_am65x_feats = { .max_pclk_khz = { [DISPC_VP_DPI ] =165000 ,
@@ -376,6 +399,35 @@ const struct dispc_features dispc_am62a7_feats = { .vid_order = { 1, 0 }, }; +const struct dispc_features dispc_am62l_feats = { + .max_pclk_khz = { + [DISPC_VP_DPI ] =165000 , + }, + + .subrev =DISPC_AM62L , + + .common ="common" , + .common_regs = tidss_am62l_common_regs, + + .num_vps =1 , + .vp_name = {"vp1" }, + .ovr_name = {"ovr1" }, + .vpclk_name = {"vp1" }, + .vp_bus_type = {DISPC_VP_DPI }, + + .vp_feat = { .color = { + .has_ctm = true, + .gamma_size =256 , + .gamma_type =TIDSS_GAMMA_8BIT , + }, + }, + + .num_planes =1 , + .vid_name = {"vidl1" }, + .vid_lite = { true }, + .vid_order = {0 }, +}; +static const u16 *dispc_common_regmap; struct dss_vp_data {
@@ -800,6 +852,40 @@ void dispc_k3_clear_irqstatus(struct dispc_device *dispc, dispc_irq_t clearmask)dispc_read (dispc,DISPC_IRQSTATUS ); } +static +void dispc_am62l_clear_irqstatus (struct dispc_device *dispc,dispc_irq_t clearmask) +{ +u32 top_clear =0 ; + +if (clearmask &DSS_IRQ_VP_MASK (0 )) { +dispc_k3_vp_write_irqstatus (dispc,0 , clearmask); + top_clear |=BIT (0 ); + } + +if (clearmask &DSS_IRQ_PLANE_MASK (0 )) { +dispc_k3_vid_write_irqstatus (dispc,0 , clearmask); + top_clear |=BIT (5 ); + } + +dispc_write (dispc,DISPC_IRQSTATUS , top_clear); + +/* Flush posted writes */ +dispc_read (dispc,DISPC_IRQSTATUS ); +} + +static +dispc_irq_t dispc_am62l_read_and_clear_irqstatus (struct dispc_device *dispc) +{ +dispc_irq_t status =0 ; + + status |=dispc_k3_vp_read_irqstatus (dispc,0 ); + status |=dispc_k3_vid_read_irqstatus (dispc,0 ); + +dispc_am62l_clear_irqstatus (dispc, status); + +return status; +} +static dispc_irq_t dispc_k3_read_and_clear_irqstatus (struct dispc_device *dispc) {
@@ -831,6 +917,39 @@ static dispc_irq_t dispc_k3_read_irqenable(struct dispc_device *dispc)return enable; } +static void dispc_am62l_set_irqenable (struct dispc_device *dispc, +dispc_irq_t mask) +{ +u32 main_enable =0 , main_disable =0 ; +dispc_irq_t old_mask; + + old_mask =dispc_k3_read_irqenable (dispc); + +/* clear the irqstatus for newly enabled irqs */ +dispc_am62l_clear_irqstatus (dispc, (old_mask ^ mask) & mask); + +dispc_k3_vp_set_irqenable (dispc,0 , mask); +if (mask &DSS_IRQ_VP_MASK (0 )) + main_enable |=BIT (0 );/* VP IRQ */ +else + main_disable |=BIT (0 );/* VP IRQ */ + +dispc_k3_vid_set_irqenable (dispc,0 , mask); +if (mask &DSS_IRQ_PLANE_MASK (0 )) + main_enable |=BIT (5 );/* VIDL IRQ */ +else + main_disable |=BIT (5 );/* VIDL IRQ */ + +if (main_enable) +dispc_write (dispc,DISPC_IRQENABLE_SET , main_enable); + +if (main_disable) +dispc_write (dispc,DISPC_IRQENABLE_CLR , main_disable); + +/* Flush posted writes */ +dispc_read (dispc,DISPC_IRQENABLE_SET ); +} +static void dispc_k3_set_irqenable (struct dispc_device *dispc,dispc_irq_t mask) {
@@ -879,6 +998,8 @@ dispc_irq_t dispc_read_and_clear_irqstatus(struct dispc_device *dispc)return dispc_k2g_read_and_clear_irqstatus (dispc);case DISPC_AM625 :case DISPC_AM62A7 : +case DISPC_AM62L : +return dispc_am62l_read_and_clear_irqstatus (dispc);case DISPC_AM65X :case DISPC_J721E :return dispc_k3_read_and_clear_irqstatus (dispc);
@@ -896,6 +1017,9 @@ void dispc_set_irqenable(struct dispc_device *dispc, dispc_irq_t mask)break ;case DISPC_AM625 :case DISPC_AM62A7 : +case DISPC_AM62L : +dispc_am62l_set_irqenable (dispc, mask); +break ;case DISPC_AM65X :case DISPC_J721E :dispc_k3_set_irqenable (dispc, mask);
@@ -1354,6 +1478,17 @@ static void dispc_k2g_ovr_set_plane(struct dispc_device *dispc, x | (y << 16)); } +static void dispc_am62l_ovr_set_plane (struct dispc_device *dispc, +u32 x,u32 y) +{ +OVR_REG_FLD_MOD (dispc,0 ,DISPC_OVR_ATTRIBUTES (0 ), +1 ,4 ,1 ); +OVR_REG_FLD_MOD (dispc,0 ,DISPC_OVR_ATTRIBUTES (0 ), + x,17 ,6 ); +OVR_REG_FLD_MOD (dispc,0 ,DISPC_OVR_ATTRIBUTES (0 ), + y,30 ,19 ); +} +static void dispc_am65x_ovr_set_plane (struct dispc_device *dispc,u32 hw_plane,u32 hw_videoport,u32 x,u32 y,u32 layer)
@@ -1388,6 +1523,9 @@ void dispc_ovr_set_plane(struct dispc_device *dispc, u32 hw_plane,break ;case DISPC_AM625 :case DISPC_AM62A7 : +case DISPC_AM62L : +dispc_am62l_ovr_set_plane (dispc, x, y); +break ;case DISPC_AM65X :dispc_am65x_ovr_set_plane (dispc, hw_plane, hw_videoport, x, y, layer);
@@ -2308,6 +2446,7 @@ static void dispc_plane_init(struct dispc_device *dispc)break ;case DISPC_AM625 :case DISPC_AM62A7 : +case DISPC_AM62L :case DISPC_AM65X :case DISPC_J721E :dispc_k3_plane_init (dispc);
@@ -2416,6 +2555,7 @@ static void dispc_vp_write_gamma_table(struct dispc_device *dispc,break ;case DISPC_AM625 :case DISPC_AM62A7 : +case DISPC_AM62L :case DISPC_AM65X :dispc_am65x_vp_write_gamma_table (dispc, hw_videoport);break ;
drivers/gpu/drm/tidss/tidss_dispc.h +2 -0
@@ -62,6 +62,7 @@ enum dispc_dss_subrevision {DISPC_K2G ,DISPC_AM625 ,DISPC_AM62A7 , +DISPC_AM62L ,DISPC_AM65X , DISPC_J721E, };
@@ -91,6 +92,7 @@ struct dispc_features {extern const struct dispc_features dispc_k2g_feats;extern const struct dispc_features dispc_am625_feats;extern const struct dispc_features dispc_am62a7_feats; +extern const struct dispc_features dispc_am62l_feats;extern const struct dispc_features dispc_am65x_feats;extern const struct dispc_features dispc_j721e_feats;
drivers/gpu/drm/tidss/tidss_drv.c +1 -0
@@ -242,6 +242,7 @@ static const struct of_device_id tidss_of_table[] = { { .compatible = "ti,k2g-dss", .data = &dispc_k2g_feats, }, { .compatible = "ti,am625-dss", .data = &dispc_am625_feats, }, { .compatible = "ti,am62a7-dss", .data = &dispc_am62a7_feats, }, + { .compatible = "ti,am62l-dss", .data = &dispc_am62l_feats, }, { .compatible = "ti,am65x-dss", .data = &dispc_am65x_feats, }, { .compatible = "ti,j721e-dss", .data = &dispc_j721e_feats, }, { }
Signature · 1 line
2.39.1