Skip to contentSkip to conversation

arm64: Fix layerscape mmu setup

PATCH New Alexander Graf 2 participants 3 messages Mar 21, 2016 – Mar 22, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Fix layerscape mmu setup

With commit 7985cdf we converted all systems except for the Layerscape SoCs to the generic descriptor table based page table setup.

On the Layerscape SoCs however, we just provide an empty table stub and do the setup ourselves. To reserve enough memory for the tables, we need to override the default counting mechanism which would end up with an empty table because we have no maps.

Fixes 7985cdf
CC Alison Wang <[email protected]>
CC Prabhakar Kushwaha <[email protected]>
---
 arch/arm/cpu/armv8/cache_v8.c           | 2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm/cpu/armv8/cache_v8.c +1 -1
index d1bd06b..1615542 100644
@@ -320,7 +320,7 @@ static int count_required_pts(u64 addr, int level, u64 maxaddr)
 }
 
 /* Returns the estimated required size of all page tables */
-u64 get_page_table_size(void)
+__weak u64 get_page_table_size(void)
 {
 	u64 one_pt = MAX_PTE_ENTRIES * sizeof(u64);
 	u64 size = 0;
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +5 -0
index 7404bd9..4b9e209 100644
@@ -410,6 +410,11 @@ static inline void final_mmu_setup(void)
 	 */
 }
 
+u64 get_page_table_size(void)
+{
+	return 0x10000;
+}
+
 int arch_cpu_init(void)
 {
 	icache_enable();
Signature · 1 line
1.8.5.6
#1 lore raw

PATCH 1/1 arm64: Fix layerscape mmu setup

Quoted 38 lines · Alexander Graf

With commit 7985cdf we converted all systems except for the Layerscape SoCs to the generic descriptor table based page table setup.

On the Layerscape SoCs however, we just provide an empty table stub and do the setup ourselves. To reserve enough memory for the tables, we need to override the default counting mechanism which would end up with an empty table because we have no maps.

Fixes 7985cdf
CC Alison Wang <[email protected]>
CC Prabhakar Kushwaha <[email protected]>
---
 arch/arm/cpu/armv8/cache_v8.c           | 2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm/cpu/armv8/cache_v8.c +1 -1
index d1bd06b..1615542 100644
@@ -320,7 +320,7 @@ static int count_required_pts(u64 addr, int level, u64 maxaddr)
 }
 
 /* Returns the estimated required size of all page tables */
-u64 get_page_table_size(void)
+__weak u64 get_page_table_size(void)
 {
 	u64 one_pt = MAX_PTE_ENTRIES * sizeof(u64);
 	u64 size = 0;
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +0 -0
index 7404bd9..4b9e209 100644
@@ -410,6 +410,11 @@ static inline void final_mmu_setup(void)
 	 */

arch/arm/cpu/armv8/fsl-layerscape/cpu.c static inline void final_mmu_setup(void) · line 420

Quoted 10 lines
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +5 -0
 }
 
+u64 get_page_table_size(void)
+{
+	return 0x10000;
+}
+
 int arch_cpu_init(void)
 {
 	icache_enable();
#2 lore raw

PATCH 1/1 arm64: Fix layerscape mmu setup

In reply to Alexander Graf
Quoted 13 lines · Alexander Graf

With commit 7985cdf we converted all systems except for the Layerscape SoCs to the generic descriptor table based page table setup.

On the Layerscape SoCs however, we just provide an empty table stub and do the setup ourselves. To reserve enough memory for the tables, we need to override the default counting mechanism which would end up with an empty table because we have no maps.

Fixes 7985cdf
CC Alison Wang <[email protected]>
CC Prabhakar Kushwaha <[email protected]>
Quoted 5 lines
---
 arch/arm/cpu/armv8/cache_v8.c           | 2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

Applied to u-boot-fsl-qoriq, awaiting upstream.

Thanks.

York