diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2014-07-07 11:41:26 +0200 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-07-18 16:11:39 +0800 |
commit | e57e4ab5fc2e4e58447d13493c3e567b61359523 (patch) | |
tree | f3da25ce0d4f4a59c4af48fcaa5949e317407691 /arch/arm/mach-imx/cpu.c | |
parent | b4de531716eb42fd074b28118bc51cef28f06e9a (diff) | |
download | op-kernel-dev-e57e4ab5fc2e4e58447d13493c3e567b61359523.zip op-kernel-dev-e57e4ab5fc2e4e58447d13493c3e567b61359523.tar.gz |
ARM: i.MX: allow disabling supervisor protect via DT
The i.MX SoCs allow to setup fine grained access rights to peripherals on the
AIPS bus.
This is done via the Peripheral Access Register (PAR) in e.g. the i.MX21
or in later SoC versions the Off-Platform Peripheral Access Control Register
(OPACR), e.g. i.MX53.
Under certain circumstances this leads to problems in which bus masters are
not granted their access rights to peripherals.
To be able to disable these restrictions on DT platforms, add a helper function
that looks for AIPS nodes in the DT and disables them for every compatible node
it finds.
The compatible has to be declared in the mach-specific entry file, where this
helper function should then be called.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/cpu.c')
-rw-r--r-- | arch/arm/mach-imx/cpu.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index bbe8ff1..df42c14 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -2,6 +2,7 @@ #include <linux/module.h> #include <linux/io.h> #include <linux/of.h> +#include <linux/of_address.h> #include <linux/slab.h> #include <linux/sys_soc.h> @@ -60,6 +61,18 @@ void __init imx_set_aips(void __iomem *base) __raw_writel(reg, base + 0x50); } +void __init imx_aips_allow_unprivileged_access( + const char *compat) +{ + void __iomem *aips_base_addr; + struct device_node *np; + + for_each_compatible_node(np, NULL, compat) { + aips_base_addr = of_iomap(np, 0); + imx_set_aips(aips_base_addr); + } +} + struct device * __init imx_soc_device_init(void) { struct soc_device_attribute *soc_dev_attr; |