Skip to contentSkip to conversation

config_distro_bootcmd.h: Allow user to indicate that usb is inited in preboot

PATCH Superseded Hans de Goede 1 participant 2 messages Nov 23, 2014 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 config_distro_bootcmd.h: Allow user to indicate that usb is inited in preboot

When using usb-keyboard support, typically usb will already get started from preboot. In this case doing it again in the bootcmd is undesirable.

Allow the user of config_distro_bootcmd to indicate that usb is inited in preboot through the user setting BOOTENV_PREBOOT_INITS_USB.

---
 include/config_distro_bootcmd.h | 4 ++++
 1 file changed, 4 insertions(+)
include/config_distro_bootcmd.h +4 -0
index be616e8..fd01a34 100644
@@ -91,7 +91,11 @@
 
 #ifdef CONFIG_CMD_USB
 #define BOOTENV_RUN_USB_INIT "run usb_init; "
+#ifndef BOOTENV_PREBOOT_INITS_USB
 #define BOOTENV_SET_USB_NEED_INIT "setenv usb_need_init; "
+#else
+#define BOOTENV_SET_USB_NEED_INIT "setenv usb_need_init false; "
+#endif
 #define BOOTENV_SHARED_USB \
 	"usb_init=" \
 		"if ${usb_need_init}; then " \
Signature · 1 line
2.1.0
#1 lore raw

PATCH 2/2 sunxi: Avoid usb getting scanned twice when using usb kbd + usb boot

Use the new BOOTENV_PREBOOT_INITS_USB define to avoid usb being scanned twice when using usb kbd + usb boot.

---
 include/configs/sunxi-common.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/configs/sunxi-common.h +3 -2
index 3f890b2..7b958f8 100644
@@ -302,12 +302,11 @@
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
 
-#include <config_distro_bootcmd.h>
-
 #ifdef CONFIG_USB_KEYBOARD
 #define CONSOLE_STDIN_SETTINGS \
 	"preboot=usb start\0" \
 	"stdin=serial,usbkbd\0"
+#define BOOTENV_PREBOOT_INITS_USB
 #else
 #define CONSOLE_STDIN_SETTINGS \
 	"stdin=serial\0"
@@ -327,6 +326,8 @@
 	CONSOLE_STDIN_SETTINGS \
 	CONSOLE_STDOUT_SETTINGS
 
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	CONSOLE_ENV_SETTINGS \
 	MEM_LAYOUT_ENV_SETTINGS \
Signature · 1 line
2.1.0