Browse Source
AIPSTZ provide access control for all the peripherals connected to it. In this patch all the perperals are configured accessible to all the master. it can be customized based the actual use case. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Change-Id: I5ef5baa1da6906f13a60923d27ede336c61e319apull/1930/head
Jacky Bai
6 years ago
6 changed files with 74 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||
/*
|
|||
* copyright (c) 2019, arm limited and contributors. all rights reserved. |
|||
* |
|||
* spdx-license-identifier: bsd-3-clause |
|||
*/ |
|||
|
|||
#include <lib/mmio.h> |
|||
|
|||
#include <imx_aipstz.h> |
|||
|
|||
void imx_aipstz_init(const struct aipstz_cfg *aipstz_cfg) |
|||
{ |
|||
const struct aipstz_cfg *aipstz = aipstz_cfg; |
|||
|
|||
while (aipstz->base != 0U) { |
|||
mmio_write_32(aipstz->base + AIPSTZ_MPR0, aipstz->mpr0); |
|||
mmio_write_32(aipstz->base + AIPSTZ_MPR1, aipstz->mpr1); |
|||
|
|||
for (int i = 0; i < AIPSTZ_OPACR_NUM; i++) |
|||
mmio_write_32(aipstz->base + OPACR_OFFSET(i), aipstz->opacr[i]); |
|||
|
|||
aipstz++; |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
/*
|
|||
* Copyright (c) 2019, ARM Limited and Contributors. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
#ifndef IMX_AIPSTZ_H |
|||
#define IMX_AIPSTZ_H |
|||
|
|||
#include <lib/utils_def.h> |
|||
|
|||
#define AIPSTZ_MPR0 U(0x0) |
|||
#define AIPSTZ_MPR1 U(0x4) |
|||
|
|||
#define AIPSTZ_OPACR_NUM U(0x5) |
|||
#define OPACR_OFFSET(i) U((i) * 4 + 0x40) |
|||
|
|||
struct aipstz_cfg { |
|||
uintptr_t base; |
|||
uint32_t mpr0; |
|||
uint32_t mpr1; |
|||
uint32_t opacr[AIPSTZ_OPACR_NUM]; |
|||
}; |
|||
|
|||
void imx_aipstz_init(const struct aipstz_cfg *aipstz_cfg); |
|||
|
|||
#endif /* IMX_AIPSTZ_H */ |
Loading…
Reference in new issue