[openwrt/openwrt] realtek: use MIPS fw_init_cmdline()

LEDE Commits lede-commits at lists.infradead.org
Sat Oct 8 03:05:25 PDT 2022


svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/27a580df4a560ccecc0f8d6dd0b0229a4c9192ce

commit 27a580df4a560ccecc0f8d6dd0b0229a4c9192ce
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sun Aug 7 14:43:35 2022 +0900

    realtek: use MIPS fw_init_cmdline()
    
    Use the generic function of MIPS in Linux Kernel instead of open coding
    our own initialisation.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
    [amend commit message]
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 .../realtek/files-5.10/arch/mips/rtl838x/prom.c    | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c
index d04d77e438..dd1b2b170d 100644
--- a/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c
+++ b/target/linux/realtek/files-5.10/arch/mips/rtl838x/prom.c
@@ -18,6 +18,7 @@
 #include <asm/addrspace.h>
 #include <asm/page.h>
 #include <asm/cpu.h>
+#include <asm/fw/fw.h>
 #include <asm/smp-ops.h>
 #include <asm/mips-cps.h>
 
@@ -78,25 +79,6 @@ void __init device_tree_init(void)
 	unflatten_and_copy_device_tree();
 }
 
-static void __init prom_init_cmdline(void)
-{
-	int argc = fw_arg0;
-	char **argv = (char **) KSEG1ADDR(fw_arg1);
-	int i;
-
-	arcs_cmdline[0] = '\0';
-
-	for (i = 0; i < argc; i++) {
-		char *p = (char *) KSEG1ADDR(argv[i]);
-
-		if (CPHYSADDR(p) && *p) {
-			strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
-			strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
-		}
-	}
-	pr_info("Kernel command line: %s\n", arcs_cmdline);
-}
-
 void __init identify_rtl9302(void)
 {
 	switch (sw_r32(RTL93XX_MODEL_NAME_INFO) & 0xfffffff0) {
@@ -214,7 +196,7 @@ void __init prom_init(void)
 
 	pr_info("SoC Type: %s\n", get_system_type());
 
-	prom_init_cmdline();
+	fw_init_cmdline();
 
 	mips_cpc_probe();
 




More information about the lede-commits mailing list