commit 1c698d819f25891f1500c2fa19d08f24536e2aa6 Author: zhuchunyi Date: Wed Nov 6 19:54:55 2019 +0800 update code diff --git a/10-devicetree.install b/10-devicetree.install new file mode 100755 index 0000000..752e5d0 --- /dev/null +++ b/10-devicetree.install @@ -0,0 +1,61 @@ +#!/bin/bash + +# set -x + +if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]] +then +COMMAND="$1" +KERNEL_VERSION="$2" +#BOOT_DIR_ABS="$3" +#KERNEL_IMAGE="$4" + +# Setup a /boot/dtb -> /boot/dtb-$newest_kernel_version symlink so that +# u-boot can find the correct dtb to load. +# +# If invoked to 'add' a new kernel, find the newest based on `sort`ing +# the kernel versions dtb. If 'remove', then follow basically the same +# procedure but exclude the version currently being removed. +# +# The theory of operation here is that, while newer kernels may add new +# dtb nodes and fields, as upstreaming hw support for some particular +# device progresses, it should never make backward incompatible changes. +# So it should always be safe to use a newer dtb with an older kernel. + + list_dtb_versions() { + excluded_version="$1" + for dtbdir in /boot/dtb-*; do + dtbver=${dtbdir#*-} + if [ "$dtbver" != "$excluded_version" ]; then + echo $dtbver + fi + done + } + + setup_dtb_link() { + ver=`list_dtb_versions $1 | sort -r --sort=version | head -1` + if [ -h /boot/dtb ]; then + rm -f /boot/dtb + fi + ln -s dtb-$ver /boot/dtb + } + + ret=0 + case "$COMMAND" in + add) + # If we're adding a kernel we want that version + if [ -h /boot/dtb ]; then + rm -f /boot/dtb + fi + ln -s dtb-$KERNEL_VERSION /boot/dtb + ret=$? + ;; + remove) + setup_dtb_link $KERNEL_VERSION + ret=$? + ;; + esac + exit $ret +else + # Just exit on non ARM + exit 0 +fi diff --git a/aarch64-boards b/aarch64-boards new file mode 100644 index 0000000..054230c --- /dev/null +++ b/aarch64-boards @@ -0,0 +1,40 @@ +a64-olinuxino +avnet_ultra96_rev1 +bananapi_m64 +dragonboard410c +dragonboard820c +espresso7420 +evb-rk3328 +evb-rk3399 +firefly-rk3399 +geekbox +hikey +khadas-vim +libretech-cc +libretech_all_h3_cc_h5 +mvebu_espressobin-88f3720 +mvebu_mcbin-88f8040 +nanopi-k2 +nanopi_neo2 +nanopi_neo_plus2 +odroid-c2 +orangepi_one_plus +orangepi_pc2 +orangepi_prime +orangepi_win +orangepi_zero_plus +orangepi_zero_plus2 +p212 +p2371-2180 +p2771-0000-500 +pine_h64 +pine64_plus +poplar +rock960-rk3399 +rpi_3 +sopine_baseboard +turris_mox +vexpress_aemv8a_dram +vexpress_aemv8a_juno +vexpress_aemv8a_semi +xilinx_zynqmp_zcu100_revC diff --git a/aarch64-chromebooks b/aarch64-chromebooks new file mode 100644 index 0000000..e69de29 diff --git a/arm-boards b/arm-boards new file mode 100644 index 0000000..95c7f5a --- /dev/null +++ b/arm-boards @@ -0,0 +1,143 @@ +A10-OLinuXino-Lime +A10s-OLinuXino-M +A13-OLinuXino +A13-OLinuXinoM +A20-Olimex-SOM-EVB +A20-OLinuXino-Lime +A20-OLinuXino-Lime2 +A20-OLinuXino_MICRO +am335x_boneblack +am335x_evm +am335x_evm_usbspl +am57xx_evm +Ampe_A76 +arndale +Auxtek-T003 +Auxtek-T004 +ba10_tv_box +Bananapi +bananapi_m2_berry +Bananapi_M2_Ultra +Bananapro +chiliboard +CHIP +Chuwi_V7_CW0825 +clearfog +cl-som-am57x +cm_fx6 +Colombus +colorfly_e708_q1 +CSQ_CS908 +Cubieboard +Cubieboard2 +Cubieboard4 +Cubietruck +Cubietruck_plus +db-mv784mp-gp +difrnce_dit4350 +dserve_dsrv9703c +evb-rk3229 +fennec-rk3288 +firefly-rk3288 +helios4 +Hummingbird_A31 +Hyundai_A7HD +i12-tvbox +icnova-a20-swac +inet1 +iNet_3F +iNet_3W +inet86dz +iNet_86VS +inet97fv2 +inet98v_rev2 +inet9f_rev03 +inet_q972 +Itead_Ibox_A20 +jesurun_q5 +jetson-tk1 +kc1 +Lamobo_R1 +libretech_all_h3_cc_h2_plus +Linksprite_pcDuino +Linksprite_pcDuino3 +Linksprite_pcDuino3_Nano +liteboard +marsboard +Marsboard_A10 +Mele_A1000 +Mele_A1000G_quad +Mele_I7 +Mele_M3 +Mele_M5 +Mele_M9 +Mini-X +mk802 +mk802_a10s +mk802ii +MK808C +MSI_Primo73 +MSI_Primo81 +mx6cuboxi +nanopi_m1 +nanopi_m1_plus +nanopi_neo +novena +odroid +odroid-xu3 +omap3_beagle +omap3_pandora +omap4_panda +omap5_uevm +Orangepi +orangepi_2 +orangepi_lite +Orangepi_mini +orangepi_one +orangepi_pc +orangepi_pc_plus +orangepi_plus +orangepi_plus2e +orangepi_r1 +orangepi_zero +origen +paz00 +polaroid_mid2809pxe04 +pov_protab2_ips9 +q8_a13_tablet +q8_a23_tablet_800x480 +q8_a33_tablet_1024x600 +q8_a33_tablet_800x480 +qemu_arm +r7-tv-dongle +riotboard +rock +rock2 +rpi_2 +rpi_3_32b +Sinlinx_SinA31s +Sinovoip_BPI_M2 +Sinovoip_BPI_M2_Plus +Sinovoip_BPI_M3 +smdkv310 +stih410-b2260 +sunxi_Gemei_G9 +tbs_a711 +tinker-rk3288 +trimslice +turris_omnia +udoo +udoo_neo +usbarmory +UTOO_P66 +vexpress_ca15_tc2 +vexpress_ca9x4 +wandboard +warp +warp7 +Wexler_TAB7200 +Wits_Pro_A20_DKT +Yones_Toptech_BS1078_V2 +zynq_microzed +zynq_zed +zynq_zybo diff --git a/arm-chromebooks b/arm-chromebooks new file mode 100644 index 0000000..899c823 --- /dev/null +++ b/arm-chromebooks @@ -0,0 +1,8 @@ +chromebit_mickey_defconfig +chromebook_jerry_defconfig +chromebook_minnie_defconfig +nyan-big_defconfig +peach-pi_defconfig +peach-pit_defconfig +snow_defconfig +spring_defconfig diff --git a/dragonboard-fixes.patch b/dragonboard-fixes.patch new file mode 100644 index 0000000..10ee96b --- /dev/null +++ b/dragonboard-fixes.patch @@ -0,0 +1,114 @@ +From fbd0bffb20ca5edd21bbeb7cc20e24d091ab4280 Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Wed, 21 Jun 2017 14:21:15 -0400 +Subject: [PATCH 1/4] WIP: fix usb + +--- + common/usb_storage.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/common/usb_storage.c b/common/usb_storage.c +index a91b1c0d2f..caea87a09f 100644 +--- a/common/usb_storage.c ++++ b/common/usb_storage.c +@@ -1018,7 +1018,7 @@ static int usb_request_sense(struct scsi_cmd *srb, struct us_data *ss) + + static int usb_test_unit_ready(struct scsi_cmd *srb, struct us_data *ss) + { +- int retries = 10; ++ int retries = 20; + + do { + memset(&srb->cmd[0], 0, 12); +@@ -1041,7 +1041,7 @@ static int usb_test_unit_ready(struct scsi_cmd *srb, struct us_data *ss) + if ((srb->sense_buf[2] == 0x02) && + (srb->sense_buf[12] == 0x3a)) + return -1; +- mdelay(100); ++ mdelay(250); + } while (retries--); + + return -1; +-- +2.14.3 + +From d1b25b8d6461c5278228d657de9c24e0979e4b9d Mon Sep 17 00:00:00 2001 +From: Rob Clark +Date: Mon, 3 Jul 2017 08:34:37 -0400 +Subject: [PATCH 2/4] HACK: disable emmc + +Hitting some timeout which makes boot take much longer. And +uefi/boot/rootfs partitions will be on sd-card or usb disk, etc, +so we can just ignore emmc. +--- + arch/arm/dts/dragonboard410c.dts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts +index 5ccfe7f8c8..9e2d3f5d9b 100644 +--- a/arch/arm/dts/dragonboard410c.dts ++++ b/arch/arm/dts/dragonboard410c.dts +@@ -67,6 +67,7 @@ + reg = <0x78d9000 0x400>; + }; + ++/* + sdhci@07824000 { + compatible = "qcom,sdhci-msm-v4"; + reg = <0x7824900 0x11c 0x7824000 0x800>; +@@ -76,6 +77,7 @@ + clock = <&clkc 0>; + clock-frequency = <100000000>; + }; ++*/ + + sdhci@07864000 { + compatible = "qcom,sdhci-msm-v4"; +-- +2.14.3 +From 6baac1d73a20f880cb91f3bc03fe4f9cf88c61f6 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 4 Sep 2018 12:21:59 +0100 +Subject: [PATCH] add options for dm410c config + +--- + configs/dragonboard410c_defconfig | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig +index 96a831443a..d167c765b1 100644 +--- a/configs/dragonboard410c_defconfig ++++ b/configs/dragonboard410c_defconfig +@@ -6,6 +6,8 @@ CONFIG_DISTRO_DEFAULTS=y + CONFIG_NR_DRAM_BANKS=1 + CONFIG_FIT=y + CONFIG_OF_BOARD_SETUP=y ++CONFIG_FAT_WRITE=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y + CONFIG_MISC_INIT_R=y + # CONFIG_DISPLAY_CPUINFO is not set + # CONFIG_DISPLAY_BOARDINFO is not set +@@ -35,6 +37,13 @@ CONFIG_DM_PMIC=y + CONFIG_PMIC_PM8916=y + CONFIG_MSM_SERIAL=y + CONFIG_SPMI_MSM=y ++CONFIG_DM_ETH=y ++CONFIG_DM_KEYBOARD=y ++CONFIG_DM_VIDEO=y ++# CONFG_VIDEO_BPP8 is not set ++CONFIG_NO_FB_CLEAR=y ++CONFIG_VIDEO_SIMPLE=y ++CONFIG_USB_KEYBOARD=y + CONFIG_USB=y + CONFIG_DM_USB=y + CONFIG_USB_EHCI_HCD=y +@@ -46,5 +55,6 @@ CONFIG_USB_HOST_ETHER=y + CONFIG_USB_ETHER_ASIX=y + CONFIG_USB_ETHER_ASIX88179=y + CONFIG_USB_ETHER_MCS7830=y ++CONFIG_USB_ETHER_RTL8152=y + CONFIG_USB_ETHER_SMSC95XX=y + CONFIG_OF_LIBFDT_OVERLAY=y +-- +2.19.0.rc0 + diff --git a/rk3399-Rock960-board-support.patch b/rk3399-Rock960-board-support.patch new file mode 100644 index 0000000..0342d2d --- /dev/null +++ b/rk3399-Rock960-board-support.patch @@ -0,0 +1,772 @@ +From patchwork Tue Aug 21 17:28:16 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot,v2,1/2] arm: dts: Add Rock960 devicetree support +X-Patchwork-Submitter: Manivannan Sadhasivam +X-Patchwork-Id: 960637 +Message-Id: <20180821172817.26463-2-manivannan.sadhasivam@linaro.org> +To: sjg@chromium.org, + philipp.tomsich@theobroma-systems.com +Cc: tom@vamrs.com, amit.kucheria@linaro.org, dev@vamrs.com, + u-boot@lists.denx.de, + Manivannan Sadhasivam , + stephen@vamrs.com +Date: Tue, 21 Aug 2018 22:58:16 +0530 +From: Manivannan Sadhasivam +List-Id: U-Boot discussion + +Add devicetree support for Vamrs Limited Rock960. This board is one of +the 96Boards Consumer Edition platform. + +Signed-off-by: Manivannan Sadhasivam +--- + +Changes in v2: + +* Added missing DTB entry in arch/arm/dts/Makefile + + arch/arm/dts/Makefile | 1 + + arch/arm/dts/rk3399-rock960.dts | 348 ++++++++++++++++++++++++++++++++ + 2 files changed, 349 insertions(+) + create mode 100644 arch/arm/dts/rk3399-rock960.dts + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index ebfa2272627..9b891826b73 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -51,6 +51,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ + rk3399-puma-ddr1333.dtb \ + rk3399-puma-ddr1600.dtb \ + rk3399-puma-ddr1866.dtb \ ++ rk3399-rock960.dtb \ + rv1108-evb.dtb + dtb-$(CONFIG_ARCH_MESON) += \ + meson-gxbb-nanopi-k2.dtb \ +diff --git a/arch/arm/dts/rk3399-rock960.dts b/arch/arm/dts/rk3399-rock960.dts +new file mode 100644 +index 00000000000..8662548e642 +--- /dev/null ++++ b/arch/arm/dts/rk3399-rock960.dts +@@ -0,0 +1,348 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2018 Manivannan Sadhasivam ++ */ ++ ++/dts-v1/; ++#include ++#include ++#include "rk3399.dtsi" ++#include "rk3399-sdram-lpddr3-4GB-1600.dtsi" ++ ++/ { ++ model = "Vamrs Limited Rock960 96Board"; ++ compatible = "rockchip,rk3399-rock960", "rockchip,rk3399"; ++ ++ chosen { ++ stdout-path = &uart2; ++ u-boot,spl-boot-order = \ ++ &sdhci, &sdmmc; ++ }; ++ ++ vccsys: vccsys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vccsys"; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ vcc5v0_sys: vcc5v0-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vcc5v0_usb: vcc5v0-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_usb"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vcc5v0_host0: vcc5v0-host0-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_host0"; ++ gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ vcc5v0_host1: vcc5v0-host1-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_host1"; ++ gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ vcc5v0_host2: vcc5v0-host2-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_host2"; ++ gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ vbus_typec: vbus-typec-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vbus_typec"; ++ gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ vdd_log: vdd-log { ++ compatible = "pwm-regulator"; ++ pwms = <&pwm2 0 25000 1>; ++ regulator-name = "vdd_log"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-init-microvolt = <900000>; ++ }; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&pwm0 { ++ status = "okay"; ++}; ++ ++&pwm2 { ++ status = "okay"; ++}; ++ ++&pwm3 { ++ status = "okay"; ++}; ++ ++&saradc { ++ status = "okay"; ++}; ++ ++&sdmmc { ++ u-boot,dm-pre-reloc; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ mmc-hs400-1_8v; ++ mmc-hs400-enhanced-strobe; ++ non-removable; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ i2c-scl-falling-time-ns = <50>; ++ i2c-scl-rising-time-ns = <100>; ++ u-boot,dm-pre-reloc; ++ ++ rk808: pmic@1b { ++ compatible = "rockchip,rk808"; ++ reg = <0x1b>; ++ interrupt-parent = <&gpio1>; ++ interrupts = <21 IRQ_TYPE_LEVEL_LOW>; ++ #clock-cells = <1>; ++ clock-output-names = "rtc_clko_soc", "rtc_clko_wifi"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ ++ vcc1-supply = <&vcc5v0_sys>; ++ vcc2-supply = <&vcc5v0_sys>; ++ vcc3-supply = <&vcc5v0_sys>; ++ vcc4-supply = <&vcc5v0_sys>; ++ vcc6-supply = <&vcc5v0_sys>; ++ vcc7-supply = <&vcc5v0_sys>; ++ vcc8-supply = <&vcc5v0_sys>; ++ vcc9-supply = <&vcc5v0_sys>; ++ vcc10-supply = <&vcc5v0_sys>; ++ vcc11-supply = <&vcc5v0_sys>; ++ vcc12-supply = <&vcc3v3_sys>; ++ vcc13-supply = <&vcc5v0_sys>; ++ vcc14-supply = <&vcc5v0_sys>; ++ vddio-supply = <&vcc_1v8>; ++ ++ regulators { ++ vdd_center: DCDC_REG1 { ++ regulator-name = "vdd_center"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_cpu_l: DCDC_REG2 { ++ regulator-name = "vdd_cpu_l"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG1 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_hdmi: LDO_REG2 { ++ regulator-name = "vcca1v8_hdmi"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG3 { ++ regulator-name = "vcca_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc_sdio: LDO_REG4 { ++ regulator-name = "vcc_sdio"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcca1v8_mipi: LDO_REG5 { ++ regulator-name = "vcca1v8_mipi"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcca0v9_hdmi: LDO_REG7 { ++ regulator-name = "vcca0v9_hdmi"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG8 { ++ regulator-name = "vcc_3v0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ }; ++ }; ++ ++ vdd_cpu_b: regulator@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ fcs,suspend-voltage-selector = <0>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: regulator@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&pinctrl { ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = ++ <1 21 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++}; + +From patchwork Tue Aug 21 17:28:17 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot,v2,2/2] board: Add Vamrs Limited Rock960 board support +X-Patchwork-Submitter: Manivannan Sadhasivam +X-Patchwork-Id: 960641 +Message-Id: <20180821172817.26463-3-manivannan.sadhasivam@linaro.org> +To: sjg@chromium.org, + philipp.tomsich@theobroma-systems.com +Cc: tom@vamrs.com, amit.kucheria@linaro.org, dev@vamrs.com, + u-boot@lists.denx.de, + Manivannan Sadhasivam , + stephen@vamrs.com +Date: Tue, 21 Aug 2018 22:58:17 +0530 +From: Manivannan Sadhasivam +List-Id: U-Boot discussion + +Add board support for Vamrs Limited Rock960 board, which is +one of the 96Boards Consumer Edition platform. + +Rock960 features: + * CPU: ARMv8 64bit Big-Little architecture, + * Big: dual-core Cortex-A72 + * Little: quad-core Cortex-A53 + * IRAM: 200KB + * DRAM: 2GB/4GB LPDDR3 @ 1866MHz + * eMMC: 16/32GB eMMC 5.1 + * PMU: RK808 + * SD/MMC + * USB: + * 1x USB 3.0 type A, 1x USB 2.0 type A (host mode only) and + 1x USB 3.0 type C OTG + * Display: + * 1x HDMI 2.0(Type A - full) up to 4Kx2K@60Hz, + 1x 4L - MIPI DSI up to 1080p@60Hz, + 1x DP 1.2(Type C) up to 4Kx2K@60 + * Camera: 2x 4-lane MIPI CSI + * PCI-E: 4- lane M.2 PCI-E 2.1 + * Low Speed Expansion Connector + * High Speed Expansion Connector + +Signed-off-by: Manivannan Sadhasivam +--- + +Changes in v2: None + + arch/arm/mach-rockchip/rk3399/Kconfig | 16 +++++ + board/vamrs/rock960_rk3399/Kconfig | 15 ++++ + board/vamrs/rock960_rk3399/MAINTAINERS | 6 ++ + board/vamrs/rock960_rk3399/Makefile | 6 ++ + board/vamrs/rock960_rk3399/README | 79 +++++++++++++++++++++ + board/vamrs/rock960_rk3399/rock960-rk3399.c | 50 +++++++++++++ + configs/rock960-rk3399_defconfig | 62 ++++++++++++++++ + include/configs/rock960_rk3399.h | 15 ++++ + 8 files changed, 249 insertions(+) + create mode 100644 board/vamrs/rock960_rk3399/Kconfig + create mode 100644 board/vamrs/rock960_rk3399/MAINTAINERS + create mode 100644 board/vamrs/rock960_rk3399/Makefile + create mode 100644 board/vamrs/rock960_rk3399/README + create mode 100644 board/vamrs/rock960_rk3399/rock960-rk3399.c + create mode 100644 configs/rock960-rk3399_defconfig + create mode 100644 include/configs/rock960_rk3399.h + +diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig +index 415466a49bb..ce4605187e3 100644 +--- a/arch/arm/mach-rockchip/rk3399/Kconfig ++++ b/arch/arm/mach-rockchip/rk3399/Kconfig +@@ -28,6 +28,21 @@ config TARGET_PUMA_RK3399 + * HDMI, eDP, MIPI-DSI, MIPI-DSI/CSI and MIPI-CSI + * SPI, I2C, I2S, UART, GPIO, ... + ++config TARGET_ROCK960_RK3399 ++ bool "Vamrs Limited Rock960 board" ++ help ++ Support for Rock960 board. This board complies with ++ 96Board Consumer Edition Specification. ++ ++ Features: ++ * Rockchip RK3399 SoC (2xCortex A72, 4xCortex A53, ARM Mali T860MP4) ++ * 2GiB/4GiB RAM ++ * 16/32GB eMMC, uSD slot ++ * WiFi, Bluetooth ++ * 1x USB 3.0 type A, 1x USB 2.0 type A (host mode only), 1x USB 3.0 type C OTG ++ * HDMI ++ * 20-pin low speed and 40-pin high speed expanders, 6 LED, 3 buttons ++ + endchoice + + config SYS_SOC +@@ -38,5 +53,6 @@ config SYS_MALLOC_F_LEN + + source "board/rockchip/evb_rk3399/Kconfig" + source "board/theobroma-systems/puma_rk3399/Kconfig" ++source "board/vamrs/rock960_rk3399/Kconfig" + + endif +diff --git a/board/vamrs/rock960_rk3399/Kconfig b/board/vamrs/rock960_rk3399/Kconfig +new file mode 100644 +index 00000000000..cacc53f3780 +--- /dev/null ++++ b/board/vamrs/rock960_rk3399/Kconfig +@@ -0,0 +1,15 @@ ++if TARGET_ROCK960_RK3399 ++ ++config SYS_BOARD ++ default "rock960_rk3399" ++ ++config SYS_VENDOR ++ default "vamrs" ++ ++config SYS_CONFIG_NAME ++ default "rock960_rk3399" ++ ++config BOARD_SPECIFIC_OPTIONS # dummy ++ def_bool y ++ ++endif +diff --git a/board/vamrs/rock960_rk3399/MAINTAINERS b/board/vamrs/rock960_rk3399/MAINTAINERS +new file mode 100644 +index 00000000000..9f3fe75f4fb +--- /dev/null ++++ b/board/vamrs/rock960_rk3399/MAINTAINERS +@@ -0,0 +1,6 @@ ++ROCK960-RK3399 ++M: Manivannan Sadhasivam manivannan.sadhasivam@linaro.org ++S: Maintained ++F: board/rockchip/rock960_rk3399 ++F: include/configs/rock960_rk3399.h ++F: configs/rock960-rk3399_defconfig +diff --git a/board/vamrs/rock960_rk3399/Makefile b/board/vamrs/rock960_rk3399/Makefile +new file mode 100644 +index 00000000000..6c3e475b3a8 +--- /dev/null ++++ b/board/vamrs/rock960_rk3399/Makefile +@@ -0,0 +1,6 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Copyright (C) 2018 Manivannan Sadhasivam ++# ++ ++obj-y += rock960-rk3399.o +diff --git a/board/vamrs/rock960_rk3399/README b/board/vamrs/rock960_rk3399/README +new file mode 100644 +index 00000000000..be6b5cd1d34 +--- /dev/null ++++ b/board/vamrs/rock960_rk3399/README +@@ -0,0 +1,79 @@ ++Introduction ++============ ++ ++Rock960 is a 96Boards Consumer Edition platform featuring the Rockchip ++RK3399 SoC. ++ ++Rock960 features: ++ * CPU: ARMv8 64bit Big-Little architecture, ++ * Big: dual-core Cortex-A72 ++ * Little: quad-core Cortex-A53 ++ * IRAM: 200KB ++ * DRAM: 2GB/4GB LPDDR3 @ 1866MHz ++ * eMMC: 16/32GB eMMC 5.1 ++ * PMU: RK808 ++ * SD/MMC ++ * USB: ++ * 1x USB 3.0 type A, 1x USB 2.0 type A (host mode only) and ++ 1x USB 3.0 type C OTG ++ * Display: ++ * 1x HDMI 2.0(Type A - full) up to 4Kx2K@60Hz, ++ 1x 4L - MIPI DSI up to 1080p@60Hz, ++ 1x DP 1.2(Type C) up to 4Kx2K@60 ++ * Camera: 2x 4-lane MIPI CSI ++ * PCI-E: 4- lane M.2 PCI-E 2.1 ++ * Low Speed Expansion Connector ++ * High Speed Expansion Connector ++ ++Here is the step-by-step to boot to U-Boot on rk3399. ++ ++Get the Source and prebuild binary ++================================== ++ ++ > git clone https://github.com/96rocks/rkbin.git ++ > git clone https://github.com/rockchip-linux/rkdeveloptool.git ++ ++Compile the U-Boot ++================== ++ ++ > cd ../u-boot ++ > export ARCH=arm64 ++ > export CROSS_COMPILE=aarch64-linux-gnu- ++ > make rock960-rk3399_defconfig ++ > make ++ ++Compile the rkdeveloptool ++========================= ++ Follow instructions in latest README ++ > cd ../rkdeveloptool ++ > autoreconf -i ++ > ./configure ++ > make ++ > sudo make install ++ ++Package the image ++================= ++ ++Package the image for Rockchip miniloader ++------------------------------------------ ++ > cd ../rkbin ++ > ./tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img 0x200000 ++ ++ > ../u-boot/tools/mkimage -n rk3399 -T rksd -d rk3399_ddr_933MHz_v1.08.bin idbloader.img ++ > cat ./rk33/rk3399_miniloader_v1.06.bin >> idbloader.img ++ ++ Get uboot.img and idbloader.img in this step. ++ ++Flash the image to eMMC ++======================= ++ ++Flash the image with Rockchip miniloader ++---------------------------------------- ++Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then: ++ > rkdeveloptool db ./rk33/rk3399_loader_v1.08.106.bin ++ > rkdeveloptool wl 0x40 idbloader.img ++ > rkdeveloptool wl 0x4000 uboot.img ++ > rkdeveloptool wl 0x6000 ./img/rk3399/trust.img ++ > rkdeveloptool rd ++ ++You should be able to get U-Boot log in console/UART2(baurdrate 1500000) +diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c +new file mode 100644 +index 00000000000..d3775b22191 +--- /dev/null ++++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c +@@ -0,0 +1,50 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2018 Manivannan Sadhasivam ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int board_init(void) ++{ ++ int ret; ++ ++ ret = regulators_enable_boot_on(false); ++ if (ret) ++ debug("%s: Cannot enable boot on regulator\n", __func__); ++ ++ return 0; ++} ++ ++void spl_board_init(void) ++{ ++ struct udevice *pinctrl; ++ int ret; ++ ++ ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); ++ if (ret) { ++ debug("%s: Cannot find pinctrl device\n", __func__); ++ goto err; ++ } ++ ++ /* Enable debug UART */ ++ ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG); ++ if (ret) { ++ debug("%s: Failed to set up console UART\n", __func__); ++ goto err; ++ } ++ ++ preloader_console_init(); ++ return; ++err: ++ printf("%s: Error %d\n", __func__, ret); ++ ++ /* No way to report error here */ ++ hang(); ++} +diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig +new file mode 100644 +index 00000000000..998c7a4b707 +--- /dev/null ++++ b/configs/rock960-rk3399_defconfig +@@ -0,0 +1,62 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_SYS_TEXT_BASE=0x00200000 ++CONFIG_SPL_LIBCOMMON_SUPPORT=y ++CONFIG_SPL_LIBGENERIC_SUPPORT=y ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_ROCKCHIP_RK3399=y ++CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000 ++CONFIG_TARGET_ROCK960_RK3399=y ++CONFIG_DEBUG_UART_BASE=0xFF1A0000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_BAUDRATE=1500000 ++CONFIG_SPL_STACK_R_ADDR=0x80000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock960" ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_SPL_LOAD_FIT=y ++CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py" ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock960.dtb" ++CONFIG_SYS_PROMPT="rock960 => " ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 ++CONFIG_SPL_ATF=y ++CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_SF=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_TIME=y ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_SPL_OF_PLATDATA=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_REGMAP=y ++CONFIG_SPL_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_SPL_SYSCON=y ++CONFIG_CLK=y ++CONFIG_SPL_CLK=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_PINCTRL=y ++CONFIG_SPL_PINCTRL=y ++CONFIG_PINCTRL_ROCKCHIP_RK3399=y ++CONFIG_DM_PMIC=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_REGULATOR_PWM=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_RAM=y ++CONFIG_SPL_RAM=y ++CONFIG_SYSRESET=y ++CONFIG_USE_TINY_PRINTF=y ++CONFIG_ERRNO_STR=y +diff --git a/include/configs/rock960_rk3399.h b/include/configs/rock960_rk3399.h +new file mode 100644 +index 00000000000..746d24cbff5 +--- /dev/null ++++ b/include/configs/rock960_rk3399.h +@@ -0,0 +1,15 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2018 Manivannan Sadhasivam ++ */ ++ ++#ifndef __ROCK960_RK3399_H ++#define __ROCK960_RK3399_H ++ ++#include ++ ++#define CONFIG_SYS_MMC_ENV_DEV 1 ++ ++#define SDRAM_BANK_SIZE (2UL << 30) ++ ++#endif diff --git a/rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch b/rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch new file mode 100644 index 0000000..d64cbb1 --- /dev/null +++ b/rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch @@ -0,0 +1,103 @@ +From patchwork Thu Apr 26 06:43:06 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot] rockchip: make_fit_atf: fix warning unit_address_vs_reg +X-Patchwork-Submitter: Kever Yang +X-Patchwork-Id: 904884 +Message-Id: <1524724986-28497-1-git-send-email-kever.yang@rock-chips.com> +To: u-boot@lists.denx.de +Date: Thu, 26 Apr 2018 14:43:06 +0800 +From: Kever Yang +List-Id: U-Boot discussion + +Patch fix warning: +/builddir/BUILD/u-boot-2018.05-rc2/"arch/arm/mach-rockchip/make_fit_atf.py" \ +arch/arm/dts/rk3399-firefly.dtb > u-boot.its + ./tools/mkimage -f u-boot.its -E u-boot.itb >/dev/null && cat +/dev/null +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/uboot@1 +has a unit name, but no reg property +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@1 has +a unit name, but no reg property +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@2 has +a unit name, but no reg property +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/atf@3 has +a unit name, but no reg property +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/fdt@1 has +a unit name, but no reg property +u-boot.itb.tmp: Warning (unit_address_vs_reg): Node +/configurations/config@1 has a unit name, but no reg property +make[1]: Leaving directory +'/builddir/BUILD/u-boot-2018.05-rc2/builds/firefly-rk3399' + +Reported-by: Peter Robinson +Signed-off-by: Kever Yang +--- + + arch/arm/mach-rockchip/make_fit_atf.py | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py +index 7c6dd57..513e088 100755 +--- a/arch/arm/mach-rockchip/make_fit_atf.py ++++ b/arch/arm/mach-rockchip/make_fit_atf.py +@@ -37,7 +37,7 @@ DT_HEADER="""/* + #address-cells = <1>; + + images { +- uboot@1 { ++ uboot { + description = "U-Boot (64-bit)"; + data = /incbin/("u-boot-nodtb.bin"); + type = "standalone"; +@@ -61,7 +61,7 @@ def append_atf_node(file, atf_index, phy_addr): + Append ATF DT node to input FIT dts file. + """ + data = 'bl31_0x%08x.bin' % phy_addr +- print >> file, '\t\tatf@%d {' % atf_index ++ print >> file, '\t\tatf_%d {' % atf_index + print >> file, '\t\t\tdescription = \"ARM Trusted Firmware\";' + print >> file, '\t\t\tdata = /incbin/("%s");' % data + print >> file, '\t\t\ttype = "firmware";' +@@ -81,7 +81,7 @@ def append_fdt_node(file, dtbs): + cnt = 1 + for dtb in dtbs: + dtname = os.path.basename(dtb) +- print >> file, '\t\tfdt@%d {' % cnt ++ print >> file, '\t\tfdt_%d {' % cnt + print >> file, '\t\t\tdescription = "%s";' % dtname + print >> file, '\t\t\tdata = /incbin/("%s");' % dtb + print >> file, '\t\t\ttype = "flat_dt";' +@@ -91,17 +91,17 @@ def append_fdt_node(file, dtbs): + cnt = cnt + 1 + + def append_conf_section(file, cnt, dtname, atf_cnt): +- print >> file, '\t\tconfig@%d {' % cnt ++ print >> file, '\t\tconfig_%d {' % cnt + print >> file, '\t\t\tdescription = "%s";' % dtname +- print >> file, '\t\t\tfirmware = "atf@1";' +- print >> file, '\t\t\tloadables = "uboot@1",', ++ print >> file, '\t\t\tfirmware = "atf_1";' ++ print >> file, '\t\t\tloadables = "uboot",', + for i in range(1, atf_cnt): +- print >> file, '"atf@%d"' % (i+1), ++ print >> file, '"atf_%d"' % (i+1), + if i != (atf_cnt - 1): + print >> file, ',', + else: + print >> file, ';' +- print >> file, '\t\t\tfdt = "fdt@1";' ++ print >> file, '\t\t\tfdt = "fdt_1";' + print >> file, '\t\t};' + print >> file, '' + +@@ -111,7 +111,7 @@ def append_conf_node(file, dtbs, atf_cnt): + """ + cnt = 1 + print >> file, '\tconfigurations {' +- print >> file, '\t\tdefault = "config@1";' ++ print >> file, '\t\tdefault = "config_1";' + for dtb in dtbs: + dtname = os.path.basename(dtb) + append_conf_section(file, cnt, dtname, atf_cnt) diff --git a/rockchip-make_fit_atf-use-elf-entry-point.patch b/rockchip-make_fit_atf-use-elf-entry-point.patch new file mode 100644 index 0000000..fc2aa99 --- /dev/null +++ b/rockchip-make_fit_atf-use-elf-entry-point.patch @@ -0,0 +1,81 @@ +From patchwork Wed May 16 16:44:33 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot] rockchip: make_fit_atf: use elf entry point +X-Patchwork-Submitter: Mian Yousaf Kaukab +X-Patchwork-Id: 914901 +Message-Id: <20180516164433.30998-1-yousaf.kaukab@suse.com> +To: u-boot@lists.denx.de +Cc: Mian Yousaf Kaukab +Date: Wed, 16 May 2018 18:44:33 +0200 +From: Mian Yousaf Kaukab +List-Id: U-Boot discussion + +make_fit_atf.py uses physical address of first segment as the +entry point to bl31. It is incorrect and causes following abort +when bl31_entry() is called: + +U-Boot SPL board initTrying to boot from MMC1 +"Synchronous Abort" handler, esr 0x02000000 +elr: 0000000000000000 lr : 00000000ff8c7e8c +x 0: 00000000ff8e0000 x 1: 0000000000000000 +x 2: 0000000000000000 x 3: 00000000ff8e0180 +x 4: 0000000000000000 x 5: 0000000000000000 +x 6: 0000000000000030 x 7: 00000000ff8e0188 +x 8: 00000000000001e0 x 9: 0000000000000000 +x10: 000000000007fcdc x11: 00000000002881b8 +x12: 00000000000001a2 x13: 0000000000000198 +x14: 000000000007fdcc x15: 00000000002881b8 +x16: 00000000003c0724 x17: 00000000003c0718 +x18: 000000000007fe80 x19: 00000000ff8e0000 +x20: 0000000000200000 x21: 00000000ff8e0000 +x22: 0000000000000000 x23: 000000000007fe30 +x24: 00000000ff8d1c3c x25: 00000000ff8d5000 +x26: 00000000deadbeef x27: 00000000000004a0 +x28: 000000000000009c x29: 000000000007fd90 + +Fix it by using the entry point from the elf header. + +Signed-off-by: Mian Yousaf Kaukab +--- + arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py +index 6b3d9201c9..b88a5e1f16 100755 +--- a/arch/arm/mach-rockchip/make_fit_atf.py ++++ b/arch/arm/mach-rockchip/make_fit_atf.py +@@ -53,7 +53,7 @@ DT_END=""" + }; + """ + +-def append_atf_node(file, atf_index, phy_addr): ++def append_atf_node(file, atf_index, phy_addr, elf_entry): + """ + Append ATF DT node to input FIT dts file. + """ +@@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr): + print >> file, '\t\t\tcompression = "none";' + print >> file, '\t\t\tload = <0x%08x>;' % phy_addr + if atf_index == 1: +- print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr ++ print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry + print >> file, '\t\t};' + print >> file, '' + +@@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi + + with open(bl31_file_name) as bl31_file: + bl31 = ELFFile(bl31_file) ++ elf_entry = bl31.header['e_entry'] + for i in range(bl31.num_segments()): + seg = bl31.get_segment(i) + if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)): + paddr = seg.__getitem__(ELF_SEG_P_PADDR) + p= seg.__getitem__(ELF_SEG_P_PADDR) +- append_atf_node(fit_file, i+1, paddr) ++ append_atf_node(fit_file, i+1, paddr, elf_entry) + atf_cnt = i+1 + append_fdt_node(fit_file, dtbs_file_name) + print >> fit_file, '%s' % DT_IMAGES_NODE_END diff --git a/rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch b/rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch new file mode 100644 index 0000000..f3d20a6 --- /dev/null +++ b/rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch @@ -0,0 +1,82 @@ +From 44dd1455f924aa99e6bff0b124a9be0a85dcfa89 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 4 Sep 2018 11:59:18 +0100 +Subject: [PATCH] rpi: Use firmware provided device tree + +Signed-off-by: Peter Robinson +--- + configs/rpi_0_w_defconfig | 2 +- + configs/rpi_2_defconfig | 2 +- + configs/rpi_3_32b_defconfig | 2 +- + configs/rpi_3_defconfig | 2 +- + configs/rpi_defconfig | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig +index d5bf01b76e..08f177f34a 100644 +--- a/configs/rpi_0_w_defconfig ++++ b/configs/rpi_0_w_defconfig +@@ -13,7 +13,7 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-zero-w" + CONFIG_ENV_FAT_INTERFACE="mmc" + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig +index a50a815759..0918c6c9ff 100644 +--- a/configs/rpi_2_defconfig ++++ b/configs/rpi_2_defconfig +@@ -13,7 +13,7 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_DEFAULT_DEVICE_TREE="bcm2836-rpi-2-b" + CONFIG_ENV_FAT_INTERFACE="mmc" + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig +index ec395d29ed..22165bde53 100644 +--- a/configs/rpi_3_32b_defconfig ++++ b/configs/rpi_3_32b_defconfig +@@ -14,7 +14,7 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b" + CONFIG_ENV_FAT_INTERFACE="mmc" + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig +index ac99f2000a..0ca298cd54 100644 +--- a/configs/rpi_3_defconfig ++++ b/configs/rpi_3_defconfig +@@ -14,7 +14,7 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_DEFAULT_DEVICE_TREE="bcm2837-rpi-3-b" + CONFIG_ENV_FAT_INTERFACE="mmc" + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig +index db42ffd135..0ec1365b1b 100644 +--- a/configs/rpi_defconfig ++++ b/configs/rpi_defconfig +@@ -13,7 +13,7 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-b" + CONFIG_ENV_FAT_INTERFACE="mmc" + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" +-- +2.19.0.rc0 + diff --git a/sunxi-DT-A64-add-Pine64-LTS-support.patch b/sunxi-DT-A64-add-Pine64-LTS-support.patch new file mode 100644 index 0000000..cf041af --- /dev/null +++ b/sunxi-DT-A64-add-Pine64-LTS-support.patch @@ -0,0 +1,67 @@ +From 82cc7aca5fb7c7103256229a3ead0b8075da5813 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 5 Sep 2018 17:00:25 +0100 +Subject: [PATCH] sunxi: DT: A64: add Pine64-LTS support + +The Pine64-LTS board is a new board version of the Pine64, though +actually it's a non-SoM version of the SoPine and its baseboard. +In contrast to the original Pine64 it features LPDDR3 DRAM, an eMMC +socket and a SPI flash chip for storing firmware (like U-Boot). +Add it as a variant to the existing SoPine defconfig, since from a +software point of view they are really not different. + +Signed-off-by: Andre Przywara +Signed-off-by: Peter Robinson +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-a64-pine64-lts.dts | 13 +++++++++++++ + configs/sopine_baseboard_defconfig | 1 + + 3 files changed, 15 insertions(+) + create mode 100644 arch/arm/dts/sun50i-a64-pine64-lts.dts + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index ebfa227262..6cd440d6af 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -401,6 +401,7 @@ dtb-$(CONFIG_MACH_SUN50I) += \ + sun50i-a64-nanopi-a64.dtb \ + sun50i-a64-olinuxino.dtb \ + sun50i-a64-orangepi-win.dtb \ ++ sun50i-a64-pine64-lts.dtb \ + sun50i-a64-pine64-plus.dtb \ + sun50i-a64-pine64.dtb \ + sun50i-a64-sopine-baseboard.dtb +diff --git a/arch/arm/dts/sun50i-a64-pine64-lts.dts b/arch/arm/dts/sun50i-a64-pine64-lts.dts +new file mode 100644 +index 0000000000..72d6961dc3 +--- /dev/null ++++ b/arch/arm/dts/sun50i-a64-pine64-lts.dts +@@ -0,0 +1,13 @@ ++/* ++ * SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++ * ++ * Copyright (c) 2018 ARM Ltd. ++ */ ++ ++#include "sun50i-a64-sopine-baseboard.dts" ++ ++/ { ++ model = "Pine64 LTS"; ++ compatible = "pine64,pine64-lts", "allwinner,sun50i-r18", ++ "allwinner,sun50i-a64"; ++}; +diff --git a/configs/sopine_baseboard_defconfig b/configs/sopine_baseboard_defconfig +index 9ede081c08..eead38a1e3 100644 +--- a/configs/sopine_baseboard_defconfig ++++ b/configs/sopine_baseboard_defconfig +@@ -15,6 +15,7 @@ CONFIG_NR_DRAM_BANKS=1 + # CONFIG_SPL_DOS_PARTITION is not set + # CONFIG_SPL_EFI_PARTITION is not set + CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-sopine-baseboard" ++CONFIG_OF_LIST="sun50i-a64-sopine-baseboard sun50i-a64-pine64-lts" + CONFIG_SUN8I_EMAC=y + CONFIG_USB_EHCI_HCD=y + CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y +-- +2.19.0.rc0 + diff --git a/tegra-TXx-Add-CONFIG_EFI_LOADER_BOUNCE_BUFFER.patch b/tegra-TXx-Add-CONFIG_EFI_LOADER_BOUNCE_BUFFER.patch new file mode 100644 index 0000000..3364bb1 --- /dev/null +++ b/tegra-TXx-Add-CONFIG_EFI_LOADER_BOUNCE_BUFFER.patch @@ -0,0 +1,54 @@ +From c8b9f0c2ca0a4270db811867ad051e75efa4100a Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 5 Sep 2018 11:13:40 +0100 +Subject: [PATCH] tegra: TXx: Add CONFIG_EFI_LOADER_BOUNCE_BUFFER + +The Jetson TX series needs EFI loader bounce buffer enabled otherwise grub doesn't see +the storage when it loads. + +Signed-off-by: Peter Robinson +--- + configs/p2371-2180_defconfig | 1 + + configs/p2771-0000-000_defconfig | 1 + + configs/p2771-0000-500_defconfig | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig +index d9dcf7e014..156a1cbcf9 100644 +--- a/configs/p2371-2180_defconfig ++++ b/configs/p2371-2180_defconfig +@@ -5,6 +5,7 @@ CONFIG_TEGRA210=y + CONFIG_TARGET_P2371_2180=y + CONFIG_NR_DRAM_BANKS=2 + CONFIG_OF_SYSTEM_SETUP=y ++CONFIG_EFI_LOADER_BOUNCE_BUFFER=y + CONFIG_CONSOLE_MUX=y + CONFIG_SYS_STDIO_DEREGISTER=y + CONFIG_SYS_PROMPT="Tegra210 (P2371-2180) # " +diff --git a/configs/p2771-0000-000_defconfig b/configs/p2771-0000-000_defconfig +index 2bf2e31359..15ea2fc6d6 100644 +--- a/configs/p2771-0000-000_defconfig ++++ b/configs/p2771-0000-000_defconfig +@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_TEGRA186=y + CONFIG_NR_DRAM_BANKS=8 + CONFIG_OF_SYSTEM_SETUP=y ++CONFIG_EFI_LOADER_BOUNCE_BUFFER=y + CONFIG_CONSOLE_MUX=y + CONFIG_SYS_STDIO_DEREGISTER=y + CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-000) # " +diff --git a/configs/p2771-0000-500_defconfig b/configs/p2771-0000-500_defconfig +index 1e33c1f95b..a32b6a866e 100644 +--- a/configs/p2771-0000-500_defconfig ++++ b/configs/p2771-0000-500_defconfig +@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_TEGRA186=y + CONFIG_NR_DRAM_BANKS=8 + CONFIG_OF_SYSTEM_SETUP=y ++CONFIG_EFI_LOADER_BOUNCE_BUFFER=y + CONFIG_CONSOLE_MUX=y + CONFIG_SYS_STDIO_DEREGISTER=y + CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-500) # " +-- +2.19.0.rc0 + diff --git a/tegra-efi_loader-simplify-ifdefs.patch b/tegra-efi_loader-simplify-ifdefs.patch new file mode 100644 index 0000000..1b39a4a --- /dev/null +++ b/tegra-efi_loader-simplify-ifdefs.patch @@ -0,0 +1,194 @@ +From patchwork Thu Aug 30 21:43:43 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot,V3,1/3] efi_loader: simplify ifdefs +X-Patchwork-Submitter: Stephen Warren +X-Patchwork-Id: 964248 +X-Patchwork-Delegate: agraf@suse.de +Message-Id: <20180830214345.2475-1-swarren@wwwdotorg.org> +To: Tom Rini +Cc: Stephen Warren , xypron.glpk@gmx.de, agraf@suse.de, + u-boot@lists.denx.de, Tom Warren +Date: Thu, 30 Aug 2018 15:43:43 -0600 +From: Stephen Warren +List-Id: U-Boot discussion + +From: Stephen Warren + +Use CONFIG_IS_ENABLED(EFI_LOADER) to avoid explicitly checking CONFIG_SPL +too. This simplifies the conditional. + +Signed-off-by: Stephen Warren +--- +v3: New patch. +--- + arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- + arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 2 +- + arch/x86/lib/e820.c | 4 ++-- + include/efi_loader.h | 6 +++--- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +index 052e0708d454..be00bd55ab68 100644 +--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c ++++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c +@@ -835,7 +835,7 @@ int dram_init_banksize(void) + return 0; + } + +-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) ++#if CONFIG_IS_ENABLED(EFI_LOADER) + void efi_add_known_memory(void) + { + int i; +diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c +index fc9de73bcef4..c9c2c3f6d3e8 100644 +--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c ++++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c +@@ -135,7 +135,7 @@ remove_psci_node: + + fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code, + *boot_code_size); +-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) ++#if CONFIG_IS_ENABLED(EFI_LOADER) + efi_add_memory_map((uintptr_t)&secondary_boot_code, + ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT, + EFI_RESERVED_MEMORY_TYPE, false); +diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c +index 8b34f677d96d..d6ae2c4e9d77 100644 +--- a/arch/x86/lib/e820.c ++++ b/arch/x86/lib/e820.c +@@ -36,7 +36,7 @@ __weak unsigned int install_e820_map(unsigned int max_entries, + return 4; + } + +-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) ++#if CONFIG_IS_ENABLED(EFI_LOADER) + void efi_add_known_memory(void) + { + struct e820_entry e820[E820MAX]; +@@ -72,4 +72,4 @@ void efi_add_known_memory(void) + efi_add_memory_map(start, pages, type, false); + } + } +-#endif /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */ ++#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */ +diff --git a/include/efi_loader.h b/include/efi_loader.h +index f162adfff7e2..b46babf9316f 100644 +--- a/include/efi_loader.h ++++ b/include/efi_loader.h +@@ -13,7 +13,7 @@ + #include + + /* No need for efi loader support in SPL */ +-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) ++#if CONFIG_IS_ENABLED(EFI_LOADER) + + #include + +@@ -460,7 +460,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor, + void *efi_bootmgr_load(struct efi_device_path **device_path, + struct efi_device_path **file_path); + +-#else /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */ ++#else /* CONFIG_IS_ENABLED(EFI_LOADER) */ + + /* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */ + #define __efi_runtime_data +@@ -477,6 +477,6 @@ static inline void efi_set_bootdev(const char *dev, const char *devnr, + static inline void efi_net_set_dhcp_ack(void *pkt, int len) { } + static inline void efi_print_image_infos(void *pc) { } + +-#endif /* CONFIG_EFI_LOADER && !CONFIG_SPL_BUILD */ ++#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */ + + #endif /* _EFI_LOADER_H */ + +From patchwork Thu Aug 30 21:43:44 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [U-Boot, V3, + 2/3] ARM: tegra: reserve unmapped RAM so EFI doesn't use it +X-Patchwork-Submitter: Stephen Warren +X-Patchwork-Id: 964249 +X-Patchwork-Delegate: agraf@suse.de +Message-Id: <20180830214345.2475-2-swarren@wwwdotorg.org> +To: Tom Rini +Cc: Stephen Warren , xypron.glpk@gmx.de, agraf@suse.de, + u-boot@lists.denx.de, Tom Warren +Date: Thu, 30 Aug 2018 15:43:44 -0600 +From: Stephen Warren +List-Id: U-Boot discussion + +From: Stephen Warren + +Tegra U-Boot ensures that board_get_usable_ram_top() never returns a value +over 4GB, since some peripherals can't access such addresses. However, on +systems with more than 2GB of RAM, RAM bank 1 does describe this extra +RAM, so that Linux (or whatever OS) can use it, subject to DMA +limitations. Since board_get_usable_ram_top() points at the top of RAM +bank 0, the memory locations describes by RAM bank 1 are not mapped by +U-Boot's MMU configuration, and so cannot be used for anything. + +For some completely inexplicable reason, U-Boot's EFI support ignores the +value returned by board_get_usable_ram_top(), and EFI memory allocation +routines will return values above U-Boot's RAM top. This causes U-Boot to +crash when it accesses that RAM, since it isn't mapped by the MMU. One +use-case where this happens is TFTP download of a file on Jetson TX1 +(p2371-2180). + +This change explicitly tells the EFI code that this extra RAM should not +be used, thus avoiding the crash. + +A previous attempt to make EFI honor board_get_usable_ram_top() was +rejected. So, this patch will need to be replicated for any board that +implements board_get_usable_ram_top(). + +Fixes: aa909462d018 ("efi_loader: efi_allocate_pages is too restrictive") +Signed-off-by: Stephen Warren +--- +v3: +- Use shift not divide for page count calculation. +- Enhance ifdef to avoid EFI references from SPL builds. +v2: +- Don't hard-code EFI page size. +- Register RAM as a boot services data rather than reserved. +--- + arch/arm/mach-tegra/board2.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c +index 421a71b3014d..12257a42b51b 100644 +--- a/arch/arm/mach-tegra/board2.c ++++ b/arch/arm/mach-tegra/board2.c +@@ -6,6 +6,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -210,6 +211,19 @@ int board_early_init_f(void) + + int board_late_init(void) + { ++#if CONFIG_IS_ENABLED(EFI_LOADER) ++ if (gd->bd->bi_dram[1].start) { ++ /* ++ * Only bank 0 is below board_get_usable_ram_top(), so all of ++ * bank 1 is not mapped by the U-Boot MMU configuration, and so ++ * we must prevent EFI from using it. ++ */ ++ efi_add_memory_map(gd->bd->bi_dram[1].start, ++ gd->bd->bi_dram[1].size >> EFI_PAGE_SHIFT, ++ EFI_BOOT_SERVICES_DATA, false); ++ } ++#endif ++ + #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) + if (tegra_cpu_is_non_secure()) { + printf("CPU is in NS mode\n"); + diff --git a/tegra-fix-tx1.patch b/tegra-fix-tx1.patch new file mode 100644 index 0000000..9c03262 --- /dev/null +++ b/tegra-fix-tx1.patch @@ -0,0 +1,472 @@ +From a2872b1e2f81e04f92f0970e18c6c8a40640eea8 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 5 Sep 2018 12:11:40 +0100 +Subject: [PATCH] tegra fix tx1 + +Signed-off-by: Peter Robinson +--- + arch/arm/include/asm/arch-tegra/xusb-padctl.h | 1 + + arch/arm/mach-tegra/board.c | 4 +- + arch/arm/mach-tegra/board2.c | 12 ++++ + arch/arm/mach-tegra/dt-setup.c | 5 +- + arch/arm/mach-tegra/gpu.c | 2 + + .../mach-tegra/{tegra186 => }/nvtboot_board.c | 70 +++++++++++++++++++ + .../mach-tegra/{tegra186 => }/nvtboot_ll.S | 0 + .../mach-tegra/{tegra186 => }/nvtboot_mem.c | 0 + arch/arm/mach-tegra/tegra186/Makefile | 6 +- + arch/arm/mach-tegra/tegra210/Makefile | 3 + + arch/arm/mach-tegra/tegra210/clock.c | 19 ----- + arch/arm/mach-tegra/tegra210/xusb-padctl.c | 68 +++++++++++------- + arch/arm/mach-tegra/xusb-padctl-dummy.c | 4 ++ + configs/p2371-0000_defconfig | 2 +- + configs/p2371-2180_defconfig | 2 +- + configs/p2571_defconfig | 2 +- + 16 files changed, 146 insertions(+), 54 deletions(-) + rename arch/arm/mach-tegra/{tegra186 => }/nvtboot_board.c (84%) + rename arch/arm/mach-tegra/{tegra186 => }/nvtboot_ll.S (100%) + rename arch/arm/mach-tegra/{tegra186 => }/nvtboot_mem.c (100%) + +diff --git a/arch/arm/include/asm/arch-tegra/xusb-padctl.h b/arch/arm/include/asm/arch-tegra/xusb-padctl.h +index deccdf455d..7e14d8109d 100644 +--- a/arch/arm/include/asm/arch-tegra/xusb-padctl.h ++++ b/arch/arm/include/asm/arch-tegra/xusb-padctl.h +@@ -16,6 +16,7 @@ struct tegra_xusb_phy; + struct tegra_xusb_phy *tegra_xusb_phy_get(unsigned int type); + + void tegra_xusb_padctl_init(void); ++void tegra_xusb_padctl_exit(void); + int tegra_xusb_phy_prepare(struct tegra_xusb_phy *phy); + int tegra_xusb_phy_enable(struct tegra_xusb_phy *phy); + int tegra_xusb_phy_disable(struct tegra_xusb_phy *phy); +diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c +index f8fc042a1d..ddef228831 100644 +--- a/arch/arm/mach-tegra/board.c ++++ b/arch/arm/mach-tegra/board.c +@@ -35,7 +35,7 @@ enum { + + static bool from_spl __attribute__ ((section(".data"))); + +-#ifndef CONFIG_SPL_BUILD ++#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TEGRA210) + void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) + { + from_spl = r0 != UBOOT_NOT_LOADED_FROM_SPL; +@@ -66,6 +66,7 @@ bool tegra_cpu_is_non_secure(void) + } + #endif + ++#if !defined(CONFIG_ARM64) + /* Read the RAM size directly from the memory controller */ + static phys_size_t query_sdram_size(void) + { +@@ -122,6 +123,7 @@ int dram_init(void) + gd->ram_size = query_sdram_size(); + return 0; + } ++#endif + + static int uart_configs[] = { + #if defined(CONFIG_TEGRA20) +diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c +index 421a71b301..22ecd99760 100644 +--- a/arch/arm/mach-tegra/board2.c ++++ b/arch/arm/mach-tegra/board2.c +@@ -171,6 +171,12 @@ int board_init(void) + return nvidia_board_init(); + } + ++void board_cleanup_before_linux(void) ++{ ++ /* power down UPHY PLL */ ++ tegra_xusb_padctl_exit(); ++} ++ + #ifdef CONFIG_BOARD_EARLY_INIT_F + static void __gpio_early_init(void) + { +@@ -220,9 +226,14 @@ int board_late_init(void) + #endif + start_cpu_fan(); + ++#if defined(CONFIG_TEGRA210) ++ tegra_soc_board_init_late(); ++#endif ++ + return 0; + } + ++#ifndef CONFIG_TEGRA210 + /* + * In some SW environments, a memory carve-out exists to house a secure + * monitor, a trusted OS, and/or various statically allocated media buffers. +@@ -348,3 +359,4 @@ ulong board_get_usable_ram_top(ulong total_size) + { + return CONFIG_SYS_SDRAM_BASE + usable_ram_size_below_4g(); + } ++#endif +diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c +index 8ac723f41e..a961fab20f 100644 +--- a/arch/arm/mach-tegra/dt-setup.c ++++ b/arch/arm/mach-tegra/dt-setup.c +@@ -12,12 +12,10 @@ + */ + int ft_system_setup(void *blob, bd_t *bd) + { ++#if !defined(CONFIG_ARM64) + const char *gpu_compats[] = { + #if defined(CONFIG_TEGRA124) + "nvidia,gk20a", +-#endif +-#if defined(CONFIG_TEGRA210) +- "nvidia,gm20b", + #endif + }; + int i, ret; +@@ -28,6 +26,7 @@ int ft_system_setup(void *blob, bd_t *bd) + if (ret) + return ret; + } ++#endif + + return 0; + } +diff --git a/arch/arm/mach-tegra/gpu.c b/arch/arm/mach-tegra/gpu.c +index e047f67821..3b8c1a0434 100644 +--- a/arch/arm/mach-tegra/gpu.c ++++ b/arch/arm/mach-tegra/gpu.c +@@ -17,6 +17,7 @@ static bool _configured; + + void tegra_gpu_config(void) + { ++#if !defined(CONFIG_ARM64) + struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE; + + #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) +@@ -34,6 +35,7 @@ void tegra_gpu_config(void) + debug("configured VPR\n"); + + _configured = true; ++#endif + } + + #if defined(CONFIG_OF_LIBFDT) +diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_board.c b/arch/arm/mach-tegra/nvtboot_board.c +similarity index 84% +rename from arch/arm/mach-tegra/tegra186/nvtboot_board.c +rename to arch/arm/mach-tegra/nvtboot_board.c +index 83c0e931ea..7b98b502ef 100644 +--- a/arch/arm/mach-tegra/tegra186/nvtboot_board.c ++++ b/arch/arm/mach-tegra/nvtboot_board.c +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -270,6 +271,27 @@ static void set_calculated_env_vars(void) + free(vars); + } + ++char *strstrip(char *s) ++{ ++ size_t size; ++ char *end; ++ ++ size = strlen(s); ++ ++ if (!size) ++ return s; ++ ++ end = s + size - 1; ++ while (end >= s && isblank(*end)) ++ end--; ++ *(end + 1) = '\0'; ++ ++ while (*s && isblank(*s)) ++ s++; ++ ++ return s; ++} ++ + static int set_fdt_addr(void) + { + int ret; +@@ -283,6 +305,7 @@ static int set_fdt_addr(void) + return 0; + } + ++#if defined(CONFIG_TEGRA186) + /* + * Attempt to use /chosen/nvidia,ether-mac in the nvtboot DTB to U-Boot's + * ethaddr environment variable if possible. +@@ -316,6 +339,49 @@ static int set_ethaddr_from_nvtboot(void) + + return 0; + } ++#endif ++ ++static int set_cbootargs(void) ++{ ++ const void *nvtboot_blob = (void *)nvtboot_boot_x0; ++ const void *prop; ++ char *bargs, *s; ++ int node, len, ret = 0; ++ ++ /* ++ * Save the bootargs passed in the DTB by the previous bootloader ++ * (CBoot) to the env. (pointer in reg x0) ++ */ ++ ++ debug("%s: nvtboot_blob = %p\n", __func__, nvtboot_blob); ++ ++ node = fdt_path_offset(nvtboot_blob, "/chosen"); ++ if (node < 0) { ++ pr_err("Can't find /chosen node in nvtboot DTB"); ++ return node; ++ } ++ debug("%s: found 'chosen' node: %d\n", __func__, node); ++ ++ prop = fdt_getprop(nvtboot_blob, node, "bootargs", &len); ++ if (!prop) { ++ pr_err("Can't find /chosen/bootargs property in nvtboot DTB"); ++ return -ENOENT; ++ } ++ debug("%s: found 'bootargs' property, len =%d\n", __func__, len); ++ ++ /* CBoot seems to add trailing whitespace - strip it here */ ++ s = strdup((char *)prop); ++ bargs = strstrip(s); ++ debug("%s: bootargs = %s!\n", __func__, bargs); ++ ++ /* Set cbootargs to env for later use by extlinux files */ ++ ret = env_set("cbootargs", bargs); ++ if (ret) ++ printf("Failed to set cbootargs from cboot DTB: %d\n", ret); ++ ++ free(s); ++ return ret; ++} + + int tegra_soc_board_init_late(void) + { +@@ -325,8 +391,12 @@ int tegra_soc_board_init_late(void) + * extlinux.conf or boot script content. + */ + set_fdt_addr(); ++#if defined(CONFIG_TEGRA186) + /* Ignore errors here; not all cases care about Ethernet addresses */ + set_ethaddr_from_nvtboot(); ++#endif ++ /* Save CBoot bootargs to env */ ++ set_cbootargs(); + + return 0; + } +diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_ll.S b/arch/arm/mach-tegra/nvtboot_ll.S +similarity index 100% +rename from arch/arm/mach-tegra/tegra186/nvtboot_ll.S +rename to arch/arm/mach-tegra/nvtboot_ll.S +diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c b/arch/arm/mach-tegra/nvtboot_mem.c +similarity index 100% +rename from arch/arm/mach-tegra/tegra186/nvtboot_mem.c +rename to arch/arm/mach-tegra/nvtboot_mem.c +diff --git a/arch/arm/mach-tegra/tegra186/Makefile b/arch/arm/mach-tegra/tegra186/Makefile +index 56f3378ece..1a43ef7a45 100644 +--- a/arch/arm/mach-tegra/tegra186/Makefile ++++ b/arch/arm/mach-tegra/tegra186/Makefile +@@ -4,6 +4,6 @@ + + obj-y += ../board186.o + obj-y += cache.o +-obj-y += nvtboot_board.o +-obj-y += nvtboot_ll.o +-obj-y += nvtboot_mem.o ++obj-y += ../nvtboot_board.o ++obj-y += ../nvtboot_ll.o ++obj-y += ../nvtboot_mem.o +diff --git a/arch/arm/mach-tegra/tegra210/Makefile b/arch/arm/mach-tegra/tegra210/Makefile +index b6012fc7ba..6de6d810eb 100644 +--- a/arch/arm/mach-tegra/tegra210/Makefile ++++ b/arch/arm/mach-tegra/tegra210/Makefile +@@ -8,5 +8,8 @@ + obj-y += clock.o + obj-y += funcmux.o + obj-y += pinmux.o ++obj-y += ../nvtboot_board.o ++obj-y += ../nvtboot_ll.o ++obj-y += ../nvtboot_mem.o + obj-y += xusb-padctl.o + obj-y += ../xusb-padctl-common.o +diff --git a/arch/arm/mach-tegra/tegra210/clock.c b/arch/arm/mach-tegra/tegra210/clock.c +index 06068c4b7b..341c97f16d 100644 +--- a/arch/arm/mach-tegra/tegra210/clock.c ++++ b/arch/arm/mach-tegra/tegra210/clock.c +@@ -1235,25 +1235,6 @@ int tegra_plle_enable(void) + value &= ~PLLE_SS_CNTL_INTERP_RESET; + writel(value, NV_PA_CLK_RST_BASE + PLLE_SS_CNTL); + +- /* 7. Enable HW power sequencer for PLLE */ +- +- value = readl(NV_PA_CLK_RST_BASE + PLLE_MISC); +- value &= ~PLLE_MISC_IDDQ_SWCTL; +- writel(value, NV_PA_CLK_RST_BASE + PLLE_MISC); +- +- value = readl(NV_PA_CLK_RST_BASE + PLLE_AUX); +- value &= ~PLLE_AUX_SS_SWCTL; +- value &= ~PLLE_AUX_ENABLE_SWCTL; +- value |= PLLE_AUX_SS_SEQ_INCLUDE; +- value |= PLLE_AUX_USE_LOCKDET; +- writel(value, NV_PA_CLK_RST_BASE + PLLE_AUX); +- +- /* 8. Wait 1 us */ +- +- udelay(1); +- value |= PLLE_AUX_SEQ_ENABLE; +- writel(value, NV_PA_CLK_RST_BASE + PLLE_AUX); +- + return 0; + } + +diff --git a/arch/arm/mach-tegra/tegra210/xusb-padctl.c b/arch/arm/mach-tegra/tegra210/xusb-padctl.c +index ab6684f027..64dc297ae2 100644 +--- a/arch/arm/mach-tegra/tegra210/xusb-padctl.c ++++ b/arch/arm/mach-tegra/tegra210/xusb-padctl.c +@@ -170,6 +170,17 @@ static int phy_unprepare(struct tegra_xusb_phy *phy) + return tegra_xusb_padctl_disable(phy->padctl); + } + ++#define XUSB_PADCTL_USB3_PAD_MUX 0x28 ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE (1 << 0) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK0 (1 << 1) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK1 (1 << 2) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK2 (1 << 3) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK3 (1 << 4) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK4 (1 << 5) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK5 (1 << 6) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK6 (1 << 7) ++#define XUSB_PADCTL_USB3_PAD_MUX_FORCE_SATA_PAD_IDDQ_DISABLE_MASK0 (1 << 8) ++ + #define XUSB_PADCTL_UPHY_PLL_P0_CTL1 0x360 + #define XUSB_PADCTL_UPHY_PLL_P0_CTL1_FREQ_NDIV_MASK (0xff << 20) + #define XUSB_PADCTL_UPHY_PLL_P0_CTL1_FREQ_NDIV(x) (((x) & 0xff) << 20) +@@ -366,31 +377,6 @@ static int pcie_phy_enable(struct tegra_xusb_phy *phy) + value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL8_RCAL_CLK_EN; + padctl_writel(padctl, value, XUSB_PADCTL_UPHY_PLL_P0_CTL8); + +- value = readl(NV_PA_CLK_RST_BASE + CLK_RST_XUSBIO_PLL_CFG0); +- value &= ~CLK_RST_XUSBIO_PLL_CFG0_PADPLL_RESET_SWCTL; +- value &= ~CLK_RST_XUSBIO_PLL_CFG0_CLK_ENABLE_SWCTL; +- value |= CLK_RST_XUSBIO_PLL_CFG0_PADPLL_USE_LOCKDET; +- value |= CLK_RST_XUSBIO_PLL_CFG0_PADPLL_SLEEP_IDDQ; +- writel(value, NV_PA_CLK_RST_BASE + CLK_RST_XUSBIO_PLL_CFG0); +- +- value = padctl_readl(padctl, XUSB_PADCTL_UPHY_PLL_P0_CTL1); +- value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL1_PWR_OVRD; +- padctl_writel(padctl, value, XUSB_PADCTL_UPHY_PLL_P0_CTL1); +- +- value = padctl_readl(padctl, XUSB_PADCTL_UPHY_PLL_P0_CTL2); +- value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL2_CAL_OVRD; +- padctl_writel(padctl, value, XUSB_PADCTL_UPHY_PLL_P0_CTL2); +- +- value = padctl_readl(padctl, XUSB_PADCTL_UPHY_PLL_P0_CTL8); +- value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL8_RCAL_OVRD; +- padctl_writel(padctl, value, XUSB_PADCTL_UPHY_PLL_P0_CTL8); +- +- udelay(1); +- +- value = readl(NV_PA_CLK_RST_BASE + CLK_RST_XUSBIO_PLL_CFG0); +- value |= CLK_RST_XUSBIO_PLL_CFG0_SEQ_ENABLE; +- writel(value, NV_PA_CLK_RST_BASE + CLK_RST_XUSBIO_PLL_CFG0); +- + debug("< %s()\n", __func__); + return 0; + } +@@ -454,3 +440,35 @@ void tegra_xusb_padctl_init(void) + ret = tegra_xusb_process_nodes(nodes, count, &tegra210_socdata); + debug("%s: done, ret=%d\n", __func__, ret); + } ++ ++void tegra_xusb_padctl_exit(void) ++{ ++ u32 value; ++ ++ debug("> %s\n", __func__); ++ ++ value = padctl_readl(&padctl, XUSB_PADCTL_USB3_PAD_MUX); ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK0; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK1; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK2; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK3; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK4; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK5; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_PCIE_PAD_IDDQ_DISABLE_MASK6; ++ value &= ~XUSB_PADCTL_USB3_PAD_MUX_FORCE_SATA_PAD_IDDQ_DISABLE_MASK0; ++ padctl_writel(&padctl, value, XUSB_PADCTL_USB3_PAD_MUX); ++ ++ value = padctl_readl(&padctl, XUSB_PADCTL_UPHY_PLL_P0_CTL1); ++ value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL1_IDDQ; ++ value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL1_SLEEP_MASK; ++ value |= XUSB_PADCTL_UPHY_PLL_P0_CTL1_SLEEP(3); ++ value &= ~XUSB_PADCTL_UPHY_PLL_P0_CTL1_ENABLE; ++ padctl_writel(&padctl, value, XUSB_PADCTL_UPHY_PLL_P0_CTL1); ++ ++ reset_set_enable(PERIPH_ID_PEX_USB_UPHY, 1); ++ while (padctl.enable) ++ tegra_xusb_padctl_disable(&padctl); ++ ++ debug("< %s()\n", __func__); ++} +diff --git a/arch/arm/mach-tegra/xusb-padctl-dummy.c b/arch/arm/mach-tegra/xusb-padctl-dummy.c +index 3ec27a2e3a..f2d90302f6 100644 +--- a/arch/arm/mach-tegra/xusb-padctl-dummy.c ++++ b/arch/arm/mach-tegra/xusb-padctl-dummy.c +@@ -36,3 +36,7 @@ int __weak tegra_xusb_phy_unprepare(struct tegra_xusb_phy *phy) + void __weak tegra_xusb_padctl_init(void) + { + } ++ ++void __weak tegra_xusb_padctl_exit(void) ++{ ++} +diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig +index 02a7569205..d9b8be15e7 100644 +--- a/configs/p2371-0000_defconfig ++++ b/configs/p2371-0000_defconfig +@@ -1,6 +1,6 @@ + CONFIG_ARM=y + CONFIG_TEGRA=y +-CONFIG_SYS_TEXT_BASE=0x80110000 ++CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_TEGRA210=y + CONFIG_TARGET_P2371_0000=y + CONFIG_NR_DRAM_BANKS=2 +diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig +index 156a1cbcf9..602c5c1fad 100644 +--- a/configs/p2371-2180_defconfig ++++ b/configs/p2371-2180_defconfig +@@ -1,6 +1,6 @@ + CONFIG_ARM=y + CONFIG_TEGRA=y +-CONFIG_SYS_TEXT_BASE=0x80110000 ++CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_TEGRA210=y + CONFIG_TARGET_P2371_2180=y + CONFIG_NR_DRAM_BANKS=2 +diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig +index 5cbb1c3201..29929e2d99 100644 +--- a/configs/p2571_defconfig ++++ b/configs/p2571_defconfig +@@ -1,6 +1,6 @@ + CONFIG_ARM=y + CONFIG_TEGRA=y +-CONFIG_SYS_TEXT_BASE=0x80110000 ++CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_TEGRA210=y + CONFIG_TARGET_P2571=y + CONFIG_NR_DRAM_BANKS=2 +-- +2.19.0.rc0 + diff --git a/tegra186-jetson-tx2-disable-onboard-emmc.patch b/tegra186-jetson-tx2-disable-onboard-emmc.patch new file mode 100644 index 0000000..d31a6df --- /dev/null +++ b/tegra186-jetson-tx2-disable-onboard-emmc.patch @@ -0,0 +1,52 @@ +From dbe4dff86520a1373076563d1bee5ada1d7fd7c5 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 26 Apr 2018 16:56:54 +0100 +Subject: [PATCH] tegra186: jetson-tx2: disable onboard emmc + +Signed-off-by: Peter Robinson +--- + arch/arm/dts/tegra186-p2771-0000.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/dts/tegra186-p2771-0000.dtsi b/arch/arm/dts/tegra186-p2771-0000.dtsi +index a1319dc493..e220f086ee 100644 +--- a/arch/arm/dts/tegra186-p2771-0000.dtsi ++++ b/arch/arm/dts/tegra186-p2771-0000.dtsi +@@ -53,7 +53,7 @@ + }; + + sdhci@3460000 { +- status = "okay"; ++ status = "disabled"; + bus-width = <8>; + non-removable; + }; +-- +2.17.0 + +From 7bba3cc32c8b8b5d3688c42a803768761df0a23f Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 1 Aug 2018 11:47:56 +0100 +Subject: [PATCH] tegra210: Jetson TX1: disable onboard emmc + +Signed-off-by: Peter Robinson +--- + arch/arm/dts/tegra210-p2371-2180.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/dts/tegra210-p2371-2180.dts b/arch/arm/dts/tegra210-p2371-2180.dts +index da4349bd039..87ce030e701 100644 +--- a/arch/arm/dts/tegra210-p2371-2180.dts ++++ b/arch/arm/dts/tegra210-p2371-2180.dts +@@ -80,7 +80,7 @@ + }; + + sdhci@700b0600 { +- status = "okay"; ++ status = "disabled"; + bus-width = <8>; + non-removable; + }; +-- +2.17.1 + diff --git a/u-boot-2018.09.tar.bz2 b/u-boot-2018.09.tar.bz2 new file mode 100644 index 0000000..3814bb9 Binary files /dev/null and b/u-boot-2018.09.tar.bz2 differ diff --git a/uboot-tools.spec b/uboot-tools.spec new file mode 100644 index 0000000..34979d4 --- /dev/null +++ b/uboot-tools.spec @@ -0,0 +1,298 @@ +Name: uboot-tools +Version: 2018.09 +Release: 4 +Summary: tools for U-Boot +License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ + +URL: http://www.denx.de/wiki/U-Boot +Source0: ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2 + +Source1: arm-boards +Source2: arm-chromebooks +Source3: aarch64-boards +Source4: aarch64-chromebooks +Source5: 10-devicetree.install + +Patch1: uefi-use-specific-path-name.patch + +Patch2: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch +Patch3: usb-kbd-fixes.patch + +Patch10: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch +Patch11: rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch +Patch12: rockchip-make_fit_atf-use-elf-entry-point.patch +Patch13: rk3399-Rock960-board-support.patch +Patch14: dragonboard-fixes.patch +Patch15: tegra186-jetson-tx2-disable-onboard-emmc.patch +Patch16: tegra-efi_loader-simplify-ifdefs.patch +Patch17: tegra-TXx-Add-CONFIG_EFI_LOADER_BOUNCE_BUFFER.patch +Patch18: tegra-fix-tx1.patch +Patch19: sunxi-DT-A64-add-Pine64-LTS-support.patch + +BuildRequires: bc dtc gcc make flex bison git-core openssl-devel +BuildRequires: python-unversioned-command python2-devel python2-setuptools +BuildRequires: python2-libfdt python2-pyelftools SDL-devel swig +%ifarch %{arm} aarch64 +BuildRequires: vboot-utils +%endif +%ifarch aarch64 +BuildRequires: arm-trusted-firmware-armv8 +%endif + +Requires: dtc systemd + +%description +This package includes the mkimage program, which allows generation of U-Boot +images in various formats, and the fw_printenv and fw_setenv programs to read +and modify U-Boot's environment. + +%ifarch aarch64 +%package -n uboot-images-armv8 +Summary: u-boot bootloader images for aarch64 boards +Requires: uboot-tools +BuildArch: noarch + +%description -n uboot-images-armv8 +u-boot bootloader images for aarch64 boards +%endif + +%ifarch %{arm} +%package -n uboot-images-armv7 +Summary: u-boot bootloader images for armv7 boards +Requires: uboot-tools +BuildArch: noarch + +%description -n uboot-images-armv7 +u-boot bootloader images for armv7 boards +%endif + +%ifarch %{arm} aarch64 +%package -n uboot-images-elf +Summary: u-boot bootloader images for armv7 boards +Requires: uboot-tools +Obsoletes: uboot-images-qemu +Provides: uboot-images-qemu + +%description -n uboot-images-elf +u-boot bootloader ELF images for use with qemu and other platforms +%endif + +%package_help + +%prep +%setup -q -n u-boot-%{version} + +git init +git config --global gc.auto 0 +git config user.email "noone@example.com" +git config user.name "no one" +git add . +git commit -a -q -m "%{version} baseline" +git am %{patches} - 2018.09-4 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:add the README files to the main package + +* Sat Oct 12 2019 openEuler Buildteam - 2018.09-3 +- Package init diff --git a/uefi-distro-load-FDT-from-any-partition-on-boot-device.patch b/uefi-distro-load-FDT-from-any-partition-on-boot-device.patch new file mode 100644 index 0000000..a2340fd --- /dev/null +++ b/uefi-distro-load-FDT-from-any-partition-on-boot-device.patch @@ -0,0 +1,83 @@ +From 8bc6f62541436ebaf87133792726d9b48f878d09 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 5 Dec 2017 00:11:08 +0000 +Subject: [PATCH] distro: load FDT from any partition on boot device + +In the EFI_LOADER boot path, we were only checking the FAT partition +containing the EFI payload for dtb files. But this is somewhat of a +fiction. In reality there will be one small (V)FAT partition containing +grub (or whatever the payload may be), and a second boot partition +containing kernel/initrd/fdt (typically ext4). It is this second +partition where we should be looking for a FDT to load. + +So instead scan all the partitions of the disk containing the EFI +payload. This matches where grub looks for kernel/initrd (barring +custom grub.cfg, in which case the user can use grub's 'devicetree' +command to load the correct FDT). + +The other option is somehow passing the ${fdtfile} to grub so that it +can load the FDT based on selected kernel version location (which grub +knows) and SoC/board specific ${fdtfile} (which grub does not know). + +Signed-off-by: Rob Clark +Signed-off-by: Peter Robinson +--- + include/config_distro_bootcmd.h | 34 +++++++++++++++++++++++----------- + 1 file changed, 23 insertions(+), 11 deletions(-) + +diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h +index 7746366ec8..c87f7c2a42 100644 +--- a/include/config_distro_bootcmd.h ++++ b/include/config_distro_bootcmd.h +@@ -135,25 +135,37 @@ + "fi\0" \ + \ + "load_efi_dtb=" \ +- "load ${devtype} ${devnum}:${distro_bootpart} " \ +- "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \ ++ "load ${devtype} ${devnum}:${dtb_devp} " \ ++ "${fdt_addr_r} ${prefix}${efi_fdtfile} && " \ ++ "run boot_efi_binary\0" \ + \ + "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \ +- "scan_dev_for_efi=" \ ++ "scan_dev_for_dtb=" \ + "setenv efi_fdtfile ${fdtfile}; " \ + BOOTENV_EFI_SET_FDTFILE_FALLBACK \ +- "for prefix in ${efi_dtb_prefixes}; do " \ +- "if test -e ${devtype} " \ +- "${devnum}:${distro_bootpart} " \ +- "${prefix}${efi_fdtfile}; then " \ +- "run load_efi_dtb; " \ +- "fi;" \ +- "done;" \ ++ "part list ${devtype} ${devnum} dtb_devplist; " \ ++ "env exists dtb_devplist || setenv dtb_devplist " \ ++ "${distro_bootpart}; " \ ++ "for dtb_devp in ${dtb_devplist}; do " \ ++ "for prefix in ${efi_dtb_prefixes}; do " \ ++ "if test -e ${devtype} " \ ++ "${devnum}:${dtb_devp} " \ ++ "${prefix}${efi_fdtfile};"\ ++ " then " \ ++ "echo Found DTB ${devtype} " \ ++ "${devnum}:${dtb_devp} " \ ++ "${prefix}${efi_fdtfile};"\ ++ "run load_efi_dtb; " \ ++ "fi;" \ ++ "done; " \ ++ "done; " \ ++ "run boot_efi_binary\0" \ ++ "scan_dev_for_efi=" \ + "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "efi/fedora/"BOOTEFI_NAME"; then " \ + "echo Found EFI removable media binary " \ + "efi/fedora/"BOOTEFI_NAME"; " \ +- "run boot_efi_binary; " \ ++ "run scan_dev_for_dtb; " \ + "echo EFI LOAD FAILED: continuing...; " \ + "fi; " \ + "setenv efi_fdtfile\0" +-- +2.14.3 + diff --git a/uefi-use-specific-path-name.patch b/uefi-use-specific-path-name.patch new file mode 100644 index 0000000..7f61250 --- /dev/null +++ b/uefi-use-specific-path-name.patch @@ -0,0 +1,47 @@ +From 2b411f6edf298899098e2077a5ca2dfdaf3d882f Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 7 Feb 2018 12:37:58 +0000 +Subject: [PATCH] use Fedora specific EFI path/name + +Signed-off-by: Peter Robinson +--- + include/config_distro_bootcmd.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h +index f567cebd38..7746366ec8 100644 +--- a/include/config_distro_bootcmd.h ++++ b/include/config_distro_bootcmd.h +@@ -93,7 +93,7 @@ + + #ifdef CONFIG_EFI_LOADER + #if defined(CONFIG_ARM64) +-#define BOOTEFI_NAME "bootaa64.efi" ++#define BOOTEFI_NAME "grubaa64.efi" + #elif defined(CONFIG_ARM) + #define BOOTEFI_NAME "bootarm.efi" + #elif defined(CONFIG_X86_RUN_32BIT) +@@ -127,7 +127,7 @@ + "bootefi bootmgr ${fdtcontroladdr};" \ + "fi;" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ +- "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \ ++ "${kernel_addr_r} efi/fedora/"BOOTEFI_NAME"; " \ + "if fdt addr ${fdt_addr_r}; then " \ + "bootefi ${kernel_addr_r} ${fdt_addr_r};" \ + "else " \ +@@ -150,9 +150,9 @@ + "fi;" \ + "done;" \ + "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ +- "efi/boot/"BOOTEFI_NAME"; then " \ ++ "efi/fedora/"BOOTEFI_NAME"; then " \ + "echo Found EFI removable media binary " \ +- "efi/boot/"BOOTEFI_NAME"; " \ ++ "efi/fedora/"BOOTEFI_NAME"; " \ + "run boot_efi_binary; " \ + "echo EFI LOAD FAILED: continuing...; " \ + "fi; " \ +-- +2.14.3 + diff --git a/usb-kbd-fixes.patch b/usb-kbd-fixes.patch new file mode 100644 index 0000000..095029a --- /dev/null +++ b/usb-kbd-fixes.patch @@ -0,0 +1,115 @@ +From 1a8fa60aedff8a2368ac357a51dc15357065fabe Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 5 Dec 2017 00:11:54 +0000 +Subject: [PATCH 3/5] usb kbd fixes + +Signed-off-by: Peter Robinson +--- + common/usb_kbd.c | 66 +++++++++++++++++++++++++++++++++++++++++-------------- + include/console.h | 2 -- + 2 files changed, 50 insertions(+), 18 deletions(-) + +diff --git a/common/usb_kbd.c b/common/usb_kbd.c +index 8cbdba6ac2..82ad93f6ca 100644 +--- a/common/usb_kbd.c ++++ b/common/usb_kbd.c +@@ -516,25 +516,59 @@ static int probe_usb_keyboard(struct usb_device *dev) + return error; + + stdinname = env_get("stdin"); +-#if CONFIG_IS_ENABLED(CONSOLE_MUX) +- error = iomux_doenv(stdin, stdinname); +- if (error) +- return error; +-#else +- /* Check if this is the standard input device. */ +- if (strcmp(stdinname, DEVNAME)) +- return 1; ++ if (CONFIG_IS_ENABLED(CONSOLE_MUX)) { ++ char *devname = DEVNAME; ++ char *newstdin = NULL; ++ /* ++ * stdin might not be set yet.. either way, with console- ++ * mux the sensible thing to do is add ourselves to the ++ * list of stdio devices: ++ */ ++ if (stdinname && !strstr(stdinname, DEVNAME)) { ++ newstdin = malloc(strlen(stdinname) + ++ strlen(","DEVNAME) + 1); ++ sprintf(newstdin, "%s,"DEVNAME, stdinname); ++ stdinname = newstdin; ++ } else if (!stdinname) { ++ stdinname = devname; ++ } ++ error = iomux_doenv(stdin, stdinname); ++ free(newstdin); ++ if (error) ++ goto unregister_stdio; ++ } else { ++ /* Check if this is the standard input device. */ ++ if (strcmp(stdinname, DEVNAME)) { ++ error = -1; ++ goto unregister_stdio; ++ } + +- /* Reassign the console */ +- if (overwrite_console()) +- return 1; ++ /* Reassign the console */ ++ if (overwrite_console()) { ++ error = -1; ++ goto unregister_stdio; ++ } + +- error = console_assign(stdin, DEVNAME); +- if (error) +- return error; +-#endif ++ error = console_assign(stdin, DEVNAME); ++ if (error) ++ goto unregister_stdio; ++ } ++ ++ return 0; + ++unregister_stdio: ++ /* ++ * If probe fails, the device will be removed.. leaving dangling ++ * pointers if the stdio device is not unregistered. If u-boot ++ * is built without stdio_deregister(), just pretend to succeed ++ * in order to avoid dangling pointers. ++ */ ++#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) ++ stdio_deregister(DEVNAME, 1); ++ return error; ++#else + return 0; ++#endif + } + + #ifndef CONFIG_DM_USB +@@ -640,7 +674,7 @@ static int usb_kbd_remove(struct udevice *dev) + + return 0; + err: +- printf("%s: warning, ret=%d", __func__, ret); ++ printf("%s: warning, ret=%d\n", __func__, ret); + return ret; + } + +diff --git a/include/console.h b/include/console.h +index cea29ed6dc..7dfd36d7d1 100644 +--- a/include/console.h ++++ b/include/console.h +@@ -57,8 +57,6 @@ int console_announce_r(void); + /* + * CONSOLE multiplexing. + */ +-#ifdef CONFIG_CONSOLE_MUX + #include +-#endif + + #endif +-- +2.14.3 +