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>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Bin Meng <bmeng.cn@gmail.com>,
	Matthias Brugger <mbrugger@suse.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Simon Glass <sjg@chromium.org>,
	Tim Harvey <tharvey@gateworks.com>, Wolfgang Denk <wd@denx.de>
Subject: [PATCH 4/7] common: board_r: drop initr_addr_map wrapper
Date: Sat, 30 Oct 2021 09:51:37 +0300	[thread overview]
Message-ID: <20211030065140.3589529-4-ovidiu.panait@windriver.com> (raw)
In-Reply-To: <20211030065140.3589529-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.

Signed-off-by: Ovidiu Panait <ovidiu.panait@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/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 1c7397b29e..0b8f2a0b91 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)
 {
@@ -628,7 +619,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:[~2021-10-30  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-30  6:51 [PATCH 1/7] common: spl: move armv7m-specific code to spl_perform_fixups() Ovidiu Panait
2021-10-30  6:51 ` [PATCH 2/7] common: board_r: move bedbug_init() to common code Ovidiu Panait
2021-10-30  6:51 ` [PATCH 3/7] common: board_r: drop initr_kgdb wrapper Ovidiu Panait
2021-10-30  6:51 ` Ovidiu Panait [this message]
2021-11-03 12:15   ` [PATCH 4/7] common: board_r: drop initr_addr_map wrapper Matthias Brugger
2021-11-05  2:02   ` Simon Glass
2021-10-30  6:51 ` [PATCH 5/7] common: board_r: move init_addr_map() to init.h Ovidiu Panait
2021-10-30  6:51 ` [PATCH 6/7] common: board_r: include asm-generic/gpio.h Ovidiu Panait
2021-10-30  6:51 ` [PATCH 7/7] common: board_r: drop ifdefs around header includes Ovidiu Panait

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=20211030065140.3589529-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=takahiro.akashi@linaro.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    /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.