diff mbox series

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

Message ID c40972dfec3dcc6719808d5df388857360262878.1697708489.git.geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show
Series sh: Revive BIOS earlyprintk support | expand

Commit Message

Geert Uytterhoeven Oct. 19, 2023, 9:46 a.m. UTC
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")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/sh/Kconfig.debug | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Randy Dunlap Oct. 19, 2023, 3:48 p.m. UTC | #1
Hi,

On 10/19/23 02:46, Geert Uytterhoeven wrote:
> 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")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  arch/sh/Kconfig.debug | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
> index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
> --- a/arch/sh/Kconfig.debug
> +++ b/arch/sh/Kconfig.debug
> @@ -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,

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

> +	  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
John Paul Adrian Glaubitz Oct. 19, 2023, 3:51 p.m. UTC | #2
Hello!

On Thu, 2023-10-19 at 08:48 -0700, Randy Dunlap wrote:
> > +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
Randy Dunlap Oct. 19, 2023, 3:53 p.m. UTC | #3
On 10/19/23 08:51, John Paul Adrian Glaubitz wrote:
> Hello!
> 
> On Thu, 2023-10-19 at 08:48 -0700, Randy Dunlap wrote:
>>> +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.

OK, thanks.
Geert Uytterhoeven Oct. 20, 2023, 7:10 a.m. UTC | #4
Hi Adrian,

On Thu, Oct 19, 2023 at 5:51 PM John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> On Thu, 2023-10-19 at 08:48 -0700, Randy Dunlap wrote:
> > > +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.

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
John Paul Adrian Glaubitz Oct. 24, 2023, 4:42 p.m. UTC | #5
On Thu, 2023-10-19 at 11:46 +0200, Geert Uytterhoeven wrote:
> 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")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  arch/sh/Kconfig.debug | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
> index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
> --- a/arch/sh/Kconfig.debug
> +++ b/arch/sh/Kconfig.debug
> @@ -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

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
diff mbox series

Patch

diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index c449e7c1b20ff5b5..8bcd6c1431a95be9 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -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