[Firefly-RK3399] U-Boot配置使用键盘与2.4G无线遥控
Posted Neutionwei
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Firefly-RK3399] U-Boot配置使用键盘与2.4G无线遥控相关的知识,希望对你有一定的参考价值。
1、键盘与2.4G无线遥控驱动文件
./common/usb_kbd.c
2、补丁添加
diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h
index 5565c7ce53..a8b34785e4 100644
--- a/include/configs/evb_rk3399.h
+++ b/include/configs/evb_rk3399.h
@@ -27,6 +27,7 @@
#define CONFIG_BMP_32BPP
#define ROCKCHIP_DEVICE_SETTINGS \\
+ "stdin=serial,usbkbd\\0" \\
"stdout=serial,vidconsole\\0" \\
"stderr=serial,vidconsole\\0"
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 600df16345..9be30d5b22 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -262,11 +262,22 @@ static int boot_from_udisk(void)
#endif
+#ifdef CONFIG_USB_KEYBOARD
+static int board_usbkbd_scan(void)
+{
+ int flag;
+ struct stdio_dev *dev;
+
+ dev = NULL;
+ flag = DEV_FLAGS_INPUT;
+ if (!run_command("usb start", -1)) {
+ dev = search_device(flag, "usbkbd");
+ if (dev)
+ return 0;
+ else {
+ printf("No usbkbd dev found\\n");
+ return -ENODEV;
+ }
+ } else
+ return -ENODEV;
+}
+#endif
@@ -411,7 +422,7 @@ int board_late_init(void)
#endif
+#ifdef CONFIG_USB_KEYBOARD
+ board_usbkbd_scan();
+#endif
3、config配置
CONFIG_DM_KEYBOARD
CONFIG_USB_KEYBOARD
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
4、编译
./make.sh firefly-rk3399
5、烧写
把编译生成的uboot.img
烧写到eMMC:
sudo ../tools/linux/Linux_Upgrade_Tool/upgrade_tool di -u uboot.img
以上是关于[Firefly-RK3399] U-Boot配置使用键盘与2.4G无线遥控的主要内容,如果未能解决你的问题,请参考以下文章
[Firefly-RK3399] U-Boot shell中增加saveenv命令
[Firefly-RK3399] U-Boot配置启动时进入启动菜单bootmenu
[Firefly-RK3399] U-Boot适配红外遥控器IR