summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv8/cache_v8.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-03-04 01:09:48 +0100
committerTom Rini <trini@konsulko.com>2016-03-15 15:13:02 -0400
commitd473f0c621513d3f1c42888c113b68f65b7e81cf (patch)
tree72566868778f606d2a3bcaa07895bf68f39bffad /arch/arm/cpu/armv8/cache_v8.c
parent5e2ec773bb6c5acf22d8652112856e87cff86ea4 (diff)
downloadtalos-obmc-uboot-d473f0c621513d3f1c42888c113b68f65b7e81cf.tar.gz
talos-obmc-uboot-d473f0c621513d3f1c42888c113b68f65b7e81cf.zip
thunderx: Move mmu table into board file
The MMU range table can vary depending on things we may only find out at runtime. While the very simple ThunderX variant does not change, other boards will, so move the definition from a static entry in a header file to the board file. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/arm/cpu/armv8/cache_v8.c')
-rw-r--r--arch/arm/cpu/armv8/cache_v8.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index 73628c9611..55c6f2f259 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -36,8 +36,6 @@ DECLARE_GLOBAL_DATA_PTR;
*/
#ifdef CONFIG_SYS_FULL_VA
-static struct mm_region mem_map[] = CONFIG_SYS_MEM_MAP;
-
static u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
{
u64 max_addr = 0;
@@ -46,7 +44,7 @@ static u64 get_tcr(int el, u64 *pips, u64 *pva_bits)
int i;
/* Find the largest address we need to support */
- for (i = 0; i < ARRAY_SIZE(mem_map); i++)
+ for (i = 0; mem_map[i].size || mem_map[i].attrs; i++)
max_addr = max(max_addr, mem_map[i].base + mem_map[i].size);
/* Calculate the maximum physical (and thus virtual) address */
@@ -266,7 +264,7 @@ static int count_required_pts(u64 addr, int level, u64 maxaddr)
int i;
enum pte_type pte_type = PTE_INVAL;
- for (i = 0; i < ARRAY_SIZE(mem_map); i++) {
+ for (i = 0; mem_map[i].size || mem_map[i].attrs; i++) {
struct mm_region *map = &mem_map[i];
u64 start = map->base;
u64 end = start + map->size;
@@ -364,7 +362,7 @@ static void setup_pgtables(void)
create_table();
/* Now add all MMU table entries one after another to the table */
- for (i = 0; i < ARRAY_SIZE(mem_map); i++)
+ for (i = 0; mem_map[i].size || mem_map[i].attrs; i++)
add_map(&mem_map[i]);
/* Create the same thing once more for our emergency page table */
OpenPOWER on IntegriCloud