[U-Boot] [PATCH v5 0/3] rockchip: firefly: Enabled the USB keyboard in the uboot

These three patches enable usbkeyboard drivers(usb_kbd.c) and set some environment variables to auto-start USB device. You can use the usbkeyboard instead of the serial input command in uboot.
Leo Wen (3): rockchip: firefly: Add some macros to enable the usb keyboard rockchip: firefly: Set the environment variable 'usbkbd' to the stdin rockchip: firefly: Add "usb start" to auto-start USB device
include/configs/firefly-rk3288.h | 5 +++-- include/configs/rk3288_common.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-)

Add four macros of CONFIG_USB_KEYBOARD,CONFIG_DM_KEYBOARD,etc in the rk3288_common.h,can support usb keyboard device when these four macros are enabled.
Signed-off-by: Leo Wen leo.wen@rock-chips.com --- include/configs/rk3288_common.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 488d679..9a74ef3 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -84,6 +84,10 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_KEYBOARD +#define CONFIG_DM_KEYBOARD +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_SYS_STDIO_DEREGISTER 1 #endif #define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00000000\0" \

On 25 Jul 2017, at 13:00, Leo Wen leo.wen@rock-chips.com wrote:
Add four macros of CONFIG_USB_KEYBOARD,CONFIG_DM_KEYBOARD,etc in the rk3288_common.h,can support usb keyboard device when these four macros are enabled.
Signed-off-by: Leo Wen leo.wen@rock-chips.com
include/configs/rk3288_common.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 488d679..9a74ef3 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -84,6 +84,10 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_KEYBOARD +#define CONFIG_DM_KEYBOARD
Both CONFIG_USB_KEYBOARD and CONFIG_DM_KEYBOARD are supported via defconfig. Please do not add these to the common header file, if we can enable them via defconfig.
+#define CONFIG_SYS_USB_EVENT_POLL
This is also available via defconfig.
+#define CONFIG_SYS_STDIO_DEREGISTER 1
Same.
#endif #define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00000000\0" \ -- 2.7.4

hi,Philipp
I'll modify them.
thanks,
-Leo
在 2017年07月25日 星期二 08:10 下午, Dr. Philipp Tomsich 写道:
On 25 Jul 2017, at 13:00, Leo Wen leo.wen@rock-chips.com wrote:
Add four macros of CONFIG_USB_KEYBOARD,CONFIG_DM_KEYBOARD,etc in the rk3288_common.h,can support usb keyboard device when these four macros are enabled.
Signed-off-by: Leo Wen leo.wen@rock-chips.com
include/configs/rk3288_common.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 488d679..9a74ef3 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -84,6 +84,10 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_SMSC95XX #define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_KEYBOARD +#define CONFIG_DM_KEYBOARD
Both CONFIG_USB_KEYBOARD and CONFIG_DM_KEYBOARD are supported via defconfig. Please do not add these to the common header file, if we can enable them via defconfig.
+#define CONFIG_SYS_USB_EVENT_POLL
This is also available via defconfig.
+#define CONFIG_SYS_STDIO_DEREGISTER 1
Same.
#endif #define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00000000\0" \ -- 2.7.4

Add the 'usbkbd' environment variable to the 'stdin', the contents of the keyboard input can be auto-displayed on the serial terminal,so you don't need to manually set the environment variable 'stdin'.
Signed-off-by: Leo Wen leo.wen@rock-chips.com --- include/configs/firefly-rk3288.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/firefly-rk3288.h b/include/configs/firefly-rk3288.h index b4dcf23..6ef0960 100644 --- a/include/configs/firefly-rk3288.h +++ b/include/configs/firefly-rk3288.h @@ -8,7 +8,7 @@ #define __CONFIG_H
#define ROCKCHIP_DEVICE_SETTINGS \ - "stdin=serial,cros-ec-keyb\0" \ + "stdin=serial,usbkbd\0" \ "stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0"

Add "preboot=usb start" to ROCKCHIP_DEVICE_SETTINGS,you don't need to input "usb start" in command line of u-boot console,it can auto-start the USB device,after that usb keyboard can work.
Signed-off-by: Leo Wen leo.wen@rock-chips.com --- include/configs/firefly-rk3288.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/configs/firefly-rk3288.h b/include/configs/firefly-rk3288.h index 6ef0960..c99ab99 100644 --- a/include/configs/firefly-rk3288.h +++ b/include/configs/firefly-rk3288.h @@ -10,7 +10,8 @@ #define ROCKCHIP_DEVICE_SETTINGS \ "stdin=serial,usbkbd\0" \ "stdout=serial,vidconsole\0" \ - "stderr=serial,vidconsole\0" + "stderr=serial,vidconsole\0" \ + "preboot=usb start\0"
#include <configs/rk3288_common.h>

It would be useful to have a changelog between revisions.
Peter
On Tue, Jul 25, 2017 at 12:00 PM, Leo Wen leo.wen@rock-chips.com wrote:
These three patches enable usbkeyboard drivers(usb_kbd.c) and set some environment variables to auto-start USB device. You can use the usbkeyboard instead of the serial input command in uboot.
Leo Wen (3): rockchip: firefly: Add some macros to enable the usb keyboard rockchip: firefly: Set the environment variable 'usbkbd' to the stdin rockchip: firefly: Add "usb start" to auto-start USB device
include/configs/firefly-rk3288.h | 5 +++-- include/configs/rk3288_common.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-)
-- 2.7.4
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
participants (4)
-
Dr. Philipp Tomsich
-
leo
-
Leo Wen
-
Peter Robinson