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: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Masahiro Yamada 2020-02-03 19:46:15 +09:00
parent eea5b880ee
commit eba319be6c
5 changed files with 32 additions and 9 deletions

View file

@ -31,6 +31,6 @@ void tsp_platform_setup(void)
void tsp_plat_arch_setup(void)
{
uniphier_mmap_setup();
uniphier_mmap_setup(uniphier_soc);
enable_mmu_el1(0);
}

View file

@ -57,7 +57,7 @@ void uniphier_scp_open_com(void);
void uniphier_scp_system_off(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_enable(void);

View file

@ -43,7 +43,7 @@ void bl2_el3_plat_arch_setup(void)
int skip_scp = 0;
int ret;
uniphier_mmap_setup();
uniphier_mmap_setup(uniphier_soc);
enable_mmu_el3(0);
/* add relocation offset (run-time-address - link-address) */

View file

@ -86,6 +86,6 @@ void bl31_platform_setup(void)
void bl31_plat_arch_setup(void)
{
uniphier_mmap_setup();
uniphier_mmap_setup(uniphier_soc);
enable_mmu_el3(0);
}

View file

@ -4,15 +4,36 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <platform_def.h>
#include <common/debug.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#define UNIPHIER_REG_REGION_BASE 0x50000000ULL
#define UNIPHIER_REG_REGION_SIZE 0x20000000ULL
#include "uniphier.h"
void uniphier_mmap_setup(void)
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(unsigned int soc)
{
VERBOSE("Trusted RAM seen by this BL image: %p - %p\n",
(void *)BL_CODE_BASE, (void *)BL_END);
@ -35,8 +56,10 @@ void uniphier_mmap_setup(void)
MT_DEVICE | MT_RW | MT_SECURE);
/* register region */
mmap_add_region(UNIPHIER_REG_REGION_BASE, UNIPHIER_REG_REGION_BASE,
UNIPHIER_REG_REGION_SIZE,
assert(soc < ARRAY_SIZE(uniphier_reg_region));
mmap_add_region(uniphier_reg_region[soc].base,
uniphier_reg_region[soc].base,
uniphier_reg_region[soc].size,
MT_DEVICE | MT_RW | MT_SECURE);
init_xlat_tables();