diff mbox series

ARM: dts: Configure rstctrl reset for SGX on AM3517

Message ID 20190821125502.32187-1-aford173@gmail.com (mailing list archive)
State New, archived
Headers show
Series ARM: dts: Configure rstctrl reset for SGX on AM3517 | expand

Commit Message

Adam Ford Aug. 21, 2019, 12:55 p.m. UTC
Based on Tony Lindgren's work for omap34xx, this patch applies the same
functionality to the AM3517.

The following can be tested via sysfs with the following to ensure the SGX
module gets enabled and disabled properly:

0x00010201

Bus error

Note that this patch depends on the PRM rstctrl driver that has
been recently posted. If the child device driver(s) need to prevent
rstctrl reset on PM runtime suspend, the drivers need to increase
the usecount for the shared rstctrl reset that can be mapped also
for the child device(s) or accessed via dev->parent.

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>

Signed-off-by: Adam Ford <aford173@gmail.com>

Comments

Tony Lindgren Aug. 23, 2019, 10:26 p.m. UTC | #1
* Adam Ford <aford173@gmail.com> [190821 12:55]:
> Based on Tony Lindgren's work for omap34xx, this patch applies the same
> functionality to the AM3517.
> 
> The following can be tested via sysfs with the following to ensure the SGX
> module gets enabled and disabled properly:
> 
> 0x00010201
> 
> Bus error

OK thanks for doing that.

> Note that this patch depends on the PRM rstctrl driver that has
> been recently posted. If the child device driver(s) need to prevent
> rstctrl reset on PM runtime suspend, the drivers need to increase
> the usecount for the shared rstctrl reset that can be mapped also
> for the child device(s) or accessed via dev->parent.

Care to check the subject and description again.. I don't think
this one uses rstctrl resets :)

Regards,

Tony
Adam Ford Aug. 26, 2019, 1:04 p.m. UTC | #2
On Fri, Aug 23, 2019 at 5:27 PM Tony Lindgren <tony@atomide.com> wrote:
>
> * Adam Ford <aford173@gmail.com> [190821 12:55]:
> > Based on Tony Lindgren's work for omap34xx, this patch applies the same
> > functionality to the AM3517.
> >
> > The following can be tested via sysfs with the following to ensure the SGX
> > module gets enabled and disabled properly:
> >
> > 0x00010201
> >
> > Bus error
>
> OK thanks for doing that.
>
> > Note that this patch depends on the PRM rstctrl driver that has
> > been recently posted. If the child device driver(s) need to prevent
> > rstctrl reset on PM runtime suspend, the drivers need to increase
> > the usecount for the shared rstctrl reset that can be mapped also
> > for the child device(s) or accessed via dev->parent.
>
> Care to check the subject and description again.. I don't think
> this one uses rstctrl resets :)

I am not entirely sure what your patch does, I just copied it from the
34xx to am3517.  Since the code is really yours, would it make sense
for you to push it and I respond with 'tested-by" message?  I don't
really want to claim it.  ;-)

adam
>
> Regards,
>
> Tony
Tony Lindgren Aug. 26, 2019, 2:47 p.m. UTC | #3
* Adam Ford <aford173@gmail.com> [190826 13:05]:
> On Fri, Aug 23, 2019 at 5:27 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > * Adam Ford <aford173@gmail.com> [190821 12:55]:
> > > Based on Tony Lindgren's work for omap34xx, this patch applies the same
> > > functionality to the AM3517.
> > >
> > > The following can be tested via sysfs with the following to ensure the SGX
> > > module gets enabled and disabled properly:
> > >
> > > 0x00010201
> > >
> > > Bus error
> >
> > OK thanks for doing that.
> >
> > > Note that this patch depends on the PRM rstctrl driver that has
> > > been recently posted. If the child device driver(s) need to prevent
> > > rstctrl reset on PM runtime suspend, the drivers need to increase
> > > the usecount for the shared rstctrl reset that can be mapped also
> > > for the child device(s) or accessed via dev->parent.
> >
> > Care to check the subject and description again.. I don't think
> > this one uses rstctrl resets :)
> 
> I am not entirely sure what your patch does, I just copied it from the
> 34xx to am3517.  Since the code is really yours, would it make sense
> for you to push it and I respond with 'tested-by" message?  I don't
> really want to claim it.  ;-)

Looks like you copied the commit from am335x patch, not from the omap3
patch. But I'll just drop the info about reset driver.

Regards,

Tony
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index 23ea381d363f..bf3002009b00 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -88,6 +88,30 @@ 
 			interrupts = <24>;
 			clocks = <&hecc_ck>;
 		};
+
+		/*
+		 * On am3517 the OCP registers do not seem to be accessible
+		 * similar to the omap34xx. Maybe SGX is permanently set to
+		 * "OCP bypass mode", or maybe there is OCP_SYSCONFIG that is
+		 * write-only at 0x50000e10. We detect SGX based on the SGX
+		 * revision register instead of the unreadable OCP revision
+		 * register.
+		 */
+		sgx_module: target-module@50000000 {
+			compatible = "ti,sysc-omap2", "ti,sysc";
+			reg = <0x50000014 0x4>;
+			reg-names = "rev";
+			clocks = <&sgx_fck>, <&sgx_ick>;
+			clock-names = "fck", "ick";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x50000000 0x4000>;
+
+			/*
+			 * Closed source PowerVR driver, no child device
+			 * binding or driver in mainline
+			 */
+		};
 	};
 };