[U-Boot] [PATCH 6/6] sunxi: Add usb keyboard Kconfig option

Hans de Goede
2014-11-14T16:54:48Z

For use together with the hdmi console.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
board/sunxi/Kconfig | 7 +++++++
configs/Ippo_q8h_v5_defconfig | 1 +
include/configs/sunxi-common.h | 25 +++++++++++++++++++++----
3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 422033a..246cd9a 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -223,4 +223,11 @@ config VIDEO
Say Y here to add support for using a cfb console on the HDMI output
found on most sunxi devices.

+config USB_KEYBOARD
+ boolean "Enable USB keyboard support"
+ default y
+ ---help---
+ Say Y here to add support for using a USB keyboard (typically used
+ in combination with a graphical console on HDMI).
+
endif
diff --git a/configs/Ippo_q8h_v5_defconfig b/configs/Ippo_q8h_v5_defconfig
index 53df213..50c2f93 100644
--- a/configs/Ippo_q8h_v5_defconfig
+++ b/configs/Ippo_q8h_v5_defconfig
@@ -5,3 +5,4 @@ CONFIG_MACH_SUN8I=y
CONFIG_TARGET_IPPO_Q8H_V5=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5.dtb"
CONFIG_VIDEO=n
+CONFIG_USB_KEYBOARD=n
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index d7d8571..5d1b611 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -249,6 +249,12 @@
#define CONFIG_USB_STORAGE
#endif

+#ifdef CONFIG_USB_KEYBOARD
+#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
+#define CONFIG_PREBOOT
+#define CONFIG_SYS_STDIO_DEREGISTER
+#endif
+
#if !defined CONFIG_ENV_IS_IN_MMC && \
!defined CONFIG_ENV_IS_IN_NAND && \
!defined CONFIG_ENV_IS_IN_FAT && \
@@ -298,17 +304,28 @@

#include <config_distro_bootcmd.h>

+#ifdef CONFIG_USB_KEYBOARD
+#define CONSOLE_IN_SETTINGS \
+ "preboot=usb start\0" \
+ "stdin=serial,usbkbd\0"
+#else
+#define CONSOLE_IN_SETTINGS \
+ "stdin=serial\0"
+#endif
+
#ifdef CONFIG_VIDEO
-#define CONSOLE_ENV_SETTINGS \
- "stdin=serial\0" \
+#define CONSOLE_OUT_SETTINGS \
"stdout=serial,vga\0" \
"stderr=serial,vga\0"
#else
-#define CONSOLE_ENV_SETTINGS
+#define CONSOLE_OUT_SETTINGS \
+ "stdout=serial\0" \
+ "stderr=serial\0"
#endif

#define CONFIG_EXTRA_ENV_SETTINGS \
- CONSOLE_ENV_SETTINGS \
+ CONSOLE_IN_SETTINGS \
+ CONSOLE_OUT_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
"fdtfile=" CONFIG_FDTFILE "\0" \
"console=ttyS0,115200\0" \
--
2.1.0