sunxi: fix support board-specific CONFIG_PREBOOT
PATCH v2 1/2 sunxi: fix support board-specific CONFIG_PREBOOT
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.
Series-Cc: Jagan Teki <[email protected]>
---
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(-)
include/configs/sunxi-common.h +6 -1
@@ -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 \
Signature · 1 line
2.25.1
PATCH v2 2/2 sun50i: a64: A64-Teres-I board detect builtin keyboard
A64-Teres-I board is a laptop which comes with a builtin keyboard. The keyboard+trackpad controller pauses for 2 seconds at a firmware prompt before loading its HID interface.
U-Boot needs to wait equally long to reliably enable the keyboard.
Series-Cc: Jagan Teki <[email protected]>
---
Changes in v2:
- (none)
--- configs/teres_i_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/teres_i_defconfig +1 -0
@@ -8,6 +8,7 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_USB1_VBUS_PIN="PL7" CONFIG_I2C0_ENABLE=y CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv usb_pgood_delay 2000; usb reset" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-teres-i"
Signature · 1 line
2.25.1
PATCH v2 1/2 sunxi: fix support board-specific CONFIG_PREBOOT
In reply to Jonas SmedegaardOn Sat, 29 Feb 2020 16:58:55 +0100
Jonas Smedegaard <[email protected]> wrote:
Hi Jonas,
Quoted 8 lines
commit
37304aaf60bf("ConvertCONFIG_USE_PREBOOTandCONFIG_PREBOOTtoKconfig") intended to supportCONFIG_PREBOOT, butinclude/configs/sunxi-common.hhardcodes preboot as part of internally definedCONSOLE_STDIN_SETTINGS, silently ignoring any board-specificCONFIG_PREBOOT.Simply moving
CONFIG_PREBOOTtoKconfigdoes 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
Quoted 36 lines
This commit implements support for explicit
CONFIG_PREBOOTfor sunxi boards, while keeping as fallback the implicity default preboot value.Tested-by Jonas Smedegaard <[email protected]>Signed-off-by Jonas Smedegaard <[email protected]>Series-Cc: Jagan Teki <[email protected]>
---
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(-)include/configs/sunxi-common.h +6
-1@@ -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 \
PATCH v2 1/2 sunxi: fix support board-specific CONFIG_PREBOOT
Hi Andre,
Quoting Andre Przywara (2020-03-02 10:51:08)
Quoted 11 lines
On Sat, 29 Feb 2020 16:58:55 +0100
Jonas Smedegaard <[email protected]> wrote:Hi Jonas,
Quoted 6 lines
commit
37304aaf60bf("ConvertCONFIG_USE_PREBOOTandCONFIG_PREBOOTtoKconfig") intended to supportCONFIG_PREBOOT, butinclude/configs/sunxi-common.hhardcodes preboot as part of internally definedCONSOLE_STDIN_SETTINGS, silently ignoring any board-specificCONFIG_PREBOOT.
Quoted 6 lines
Quoted 2 lines
Simply moving
CONFIG_PREBOOTtoKconfigdoes 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/Kconfigdirectly:
config PREBOOT
default "usb start" ifUSB_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
Signature · 11 lines
* Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ [x] quote me freely [ ] ask before reusing [ ] keep private -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: signature URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200303/3d717c90/attachment.sig>