[PATCH 10/18] common: board_r: Drop initr_addr_map wrapper

Ovidiu Panait ovidiu.panait at windriver.com
Thu Nov 5 10:09:47 CET 2020


Add a return value to init_addr_map and use it directly in the
post-relocation init sequence, rather than using a wrapper stub.

Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
---
 arch/arm/include/asm/mmu.h          |  2 +-
 arch/arm/mach-bcm283x/init.c        |  4 +++-
 arch/powerpc/cpu/mpc85xx/tlb.c      |  4 ++--
 arch/powerpc/cpu/mpc86xx/cpu_init.c |  4 +++-
 arch/powerpc/include/asm/mmu.h      |  2 +-
 common/board_r.c                    | 11 +----------
 6 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 9ac16f599e..8449720fad 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -3,6 +3,6 @@
 #ifndef __ASM_ARM_MMU_H
 #define __ASM_ARM_MMU_H
 
-void init_addr_map(void);
+int init_addr_map(void);
 
 #endif
diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c
index f2a5411623..ba32187315 100644
--- a/arch/arm/mach-bcm283x/init.c
+++ b/arch/arm/mach-bcm283x/init.c
@@ -151,7 +151,7 @@ int mach_cpu_init(void)
 #include <addr_map.h>
 #include <asm/system.h>
 
-void init_addr_map(void)
+int init_addr_map(void)
 {
 	mmu_set_region_dcache_behaviour_phys(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT,
 					     BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS,
@@ -164,6 +164,8 @@ void init_addr_map(void)
 	addrmap_set_entry(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT,
 			  BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS,
 			  BCM2711_RPI4_PCIE_XHCI_MMIO_SIZE, 1);
+
+	return 0;
 }
 #endif
 
diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c
index 4465ae7565..4afc11125b 100644
--- a/arch/powerpc/cpu/mpc85xx/tlb.c
+++ b/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -218,7 +218,7 @@ int find_tlb_idx(void *addr, u8 tlbsel)
 }
 
 #ifdef CONFIG_ADDR_MAP
-void init_addr_map(void)
+int init_addr_map(void)
 {
 	int i;
 	unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
@@ -234,7 +234,7 @@ void init_addr_map(void)
 			addrmap_set_entry(epn, rpn, TSIZE_TO_BYTES(tsize), i);
 	}
 
-	return ;
+	return 0;
 }
 #endif
 
diff --git a/arch/powerpc/cpu/mpc86xx/cpu_init.c b/arch/powerpc/cpu/mpc86xx/cpu_init.c
index a17091d2ff..f7cbf9658b 100644
--- a/arch/powerpc/cpu/mpc86xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc86xx/cpu_init.c
@@ -77,7 +77,7 @@ int cpu_init_r(void)
 
 #ifdef CONFIG_ADDR_MAP
 /* Initialize address mapping array */
-void init_addr_map(void)
+int init_addr_map(void)
 {
 	int i;
 	ppc_bat_t bat = DBAT0;
@@ -99,5 +99,7 @@ void init_addr_map(void)
 			bat = DBAT4 - 1;
 #endif
 	}
+
+	return 0;
 }
 #endif
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 353dc4e874..a49758a625 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -138,7 +138,7 @@ extern void _tlbie(unsigned long va);	/* invalidate a TLB entry */
 extern void _tlbia(void);		/* invalidate all TLB entries */
 
 #ifdef CONFIG_ADDR_MAP
-extern void init_addr_map(void);
+int init_addr_map(void);
 #endif
 
 typedef enum {
diff --git a/common/board_r.c b/common/board_r.c
index 414b6272c5..964f3df918 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -197,15 +197,6 @@ static int initr_trap(void)
 }
 #endif
 
-#ifdef CONFIG_ADDR_MAP
-static int initr_addr_map(void)
-{
-	init_addr_map();
-
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
 static int initr_unlock_ram_in_cache(void)
 {
@@ -712,7 +703,7 @@ static init_fnc_t init_sequence_r[] = {
 	initr_trap,
 #endif
 #ifdef CONFIG_ADDR_MAP
-	initr_addr_map,
+	init_addr_map,
 #endif
 #if defined(CONFIG_BOARD_EARLY_INIT_R)
 	board_early_init_r,
-- 
2.17.1



More information about the U-Boot mailing list