Commit eba319be authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

uniphier: make I/O register region configurable



The I/O register region will be changed in the next SoC. Make it
configurable.

Change-Id: Iec0cbd1ef2d0703ebc7c3d3082edd73791bbfec9
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent eea5b880
...@@ -31,6 +31,6 @@ void tsp_platform_setup(void) ...@@ -31,6 +31,6 @@ void tsp_platform_setup(void)
void tsp_plat_arch_setup(void) void tsp_plat_arch_setup(void)
{ {
uniphier_mmap_setup(); uniphier_mmap_setup(uniphier_soc);
enable_mmu_el1(0); enable_mmu_el1(0);
} }
...@@ -57,7 +57,7 @@ void uniphier_scp_open_com(void); ...@@ -57,7 +57,7 @@ void uniphier_scp_open_com(void);
void uniphier_scp_system_off(void); void uniphier_scp_system_off(void);
void uniphier_scp_system_reset(void); void uniphier_scp_system_reset(void);
void uniphier_mmap_setup(void); void uniphier_mmap_setup(unsigned int soc);
void uniphier_cci_init(unsigned int soc); void uniphier_cci_init(unsigned int soc);
void uniphier_cci_enable(void); void uniphier_cci_enable(void);
......
...@@ -43,7 +43,7 @@ void bl2_el3_plat_arch_setup(void) ...@@ -43,7 +43,7 @@ void bl2_el3_plat_arch_setup(void)
int skip_scp = 0; int skip_scp = 0;
int ret; int ret;
uniphier_mmap_setup(); uniphier_mmap_setup(uniphier_soc);
enable_mmu_el3(0); enable_mmu_el3(0);
/* add relocation offset (run-time-address - link-address) */ /* add relocation offset (run-time-address - link-address) */
......
...@@ -86,6 +86,6 @@ void bl31_platform_setup(void) ...@@ -86,6 +86,6 @@ void bl31_platform_setup(void)
void bl31_plat_arch_setup(void) void bl31_plat_arch_setup(void)
{ {
uniphier_mmap_setup(); uniphier_mmap_setup(uniphier_soc);
enable_mmu_el3(0); enable_mmu_el3(0);
} }
...@@ -4,15 +4,36 @@ ...@@ -4,15 +4,36 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h> #include <common/debug.h>
#include <lib/xlat_tables/xlat_tables_v2.h> #include <lib/xlat_tables/xlat_tables_v2.h>
#define UNIPHIER_REG_REGION_BASE 0x50000000ULL #include "uniphier.h"
#define UNIPHIER_REG_REGION_SIZE 0x20000000ULL
struct uniphier_reg_region {
uintptr_t base;
size_t size;
};
static const struct uniphier_reg_region uniphier_reg_region[] = {
[UNIPHIER_SOC_LD11] = {
.base = 0x50000000UL,
.size = 0x20000000UL,
},
[UNIPHIER_SOC_LD20] = {
.base = 0x50000000UL,
.size = 0x20000000UL,
},
[UNIPHIER_SOC_PXS3] = {
.base = 0x50000000UL,
.size = 0x20000000UL,
},
};
void uniphier_mmap_setup(void) void uniphier_mmap_setup(unsigned int soc)
{ {
VERBOSE("Trusted RAM seen by this BL image: %p - %p\n", VERBOSE("Trusted RAM seen by this BL image: %p - %p\n",
(void *)BL_CODE_BASE, (void *)BL_END); (void *)BL_CODE_BASE, (void *)BL_END);
...@@ -35,8 +56,10 @@ void uniphier_mmap_setup(void) ...@@ -35,8 +56,10 @@ void uniphier_mmap_setup(void)
MT_DEVICE | MT_RW | MT_SECURE); MT_DEVICE | MT_RW | MT_SECURE);
/* register region */ /* register region */
mmap_add_region(UNIPHIER_REG_REGION_BASE, UNIPHIER_REG_REGION_BASE, assert(soc < ARRAY_SIZE(uniphier_reg_region));
UNIPHIER_REG_REGION_SIZE, mmap_add_region(uniphier_reg_region[soc].base,
uniphier_reg_region[soc].base,
uniphier_reg_region[soc].size,
MT_DEVICE | MT_RW | MT_SECURE); MT_DEVICE | MT_RW | MT_SECURE);
init_xlat_tables(); init_xlat_tables();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment