summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-23 20:50:11 -0500
committerTom Rini <trini@konsulko.com>2019-11-23 20:50:11 -0500
commit9a0cbae22a613dfd55e15565785749b74c19fdf0 (patch)
treee66f4ce35ba9d7ce812b95b8b441fc0bec917a4f /arch/arm
parentc8f2fe4e670c91172540ab36700d7a8411fc6f76 (diff)
parent8019d32c4701b95410113541deb7f28d5c2b02a5 (diff)
downloadu-boot-WIP/23Nov2019.tar.gz
Merge tag 'u-boot-rockchip-20191124' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchipWIP/23Nov2019
- Clean vid/pid in Kconfig and add fastboot for rk3399 - add 'u-boot, spl-fifo-mode' for mmc - Use FIT generator for rk3229 optee and rk3368 ATF - fan53555: add support for Silergy SYR82X and SYR83X
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/dts/px30-evb-u-boot.dtsi7
-rw-r--r--arch/arm/mach-rockchip/board.c32
-rw-r--r--arch/arm/mach-rockchip/fit_spl_optee.its50
-rwxr-xr-xarch/arm/mach-rockchip/fit_spl_optee.sh78
4 files changed, 113 insertions, 54 deletions
diff --git a/arch/arm/dts/px30-evb-u-boot.dtsi b/arch/arm/dts/px30-evb-u-boot.dtsi
index 3de9c7068e..a2a2c07dcc 100644
--- a/arch/arm/dts/px30-evb-u-boot.dtsi
+++ b/arch/arm/dts/px30-evb-u-boot.dtsi
@@ -31,12 +31,15 @@
&sdmmc {
u-boot,dm-pre-reloc;
- /* temporary till I find out why dma mode doesn't work */
- fifo-mode;
+ /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
+ u-boot,spl-fifo-mode;
};
&emmc {
u-boot,dm-pre-reloc;
+
+ /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
+ u-boot,spl-fifo-mode;
};
&grf {
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index c90eb976d0..8cd8911ad3 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -49,8 +49,10 @@ void enable_caches(void)
}
#endif
-#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
+#if defined(CONFIG_USB_GADGET)
#include <usb.h>
+
+#if defined(CONFIG_USB_GADGET_DWC2_OTG)
#include <usb/dwc2_udc.h>
static struct dwc2_plat_otg_data otg_data = {
@@ -117,7 +119,33 @@ int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
-#endif
+#endif /* CONFIG_USB_GADGET_DWC2_OTG */
+
+#if defined(CONFIG_USB_DWC3_GADGET) && !defined(CONFIG_DM_USB_GADGET)
+#include <dwc3-uboot.h>
+
+static struct dwc3_device dwc3_device_data = {
+ .maximum_speed = USB_SPEED_HIGH,
+ .base = 0xfe800000,
+ .dr_mode = USB_DR_MODE_PERIPHERAL,
+ .index = 0,
+ .dis_u2_susphy_quirk = 1,
+ .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW,
+};
+
+int usb_gadget_handle_interrupts(void)
+{
+ dwc3_uboot_handle_interrupt(0);
+ return 0;
+}
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+ return dwc3_uboot_init(&dwc3_device_data);
+}
+#endif /* CONFIG_USB_DWC3_GADGET */
+
+#endif /* CONFIG_USB_GADGET */
#if CONFIG_IS_ENABLED(FASTBOOT)
int fastboot_set_reboot_flag(void)
diff --git a/arch/arm/mach-rockchip/fit_spl_optee.its b/arch/arm/mach-rockchip/fit_spl_optee.its
deleted file mode 100644
index 6ed5d486f2..0000000000
--- a/arch/arm/mach-rockchip/fit_spl_optee.its
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 Rockchip Electronic Co.,Ltd
- *
- * Simple U-boot fit source file containing U-Boot, dtb and optee
- */
-
-/dts-v1/;
-
-/ {
- description = "Simple image with OP-TEE support";
- #address-cells = <1>;
-
- images {
- uboot {
- description = "U-Boot";
- data = /incbin/("../../../u-boot-nodtb.bin");
- type = "standalone";
- os = "U-Boot";
- arch = "arm";
- compression = "none";
- load = <0x61000000>;
- };
- optee {
- description = "OP-TEE";
- data = /incbin/("../../../tee.bin");
- type = "firmware";
- arch = "arm";
- os = "tee";
- compression = "none";
- load = <0x68400000>;
- entry = <0x68400000>;
- };
- fdt {
- description = "dtb";
- data = /incbin/("../../../u-boot.dtb");
- type = "flat_dt";
- compression = "none";
- };
- };
-
- configurations {
- default = "conf";
- conf {
- description = "Rockchip armv7 with OP-TEE";
- firmware = "optee";
- loadables = "uboot";
- fdt = "fdt";
- };
- };
-};
diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh
new file mode 100755
index 0000000000..89ef04312c
--- /dev/null
+++ b/arch/arm/mach-rockchip/fit_spl_optee.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019 Rockchip Electronic Co.,Ltd
+#
+# Script to generate FIT image source for 32-bit Rockchip SoCs with
+# U-Boot proper, OPTEE, and devicetree.
+#
+# usage: $0 <dt_name>
+
+[ -z "$TEE" ] && TEE="tee.bin"
+
+if [ ! -f $TEE ]; then
+ echo "WARNING: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2
+ echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2
+ TEE=/dev/null
+fi
+
+dtname=$1
+
+cat << __HEADER_EOF
+/*
+ * Copyright (C) 2017-2019 Rockchip Electronic Co.,Ltd
+ *
+ * Simple U-boot FIT source file containing U-Boot, dtb and optee
+ */
+
+/dts-v1/;
+
+/ {
+ description = "FIT image with OP-TEE support";
+ #address-cells = <1>;
+
+ images {
+ uboot {
+ description = "U-Boot";
+ data = /incbin/("u-boot-nodtb.bin");
+ type = "standalone";
+ os = "U-Boot";
+ arch = "arm";
+ compression = "none";
+ load = <0x61000000>;
+ };
+ optee {
+ description = "OP-TEE";
+ data = /incbin/("$TEE");
+ type = "firmware";
+ arch = "arm";
+ os = "tee";
+ compression = "none";
+ load = <0x68400000>;
+ entry = <0x68400000>;
+ };
+ fdt {
+ description = "$(basename $dtname .dtb)";
+ data = /incbin/("$dtname");
+ type = "flat_dt";
+ compression = "none";
+ };
+__HEADER_EOF
+
+cat << __CONF_HEADER_EOF
+ };
+
+ configurations {
+ default = "conf";
+ conf {
+ description = "$(basename $dtname .dtb)";
+ firmware = "optee";
+ loadables = "uboot";
+ fdt = "fdt";
+ };
+__CONF_HEADER_EOF
+
+cat << __ITS_EOF
+ };
+};
+__ITS_EOF