diff options
-rw-r--r-- | arch/arm/dts/rv1108-elgin-r1.dts | 11 | ||||
-rw-r--r-- | arch/arm/dts/rv1108-u-boot.dtsi | 6 | ||||
-rw-r--r-- | board/elgin/elgin_rv1108/elgin_rv1108.c | 9 | ||||
-rw-r--r-- | board/rockchip/evb_rv1108/evb_rv1108.c | 7 | ||||
-rw-r--r-- | configs/elgin-rv1108_defconfig | 2 | ||||
-rw-r--r-- | configs/miqi-rk3288_defconfig | 1 | ||||
-rw-r--r-- | configs/roc-pc-rk3399_defconfig | 1 | ||||
-rw-r--r-- | configs/rock2_defconfig | 1 | ||||
-rw-r--r-- | configs/tinker-rk3288_defconfig | 1 | ||||
-rw-r--r-- | configs/tinker-s-rk3288_defconfig | 1 | ||||
-rw-r--r-- | include/configs/miqi_rk3288.h | 2 | ||||
-rw-r--r-- | include/configs/roc-pc-rk3399.h | 2 | ||||
-rw-r--r-- | include/configs/rock2.h | 2 | ||||
-rw-r--r-- | include/configs/tinker_rk3288.h | 2 | ||||
-rw-r--r-- | include/configs/vyasa-rk3288.h | 2 | ||||
-rw-r--r-- | tools/rkcommon.c | 6 |
16 files changed, 40 insertions, 16 deletions
diff --git a/arch/arm/dts/rv1108-elgin-r1.dts b/arch/arm/dts/rv1108-elgin-r1.dts index 32b95940b0..83e8b31838 100644 --- a/arch/arm/dts/rv1108-elgin-r1.dts +++ b/arch/arm/dts/rv1108-elgin-r1.dts @@ -40,9 +40,20 @@ }; &uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2m0_xfer_pullup>; status = "okay"; }; &usb20_otg { status = "okay"; }; + +&pinctrl { + uart2m0 { + uart2m0_xfer_pullup: uart2m0-xfer-pullup { + rockchip,pins = <2 RK_PD2 RK_FUNC_1 &pcfg_pull_up_drv_8ma>, + <2 RK_PD1 RK_FUNC_1 &pcfg_pull_up_drv_8ma>; + }; + }; +}; diff --git a/arch/arm/dts/rv1108-u-boot.dtsi b/arch/arm/dts/rv1108-u-boot.dtsi new file mode 100644 index 0000000000..41ac054b81 --- /dev/null +++ b/arch/arm/dts/rv1108-u-boot.dtsi @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> + */ + +#include "rockchip-u-boot.dtsi" diff --git a/board/elgin/elgin_rv1108/elgin_rv1108.c b/board/elgin/elgin_rv1108/elgin_rv1108.c index 607667ac63..c5a1cc95e4 100644 --- a/board/elgin/elgin_rv1108/elgin_rv1108.c +++ b/board/elgin/elgin_rv1108/elgin_rv1108.c @@ -5,8 +5,9 @@ */ #include <common.h> +#include <syscon.h> #include <asm/io.h> -#include <fdtdec.h> +#include <asm/arch-rockchip/clock.h> #include <asm/arch-rockchip/grf_rv1108.h> #include <asm/arch-rockchip/hardware.h> #include <asm/gpio.h> @@ -15,7 +16,6 @@ DECLARE_GLOBAL_DATA_PTR; int mach_cpu_init(void) { - int node; struct rv1108_grf *grf; enum { GPIO3C3_SHIFT = 6, @@ -35,8 +35,7 @@ int mach_cpu_init(void) GPIO2D1_UART2_SIN_M0, }; - node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf"); - grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); + grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); /* Elgin board use UART2 m0 for debug*/ rk_clrsetreg(&grf->gpio2d_iomux, @@ -50,7 +49,7 @@ int mach_cpu_init(void) #define MODEM_ENABLE_GPIO 111 -int board_early_init_f(void) +int rk_board_late_init(void) { gpio_request(MODEM_ENABLE_GPIO, "modem_enable"); gpio_direction_output(MODEM_ENABLE_GPIO, 0); diff --git a/board/rockchip/evb_rv1108/evb_rv1108.c b/board/rockchip/evb_rv1108/evb_rv1108.c index 733f29376e..5d622c3737 100644 --- a/board/rockchip/evb_rv1108/evb_rv1108.c +++ b/board/rockchip/evb_rv1108/evb_rv1108.c @@ -5,8 +5,9 @@ */ #include <common.h> +#include <syscon.h> #include <asm/io.h> -#include <fdtdec.h> +#include <asm/arch-rockchip/clock.h> #include <asm/arch-rockchip/grf_rv1108.h> #include <asm/arch-rockchip/hardware.h> @@ -14,7 +15,6 @@ DECLARE_GLOBAL_DATA_PTR; int mach_cpu_init(void) { - int node; struct rv1108_grf *grf; enum { GPIO3C3_SHIFT = 6, @@ -34,8 +34,7 @@ int mach_cpu_init(void) GPIO2D1_UART2_SIN_M0, }; - node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf"); - grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); + grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); /*evb board use UART2 m0 for debug*/ rk_clrsetreg(&grf->gpio2d_iomux, diff --git a/configs/elgin-rv1108_defconfig b/configs/elgin-rv1108_defconfig index 62af7634a3..b6682994f5 100644 --- a/configs/elgin-rv1108_defconfig +++ b/configs/elgin-rv1108_defconfig @@ -4,12 +4,14 @@ CONFIG_SYS_TEXT_BASE=0x60000000 CONFIG_ENV_OFFSET=0x3F8000 CONFIG_ROCKCHIP_RV1108=y CONFIG_TARGET_ELGIN_RV1108=y +CONFIG_ROCKCHIP_BOOT_MODE_REG=0 CONFIG_NR_DRAM_BANKS=1 CONFIG_DEBUG_UART_BASE=0x10210000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEBUG_UART=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_DEFAULT_FDT_FILE="rv1108-elgin-r1.dtb" +CONFIG_BOARD_LATE_INIT=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_CMD_GPIO=y diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig index edba9da31b..e3e205fd54 100644 --- a/configs/miqi-rk3288_defconfig +++ b/configs/miqi-rk3288_defconfig @@ -75,6 +75,7 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y # CONFIG_VIDEO_BPP8 is not set CONFIG_DISPLAY=y diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig index 659c67a033..d540a17aeb 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -56,5 +56,6 @@ CONFIG_USB_ETHER_ASIX88179=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_USB_KEYBOARD=y CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig index bb12b32a21..cf71c85927 100644 --- a/configs/rock2_defconfig +++ b/configs/rock2_defconfig @@ -74,6 +74,7 @@ CONFIG_USB_DWC2=y CONFIG_ROCKCHIP_USB2_PHY=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y # CONFIG_VIDEO_BPP8 is not set CONFIG_DISPLAY=y diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig index 50820ba08e..034d28ea2d 100644 --- a/configs/tinker-rk3288_defconfig +++ b/configs/tinker-rk3288_defconfig @@ -80,6 +80,7 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y CONFIG_DISPLAY=y CONFIG_VIDEO_ROCKCHIP=y diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig index ab192cf4e4..06c5d9b507 100644 --- a/configs/tinker-s-rk3288_defconfig +++ b/configs/tinker-s-rk3288_defconfig @@ -80,6 +80,7 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y # CONFIG_VIDEO_BPP8 is not set CONFIG_DISPLAY=y diff --git a/include/configs/miqi_rk3288.h b/include/configs/miqi_rk3288.h index c9691a0392..e19fa90212 100644 --- a/include/configs/miqi_rk3288.h +++ b/include/configs/miqi_rk3288.h @@ -7,7 +7,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" diff --git a/include/configs/roc-pc-rk3399.h b/include/configs/roc-pc-rk3399.h index 3fd1062542..d4cbc3532e 100644 --- a/include/configs/roc-pc-rk3399.h +++ b/include/configs/roc-pc-rk3399.h @@ -7,7 +7,7 @@ #define __ROC_PC_RK3399_H #define ROCKCHIP_DEVICE_SETTINGS \ - "stdin=serial,cros-ec-keyb\0" \ + "stdin=serial,usbkbd\0" \ "stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0" diff --git a/include/configs/rock2.h b/include/configs/rock2.h index 917caf4d53..9e4a66902b 100644 --- a/include/configs/rock2.h +++ b/include/configs/rock2.h @@ -7,7 +7,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" diff --git a/include/configs/tinker_rk3288.h b/include/configs/tinker_rk3288.h index f1095ccd0e..d239e3beb1 100644 --- a/include/configs/tinker_rk3288.h +++ b/include/configs/tinker_rk3288.h @@ -7,7 +7,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" diff --git a/include/configs/vyasa-rk3288.h b/include/configs/vyasa-rk3288.h index e31dc77720..c3521cac41 100644 --- a/include/configs/vyasa-rk3288.h +++ b/include/configs/vyasa-rk3288.h @@ -9,7 +9,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" diff --git a/tools/rkcommon.c b/tools/rkcommon.c index c2382dfe5a..8f281f5901 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -307,11 +307,13 @@ static int rkcommon_parse_header(const void *buf, struct header0_info *header0, rkcommon_offset_to_spi(hdr1_offset)); for (i = 0; i < ARRAY_SIZE(spl_infos); i++) { - if (!memcmp(&hdr1_sdmmc->magic, spl_infos[i].spl_hdr, 4)) { + if (!memcmp(&hdr1_sdmmc->magic, spl_infos[i].spl_hdr, + RK_SPL_HDR_SIZE)) { if (spl_info) *spl_info = &spl_infos[i]; return IH_TYPE_RKSD; - } else if (!memcmp(&hdr1_spi->magic, spl_infos[i].spl_hdr, 4)) { + } else if (!memcmp(&hdr1_spi->magic, spl_infos[i].spl_hdr, + RK_SPL_HDR_SIZE)) { if (spl_info) *spl_info = &spl_infos[i]; return IH_TYPE_RKSPI; |