summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8ulp/rdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/imx8ulp/rdc.c')
-rw-r--r--arch/arm/mach-imx/imx8ulp/rdc.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/imx8ulp/rdc.c b/arch/arm/mach-imx/imx8ulp/rdc.c
index e2eca0633e..f5423ec7b9 100644
--- a/arch/arm/mach-imx/imx8ulp/rdc.c
+++ b/arch/arm/mach-imx/imx8ulp/rdc.c
@@ -8,8 +8,8 @@
#include <asm/types.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
-#include <asm/arch/mu_hal.h>
-#include <asm/arch/s400_api.h>
+#include <asm/mach-imx/mu_hal.h>
+#include <asm/mach-imx/s400_api.h>
#include <asm/arch/rdc.h>
#include <div64.h>
@@ -184,14 +184,14 @@ int xrdc_config_pdac(u32 bridge, u32 index, u32 dom, u32 perm)
int release_rdc(enum rdc_type type)
{
ulong s_mu_base = 0x27020000UL;
- struct imx8ulp_s400_msg msg;
+ struct sentinel_msg msg;
int ret;
u32 rdc_id = (type == RDC_XRDC) ? 0x78 : 0x74;
msg.version = AHAB_VERSION;
msg.tag = AHAB_CMD_TAG;
msg.size = 2;
- msg.command = AHAB_RELEASE_RDC_REQ_CID;
+ msg.command = ELE_RELEASE_RDC_REQ;
msg.data[0] = (rdc_id << 8) | 0x2; /* A35 XRDC */
mu_hal_init(s_mu_base);
@@ -276,6 +276,36 @@ void xrdc_init_mda(void)
void xrdc_init_mrc(void)
{
+ /* Re-config MRC3 for SRAM0 in case protected by S400 */
+ xrdc_config_mrc_w0_w1(3, 0, 0x22010000, 0x10000);
+ xrdc_config_mrc_dx_perm(3, 0, 0, 1);
+ xrdc_config_mrc_dx_perm(3, 0, 1, 1);
+ xrdc_config_mrc_dx_perm(3, 0, 4, 1);
+ xrdc_config_mrc_dx_perm(3, 0, 5, 1);
+ xrdc_config_mrc_dx_perm(3, 0, 6, 1);
+ xrdc_config_mrc_dx_perm(3, 0, 7, 1);
+ xrdc_config_mrc_w3_w4(3, 0, 0x0, 0x80000FFF);
+
+ /* Clear other 3 regions of MRC3 to invalid */
+ xrdc_config_mrc_w3_w4(3, 1, 0x0, 0x0);
+ xrdc_config_mrc_w3_w4(3, 2, 0x0, 0x0);
+ xrdc_config_mrc_w3_w4(3, 3, 0x0, 0x0);
+
+ /* Set MRC4 and MRC5 for DDR access from A35 and AP NIC PER masters */
+ xrdc_config_mrc_w0_w1(4, 0, CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_SIZE);
+ xrdc_config_mrc_dx_perm(4, 0, 1, 1);
+ xrdc_config_mrc_dx_perm(4, 0, 7, 1);
+ xrdc_config_mrc_w3_w4(4, 0, 0x0, 0x80000FFF);
+
+ xrdc_config_mrc_w0_w1(5, 0, CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_SIZE);
+ xrdc_config_mrc_dx_perm(5, 0, 1, 1);
+ xrdc_config_mrc_w3_w4(5, 0, 0x0, 0x80000FFF);
+
+ /* Set MRC6 for DDR access from Sentinel */
+ xrdc_config_mrc_w0_w1(6, 0, CONFIG_SYS_SDRAM_BASE, PHYS_SDRAM_SIZE);
+ xrdc_config_mrc_dx_perm(6, 0, 4, 1);
+ xrdc_config_mrc_w3_w4(6, 0, 0x0, 0x80000FFF);
+
/* The MRC8 is for SRAM1 */
xrdc_config_mrc_w0_w1(8, 0, 0x21000000, 0x10000);
/* Allow for all domains: So domain 2/3 (HIFI DSP/LPAV) is ok to access */