Skip to contentSkip to conversation

m68k: generalize uboot command line support

PATCH In review Greg Ungerer 2 participants 3 messages Sep 9, 2016

Subsystems (2)
lore
Share & tools
lore

Greg Ungerer

author maintainer
#0 lore raw

PATCH 1/1 m68k: generalize uboot command line support

The uboot command line support needs to be used by both MMU and no-MMU setups, but currently we only have the code in the no-MMU code paths. Move the uboot command line processing code into its own file. Add appropriate calls to it from both the MMU and no-MMU arch setup code.

---
 arch/m68k/include/asm/bootinfo.h |   4 ++
 arch/m68k/kernel/Makefile        |   1 +
 arch/m68k/kernel/setup_mm.c      |   3 ++
 arch/m68k/kernel/setup_no.c      |  79 +----------------------------
 arch/m68k/kernel/uboot.c         | 107 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 117 insertions(+), 77 deletions(-)
 create mode 100644 arch/m68k/kernel/uboot.c
arch/m68k/include/asm/bootinfo.h +4 -0
index 8e21326..f679843 100644
@@ -22,6 +22,10 @@ extern void save_bootinfo(const struct bi_record *bi);
 static inline void save_bootinfo(const struct bi_record *bi) {}
 #endif
 
+#ifdef CONFIG_UBOOT
+void process_uboot_commandline(char *commandp, int size);
+#endif
+
 #endif /* __ASSEMBLY__ */
 
 
arch/m68k/kernel/Makefile +1 -0
index e47778f..8a1c4d3 100644
@@ -24,6 +24,7 @@ obj-$(CONFIG_HAS_DMA)	+= dma.o
 
 obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_BOOTINFO_PROC)	+= bootinfo_proc.o
+obj-$(CONFIG_UBOOT)		+= uboot.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/m68k/kernel/setup_mm.c +3 -0
index 9afad2b..6f6ffb3 100644
@@ -274,6 +274,9 @@ void __init setup_arch(char **cmdline_p)
 	strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
 	m68k_command_line[CL_SIZE - 1] = 0;
 #endif /* CONFIG_BOOTPARAM */
+#if defined(CONFIG_UBOOT)
+	process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
+#endif
 	*cmdline_p = m68k_command_line;
 	memcpy(boot_command_line, *cmdline_p, CL_SIZE);
 
arch/m68k/kernel/setup_no.c +2 -77

97 lines not on this page · raw message

arch/m68k/kernel/uboot.c new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

Hi Greg,

arch/m68k/include/asm/bootinfo.h extern void save_bootinfo(const struct bi_record *bi); · line 27

Quoted 9 lines · Greg Ungerer
arch/m68k/include/asm/bootinfo.h +3 -0
@@ -22,6 +22,10 @@ extern void save_bootinfo(const struct bi_record *bi);
 static inline void save_bootinfo(const struct bi_record *bi) {}
 #endif
 
+#ifdef CONFIG_UBOOT
+void process_uboot_commandline(char *commandp, int size);
+#endif

What about providing a dummy for the !CONFIG_UBOOT case..

arch/m68k/kernel/setup_mm.c void __init setup_arch(char **cmdline_p) · line 279

Quoted 9 lines
arch/m68k/kernel/setup_mm.c +3 -0
@@ -274,6 +274,9 @@ void __init setup_arch(char **cmdline_p)
        strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
        m68k_command_line[CL_SIZE - 1] = 0;
 #endif /* CONFIG_BOOTPARAM */
+#if defined(CONFIG_UBOOT)
+       process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
+#endif

... so you can drop the #if and #endif here?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#2 lore raw

Hi Geert,

Quoted 15 lines · Geert Uytterhoeven

Hi Greg,

arch/m68k/include/asm/bootinfo.h extern void save_bootinfo(const struct bi_record *bi); · line 27

Quoted 9 lines · Greg Ungerer
arch/m68k/include/asm/bootinfo.h +3 -0
@@ -22,6 +22,10 @@ extern void save_bootinfo(const struct bi_record *bi);
 static inline void save_bootinfo(const struct bi_record *bi) {}
 #endif
 
+#ifdef CONFIG_UBOOT
+void process_uboot_commandline(char *commandp, int size);
+#endif

What about providing a dummy for the !CONFIG_UBOOT case..

Quoted 11 lines

arch/m68k/kernel/setup_mm.c void __init setup_arch(char **cmdline_p) · line 279

Quoted 9 lines
arch/m68k/kernel/setup_mm.c +3 -0
@@ -274,6 +274,9 @@ void __init setup_arch(char **cmdline_p)
        strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
        m68k_command_line[CL_SIZE - 1] = 0;
 #endif /* CONFIG_BOOTPARAM */
+#if defined(CONFIG_UBOOT)
+       process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
+#endif

... so you can drop the #if and #endif here?

Yep, good idea. I'll re-spin with that.

Thanks
Greg