All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ovidiu Panait <ovidiu.panait@windriver.com>
To: u-boot@lists.denx.de
Cc: Ovidiu Panait <ovidiu.panait@windriver.com>,
	Matthias Brugger <mbrugger@suse.com>,
	Simon Glass <sjg@chromium.org>, Bin Meng <bmeng.cn@gmail.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Tim Harvey <tharvey@gateworks.com>, Wolfgang Denk <wd@denx.de>,
	Zong Li <zong.li@sifive.com>
Subject: [PATCH v2 4/7] common: board_r: drop initr_addr_map wrapper
Date: Sat,  1 Jan 2022 19:13:28 +0200	[thread overview]
Message-ID: <20220101171332.2676936-4-ovidiu.panait@windriver.com> (raw)
In-Reply-To: <20220101171332.2676936-1-ovidiu.panait@windriver.com>

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

Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---

(no changes since v1)

 arch/arm/include/asm/mmu.h     |  2 +-
 arch/arm/mach-bcm283x/init.c   |  4 +++-
 arch/powerpc/cpu/mpc85xx/tlb.c |  4 ++--
 arch/powerpc/include/asm/mmu.h |  2 +-
 common/board_r.c               | 11 +----------
 5 files changed, 8 insertions(+), 15 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 9803499985..183650a90a 100644
--- a/arch/arm/mach-bcm283x/init.c
+++ b/arch/arm/mach-bcm283x/init.c
@@ -152,7 +152,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,
@@ -165,6 +165,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 973b6fbe4b..aa9b59d487 100644
--- a/arch/powerpc/cpu/mpc85xx/tlb.c
+++ b/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -219,7 +219,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;
@@ -235,7 +235,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/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 353dc4e874..cb5b26cd77 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);
+extern int init_addr_map(void);
 #endif
 
 typedef enum {
diff --git a/common/board_r.c b/common/board_r.c
index 5905921caa..b0840c70b2 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -186,15 +186,6 @@ __weak int arch_initr_trap(void)
 	return 0;
 }
 
-#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)
 {
@@ -623,7 +614,7 @@ static init_fnc_t init_sequence_r[] = {
 	initr_dm,
 #endif
 #ifdef CONFIG_ADDR_MAP
-	initr_addr_map,
+	init_addr_map,
 #endif
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
 	defined(CONFIG_SANDBOX)
-- 
2.25.1


  parent reply	other threads:[~2022-01-01 17:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01 17:13 [PATCH v2 1/7] common: spl: move armv7m-specific code to spl_perform_fixups() Ovidiu Panait
2022-01-01 17:13 ` [PATCH v2 2/7] common: remove bedbug debugger support Ovidiu Panait
2022-01-04  9:17   ` Thomas Huth
2022-01-04 14:11   ` Simon Glass
2022-01-18 17:40   ` Tom Rini
2022-01-01 17:13 ` [PATCH v2 3/7] common: board_r: drop initr_kgdb wrapper Ovidiu Panait
2022-01-18 17:40   ` Tom Rini
2022-01-01 17:13 ` Ovidiu Panait [this message]
2022-01-18 17:40   ` [PATCH v2 4/7] common: board_r: drop initr_addr_map wrapper Tom Rini
2022-01-01 17:13 ` [PATCH v2 5/7] common: board_r: move init_addr_map() to init.h Ovidiu Panait
2022-01-18 17:40   ` Tom Rini
2022-01-01 17:13 ` [PATCH v2 6/7] common: board_r: include asm-generic/gpio.h Ovidiu Panait
2022-01-18 17:40   ` Tom Rini
2022-01-01 17:13 ` [PATCH v2 7/7] common: board_r: drop ifdefs around header includes Ovidiu Panait
2022-01-18 17:40   ` Tom Rini
2022-01-18 17:39 ` [PATCH v2 1/7] common: spl: move armv7m-specific code to spl_perform_fixups() Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220101171332.2676936-4-ovidiu.panait@windriver.com \
    --to=ovidiu.panait@windriver.com \
    --cc=bmeng.cn@gmail.com \
    --cc=mbrugger@suse.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    --cc=zong.li@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.