diff mbox series

[v2,1/2] sunxi: fix support board-specific CONFIG_PREBOOT

Message ID 20200229155857.2622367-1-dr@jones.dk
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [v2,1/2] sunxi: fix support board-specific CONFIG_PREBOOT | expand

Commit Message

Jonas Smedegaard Feb. 29, 2020, 3:58 p.m. UTC
commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to
Kconfig") intended to support CONFIG_PREBOOT, but
include/configs/sunxi-common.h hardcodes preboot as part of internally
defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific
CONFIG_PREBOOT.

Simply moving CONFIG_PREBOOT to Kconfig does not work here,
as that would loose the logic of implicitly setting a conditional default.

This commit implements support for explicit CONFIG_PREBOOT for sunxi boards,
while keeping as fallback the implicity default preboot value.

Tested-by: Jonas Smedegaard <dr@jones.dk>
Signed-off-by: Jonas Smedegaard <dr@jones.dk>
Series-Cc: Jagan Teki <jagan@amarulasolutions.com>

---


Changes in v2:
- Rephrase commit message to clarify relationship with KConfig entries

---
 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Andre Przywara March 2, 2020, 9:51 a.m. UTC | #1
On Sat, 29 Feb 2020 16:58:55 +0100
Jonas Smedegaard <dr@jones.dk> wrote:

Hi Jonas,

> commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to
> Kconfig") intended to support CONFIG_PREBOOT, but
> include/configs/sunxi-common.h hardcodes preboot as part of internally
> defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific
> CONFIG_PREBOOT.
> 
> Simply moving CONFIG_PREBOOT to Kconfig does not work here,
> as that would loose the logic of implicitly setting a conditional default.

Can't we do this in arch/arm/mach-sunxi/Kconfig directly:
config PREBOOT
	default "usb start" if USB_KEYBOARD

I have the impression that sunxi-common.h is somewhat legacy, at least for those kind of settings.

Cheers,
Andre

> This commit implements support for explicit CONFIG_PREBOOT for sunxi boards,
> while keeping as fallback the implicity default preboot value.
> 
> Tested-by: Jonas Smedegaard <dr@jones.dk>
> Signed-off-by: Jonas Smedegaard <dr@jones.dk>
> Series-Cc: Jagan Teki <jagan@amarulasolutions.com>
> 
> ---
> 
> 
> Changes in v2:
> - Rephrase commit message to clarify relationship with KConfig entries
> 
> ---
>  include/configs/sunxi-common.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 0ef289fd64..5edde29d1c 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -428,8 +428,13 @@ extern int soft_i2c_gpio_scl;
>  #include <config_distro_bootcmd.h>
>  
>  #ifdef CONFIG_USB_KEYBOARD
> +#ifdef CONFIG_USE_PREBOOT
> +#ifndef CONFIG_PREBOOT
> +#define CONFIG_PREBOOT \
> +	"usb start"
> +#endif
> +#endif
>  #define CONSOLE_STDIN_SETTINGS \
> -	"preboot=usb start\0" \
>  	"stdin=serial,usbkbd\0"
>  #else
>  #define CONSOLE_STDIN_SETTINGS \
Jonas Smedegaard March 3, 2020, 2:56 p.m. UTC | #2
Hi Andre,

Quoting Andre Przywara (2020-03-02 10:51:08)
> On Sat, 29 Feb 2020 16:58:55 +0100
> Jonas Smedegaard <dr@jones.dk> wrote:
> 
> Hi Jonas,
> 
> > commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to
> > Kconfig") intended to support CONFIG_PREBOOT, but
> > include/configs/sunxi-common.h hardcodes preboot as part of internally
> > defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific
> > CONFIG_PREBOOT.
> > 
> > Simply moving CONFIG_PREBOOT to Kconfig does not work here,
> > as that would loose the logic of implicitly setting a conditional default.
> 
> Can't we do this in arch/arm/mach-sunxi/Kconfig directly:
> config PREBOOT
>         default "usb start" if USB_KEYBOARD

Ahh, of course.  Thanks!

I guess that's also what Lukasz was getting at, now that I reread his 
comment for v1.

I'll (test and most likely) make a v3 with your proposed change.

 - Jonas
diff mbox series

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 0ef289fd64..5edde29d1c 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -428,8 +428,13 @@  extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+	"usb start"
+#endif
+#endif
 #define CONSOLE_STDIN_SETTINGS \
-	"preboot=usb start\0" \
 	"stdin=serial,usbkbd\0"
 #else
 #define CONSOLE_STDIN_SETTINGS \