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

ARM: dts: Configure interconnect target module for omap3 sgx

Looks like omap34xx OCP registers are not readable unlike on omap36xx.
We use SGX revision register instead of the OCP revision register for
34xx and do not configure any SYSCONFIG register unlike for 36xx.

I've tested that the interconnect target module enables and idles
just fine with PM runtime control via sys:

# echo on > $(find /sys -name control | grep \/5000); rwmem 0x5000fe10
# rwmem 0x50000014 # SGX revision register on 36xx
0x50000014 = 0x00010205
# echo auto > $(find /sys -name control | grep \/5000)
# rwmem 0x5000fe00
And when idled, it will produce "Bus error" as expected.

Cc: Adam Ford <aford173@gmail.com>
Cc: Filip Matijević <filip.matijevic.pz@gmail.com>
Cc: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: moaz korena <moaz@korena.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Cc: Philipp Rossak <embed3d@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Adam Ford <aford173@gmail.com> #logicpd-torpedo-37xx-devkit
Signed-off-by: Tony Lindgren <tony@atomide.com>

+54
+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 {