Skip to contentSkip to conversation

sh: Revive BIOS earlyprintk support

PATCH In review Geert Uytterhoeven 4 participants 11 messages Oct 19, 2023 – Oct 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover sh: Revive BIOS earlyprintk support

Hi all,

SuperH BIOS earlyprintk support was accidently disabled. This series revives it, and records its existence in the documentation.

This was tested on landisk using "earlyprintk=bios" and "earlyprintk=bios,keep".

Thanks for your comments!

Geert Uytterhoeven (2):
sh: bios: Revive earlyprintk support
Documentation: kernel-parameters: Add earlyprintk=bios on SH

 Documentation/admin-guide/kernel-parameters.txt |  3 +++
 arch/sh/Kconfig.debug                           | 11 +++++++++++
 2 files changed, 14 insertions(+)
Signature · 12 lines
2.34.1

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
#1 lore raw

PATCH 1/2 sh: bios: Revive earlyprintk support

The SuperH BIOS earlyprintk code is protected by CONFIG_EARLY_PRINTK. However, when this protection was added, it was missed that SuperH no longer defines an EARLY_PRINTK config symbol since commit e76fe57447e88916 ("sh: Remove old early serial console code V2"), so BIOS earlyprintk can no longer be used.

Fix this by reviving the EARLY_PRINTK config symbol.

Fixes d0380e6c3c0f6edb ("early_printk: consolidate random copies of identical code")
---
 arch/sh/Kconfig.debug | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/sh/Kconfig.debug +11 -0
index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
@@ -22,6 +22,17 @@ config STACK_DEBUG
 	  every function call and will therefore incur a major
 	  performance hit. Most users should say N.
 
+config EARLY_PRINTK
+	bool "Early printk"
+	depends on SH_STANDARD_BIOS
+	help
+	  Say Y here to redirect kernel printk messages to the serial port
+	  used by the SH-IPL bootloader, starting very early in the boot
+	  process and ending when the kernel's serial console is initialised.
+	  This option is only useful while porting the kernel to a new machine,
+	  when the kernel may crash or hang before the serial console is
+	  initialised.  If unsure, say N.
+
 config 4KSTACKS
 	bool "Use 4Kb for kernel stacks instead of 8Kb"
 	depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
Signature · 1 line
2.34.1
reviewer
#2 lore raw

Re: [PATCH 1/2] sh: bios: Revive earlyprintk support

Hi,

Quoted 20 lines · Geert Uytterhoeven

The SuperH BIOS earlyprintk code is protected by CONFIG_EARLY_PRINTK. However, when this protection was added, it was missed that SuperH no longer defines an EARLY_PRINTK config symbol since commit e76fe57447e88916 ("sh: Remove old early serial console code V2"), so BIOS earlyprintk can no longer be used.

Fix this by reviving the EARLY_PRINTK config symbol.

Fixes d0380e6c3c0f6edb ("early_printk: consolidate random copies of identical code")
---
 arch/sh/Kconfig.debug | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/sh/Kconfig.debug +0 -0
index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
@@ -22,6 +22,17 @@ config STACK_DEBUG
 	  every function call and will therefore incur a major

arch/sh/Kconfig.debug config STACK_DEBUG · line 32

Quoted 10 lines
arch/sh/Kconfig.debug +8 -0
 	  performance hit. Most users should say N.
 
+config EARLY_PRINTK
+	bool "Early printk"
+	depends on SH_STANDARD_BIOS
+	help
+	  Say Y here to redirect kernel printk messages to the serial port
+	  used by the SH-IPL bootloader, starting very early in the boot
+	  process and ending when the kernel's serial console is initialised.
+	  This option is only useful while porting the kernel to a new machine,

Can we expect to see new machine ports using arch/sh/ ?

Quoted 6 lines
arch/sh/Kconfig.debug +3 -0
+	  when the kernel may crash or hang before the serial console is
+	  initialised.  If unsure, say N.
+
 config 4KSTACKS
 	bool "Use 4Kb for kernel stacks instead of 8Kb"
 	depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
