mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-25 22:35:42 +00:00
uniphier: make on-chip SRAM region configurable
The on-chip SRAM region will be changed in the next SoC. Make it configurable. Also, split the mmap code into a new helper function so that it can be re-used for another boot mode. Change-Id: I89f40432bf852a58ebc9be5d9dec4136b8dc010b Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
eba319be6c
commit
8eaffdf70b
1 changed files with 26 additions and 7 deletions
|
@ -23,7 +23,6 @@
|
||||||
#define UNIPHIER_ROM_REGION_BASE 0x00000000ULL
|
#define UNIPHIER_ROM_REGION_BASE 0x00000000ULL
|
||||||
#define UNIPHIER_ROM_REGION_SIZE 0x10000000ULL
|
#define UNIPHIER_ROM_REGION_SIZE 0x10000000ULL
|
||||||
|
|
||||||
#define UNIPHIER_OCM_REGION_BASE 0x30000000ULL
|
|
||||||
#define UNIPHIER_OCM_REGION_SIZE 0x00040000ULL
|
#define UNIPHIER_OCM_REGION_SIZE 0x00040000ULL
|
||||||
|
|
||||||
#define UNIPHIER_BLOCK_BUF_OFFSET 0x04200000UL
|
#define UNIPHIER_BLOCK_BUF_OFFSET 0x04200000UL
|
||||||
|
@ -278,12 +277,20 @@ static int uniphier_io_nor_setup(unsigned int soc_id, size_t buffer_offset)
|
||||||
return uniphier_io_memmap_setup(0x70000);
|
return uniphier_io_memmap_setup(0x70000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int uniphier_io_usb_setup(unsigned int soc_id, size_t buffer_offset)
|
static const uintptr_t uniphier_ocm_base[] = {
|
||||||
|
[UNIPHIER_SOC_LD11] = 0x30000000,
|
||||||
|
[UNIPHIER_SOC_LD20] = 0x30000000,
|
||||||
|
[UNIPHIER_SOC_PXS3] = 0x30000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int uniphier_io_rom_api_setup(unsigned int soc)
|
||||||
{
|
{
|
||||||
struct io_block_dev_spec *block_dev_spec;
|
uintptr_t ocm_base;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* use ROM API for loading images from USB storage */
|
assert(soc < ARRAY_SIZE(uniphier_ocm_base));
|
||||||
|
ocm_base = uniphier_ocm_base[soc];
|
||||||
|
|
||||||
ret = mmap_add_dynamic_region(UNIPHIER_ROM_REGION_BASE,
|
ret = mmap_add_dynamic_region(UNIPHIER_ROM_REGION_BASE,
|
||||||
UNIPHIER_ROM_REGION_BASE,
|
UNIPHIER_ROM_REGION_BASE,
|
||||||
UNIPHIER_ROM_REGION_SIZE,
|
UNIPHIER_ROM_REGION_SIZE,
|
||||||
|
@ -296,14 +303,26 @@ static int uniphier_io_usb_setup(unsigned int soc_id, size_t buffer_offset)
|
||||||
* load functions provided by the ROM use this memory region as a work
|
* load functions provided by the ROM use this memory region as a work
|
||||||
* area, but do not cater to cache coherency.
|
* area, but do not cater to cache coherency.
|
||||||
*/
|
*/
|
||||||
ret = mmap_add_dynamic_region(UNIPHIER_OCM_REGION_BASE,
|
ret = mmap_add_dynamic_region(ocm_base, ocm_base,
|
||||||
UNIPHIER_OCM_REGION_BASE,
|
|
||||||
UNIPHIER_OCM_REGION_SIZE,
|
UNIPHIER_OCM_REGION_SIZE,
|
||||||
MT_DEVICE | MT_RW | MT_SECURE);
|
MT_DEVICE | MT_RW | MT_SECURE);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = uniphier_usb_init(soc_id, &block_dev_spec);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int uniphier_io_usb_setup(unsigned int soc, size_t buffer_offset)
|
||||||
|
{
|
||||||
|
struct io_block_dev_spec *block_dev_spec;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* use ROM API for loading images from USB storage */
|
||||||
|
ret = uniphier_io_rom_api_setup(soc);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = uniphier_usb_init(soc, &block_dev_spec);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue