diff mbox

[v4,2/2] ARM: i.MX53: globally disable supervisor protect

Message ID 1404726087-2069-2-git-send-email-s.trumtrar@pengutronix.de
State New
Headers show

Commit Message

Steffen Trumtrar July 7, 2014, 9:41 a.m. UTC
Most peripherals on the i.MX53 have an
  Off-Platform Peripheral Access Control Register (OPACR)
in which the access rights (together with the MPROT registers) can be declared.
However, this does not seem to work for example for SSI1+SDMA, because the
supervisor bit is not set for the SDMA unit.
It does work for SSI2, the QSB for example uses SSI2 for its audio. But SSI2 only
works because it does NOT have an OPACR.

The right solution would be to fix the access rights for the SDMA, but the unit
responsible for this is the Central Security Unit (CSU), which of course is NOT
documented. So, until documentation for this is openly available, turn off the
supervisor protection because it cripples the hardware.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/mach-imx/mach-imx53.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Shawn Guo July 7, 2014, 2:04 p.m. UTC | #1
On Mon, Jul 07, 2014 at 11:41:27AM +0200, Steffen Trumtrar wrote:
> Most peripherals on the i.MX53 have an
>   Off-Platform Peripheral Access Control Register (OPACR)
> in which the access rights (together with the MPROT registers) can be declared.
> However, this does not seem to work for example for SSI1+SDMA, because the
> supervisor bit is not set for the SDMA unit.
> It does work for SSI2, the QSB for example uses SSI2 for its audio. But SSI2 only
> works because it does NOT have an OPACR.
> 
> The right solution would be to fix the access rights for the SDMA, but the unit
> responsible for this is the Central Security Unit (CSU), which of course is NOT
> documented. So, until documentation for this is openly available, turn off the
> supervisor protection because it cripples the hardware.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
>  arch/arm/mach-imx/mach-imx53.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
> index 2bad387..1fbd77d 100644
> --- a/arch/arm/mach-imx/mach-imx53.c
> +++ b/arch/arm/mach-imx/mach-imx53.c
> @@ -26,9 +26,13 @@
>  
>  static void __init imx53_dt_init(void)
>  {
> +	const char *aips_compatible = "fsl,imx53-aipstz";
> +

The variable is not really necessary, since we can just do:

	imx_aips_allow_unprivileged_access("fsl,imx53-aipstz");

I'm going to fix it up and apply both patches.  Let me know if you have
concern with that.

Shawn

>  	mxc_arch_reset_init_dt();
>  
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> +
> +	imx_aips_allow_unprivileged_access(aips_compatible);
>  }
>  
>  static const char *imx53_dt_board_compat[] __initconst = {
> -- 
> 2.0.0
>
Steffen Trumtrar July 7, 2014, 4:16 p.m. UTC | #2
Hi!

On Mon, Jul 07, 2014 at 10:04:18PM +0800, Shawn Guo wrote:
> On Mon, Jul 07, 2014 at 11:41:27AM +0200, Steffen Trumtrar wrote:
> > Most peripherals on the i.MX53 have an
> >   Off-Platform Peripheral Access Control Register (OPACR)
> > in which the access rights (together with the MPROT registers) can be declared.
> > However, this does not seem to work for example for SSI1+SDMA, because the
> > supervisor bit is not set for the SDMA unit.
> > It does work for SSI2, the QSB for example uses SSI2 for its audio. But SSI2 only
> > works because it does NOT have an OPACR.
> > 
> > The right solution would be to fix the access rights for the SDMA, but the unit
> > responsible for this is the Central Security Unit (CSU), which of course is NOT
> > documented. So, until documentation for this is openly available, turn off the
> > supervisor protection because it cripples the hardware.
> > 
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > ---
> >  arch/arm/mach-imx/mach-imx53.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
> > index 2bad387..1fbd77d 100644
> > --- a/arch/arm/mach-imx/mach-imx53.c
> > +++ b/arch/arm/mach-imx/mach-imx53.c
> > @@ -26,9 +26,13 @@
> >  
> >  static void __init imx53_dt_init(void)
> >  {
> > +	const char *aips_compatible = "fsl,imx53-aipstz";
> > +
> 
> The variable is not really necessary, since we can just do:
> 
> 	imx_aips_allow_unprivileged_access("fsl,imx53-aipstz");
> 
> I'm going to fix it up and apply both patches.  Let me know if you have
> concern with that.
> 

I'm okay with that. I don't really have any preference here, so
do as you like best.

Thanks,
Steffen
diff mbox

Patch

diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 2bad387..1fbd77d 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -26,9 +26,13 @@ 
 
 static void __init imx53_dt_init(void)
 {
+	const char *aips_compatible = "fsl,imx53-aipstz";
+
 	mxc_arch_reset_init_dt();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+	imx_aips_allow_unprivileged_access(aips_compatible);
 }
 
 static const char *imx53_dt_board_compat[] __initconst = {