Signature · 1 line
~Randy
#3 lore raw

Re: [PATCH 1/2] sh: bios: Revive earlyprintk support

Hello!

Quoted 10 lines · Randy Dunlap

arch/sh/Kconfig.debug config STACK_DEBUG · line 32

Quoted 8 lines
arch/sh/Kconfig.debug +8 -0
+config EARLY_PRINTK
+	bool "Early printk"
+	depends on SH_STANDARD_BIOS
+	help
+	  Say Y here to redirect kernel printk messages to the serial port
+	  used by the SH-IPL bootloader, starting very early in the boot
+	  process and ending when the kernel's serial console is initialised.
+	  This option is only useful while porting the kernel to a new machine,

Can we expect to see new machine ports using arch/sh/ ?

There is J-Core which is new open source hardware based on arch/sh.

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
reviewer
#4 lore raw

Re: [PATCH 1/2] sh: bios: Revive earlyprintk support

Quoted 14 lines · John Paul Adrian Glaubitz

Hello!

Quoted 10 lines · Randy Dunlap

arch/sh/Kconfig.debug config STACK_DEBUG · line 32

Quoted 8 lines
arch/sh/Kconfig.debug +8 -0
+config EARLY_PRINTK
+	bool "Early printk"
+	depends on SH_STANDARD_BIOS
+	help
+	  Say Y here to redirect kernel printk messages to the serial port
+	  used by the SH-IPL bootloader, starting very early in the boot
+	  process and ending when the kernel's serial console is initialised.
+	  This option is only useful while porting the kernel to a new machine,

Can we expect to see new machine ports using arch/sh/ ?

Quoted 1 line

There is J-Core which is new open source hardware based on arch/sh.

OK, thanks.

Signature · 1 line
~Randy
#5 lore raw

Re: [PATCH 1/2] sh: bios: Revive earlyprintk support

In reply to John Paul Adrian Glaubitz

Hi Adrian,

Quoted 10 lines · John Paul Adrian Glaubitz
Quoted 9 lines · Randy Dunlap
Quoted 8 lines
arch/sh/Kconfig.debug +8 -0
+config EARLY_PRINTK
+   bool "Early printk"
+   depends on SH_STANDARD_BIOS
+   help
+     Say Y here to redirect kernel printk messages to the serial port
+     used by the SH-IPL bootloader, starting very early in the boot
+     process and ending when the kernel's serial console is initialised.
+     This option is only useful while porting the kernel to a new machine,
Quoted 3 lines
Quoted 1 line

Can we expect to see new machine ports using arch/sh/ ?

There is J-Core which is new open source hardware based on arch/sh.

Do J-Core systems use the LinuxSH standard BIOS?
Still, it can be useful while converting existing SH systems to DT.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
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
maintainer Reviewed-by on v1 1/2
#6 lore raw

Re: [PATCH 1/2] sh: bios: Revive earlyprintk support

In reply to Geert Uytterhoeven
Quoted 26 lines · Geert Uytterhoeven

The SuperH BIOS earlyprintk code is protected by CONFIG_EARLY_PRINTK. However, when this protection was added, it was missed that SuperH no longer defines an EARLY_PRINTK config symbol since commit e76fe57447e88916 ("sh: Remove old early serial console code V2"), so BIOS earlyprintk can no longer be used.

Fix this by reviving the EARLY_PRINTK config symbol.

Fixes d0380e6c3c0f6edb ("early_printk: consolidate random copies of identical code")
---
 arch/sh/Kconfig.debug | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/sh/Kconfig.debug +4 -0
index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
@@ -22,6 +22,17 @@ config STACK_DEBUG
 	  every function call and will therefore incur a major
 	  performance hit. Most users should say N.
 
+config EARLY_PRINTK
+	bool "Early printk"
+	depends on SH_STANDARD_BIOS
+	help

arch/sh/Kconfig.debug config STACK_DEBUG · line 38

