diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 087b721eea..50ebeba724 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -57,7 +57,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3399-puma-ddr1333.dtb \ rk3399-puma-ddr1600.dtb \ rk3399-puma-ddr1866.dtb \ - rv1108-evb.dtb + rv1108-evb.dtb \ + px3se-evb.dtb dtb-$(CONFIG_ARCH_MESON) += \ meson-gxbb-odroidc2.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ diff --git a/arch/arm/dts/px3se-evb.dts b/arch/arm/dts/px3se-evb.dts new file mode 100644 index 0000000000..9546bdad03 --- /dev/null +++ b/arch/arm/dts/px3se-evb.dts @@ -0,0 +1,96 @@ +/* + * (C) Copyright 2017 Rockchip Electronics Co., Ltd + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "rk3128.dtsi" +#include "rk3128-u-boot.dtsi" + +/ { + model = "Rockchip RK3128 Evaluation board"; + compatible = "rockchip,rk3128-evb", "rockchip,rk3128"; + + chosen { + stdout-path = &uart2; + }; + + vcc5v0_otg: vcc5v0-otg-drv { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_otg"; + gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&otg_vbus_drv>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vcc5v0_host: vcc5v0-host-drv { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_host"; + gpio = <&gpio2 23 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&host_vbus_drv>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; +}; + +&i2c1 { + status = "okay"; + + hym8563: hym8563@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "xin32k"; + }; +}; + +&u2phy { + status = "okay"; +}; + +&u2phy_otg { + status = "okay"; +}; + +&u2phy_host { + status = "okay"; +}; + +&usb_host_ehci { + status = "okay"; +}; + +&usb_host_ohci { + status = "okay"; +}; + +&usb_otg { + vbus-supply = <&vcc5v0_otg>; + status = "okay"; +}; + +&emmc { + fifo-mode; + status = "okay"; +}; + +&pinctrl { + usb_otg { + otg_vbus_drv: otg-vbus-drv { + rockchip,pins = <0 26 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + usb_host { + host_vbus_drv: host-vbus-drv { + rockchip,pins = <2 23 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; diff --git a/configs/evb-px3se_defconfig b/configs/evb-px3se_defconfig new file mode 100644 index 0000000000..7ddc4932cd --- /dev/null +++ b/configs/evb-px3se_defconfig @@ -0,0 +1,55 @@ +CONFIG_ARM=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_ROCKCHIP_RK3128=y +CONFIG_DEFAULT_DEVICE_TREE="px3se-evb" +CONFIG_DEBUG_UART=y +CONFIG_FIT=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_CMD_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x60800800 +CONFIG_FASTBOOT_BUF_SIZE=0x04000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +# CONFIG_CMD_IMLS is not set +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_TIME=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y +CONFIG_CLK=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_PHY=y +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PINCTRL=y +CONFIG_REGULATOR_PWM=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_RAM=y +CONFIG_DM_RESET=y +CONFIG_DEBUG_UART_BASE=0x20068000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_NS16550=y +CONFIG_SYSRESET=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_GENERIC=y +CONFIG_USB_DWC2=y +CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="Rockchip" +CONFIG_G_DNL_VENDOR_NUM=0x2207 +CONFIG_G_DNL_PRODUCT_NUM=0x310c +CONFIG_USE_TINY_PRINTF=y +CONFIG_ERRNO_STR=y diff --git a/make.sh b/make.sh index 62419d277a..3551d27b93 100755 --- a/make.sh +++ b/make.sh @@ -2,8 +2,9 @@ set -e BOARD=$1 SUBCMD=$2 -RKCHIP=${BOARD##*-} -RKCHIP=$(echo ${RKCHIP} | tr '[a-z]' '[A-Z]') +RKTRUST_CHIP=${BOARD##*-} +RKTRUST_CHIP=$(echo ${RKTRUST_CHIP} | tr '[a-z]' '[A-Z]') +RKBOOT_CHIP=$RKTRUST_CHIP JOB=`sed -n "N;/processor/p" /proc/cpuinfo|wc -l` SUPPROT_LIST=`ls configs/*-r[v,k][0-9][0-9][0-9][0-9]_defconfig` @@ -129,8 +130,12 @@ sub_commands() fixup_chip_name() { - if [ "$RKCHIP" = 'RK3228' -o "$RKCHIP" = 'RK3229' ]; then - RKCHIP=RK322X + if [ "$RKTRUST_CHIP" = 'RK3228' -o "$RKTRUST_CHIP" = 'RK3229' ]; then + RKBOOT_CHIP=RK322X + RKTRUST_CHIP=RK322X + elif [ "$RKTRUST_CHIP" = 'PX3SE' ]; then + RKBOOT_CHIP=PX3SE + RKTRUST_CHIP=RK3126 fi } @@ -154,26 +159,26 @@ pack_uboot_image() pack_loader_image() { - if [ ! -f ${RKBIN}/RKBOOT/${RKCHIP}MINIALL.ini ]; then - echo "pack loader failed! Can't find: ${RKBIN}/RKBOOT/${RKCHIP}MINIALL.ini" + if [ ! -f ${RKBIN}/RKBOOT/${RKBOOT_CHIP}MINIALL.ini ]; then + echo "pack loader failed! Can't find: ${RKBIN}/RKBOOT/${RKBOOT_CHIP}MINIALL.ini" return fi cd ${RKBIN} - ${TOOLCHAIN_RKBIN}/boot_merger --replace tools/rk_tools/ ./ ${RKBIN}/RKBOOT/${RKCHIP}MINIALL.ini + ${TOOLCHAIN_RKBIN}/boot_merger --replace tools/rk_tools/ ./ ${RKBIN}/RKBOOT/${RKBOOT_CHIP}MINIALL.ini cd - mv ${RKBIN}/*_loader_*.bin ./ - echo "pack loader okay! Input: ${RKBIN}/RKBOOT/${RKCHIP}MINIALL.ini" + echo "pack loader okay! Input: ${RKBIN}/RKBOOT/${RKBOOT_CHIP}MINIALL.ini" } pack_mass_trust_image() { local TOS0 TOS1 IMG0 IMG1 DARM_BASE TEE_LOAD_ADDR TEE_OFFSET=0x8400000 - TOS0=`sed -n "/TOS0=/s/TOS0=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - TOS1=`sed -n "/TOS1=/s/TOS1=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - IMG0=`sed -n "/PATH0=/s/PATH0=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - IMG1=`sed -n "/PATH1=/s/PATH1=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` + TOS0=`sed -n "/TOS0=/s/TOS0=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + TOS1=`sed -n "/TOS1=/s/TOS1=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + IMG0=`sed -n "/PATH0=/s/PATH0=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + IMG1=`sed -n "/PATH1=/s/PATH1=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` # OP-TEE is 132M(0x8400000) offset from DRAM base. DARM_BASE=`sed -n "/CONFIG_SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" ${OUTDIR}/include/autoconf.mk|tr -d '\r'` @@ -183,10 +188,10 @@ pack_mass_trust_image() TEE_LOAD_ADDR=$(echo "obase=16;${TEE_LOAD_ADDR}"|bc) # Parse orignal path - TOS0=`sed -n "/TOS0=/s/TOS0=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - TOS1=`sed -n "/TOS1=/s/TOS1=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - IMG0=`sed -n "/PATH0=/s/PATH0=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - IMG1=`sed -n "/PATH1=/s/PATH1=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` + TOS0=`sed -n "/TOS0=/s/TOS0=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + TOS1=`sed -n "/TOS1=/s/TOS1=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + IMG0=`sed -n "/PATH0=/s/PATH0=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + IMG1=`sed -n "/PATH1=/s/PATH1=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` # replace "./tools/rk_tools/" with "./" to compatible legacy ini content of rkdevelop branch TOS0=$(echo ${TOS0} | sed "s/tools\/rk_tools\//\.\//g") @@ -213,30 +218,30 @@ pack_trust_image() # ARM64 uses trust_merger if grep -q '^CONFIG_ARM64=y' ${OUTDIR}/.config ; then - if [ ! -f ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini ]; then - echo "pack trust failed! Can't find: ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini" + if [ ! -f ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini ]; then + echo "pack trust failed! Can't find: ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini" return fi cd ${RKBIN} # RK3308/PX30/RK3326 use RSA-PKCS1 V2.1, it's pack magic is "3" - if [ $RKCHIP = "PX30" -o $RKCHIP = "RK3326" -o $RKCHIP = "RK3308" ]; then - ${TOOLCHAIN_RKBIN}/trust_merger --rsa 3 --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini + if [ $RKTRUST_CHIP = "PX30" -o $RKTRUST_CHIP = "RK3326" -o $RKTRUST_CHIP = "RK3308" ]; then + ${TOOLCHAIN_RKBIN}/trust_merger --rsa 3 --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini # RK3368 use rk big endian SHA256, it's pack magic is "2" - elif [ $RKCHIP = "RK3368" ]; then - ${TOOLCHAIN_RKBIN}/trust_merger --sha 2 --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini + elif [ $RKTRUST_CHIP = "RK3368" ]; then + ${TOOLCHAIN_RKBIN}/trust_merger --sha 2 --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini else - ${TOOLCHAIN_RKBIN}/trust_merger --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini + ${TOOLCHAIN_RKBIN}/trust_merger --replace tools/rk_tools/ ./ ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini fi cd - mv ${RKBIN}/trust.img ./trust.img - echo "pack trust okay! Input: ${RKBIN}/RKTRUST/${RKCHIP}TRUST.ini" + echo "pack trust okay! Input: ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TRUST.ini" # ARM uses loaderimage else - if [ ! -f ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini ]; then - echo "pack trust failed! Can't find: ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini" + if [ ! -f ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini ]; then + echo "pack trust failed! Can't find: ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini" return fi @@ -248,8 +253,8 @@ pack_trust_image() TEE_LOAD_ADDR=$(echo "obase=16;${TEE_LOAD_ADDR}"|bc) # Parse orignal path - TOS=`sed -n "/TOS=/s/TOS=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` - TOS_TA=`sed -n "/TOSTA=/s/TOSTA=//p" ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini|tr -d '\r'` + TOS=`sed -n "/TOS=/s/TOS=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` + TOS_TA=`sed -n "/TOSTA=/s/TOSTA=//p" ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini|tr -d '\r'` # replace "./tools/rk_tools/" with "./" to compatible legacy ini content of rkdevelop branch TOS=$(echo ${TOS} | sed "s/tools\/rk_tools\//\.\//g") @@ -270,7 +275,7 @@ pack_trust_image() pack_mass_trust_image fi - echo "pack trust okay! Input: ${RKBIN}/RKTRUST/${RKCHIP}TOS.ini" + echo "pack trust okay! Input: ${RKBIN}/RKTRUST/${RKTRUST_CHIP}TOS.ini" fi }