Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'omap-for-v5.4/ti-sysc-sgx-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/late

SoC glue layer changes for SGX on omap variants for v5.4

For a while we've had omap4 sgx glue layer defined in dts and probed
with ti-sysc driver. This allows idling the sgx module for PM, and
removes the need for custom platform glue layer code for any further
driver changes.

We first drop the unused legacy platform data for omap4 sgx. Then for
omap5, we need add the missing clkctrl clock data so we can configure
sgx. And we configure sgx for omap34xx, omap36xx and am3517.

For am335x, we still have a dependency for rstctrl reset driver changes,
so that will be added later on.

Note that this branch is based on earlier ti-sysc branch for omap36xx
glue layer quirk handling.

* tag 'omap-for-v5.4/ti-sysc-sgx-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: dts: ARM: dts: Configure interconnect target module for am3517sgx
ARM: dts: Configure interconnect target module for omap3 sgx
ARM: dts: Configure sgx for omap5
clk: ti: add clkctrl data omap5 sgx
ARM: OMAP2+: Drop legacy platform data for omap4 gpu

Link: https://lore.kernel.org/r/pull-1567016893-318461@atomide.com-4
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+152 -54
+24
arch/arm/boot/dts/am3517.dtsi
··· 88 88 interrupts = <24>; 89 89 clocks = <&hecc_ck>; 90 90 }; 91 + 92 + /* 93 + * On am3517 the OCP registers do not seem to be accessible 94 + * similar to the omap34xx. Maybe SGX is permanently set to 95 + * "OCP bypass mode", or maybe there is OCP_SYSCONFIG that is 96 + * write-only at 0x50000e10. We detect SGX based on the SGX 97 + * revision register instead of the unreadable OCP revision 98 + * register. 99 + */ 100 + sgx_module: target-module@50000000 { 101 + compatible = "ti,sysc-omap2", "ti,sysc"; 102 + reg = <0x50000014 0x4>; 103 + reg-names = "rev"; 104 + clocks = <&sgx_fck>, <&sgx_ick>; 105 + clock-names = "fck", "ick"; 106 + #address-cells = <1>; 107 + #size-cells = <1>; 108 + ranges = <0 0x50000000 0x4000>; 109 + 110 + /* 111 + * Closed source PowerVR driver, no child device 112 + * binding or driver in mainline 113 + */ 114 + }; 91 115 }; 92 116 }; 93 117
+26
arch/arm/boot/dts/omap34xx.dtsi
··· 100 100 interrupts = <18>; 101 101 }; 102 102 }; 103 + 104 + /* 105 + * On omap34xx the OCP registers do not seem to be accessible 106 + * at all unlike on 36xx. Maybe SGX is permanently set to 107 + * "OCP bypass mode", or maybe there is OCP_SYSCONFIG that is 108 + * write-only at 0x50000e10. We detect SGX based on the SGX 109 + * revision register instead of the unreadable OCP revision 110 + * register. Also note that on early 34xx es1 revision there 111 + * are also different clocks, but we do not have any dts users 112 + * for it. 113 + */ 114 + sgx_module: target-module@50000000 { 115 + compatible = "ti,sysc-omap2", "ti,sysc"; 116 + reg = <0x50000014 0x4>; 117 + reg-names = "rev"; 118 + clocks = <&sgx_fck>, <&sgx_ick>; 119 + clock-names = "fck", "ick"; 120 + #address-cells = <1>; 121 + #size-cells = <1>; 122 + ranges = <0 0x50000000 0x4000>; 123 + 124 + /* 125 + * Closed source PowerVR driver, no child device 126 + * binding or driver in mainline 127 + */ 128 + }; 103 129 }; 104 130 105 131 thermal_zones: thermal-zones {
+28
arch/arm/boot/dts/omap36xx.dtsi
··· 139 139 interrupts = <18>; 140 140 }; 141 141 }; 142 + 143 + /* 144 + * Note that the sysconfig register layout is a subset of the 145 + * "ti,sysc-omap4" type register with just sidle and midle bits 146 + * available while omap34xx has "ti,sysc-omap2" type sysconfig. 147 + */ 148 + sgx_module: target-module@50000000 { 149 + compatible = "ti,sysc-omap4", "ti,sysc"; 150 + reg = <0x5000fe00 0x4>, 151 + <0x5000fe10 0x4>; 152 + reg-names = "rev", "sysc"; 153 + ti,sysc-midle = <SYSC_IDLE_FORCE>, 154 + <SYSC_IDLE_NO>, 155 + <SYSC_IDLE_SMART>; 156 + ti,sysc-sidle = <SYSC_IDLE_FORCE>, 157 + <SYSC_IDLE_NO>, 158 + <SYSC_IDLE_SMART>; 159 + clocks = <&sgx_fck>, <&sgx_ick>; 160 + clock-names = "fck", "ick"; 161 + #address-cells = <1>; 162 + #size-cells = <1>; 163 + ranges = <0 0x50000000 0x2000000>; 164 + 165 + /* 166 + * Closed source PowerVR driver, no child device 167 + * binding or driver in mainline 168 + */ 169 + }; 142 170 }; 143 171 144 172 thermal_zones: thermal-zones {
-1
arch/arm/boot/dts/omap4.dtsi
··· 330 330 331 331 target-module@56000000 { 332 332 compatible = "ti,sysc-omap4", "ti,sysc"; 333 - ti,hwmods = "gpu"; 334 333 reg = <0x5601fc00 0x4>, 335 334 <0x5601fc10 0x4>; 336 335 reg-names = "rev", "sysc";
+23
arch/arm/boot/dts/omap5.dtsi
··· 257 257 ports-implemented = <0x1>; 258 258 }; 259 259 260 + target-module@56000000 { 261 + compatible = "ti,sysc-omap4", "ti,sysc"; 262 + reg = <0x5600fe00 0x4>, 263 + <0x5600fe10 0x4>; 264 + reg-names = "rev", "sysc"; 265 + ti,sysc-midle = <SYSC_IDLE_FORCE>, 266 + <SYSC_IDLE_NO>, 267 + <SYSC_IDLE_SMART>; 268 + ti,sysc-sidle = <SYSC_IDLE_FORCE>, 269 + <SYSC_IDLE_NO>, 270 + <SYSC_IDLE_SMART>; 271 + clocks = <&gpu_clkctrl OMAP5_GPU_CLKCTRL 0>; 272 + clock-names = "fck"; 273 + #address-cells = <1>; 274 + #size-cells = <1>; 275 + ranges = <0 0x56000000 0x2000000>; 276 + 277 + /* 278 + * Closed source PowerVR driver, no child device 279 + * binding or driver in mainline 280 + */ 281 + }; 282 + 260 283 dss: dss@58000000 { 261 284 compatible = "ti,omap5-dss"; 262 285 reg = <0x58000000 0x80>;
+14
arch/arm/boot/dts/omap54xx-clocks.dtsi
··· 1146 1146 }; 1147 1147 }; 1148 1148 1149 + gpu_cm: clock-controller@1500 { 1150 + compatible = "ti,omap4-cm"; 1151 + reg = <0x1500 0x100>; 1152 + #address-cells = <1>; 1153 + #size-cells = <1>; 1154 + ranges = <0 0x1500 0x100>; 1155 + 1156 + gpu_clkctrl: clk@20 { 1157 + compatible = "ti,clkctrl"; 1158 + reg = <0x20 0x4>; 1159 + #clock-cells = <2>; 1160 + }; 1161 + }; 1162 + 1149 1163 l3init_cm: l3init_cm@1600 { 1150 1164 compatible = "ti,omap4-cm"; 1151 1165 reg = <0x1600 0x100>;
-53
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 1062 1062 }; 1063 1063 1064 1064 /* 1065 - * 'gpu' class 1066 - * 2d/3d graphics accelerator 1067 - */ 1068 - 1069 - static struct omap_hwmod_class_sysconfig omap44xx_gpu_sysc = { 1070 - .rev_offs = 0x1fc00, 1071 - .sysc_offs = 0x1fc10, 1072 - .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), 1073 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1074 - SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 1075 - MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 1076 - .sysc_fields = &omap_hwmod_sysc_type2, 1077 - }; 1078 - 1079 - static struct omap_hwmod_class omap44xx_gpu_hwmod_class = { 1080 - .name = "gpu", 1081 - .sysc = &omap44xx_gpu_sysc, 1082 - }; 1083 - 1084 - /* gpu */ 1085 - static struct omap_hwmod omap44xx_gpu_hwmod = { 1086 - .name = "gpu", 1087 - .class = &omap44xx_gpu_hwmod_class, 1088 - .clkdm_name = "l3_gfx_clkdm", 1089 - .main_clk = "sgx_clk_mux", 1090 - .prcm = { 1091 - .omap4 = { 1092 - .clkctrl_offs = OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET, 1093 - .context_offs = OMAP4_RM_GFX_GFX_CONTEXT_OFFSET, 1094 - .modulemode = MODULEMODE_SWCTRL, 1095 - }, 1096 - }, 1097 - }; 1098 - 1099 - /* 1100 1065 * 'hdq1w' class 1101 1066 * hdq / 1-wire serial interface controller 1102 1067 */ ··· 2482 2517 .user = OCP_USER_MPU | OCP_USER_SDMA, 2483 2518 }; 2484 2519 2485 - /* gpu -> l3_main_2 */ 2486 - static struct omap_hwmod_ocp_if omap44xx_gpu__l3_main_2 = { 2487 - .master = &omap44xx_gpu_hwmod, 2488 - .slave = &omap44xx_l3_main_2_hwmod, 2489 - .clk = "l3_div_ck", 2490 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2491 - }; 2492 - 2493 2520 /* hsi -> l3_main_2 */ 2494 2521 static struct omap_hwmod_ocp_if omap44xx_hsi__l3_main_2 = { 2495 2522 .master = &omap44xx_hsi_hwmod, ··· 2898 2941 .user = OCP_USER_MPU | OCP_USER_SDMA, 2899 2942 }; 2900 2943 2901 - /* l3_main_2 -> gpu */ 2902 - static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpu = { 2903 - .master = &omap44xx_l3_main_2_hwmod, 2904 - .slave = &omap44xx_gpu_hwmod, 2905 - .clk = "l3_div_ck", 2906 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2907 - }; 2908 - 2909 2944 /* l4_per -> hdq1w */ 2910 2945 static struct omap_hwmod_ocp_if omap44xx_l4_per__hdq1w = { 2911 2946 .master = &omap44xx_l4_per_hwmod, ··· 3288 3339 &omap44xx_debugss__l3_main_2, 3289 3340 &omap44xx_dma_system__l3_main_2, 3290 3341 &omap44xx_fdif__l3_main_2, 3291 - &omap44xx_gpu__l3_main_2, 3292 3342 &omap44xx_hsi__l3_main_2, 3293 3343 &omap44xx_ipu__l3_main_2, 3294 3344 &omap44xx_iss__l3_main_2, ··· 3339 3391 &omap44xx_l4_per__elm, 3340 3392 &omap44xx_l4_cfg__fdif, 3341 3393 &omap44xx_l3_main_2__gpmc, 3342 - &omap44xx_l3_main_2__gpu, 3343 3394 &omap44xx_l4_per__hdq1w, 3344 3395 &omap44xx_l4_cfg__hsi, 3345 3396 &omap44xx_l3_main_2__ipu,
+34
drivers/clk/ti/clk-54xx.c
··· 314 314 { 0 }, 315 315 }; 316 316 317 + static const char * const omap5_gpu_core_mux_parents[] __initconst = { 318 + "dpll_core_h14x2_ck", 319 + "dpll_per_h14x2_ck", 320 + NULL, 321 + }; 322 + 323 + static const char * const omap5_gpu_hyd_mux_parents[] __initconst = { 324 + "dpll_core_h14x2_ck", 325 + "dpll_per_h14x2_ck", 326 + NULL, 327 + }; 328 + 329 + static const char * const omap5_gpu_sys_clk_parents[] __initconst = { 330 + "sys_clkin", 331 + NULL, 332 + }; 333 + 334 + static const struct omap_clkctrl_div_data omap5_gpu_sys_clk_data __initconst = { 335 + .max_div = 2, 336 + }; 337 + 338 + static const struct omap_clkctrl_bit_data omap5_gpu_core_bit_data[] __initconst = { 339 + { 24, TI_CLK_MUX, omap5_gpu_core_mux_parents, NULL }, 340 + { 25, TI_CLK_MUX, omap5_gpu_hyd_mux_parents, NULL }, 341 + { 26, TI_CLK_DIVIDER, omap5_gpu_sys_clk_parents, &omap5_gpu_sys_clk_data }, 342 + { 0 }, 343 + }; 344 + 345 + static const struct omap_clkctrl_reg_data omap5_gpu_clkctrl_regs[] __initconst = { 346 + { OMAP5_GPU_CLKCTRL, omap5_gpu_core_bit_data, CLKF_SW_SUP, "gpu_cm:clk:0000:24" }, 347 + { 0 }, 348 + }; 349 + 317 350 static const char * const omap5_mmc1_fclk_mux_parents[] __initconst = { 318 351 "func_128m_clk", 319 352 "dpll_per_m2x2_ck", ··· 503 470 { 0x4a008e20, omap5_l3instr_clkctrl_regs }, 504 471 { 0x4a009020, omap5_l4per_clkctrl_regs }, 505 472 { 0x4a009420, omap5_dss_clkctrl_regs }, 473 + { 0x4a009520, omap5_gpu_clkctrl_regs }, 506 474 { 0x4a009620, omap5_l3init_clkctrl_regs }, 507 475 { 0x4ae07920, omap5_wkupaon_clkctrl_regs }, 508 476 { 0 },
+3
include/dt-bindings/clock/omap5.h
··· 89 89 /* dss clocks */ 90 90 #define OMAP5_DSS_CORE_CLKCTRL OMAP5_CLKCTRL_INDEX(0x20) 91 91 92 + /* gpu clocks */ 93 + #define OMAP5_GPU_CLKCTRL OMAP5_CLKCTRL_INDEX(0x20) 94 + 92 95 /* l3init clocks */ 93 96 #define OMAP5_MMC1_CLKCTRL OMAP5_CLKCTRL_INDEX(0x28) 94 97 #define OMAP5_MMC2_CLKCTRL OMAP5_CLKCTRL_INDEX(0x30)