Quoted 10 lines
arch/sh/Kconfig.debug +7 -0
+	  Say Y here to redirect kernel printk messages to the serial port
+	  used by the SH-IPL bootloader, starting very early in the boot
+	  process and ending when the kernel's serial console is initialised.
+	  This option is only useful while porting the kernel to a new machine,
+	  when the kernel may crash or hang before the serial console is
+	  initialised.  If unsure, say N.
+
 config 4KSTACKS
 	bool "Use 4Kb for kernel stacks instead of 8Kb"
 	depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#7 lore raw

PATCH 2/2 Documentation: kernel-parameters: Add earlyprintk=bios on SH

In reply to Geert Uytterhoeven

Document the use of the "earlyprintk=bios[,keep]" kernel parameter option on SuperH systems with a SuperH standard BIOS.

---
 Documentation/admin-guide/kernel-parameters.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +3 -0
index 657bb0b54e2fc6cf..8e7f6be051a0e1d3 100644
@@ -1331,6 +1331,7 @@
 			earlyprintk=dbgp[debugController#]
 			earlyprintk=pciserial[,force],bus:device.function[,baudrate]
 			earlyprintk=xdbc[xhciController#]
+			earlyprintk=bios
 
 			earlyprintk is useful when the kernel crashes before
 			the normal console is initialized. It is not enabled by
@@ -1361,6 +1362,8 @@
 
 			The sclp output can only be used on s390.
 
+			The bios output can only be used on SuperH.
+
 			The optional "force" to "pciserial" enables use of a
 			PCI device even when its classcode is not of the
 			UART class.
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 2/2
#8 lore raw

Re: [PATCH 2/2] Documentation: kernel-parameters: Add earlyprintk=bios on SH

Quoted 21 lines · Geert Uytterhoeven

Document the use of the "earlyprintk=bios[,keep]" kernel parameter option on SuperH systems with a SuperH standard BIOS.

---
 Documentation/admin-guide/kernel-parameters.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +1 -0
index 657bb0b54e2fc6cf..8e7f6be051a0e1d3 100644
@@ -1331,6 +1331,7 @@
 			earlyprintk=dbgp[debugController#]
 			earlyprintk=pciserial[,force],bus:device.function[,baudrate]
 			earlyprintk=xdbc[xhciController#]
+			earlyprintk=bios
 
 			earlyprintk is useful when the kernel crashes before
 			the normal console is initialized. It is not enabled by

Documentation/admin-guide/kernel-parameters.txt line 1369

Quoted 8 lines
Documentation/admin-guide/kernel-parameters.txt +2 -0
@@ -1361,6 +1362,8 @@
 
 			The sclp output can only be used on s390.
 
+			The bios output can only be used on SuperH.
+
 			The optional "force" to "pciserial" enables use of a
 			PCI device even when its classcode is not of the
 			UART class.
Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#9 lore raw
In reply to Geert Uytterhoeven

Hi Geert!

Quoted 7 lines · Geert Uytterhoeven

SuperH BIOS earlyprintk support was accidently disabled. This series revives it, and records its existence in the documentation.

This was tested on landisk using "earlyprintk=bios" and "earlyprintk=bios,keep".

Thanks for your comments!

Thanks for catching this and fixing this! I will pick this up ASAP!

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
#10 lore raw
In reply to Geert Uytterhoeven
Quoted 10 lines · Geert Uytterhoeven

Hi all,

SuperH BIOS earlyprintk support was accidently disabled. This series revives it, and records its existence in the documentation.

This was tested on landisk using "earlyprintk=bios" and "earlyprintk=bios,keep".

Thanks for your comments!

Quoted 8 lines

Geert Uytterhoeven (2):
sh: bios: Revive earlyprintk support
Documentation: kernel-parameters: Add earlyprintk=bios on SH

 Documentation/admin-guide/kernel-parameters.txt |  3 +++
 arch/sh/Kconfig.debug                           | 11 +++++++++++
 2 files changed, 14 insertions(+)

Series applied for v6.7 to my sh-linux tree in the for-next branch.

Thanks,
Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913