@@ -37,41 +37,49 @@ static const display_config_t display_config_m1 = {
3737 .dcp_dart = "/arm-io/dart-dcp" ,
3838 .disp_dart = "/arm-io/dart-disp0" ,
3939 .pmgr_dev = "DISP0_CPU0" ,
40+ .dcp_alias = "dcp" ,
4041};
4142
43+ #define USE_DCPEXT 1
44+
4245static const display_config_t display_config_m2 = {
46+ #if USE_DCPEXT
47+ .dcp = "/arm-io/dcpext" ,
48+ .dcp_dart = "/arm-io/dart-dcpext" ,
49+ .disp_dart = "/arm-io/dart-dispext0" ,
50+ .pmgr_dev = "DISPEXT_CPU0" ,
51+ .dcp_alias = "dcpext" ,
52+ .dcp_index = 1 ,
53+ #else
4354 .dcp = "/arm-io/dcp" ,
4455 .dcp_dart = "/arm-io/dart-dcp" ,
4556 .disp_dart = "/arm-io/dart-disp0" ,
4657 .dp2hdmi_gpio = "/arm-io/dp2hdmi-gpio" ,
4758 .dptx_phy = "/arm-io/dptx-phy" ,
4859 .pmgr_dev = "DISP0_CPU0" ,
60+ .dcp_alias = "dcp" ,
4961 .dcp_index = 0 ,
62+ #endif
63+ .dp2hdmi_gpio = "/arm-io/dp2hdmi-gpio" ,
64+ .dptx_phy = "/arm-io/dptx-phy" ,
5065 .num_dptxports = 2 ,
5166};
5267
53- #define T6020_T6021_USE_DCPEXT 255
54-
5568static const display_config_t display_config_m2_pro_max = {
56- #if T6020_T6021_USE_DCPEXT == 0
69+ #if USE_DCPEXT
5770 .dcp = "/arm-io/dcpext0" ,
5871 .dcp_dart = "/arm-io/dart-dcpext0" ,
5972 .disp_dart = "/arm-io/dart-dispext0" ,
6073 .pmgr_dev = "DISPEXT0_CPU0" ,
74+ .dcp_alias = "dcpext0" ,
6175 .dcp_index = 1 ,
6276 .num_dptxports = 2 ,
63- #elif T6020_T6021_USE_DCPEXT == 1
64- .dcp = "/arm-io/dcpext1" ,
65- .dcp_dart = "/arm-io/dart-dcpext1" ,
66- .disp_dart = "/arm-io/dart-dispext1" ,
67- .pmgr_dev = "DISPEXT1_CPU0" ,
68- .dcp_index = 2 ,
69- .num_dptxports = 2 ,
7077#else
7178 .dcp = "/arm-io/dcp0" ,
7279 .dcp_dart = "/arm-io/dart-dcp0" ,
7380 .disp_dart = "/arm-io/dart-disp0" ,
7481 .pmgr_dev = "DISP0_CPU0" ,
82+ .dcp_alias = "dcp" ,
7583 .dcp_index = 0 ,
7684 .num_dptxports = 1 ,
7785#endif
@@ -86,6 +94,7 @@ static const display_config_t display_config_m2_ultra = {
8694 .dp2hdmi_gpio = "/arm-io/dp2hdmi-gpio1" ,
8795 .dptx_phy = "/arm-io/lpdptx-phy1" ,
8896 .pmgr_dev = "DISPEXT4_CPU0" ,
97+ .dcp_alias = "dcpext4" ,
8998 .dcp_index = 1 ,
9099 .num_dptxports = 2 ,
91100 .die = 1 ,
@@ -222,6 +231,18 @@ static uintptr_t display_map_fb(uintptr_t iova, u64 paddr, u64 size)
222231 return iova ;
223232}
224233
234+ const display_config_t * display_get_config (void )
235+ {
236+ if (adt_is_compatible (adt , 0 , "J473AP" ))
237+ return & display_config_m2 ;
238+ else if (adt_is_compatible (adt , 0 , "J474sAP" ) || adt_is_compatible (adt , 0 , "J475cAP" ))
239+ return & display_config_m2_pro_max ;
240+ else if (adt_is_compatible (adt , 0 , "J180dAP" ) || adt_is_compatible (adt , 0 , "J475dAP" ))
241+ return & display_config_m2_ultra ;
242+ else
243+ return & display_config_m1 ;
244+ }
245+
225246int display_start_dcp (void )
226247{
227248 if (iboot )
@@ -232,14 +253,7 @@ int display_start_dcp(void)
232253 return 0 ;
233254#endif
234255
235- const display_config_t * disp_cfg = & display_config_m1 ;
236-
237- if (adt_is_compatible (adt , 0 , "J473AP" ))
238- disp_cfg = & display_config_m2 ;
239- else if (adt_is_compatible (adt , 0 , "J474sAP" ) || adt_is_compatible (adt , 0 , "J475cAP" ))
240- disp_cfg = & display_config_m2_pro_max ;
241- else if (adt_is_compatible (adt , 0 , "J180dAP" ) || adt_is_compatible (adt , 0 , "J475dAP" ))
242- disp_cfg = & display_config_m2_ultra ;
256+ const display_config_t * disp_cfg = display_get_config ();
243257
244258 display_is_dptx = !!disp_cfg -> dptx_phy [0 ];
245259
0 commit comments