Skip to content

Commit 26279c8

Browse files
TE-N-ShengjiuWangnxpfrankli
authored andcommitted
bus: imx-aipstz: set default value for opacr registers
The sdma script app_2_mcu needs the permission to access the peripheral devices: 1) SDMA2 transactions are set to user-mode in this particular case. 2) This type of script doesn't use the peripheral interface (connected directly to SPBA), but it uses the peripheral DMA interface, then the SDMA2-issued transactions are subjected to AIPSTZ5's security-related checks. So need to clear the Supervisor Protect bit of SPBA2, otherwise the sdma script can't work. As the imx-aipstz is a common driver for all aips bus, so set default value (zero) for all opacr registers. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
1 parent 6de23f8 commit 26279c8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/bus/imx-aipstz.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@
1111
#include <linux/regmap.h>
1212

1313
#define IMX_AIPSTZ_MPR0 0x0
14+
#define IMX_AIPSTZ_OPACR0 0x40
15+
#define IMX_AIPSTZ_OPACR1 0x44
16+
#define IMX_AIPSTZ_OPACR2 0x48
17+
#define IMX_AIPSTZ_OPACR3 0x4c
18+
#define IMX_AIPSTZ_OPACR4 0x50
1419

1520
struct imx_aipstz_config {
1621
u32 mpr0;
22+
u32 opacr0;
23+
u32 opacr1;
24+
u32 opacr2;
25+
u32 opacr3;
26+
u32 opacr4;
1727
};
1828

1929
struct imx_aipstz_data {
@@ -24,6 +34,11 @@ struct imx_aipstz_data {
2434
static void imx_aipstz_apply_default(struct imx_aipstz_data *data)
2535
{
2636
writel(data->default_cfg->mpr0, data->base + IMX_AIPSTZ_MPR0);
37+
writel(data->default_cfg->opacr0, data->base + IMX_AIPSTZ_OPACR0);
38+
writel(data->default_cfg->opacr1, data->base + IMX_AIPSTZ_OPACR1);
39+
writel(data->default_cfg->opacr2, data->base + IMX_AIPSTZ_OPACR2);
40+
writel(data->default_cfg->opacr3, data->base + IMX_AIPSTZ_OPACR3);
41+
writel(data->default_cfg->opacr4, data->base + IMX_AIPSTZ_OPACR4);
2742
}
2843

2944
static const struct of_device_id imx_aipstz_match_table[] = {

0 commit comments

Comments
 (0)