mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] MIPS: don't pass fdt_size into main_entry()
Date: Thu, 13 Jun 2024 02:28:05 +0300	[thread overview]
Message-ID: <20240612232807.142127-2-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20240612232807.142127-1-antonynpavlov@gmail.com>

The commit 113c2bc244649430 ("MIPS: remove request_sdram_region "fdt"")
makes glob_fdt_size unused. The patch drops glob_fdt_size and all
variables used for glob_fdt_size initialization inside main_entry().

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/boot/dtb.c            |  1 -
 arch/mips/boot/main_entry-pbl.c |  4 ++--
 arch/mips/boot/main_entry.c     |  6 ++----
 arch/mips/boot/start.c          |  9 ++++-----
 arch/mips/lib/reloc.c           | 12 +++++-------
 5 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/arch/mips/boot/dtb.c b/arch/mips/boot/dtb.c
index ece1494e5fd..5a62ef41e34 100644
--- a/arch/mips/boot/dtb.c
+++ b/arch/mips/boot/dtb.c
@@ -12,7 +12,6 @@
 #include <asm/addrspace.h>
 
 void *glob_fdt;
-u32 glob_fdt_size;
 
 int of_add_memory_bank(struct device_node *node, bool dump, int r,
 		u64 base, u64 size)
diff --git a/arch/mips/boot/main_entry-pbl.c b/arch/mips/boot/main_entry-pbl.c
index 389dc94f370..01833a508d3 100644
--- a/arch/mips/boot/main_entry-pbl.c
+++ b/arch/mips/boot/main_entry-pbl.c
@@ -35,7 +35,7 @@ void __section(.text_entry) pbl_main_entry(void *fdt, void *fdt_end,
 {
 	u32 piggy_len, fdt_len;
 	void *fdt_new;
-	void (*barebox)(void *fdt, u32 fdt_len, u32 ram_size);
+	void (*barebox)(void *fdt, u32 ram_size);
 
 	puts_ll("pbl_main_entry()\n");
 
@@ -53,5 +53,5 @@ void __section(.text_entry) pbl_main_entry(void *fdt, void *fdt_end,
 	memcpy(fdt_new, fdt, fdt_len);
 
 	barebox = (void *)TEXT_BASE;
-	barebox(fdt_new, fdt_len, ram_size);
+	barebox(fdt_new, ram_size);
 }
diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot/main_entry.c
index d0c69f3c82c..1f8f7529a31 100644
--- a/arch/mips/boot/main_entry.c
+++ b/arch/mips/boot/main_entry.c
@@ -17,7 +17,7 @@
 extern void exception_vec(void);
 extern void exception_vec_end(void);
 
-void main_entry(void *fdt, u32 fdt_size);
+void main_entry(void *fdt);
 
 static void trap_init(void)
 {
@@ -36,7 +36,6 @@ static void trap_init(void)
 }
 
 extern void *glob_fdt;
-extern u32 glob_fdt_size;
 extern unsigned long mips_stack_top;
 
 /**
@@ -44,7 +43,7 @@ extern unsigned long mips_stack_top;
  *
  * @note The C environment isn't initialized yet
  */
-void __bare_init main_entry(void *fdt, u32 fdt_size)
+void __bare_init main_entry(void *fdt)
 {
 	unsigned long malloc_start, malloc_end;
 	/* clear the BSS first */
@@ -68,7 +67,6 @@ void __bare_init main_entry(void *fdt, u32 fdt_size)
 	mips_stack_top = malloc_start;
 
 	glob_fdt = fdt;
-	glob_fdt_size = fdt_size;
 
 	start_barebox();
 }
diff --git a/arch/mips/boot/start.c b/arch/mips/boot/start.c
index 81603c8d7a5..2d258047fea 100644
--- a/arch/mips/boot/start.c
+++ b/arch/mips/boot/start.c
@@ -7,11 +7,10 @@
 
 #include <linux/kernel.h>
 
-void __noreturn _start(void *fdt, u32 fdt_size, u32 relocaddr);
-void __noreturn relocate_code(void *fdt, u32 fdt_size, u32 relocaddr);
+void __noreturn _start(void *fdt, u32 relocaddr);
+void __noreturn relocate_code(void *fdt, u32 relocaddr);
 
-void __noreturn __section(.text_entry) _start(void *fdt, u32 fdt_size,
-					      u32 relocaddr)
+void __noreturn __section(.text_entry) _start(void *fdt, u32 relocaddr)
 {
-	relocate_code(fdt, fdt_size, relocaddr);
+	relocate_code(fdt, relocaddr);
 }
diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index a9078aa8136..ec351b66f75 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -40,8 +40,8 @@
 #include <linux/sizes.h>
 #include <asm-generic/memory_layout.h>
 
-void main_entry(void *fdt, u32 fdt_size);
-void __noreturn relocate_code(void *fdt, u32 fdt_size, u32 relocaddr);
+void main_entry(void *fdt);
+void __noreturn relocate_code(void *fdt, u32 relocaddr);
 
 /**
  * read_uint() - Read an unsigned integer from the buffer
@@ -106,7 +106,7 @@ static void apply_reloc(unsigned int type, void *addr, long off)
 	}
 }
 
-void __noreturn relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
+void __noreturn relocate_code(void *fdt, u32 ram_size)
 {
 	unsigned long addr, length, bss_len, relocaddr, new_stack;
 	uint8_t *buf;
@@ -156,13 +156,11 @@ void __noreturn relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
 
 	 __asm__ __volatile__ (
 			"move	$a0, %0\n"
-		"	move	$a1, %1\n"
 		"	move	$31, $0\n"
-		"	move	$sp, %2\n"
-		"	jr	%3\n"
+		"	move	$sp, %1\n"
+		"	jr	%2\n"
 		: /* no outputs */
 		: "r"(fdt),
-		  "r"(fdt_size),
 		  "r"(new_stack),
 		  "r"((unsigned long)main_entry + off));
 
-- 
2.39.0




  reply	other threads:[~2024-06-12 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 23:28 [PATCH 0/3] MIPS: pbl fixes Antony Pavlov
2024-06-12 23:28 ` Antony Pavlov [this message]
2024-06-12 23:28 ` [PATCH 2/3] MIPS: pbl_main_entry(): inline barebox_uncompress() Antony Pavlov
2024-06-12 23:28 ` [PATCH 3/3] MIPS: rename pbl_main_entry() -> barebox_pbl_start() Antony Pavlov
2024-06-13  6:59 ` [PATCH 0/3] MIPS: pbl fixes Sascha Hauer

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=20240612232807.142127-2-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox