From 87fe6e18e5c23ab8031ed9f19d3a4688fb069699 Mon Sep 17 00:00:00 2001 From: Dalon Westergreen Date: Wed, 18 Sep 2019 15:02:42 -0700 Subject: Remove old, unused u-boot files Signed-off-by: Dalon Westergreen --- ...1-Fix-native-build-by-using-env-variables.patch | 31 - .../u-boot/files/fix-build-error-under-gcc6.patch | 91 --- .../u-boot/files/v2016.11/cyclone5-socdk.env | 11 - recipes-bsp/u-boot/files/v2016.11/de0-nano-soc.env | 11 - .../u-boot/files/v2017.07/cyclone5-socdk.env | 11 - recipes-bsp/u-boot/files/v2017.07/de0-nano-soc.env | 11 - ...ocfpga-stratix10-Enable-PSCI-system-reset.patch | 59 -- ...-ARM-socfpga-stratix10-Enable-PSCI-CPU_ON.patch | 67 -- ...-stratix10-Enable-PSCI-support-for-Strati.patch | 45 -- ...-stratix10-Enable-SMC-PSCI-calls-from-sla.patch | 153 ---- ...-stratix10-Add-SOCFPGA-bridges-reset-supp.patch | 102 --- ...-stratix10-Add-Stratix10-FPGA-configurati.patch | 833 --------------------- ...Enable-small-delay-before-returning-error.patch | 60 -- ...ga-stratix10-Enable-DMA330-DMA-controller.patch | 41 - ...-Stratix10-Fix-el3_exception_vectors-relo.patch | 32 - ...cfpga-Stratix10-Disable-CONFIG_PSCI_RESET.patch | 30 - ...d-target-to-generate-hex-output-for-combi.patch | 87 --- ...-socfpga-stratix10-Remove-CONFIG_OF_EMBED.patch | 36 - ...-update-CONFIG_SPL_FS_LOAD_PAYLOAD_NAME-t.patch | 30 - ...ria10-Fix-error-in-fpga-pin-configuration.patch | 38 - 20 files changed, 1779 deletions(-) delete mode 100644 recipes-bsp/u-boot/files/0001-Fix-native-build-by-using-env-variables.patch delete mode 100644 recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch delete mode 100644 recipes-bsp/u-boot/files/v2016.11/cyclone5-socdk.env delete mode 100644 recipes-bsp/u-boot/files/v2016.11/de0-nano-soc.env delete mode 100644 recipes-bsp/u-boot/files/v2017.07/cyclone5-socdk.env delete mode 100644 recipes-bsp/u-boot/files/v2017.07/de0-nano-soc.env delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0001-ARM-socfpga-stratix10-Enable-PSCI-system-reset.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0002-ARM-socfpga-stratix10-Enable-PSCI-CPU_ON.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0003-ARM-socfpga-stratix10-Enable-PSCI-support-for-Strati.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0004-ARM-socfpga-stratix10-Enable-SMC-PSCI-calls-from-sla.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0005-ARM-socfpga-stratix10-Add-SOCFPGA-bridges-reset-supp.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0006-ARM-socfpga-stratix10-Add-Stratix10-FPGA-configurati.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0008-ARM-socfpga-stratix10-Enable-DMA330-DMA-controller.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0009-ARM-socfpga-Stratix10-Fix-el3_exception_vectors-relo.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0010-ARM-socfpga-Stratix10-Disable-CONFIG_PSCI_RESET.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0011-Makefile-Add-target-to-generate-hex-output-for-combi.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0012-ARM-socfpga-stratix10-Remove-CONFIG_OF_EMBED.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0013-ARM-socfpga-update-CONFIG_SPL_FS_LOAD_PAYLOAD_NAME-t.patch delete mode 100644 recipes-bsp/u-boot/files/v2019.07/0014-fpga-arria10-Fix-error-in-fpga-pin-configuration.patch (limited to 'recipes-bsp/u-boot') diff --git a/recipes-bsp/u-boot/files/0001-Fix-native-build-by-using-env-variables.patch b/recipes-bsp/u-boot/files/0001-Fix-native-build-by-using-env-variables.patch deleted file mode 100644 index 5443bce..0000000 --- a/recipes-bsp/u-boot/files/0001-Fix-native-build-by-using-env-variables.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5aa1e2d99a26f1cab1774fa1e94b53de42897d1c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= -Date: Thu, 10 Aug 2017 19:36:21 +0200 -Subject: [PATCH] Fix native build by using env variables -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Jan-Simon Möller ---- - Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 8ca1db5..fef1059 100644 ---- a/Makefile -+++ b/Makefile -@@ -254,8 +254,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ - else if [ -x /bin/bash ]; then echo /bin/bash; \ - else echo sh; fi ; fi) - --HOSTCC = cc --HOSTCXX = c++ -+HOSTCC = $(CC) -+HOSTCXX = $(CXX) - HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ - $(if $(CONFIG_TOOLS_DEBUG),-g) - HOSTCXXFLAGS = -O2 --- -2.1.4 - diff --git a/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch b/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch deleted file mode 100644 index 18c5e74..0000000 --- a/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 07373b2e477ae61f9f6a0e2eff41be3276d92923 Mon Sep 17 00:00:00 2001 -From: yocto -Date: Thu, 2 Jun 2016 03:21:51 -0500 -Subject: [PATCH] fix build error under gcc6 - -Fix the following error: -| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory -| #include gcc_header(__GNUC__) - -Signed-off-by: Zhenhua Luo - -Upstream-Status: Pending ---- - include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 65 insertions(+) - create mode 100644 include/linux/compiler-gcc6.h - -diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h -new file mode 100644 -index 0000000..c8c5659 ---- /dev/null -+++ b/include/linux/compiler-gcc6.h -@@ -0,0 +1,65 @@ -+#ifndef __LINUX_COMPILER_H -+#error "Please don't include directly, include instead." -+#endif -+ -+#define __used __attribute__((__used__)) -+#define __must_check __attribute__((warn_unused_result)) -+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -+ -+/* Mark functions as cold. gcc will assume any path leading to a call -+ to them will be unlikely. This means a lot of manual unlikely()s -+ are unnecessary now for any paths leading to the usual suspects -+ like BUG(), printk(), panic() etc. [but let's keep them for now for -+ older compilers] -+ -+ Early snapshots of gcc 4.3 don't support this and we can't detect this -+ in the preprocessor, but we can live with this because they're unreleased. -+ Maketime probing would be overkill here. -+ -+ gcc also has a __attribute__((__hot__)) to move hot functions into -+ a special section, but I don't see any sense in this right now in -+ the kernel context */ -+#define __cold __attribute__((__cold__)) -+ -+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+ -+#ifndef __CHECKER__ -+# define __compiletime_warning(message) __attribute__((warning(message))) -+# define __compiletime_error(message) __attribute__((error(message))) -+#endif /* __CHECKER__ */ -+ -+/* -+ * Mark a position in code as unreachable. This can be used to -+ * suppress control flow warnings after asm blocks that transfer -+ * control elsewhere. -+ * -+ * Early snapshots of gcc 4.5 don't support this and we can't detect -+ * this in the preprocessor, but we can live with this because they're -+ * unreleased. Really, we need to have autoconf for the kernel. -+ */ -+#define unreachable() __builtin_unreachable() -+ -+/* Mark a function definition as prohibited from being cloned. */ -+#define __noclone __attribute__((__noclone__)) -+ -+/* -+ * Tell the optimizer that something else uses this function or variable. -+ */ -+#define __visible __attribute__((externally_visible)) -+ -+/* -+ * GCC 'asm goto' miscompiles certain code sequences: -+ * -+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+ * -+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+ * -+ * (asm goto is automatically volatile - the naming reflects this.) -+ */ -+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+ -+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+#define __HAVE_BUILTIN_BSWAP32__ -+#define __HAVE_BUILTIN_BSWAP64__ -+#define __HAVE_BUILTIN_BSWAP16__ -+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ --- -2.5.0 - diff --git a/recipes-bsp/u-boot/files/v2016.11/cyclone5-socdk.env b/recipes-bsp/u-boot/files/v2016.11/cyclone5-socdk.env deleted file mode 100644 index 15c329f..0000000 --- a/recipes-bsp/u-boot/files/v2016.11/cyclone5-socdk.env +++ /dev/null @@ -1,11 +0,0 @@ -baudrate=115200 -bootargs=console=ttyS0,115200 -bootcmd=run mmcload; run mmcboot -fdtimage=socfpga_cyclone5_socdk.dtb -bootimage=zImage -fdt_addr=100 -loadaddr=0x01000000 -mmcboot=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait;bootz ${loadaddr} - ${fdt_addr} -mmcload=mmc rescan;load mmc 0:1 ${loadaddr} ${bootimage};load mmc 0:1 ${fdt_addr} ${fdtimage} -mmcroot=/dev/mmcblk0p3 -ramboot=setenv bootargs console=ttyS0,115200;bootm ${loadaddr} - ${fdt_addr} diff --git a/recipes-bsp/u-boot/files/v2016.11/de0-nano-soc.env b/recipes-bsp/u-boot/files/v2016.11/de0-nano-soc.env deleted file mode 100644 index b7d69cb..0000000 --- a/recipes-bsp/u-boot/files/v2016.11/de0-nano-soc.env +++ /dev/null @@ -1,11 +0,0 @@ -baudrate=115200 -bootargs=console=ttyS0,115200 -bootcmd=run mmcload; run mmcboot -fdtimage=socfpga_cyclone5_de0_sockit.dtb -bootimage=zImage -fdt_addr=100 -loadaddr=0x01000000 -mmcboot=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait;bootz ${loadaddr} - ${fdt_addr} -mmcload=mmc rescan;load mmc 0:1 ${loadaddr} ${bootimage};load mmc 0:1 ${fdt_addr} ${fdtimage} -mmcroot=/dev/mmcblk0p3 -ramboot=setenv bootargs console=ttyS0,115200;bootm ${loadaddr} - ${fdt_addr} diff --git a/recipes-bsp/u-boot/files/v2017.07/cyclone5-socdk.env b/recipes-bsp/u-boot/files/v2017.07/cyclone5-socdk.env deleted file mode 100644 index 15c329f..0000000 --- a/recipes-bsp/u-boot/files/v2017.07/cyclone5-socdk.env +++ /dev/null @@ -1,11 +0,0 @@ -baudrate=115200 -bootargs=console=ttyS0,115200 -bootcmd=run mmcload; run mmcboot -fdtimage=socfpga_cyclone5_socdk.dtb -bootimage=zImage -fdt_addr=100 -loadaddr=0x01000000 -mmcboot=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait;bootz ${loadaddr} - ${fdt_addr} -mmcload=mmc rescan;load mmc 0:1 ${loadaddr} ${bootimage};load mmc 0:1 ${fdt_addr} ${fdtimage} -mmcroot=/dev/mmcblk0p3 -ramboot=setenv bootargs console=ttyS0,115200;bootm ${loadaddr} - ${fdt_addr} diff --git a/recipes-bsp/u-boot/files/v2017.07/de0-nano-soc.env b/recipes-bsp/u-boot/files/v2017.07/de0-nano-soc.env deleted file mode 100644 index b7d69cb..0000000 --- a/recipes-bsp/u-boot/files/v2017.07/de0-nano-soc.env +++ /dev/null @@ -1,11 +0,0 @@ -baudrate=115200 -bootargs=console=ttyS0,115200 -bootcmd=run mmcload; run mmcboot -fdtimage=socfpga_cyclone5_de0_sockit.dtb -bootimage=zImage -fdt_addr=100 -loadaddr=0x01000000 -mmcboot=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait;bootz ${loadaddr} - ${fdt_addr} -mmcload=mmc rescan;load mmc 0:1 ${loadaddr} ${bootimage};load mmc 0:1 ${fdt_addr} ${fdtimage} -mmcroot=/dev/mmcblk0p3 -ramboot=setenv bootargs console=ttyS0,115200;bootm ${loadaddr} - ${fdt_addr} diff --git a/recipes-bsp/u-boot/files/v2019.07/0001-ARM-socfpga-stratix10-Enable-PSCI-system-reset.patch b/recipes-bsp/u-boot/files/v2019.07/0001-ARM-socfpga-stratix10-Enable-PSCI-system-reset.patch deleted file mode 100644 index 0b4fec1..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0001-ARM-socfpga-stratix10-Enable-PSCI-system-reset.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 5534368e77a2bfcb366eb158c72a751c28e377a7 Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Mon, 29 Apr 2019 23:35:30 -0700 -Subject: [PATCH 01/14] ARM: socfpga: stratix10: Enable PSCI system reset - -Enable psci_system_reset support for Stratix10. This PSCI function -will eventually trigger the mailbox HPS_REBOOT to SDM. - -Signed-off-by: Ang, Chee Hong ---- - arch/arm/mach-socfpga/Makefile | 3 +++ - arch/arm/mach-socfpga/psci.c | 21 +++++++++++++++++++++ - 2 files changed, 24 insertions(+) - create mode 100644 arch/arm/mach-socfpga/psci.c - -diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile -index e66720447f..f77b229a38 100644 ---- a/arch/arm/mach-socfpga/Makefile -+++ b/arch/arm/mach-socfpga/Makefile -@@ -38,6 +38,9 @@ obj-y += system_manager_s10.o - obj-y += timer_s10.o - obj-y += wrap_pinmux_config_s10.o - obj-y += wrap_pll_config_s10.o -+ifndef CONFIG_SPL_BUILD -+obj-$(CONFIG_ARMV8_PSCI) += psci.o -+endif - endif - - ifdef CONFIG_SPL_BUILD -diff --git a/arch/arm/mach-socfpga/psci.c b/arch/arm/mach-socfpga/psci.c -new file mode 100644 -index 0000000000..9ef393110d ---- /dev/null -+++ b/arch/arm/mach-socfpga/psci.c -@@ -0,0 +1,21 @@ -+/* -+ * Copyright (C) 2017 Intel Corporation -+ * -+ * SPDX-License-Identifier: GPL-2.0 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+void __noreturn __secure psci_system_reset(void) -+{ -+ mbox_send_cmd_psci(MBOX_ID_UBOOT, MBOX_REBOOT_HPS, -+ MBOX_CMD_DIRECT, 0, NULL, 0, 0, NULL); -+ -+ while (1) -+ ; -+} --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0002-ARM-socfpga-stratix10-Enable-PSCI-CPU_ON.patch b/recipes-bsp/u-boot/files/v2019.07/0002-ARM-socfpga-stratix10-Enable-PSCI-CPU_ON.patch deleted file mode 100644 index 05d1e91..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0002-ARM-socfpga-stratix10-Enable-PSCI-CPU_ON.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0d6fb850e5662ade636b0c7aa96de9d6ed653310 Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Mon, 14 Jan 2019 01:07:50 -0800 -Subject: [PATCH 02/14] ARM: socfpga: stratix10: Enable PSCI CPU_ON - -Enable psci_cpu_on support for Stratix10. This PSCI function -will pass the cpu release address for CPU1-CPU3. Then send event -signal shall be triggered to get these CPUs running Linux code. - -Signed-off-by: Ang, Chee Hong ---- - arch/arm/mach-socfpga/psci.c | 35 +++++++++++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - -diff --git a/arch/arm/mach-socfpga/psci.c b/arch/arm/mach-socfpga/psci.c -index 9ef393110d..0af3eb195c 100644 ---- a/arch/arm/mach-socfpga/psci.c -+++ b/arch/arm/mach-socfpga/psci.c -@@ -11,6 +11,9 @@ - #include - #include - -+static u64 psci_cpu_on_64_cpuid __secure_data; -+static u64 psci_cpu_on_64_entry_point __secure_data; -+ - void __noreturn __secure psci_system_reset(void) - { - mbox_send_cmd_psci(MBOX_ID_UBOOT, MBOX_REBOOT_HPS, -@@ -19,3 +22,35 @@ void __noreturn __secure psci_system_reset(void) - while (1) - ; - } -+ -+/* This function will handle multiple core release based PSCI */ -+void __secure psci_cpu_on_64_mpidr(void) -+{ -+ asm volatile( -+ ".align 5 \n" -+ "1: wfe \n" -+ " ldr x0, [%0] \n" -+ " ldr x1, [%1] \n" -+ " mrs x2, mpidr_el1 \n" -+ " and x2, x2, #0xff \n" -+ " cmp x0, x2 \n" -+ " b.ne 1b \n" -+ " br x1 \n" -+ : : "r"(&psci_cpu_on_64_cpuid), "r"(&psci_cpu_on_64_entry_point) -+ : "x0", "x1", "x2", "memory", "cc"); -+} -+ -+int __secure psci_cpu_on_64(u32 function_id, u64 cpuid, u64 entry_point) -+{ -+ /* Releases all secondary CPUs to jump into psci_cpu_on_64_mpidr */ -+ writeq(0, &psci_cpu_on_64_cpuid); -+ writeq(0, &psci_cpu_on_64_entry_point); -+ writeq((u64)&psci_cpu_on_64_mpidr, CPU_RELEASE_ADDR); -+ -+ /* to store in global so psci_cpu_on_64_mpidr function can refer */ -+ writeq(entry_point, &psci_cpu_on_64_entry_point); -+ writeq(cpuid, &psci_cpu_on_64_cpuid); -+ asm volatile("sev"); -+ -+ return ARM_PSCI_RET_SUCCESS; -+} --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0003-ARM-socfpga-stratix10-Enable-PSCI-support-for-Strati.patch b/recipes-bsp/u-boot/files/v2019.07/0003-ARM-socfpga-stratix10-Enable-PSCI-support-for-Strati.patch deleted file mode 100644 index 9b92117..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0003-ARM-socfpga-stratix10-Enable-PSCI-support-for-Strati.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d58eacb640040fc19b0939f4398829fa43e5601e Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Mon, 29 Apr 2019 23:18:38 -0700 -Subject: [PATCH 03/14] ARM: socfpga: stratix10: Enable PSCI support for - Stratix 10 - -The address of PSCI text, data and stack sections start at -0x00001000 (SDRAM). - -Signed-off-by: Ang, Chee Hong ---- - arch/arm/mach-socfpga/Kconfig | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig -index 1d914648e3..dc4cba67ab 100644 ---- a/arch/arm/mach-socfpga/Kconfig -+++ b/arch/arm/mach-socfpga/Kconfig -@@ -18,6 +18,12 @@ config SPL_SYS_MALLOC_F_LEN - config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE - default 0xa2 - -+config ARMV8_SECURE_BASE -+ default 0x00001000 if TARGET_SOCFPGA_STRATIX10 -+ -+config SYS_HAS_ARMV8_SECURE_BASE -+ default y if TARGET_SOCFPGA_STRATIX10 -+ - config SYS_MALLOC_F_LEN - default 0x2000 if TARGET_SOCFPGA_ARRIA10 - default 0x2000 if TARGET_SOCFPGA_GEN5 -@@ -64,8 +70,9 @@ config TARGET_SOCFPGA_GEN5 - config TARGET_SOCFPGA_STRATIX10 - bool - select ARMV8_MULTIENTRY -+ select ARMV8_PSCI -+ select ARMV8_SEC_FIRMWARE_SUPPORT - select ARMV8_SET_SMPEN -- select ARMV8_SPIN_TABLE - select FPGA_STRATIX10 - - choice --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0004-ARM-socfpga-stratix10-Enable-SMC-PSCI-calls-from-sla.patch b/recipes-bsp/u-boot/files/v2019.07/0004-ARM-socfpga-stratix10-Enable-SMC-PSCI-calls-from-sla.patch deleted file mode 100644 index 55a9805..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0004-ARM-socfpga-stratix10-Enable-SMC-PSCI-calls-from-sla.patch +++ /dev/null @@ -1,153 +0,0 @@ -From d6ac4f9f2756a14021f9cdc3c3305f950643d45f Mon Sep 17 00:00:00 2001 -From: Chee Hong Ang -Date: Fri, 20 Apr 2018 18:28:07 +0800 -Subject: [PATCH 04/14] ARM: socfpga: stratix10: Enable SMC/PSCI calls from - slave CPUs - -Before this patch, only master CPU (CPU0) is able to -make SMC/PSCI calls to EL3 exception handler. This patch -allow SMC/PSCI calls from slave CPUs (CPU1/2/3) as well. - -Signed-off-by: Chee Hong Ang ---- - arch/arm/mach-socfpga/Makefile | 1 + - arch/arm/mach-socfpga/lowlevel_init.S | 97 +++++++++++++++++++++++ - include/configs/socfpga_stratix10_socdk.h | 6 ++ - 3 files changed, 104 insertions(+) - create mode 100644 arch/arm/mach-socfpga/lowlevel_init.S - -diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile -index f77b229a38..d34198d159 100644 ---- a/arch/arm/mach-socfpga/Makefile -+++ b/arch/arm/mach-socfpga/Makefile -@@ -29,6 +29,7 @@ obj-y += reset_manager_arria10.o - endif - - ifdef CONFIG_TARGET_SOCFPGA_STRATIX10 -+obj-y += lowlevel_init.o - obj-y += clock_manager_s10.o - obj-y += mailbox_s10.o - obj-y += misc_s10.o -diff --git a/arch/arm/mach-socfpga/lowlevel_init.S b/arch/arm/mach-socfpga/lowlevel_init.S -new file mode 100644 -index 0000000000..832785a682 ---- /dev/null -+++ b/arch/arm/mach-socfpga/lowlevel_init.S -@@ -0,0 +1,97 @@ -+/* -+ * Copyright (C) 2018 Intel Corporation. All rights reserved -+ * -+ * SPDX-License-Identifier: GPL-2.0 -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI) -+.align 3 -+_el3_exception_vectors: -+ .word el3_exception_vectors; -+ .word 0 -+#endif -+ -+ENTRY(lowlevel_init) -+ mov x29, lr /* Save LR */ -+ -+#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3) -+ branch_if_slave x0, 1f -+ ldr x0, =GICD_BASE -+ bl gic_init_secure -+1: -+#if defined(CONFIG_GICV3) -+ ldr x0, =GICR_BASE -+ bl gic_init_secure_percpu -+#elif defined(CONFIG_GICV2) -+ ldr x0, =GICD_BASE -+ ldr x1, =GICC_BASE -+ bl gic_init_secure_percpu -+#endif -+#endif -+ -+#ifdef CONFIG_ARMV8_MULTIENTRY -+ branch_if_master x0, x1, 2f -+ -+ /* -+ * Slave should wait for master clearing spin table. -+ * This sync prevent slaves observing incorrect -+ * value of spin table and jumping to wrong place. -+ */ -+#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3) -+#ifdef CONFIG_GICV2 -+ ldr x0, =GICC_BASE -+#endif -+ bl gic_wait_for_interrupt -+#endif -+ -+#ifdef CONFIG_SPL_BUILD -+ /* -+ * Read the u-boot's PSCI exception handler's vector base -+ * address from the sysmgr.boot_scratch_cold6 & 7 and update -+ * their VBAR_EL3 respectively. -+ */ -+wait_vbar_el3: -+ ldr x4, =VBAR_EL3_BASE_ADDR -+ ldr x5, [x4] -+ cbz x5, wait_vbar_el3 -+ msr vbar_el3, x5 -+#endif -+ /* -+ * All slaves will enter EL2 and optionally EL1. -+ */ -+ adr x4, lowlevel_in_el2 -+ ldr x5, =ES_TO_AARCH64 -+ bl armv8_switch_to_el2 -+ -+lowlevel_in_el2: -+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1 -+ adr x4, lowlevel_in_el1 -+ ldr x5, =ES_TO_AARCH64 -+ bl armv8_switch_to_el1 -+ -+lowlevel_in_el1: -+#endif -+ -+#endif /* CONFIG_ARMV8_MULTIENTRY */ -+ -+2: -+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI) -+ /* -+ * Write the u-boot PSCI exception handler's vector base address -+ * into a sysmgr.boot_scratch_cold6 & 7 so that other slave cpus -+ * are able to get the vector base address and update their VBAR_EL3 -+ * respectively. -+ */ -+ adr x0, _el3_exception_vectors -+ ldr x5, [x0] -+ ldr x4, =VBAR_EL3_BASE_ADDR -+ str x5, [x4] -+#endif -+ mov lr, x29 /* Restore LR */ -+ ret -+ENDPROC(lowlevel_init) -diff --git a/include/configs/socfpga_stratix10_socdk.h b/include/configs/socfpga_stratix10_socdk.h -index 8d2971c6e2..39d757d737 100644 ---- a/include/configs/socfpga_stratix10_socdk.h -+++ b/include/configs/socfpga_stratix10_socdk.h -@@ -19,6 +19,12 @@ - #define CONFIG_REMAKE_ELF - /* sysmgr.boot_scratch_cold4 & 5 (64bit) will be used for PSCI_CPU_ON call */ - #define CPU_RELEASE_ADDR 0xFFD12210 -+/* -+ * sysmgr.boot_scratch_cold6 & 7 (64bit) will be used by master CPU to -+ * store its VBAR_EL3 value. Other slave CPUs will read from this -+ * location and update their VBAR_EL3 respectively -+ */ -+#define VBAR_EL3_BASE_ADDR 0xFFD12218 - #define CONFIG_SYS_CACHELINE_SIZE 64 - #define CONFIG_SYS_MEM_RESERVE_SECURE 0 /* using OCRAM, not DDR */ - --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0005-ARM-socfpga-stratix10-Add-SOCFPGA-bridges-reset-supp.patch b/recipes-bsp/u-boot/files/v2019.07/0005-ARM-socfpga-stratix10-Add-SOCFPGA-bridges-reset-supp.patch deleted file mode 100644 index a6c2b2a..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0005-ARM-socfpga-stratix10-Add-SOCFPGA-bridges-reset-supp.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 97cae73c90b57bbcf2b422ff142a3c9de6e9ea66 Mon Sep 17 00:00:00 2001 -From: Dalon Westergreen -Date: Wed, 22 May 2019 17:05:12 -0700 -Subject: [PATCH 05/14] ARM: socfpga: stratix10: Add SOCFPGA bridges reset - support for PSCI call - -Add SOCFPGA bridges reset support for FPGA configuration SMC services -to disable/enable the bridges before and after the FPGA configuration -process. - -Signed-off-by: Ang, Chee Hong -Signed-off-by: Dalon Westergreen ---- - .../include/mach/reset_manager_s10.h | 1 + - arch/arm/mach-socfpga/reset_manager_s10.c | 25 ++++++++++++++++++- - 2 files changed, 25 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -index 452147b017..1939ffa149 100644 ---- a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -+++ b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -@@ -11,6 +11,7 @@ void reset_cpu(ulong addr); - int cpu_has_been_warmreset(void); - - void socfpga_bridges_reset(int enable); -+void socfpga_bridges_reset_psci(int enable); - - void socfpga_per_reset(u32 reset, int set); - void socfpga_per_reset_all(void); -diff --git a/arch/arm/mach-socfpga/reset_manager_s10.c b/arch/arm/mach-socfpga/reset_manager_s10.c -index 499a84aff5..4494f6666f 100644 ---- a/arch/arm/mach-socfpga/reset_manager_s10.c -+++ b/arch/arm/mach-socfpga/reset_manager_s10.c -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - - DECLARE_GLOBAL_DATA_PTR; - -@@ -20,6 +21,8 @@ static const struct socfpga_system_manager *system_manager_base = - /* Assert or de-assert SoCFPGA reset manager reset. */ - void socfpga_per_reset(u32 reset, int set) - { -+ static const struct socfpga_reset_manager *reset_manager_base = -+ (void *)SOCFPGA_RSTMGR_ADDRESS; - const void *reg; - - if (RSTMGR_BANK(reset) == 0) -@@ -46,6 +49,8 @@ void socfpga_per_reset(u32 reset, int set) - */ - void socfpga_per_reset_all(void) - { -+ static const struct socfpga_reset_manager *reset_manager_base = -+ (void *)SOCFPGA_RSTMGR_ADDRESS; - const u32 l4wd0 = 1 << RSTMGR_RESET(SOCFPGA_RESET(L4WD0)); - - /* disable all except OCP and l4wd0. OCP disable later */ -@@ -55,8 +60,13 @@ void socfpga_per_reset_all(void) - writel(0xffffffff, &reset_manager_base->per1modrst); - } - --void socfpga_bridges_reset(int enable) -+static __always_inline void __socfpga_bridges_reset(int enable) - { -+ static const struct socfpga_reset_manager *reset_manager_base = -+ (void *)SOCFPGA_RSTMGR_ADDRESS; -+ static const struct socfpga_system_manager *system_manager_base = -+ (void *)SOCFPGA_SYSMGR_ADDRESS; -+ - if (enable) { - /* clear idle request to all bridges */ - setbits_le32(&system_manager_base->noc_idlereq_clr, ~0); -@@ -94,11 +104,24 @@ void socfpga_bridges_reset(int enable) - } - } - -+void socfpga_bridges_reset(int enable) -+{ -+ __socfpga_bridges_reset(enable); -+} -+ -+void __secure socfpga_bridges_reset_psci(int enable) -+{ -+ __socfpga_bridges_reset(enable); -+} -+ - /* - * Return non-zero if the CPU has been warm reset - */ - int cpu_has_been_warmreset(void) - { -+ static const struct socfpga_reset_manager *reset_manager_base = -+ (void *)SOCFPGA_RSTMGR_ADDRESS; -+ - return readl(&reset_manager_base->status) & - RSTMGR_L4WD_MPU_WARMRESET_MASK; - } --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0006-ARM-socfpga-stratix10-Add-Stratix10-FPGA-configurati.patch b/recipes-bsp/u-boot/files/v2019.07/0006-ARM-socfpga-stratix10-Add-Stratix10-FPGA-configurati.patch deleted file mode 100644 index 5f58e52..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0006-ARM-socfpga-stratix10-Add-Stratix10-FPGA-configurati.patch +++ /dev/null @@ -1,833 +0,0 @@ -From 97b805b19ed529f389bf5899fbe1d99bd13ffd59 Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Mon, 29 Apr 2019 23:42:39 -0700 -Subject: [PATCH 06/14] ARM: socfpga: stratix10: Add Stratix10 FPGA - configuration PSCI services - -Allow PSCI layer to handle the S10 FPGA configuration (SiP) service -calls. All these services are also known as FPGA configuration service -layer for S10. This service layer support FPGA configuration service -requests from OS (EL1). It acts as the middle layer between SDM -(Secure Device Manager) and the OS. It enables OS (EL1) to invoke SMC -call to this service layer (EL3) and pass the FPGA bit stream to SDM -for FPGA configuration. - -Signed-off-by: Ang, Chee Hong ---- - arch/arm/mach-socfpga/Makefile | 1 + - arch/arm/mach-socfpga/include/mach/smc_s10.h | 42 ++ - arch/arm/mach-socfpga/smc_fpga_reconfig_s10.c | 422 ++++++++++++++++++ - include/linux/intel-smc.h | 311 +++++++++++++ - 4 files changed, 776 insertions(+) - create mode 100644 arch/arm/mach-socfpga/include/mach/smc_s10.h - create mode 100644 arch/arm/mach-socfpga/smc_fpga_reconfig_s10.c - create mode 100644 include/linux/intel-smc.h - -diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile -index d34198d159..88970e7555 100644 ---- a/arch/arm/mach-socfpga/Makefile -+++ b/arch/arm/mach-socfpga/Makefile -@@ -41,6 +41,7 @@ obj-y += wrap_pinmux_config_s10.o - obj-y += wrap_pll_config_s10.o - ifndef CONFIG_SPL_BUILD - obj-$(CONFIG_ARMV8_PSCI) += psci.o -+obj-$(CONFIG_FPGA_STRATIX10) += smc_fpga_reconfig_s10.o - endif - endif - -diff --git a/arch/arm/mach-socfpga/include/mach/smc_s10.h b/arch/arm/mach-socfpga/include/mach/smc_s10.h -new file mode 100644 -index 0000000000..9c82d863e5 ---- /dev/null -+++ b/arch/arm/mach-socfpga/include/mach/smc_s10.h -@@ -0,0 +1,42 @@ -+/* -+ * Copyright (C) 2018 Intel Corporation. All rights reserved -+ * -+ * SPDX-License-Identifier: GPL-2.0 -+ */ -+ -+#include -+ -+#define SMC_ARG0 0 -+#define SMC_ARG1 (SMC_ARG0 + 1) -+#define SMC_ARG2 (SMC_ARG1 + 1) -+#define SMC_ARG3 (SMC_ARG2 + 1) -+#define SMC_RETURN_ARGS_MAX (SMC_ARG3 + 1) -+ -+/* Macro functions for allocation and read/write of -+ variables to be assigned to registers */ -+/* Allocate memory for variable */ -+#define SMC_ALLOC_REG_MEM(var) unsigned long var[SMC_RETURN_ARGS_MAX] -+/* Clear variable */ -+#define SMC_INIT_REG_MEM(var) \ -+ do { \ -+ int i; \ -+ for (i = 0; i < SMC_RETURN_ARGS_MAX; i++) \ -+ var[i] = 0; \ -+ } while (0) -+/* Read variable */ -+#define SMC_GET_REG_MEM(var, i) var[i] -+/* Write Variable */ -+#define SMC_ASSIGN_REG_MEM(var, i, val) \ -+ do { \ -+ var[i] = (val); \ -+ } while (0) -+/* Assign variables back to registers */ -+#define SMC_RET_REG_MEM(var) \ -+ do { \ -+ asm volatile("ldr x0, %0\n" \ -+ "ldr x1, %1\n" \ -+ "ldr x2, %2\n" \ -+ "ldr x3, %3\n" \ -+ : : "m" (var[0]), "m" (var[1]), \ -+ "m" (var[2]), "m" (var[3]) : ); \ -+ } while (0) -diff --git a/arch/arm/mach-socfpga/smc_fpga_reconfig_s10.c b/arch/arm/mach-socfpga/smc_fpga_reconfig_s10.c -new file mode 100644 -index 0000000000..0ed12e16b4 ---- /dev/null -+++ b/arch/arm/mach-socfpga/smc_fpga_reconfig_s10.c -@@ -0,0 +1,422 @@ -+/* -+ * Copyright (C) 2018 Intel Corporation. All rights reserved -+ * -+ * SPDX-License-Identifier: GPL-2.0 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Start of reserved memory */ -+#define FPGA_CONFIG_RESEVED_MEM_START (CONFIG_SYS_SDRAM_BASE + \ -+ 0x400000) -+/* End of reserved memory */ -+#define FPGA_CONFIG_RESERVED_MEM_END (CONFIG_SYS_SDRAM_BASE + \ -+ 0xFFFFFF) -+ -+#define FPGA_CONFIG_BUF_MAX 16 -+ -+#define FPGA_BUF_STAT_IDLE 0 -+#define FPGA_BUF_STAT_PENDING 1 -+#define FPGA_BUF_STAT_COMPLETED 2 -+#define FPGA_BUF_STAT_SUCCESS 3 -+#define FPGA_BUF_STAT_ERROR 4 -+ -+#define IS_BUF_FREE(x) (x.state == FPGA_BUF_STAT_IDLE) -+#define IS_BUF_PENDING(x) (x.state == FPGA_BUF_STAT_PENDING) -+#define IS_BUF_SUBMITTED(x) (x.state >= FPGA_BUF_STAT_PENDING && \ -+ x.submit_count > 0) -+#define IS_BUF_COMPLETED(x) (x.state == FPGA_BUF_STAT_COMPLETED && \ -+ x.submit_count > 0) -+#define IS_BUF_FULLY_COMPLETED(x) (x.state == FPGA_BUF_STAT_COMPLETED && \ -+ x.submit_count == 0) -+#define IS_BUF_SUCCESS(x) (x.state == FPGA_BUF_STAT_SUCCESS) -+#define IS_BUF_ERROR(x) (x.state == FPGA_BUF_STAT_ERROR) -+ -+static __secure_data struct fpga_buf_list { -+ u32 state; -+ u32 buf_id; -+ u64 buf_addr; -+ u64 buf_size; -+ u32 buf_off; -+ u32 submit_count; -+} fpga_buf_list[FPGA_CONFIG_BUF_MAX]; -+ -+static u8 __secure_data fpga_error = 1; -+static u8 __secure_data is_partial_reconfig; -+static u8 __secure_data fpga_buf_id = 1; -+static u32 __secure_data fpga_xfer_max = 4; -+static u32 __secure_data fpga_buf_read_index; -+static u32 __secure_data fpga_buf_write_index; -+static u32 __secure_data fpga_buf_count; -+/* 20bits DMA size with 8 bytes alignment */ -+static u32 __secure_data fpga_buf_size_max = 0xFFFF8; -+/* Number of data blocks received from OS(EL1) */ -+static u32 __secure_data fpga_buf_rcv_count; -+/* Number of data blocks submitted to SDM */ -+static u32 __secure_data fpga_xfer_submitted_count; -+ -+/* Check for any responses from SDM and update the status in buffer list */ -+static void __secure reclaim_completed_buf(void) -+{ -+ u32 i, j; -+ u32 resp_len; -+ u32 buf[MBOX_RESP_BUFFER_SIZE]; -+ -+ /* If no buffer has been submitted to SDM */ -+ if (!fpga_xfer_submitted_count) -+ return; -+ -+ /* Read the SDM responses asynchronously */ -+ resp_len = mbox_rcv_resp_psci(buf, MBOX_RESP_BUFFER_SIZE); -+ -+ for (i = 0; i < resp_len; i++) { -+ /* Skip mailbox response headers which are not belong to us */ -+ if (MBOX_RESP_LEN_GET(buf[i]) || -+ MBOX_RESP_CLIENT_GET(buf[i]) != MBOX_CLIENT_ID_UBOOT) -+ continue; -+ -+ for (j = 0; j < FPGA_CONFIG_BUF_MAX; j++) { -+ /* Check buffer id */ -+ if (fpga_buf_list[j].buf_id != -+ MBOX_RESP_ID_GET(buf[i])) -+ continue; -+ -+ if (IS_BUF_SUBMITTED(fpga_buf_list[j])) { -+ if (fpga_buf_list[j].submit_count) -+ fpga_buf_list[j].submit_count--; -+ fpga_xfer_submitted_count--; -+ /* Error occur in transaction */ -+ if (MBOX_RESP_ERR_GET(buf[i])) { -+ fpga_error = 1; -+ fpga_buf_list[j].state = -+ FPGA_BUF_STAT_ERROR; -+ fpga_buf_list[j].submit_count = 0; -+ } else if (IS_BUF_FULLY_COMPLETED( -+ fpga_buf_list[j])) { -+ /* Last chunk in buffer and no error */ -+ fpga_buf_list[j].state = -+ FPGA_BUF_STAT_SUCCESS; -+ } -+ break; -+ } else if (IS_BUF_ERROR(fpga_buf_list[j])) { -+ fpga_xfer_submitted_count--; -+ break; -+ } -+ } -+ } -+} -+ -+static void __secure do_xfer_buf(void) -+{ -+ u32 i = fpga_buf_read_index; -+ u32 args[3]; -+ int ret; -+ -+ /* No buffer found in buffer list or SDM can't handle xfer anymore */ -+ if (!fpga_buf_rcv_count || -+ fpga_xfer_submitted_count == fpga_xfer_max) -+ return; -+ -+ while (fpga_xfer_submitted_count < fpga_xfer_max) { -+ if (IS_BUF_FREE(fpga_buf_list[i]) || -+ IS_BUF_ERROR(fpga_buf_list[i])) -+ break; -+ if (IS_BUF_PENDING(fpga_buf_list[i])) { -+ /* -+ * Argument descriptor for RECONFIG_DATA -+ * must always be 1. -+ */ -+ args[0] = MBOX_ARG_DESC_COUNT(1); -+ args[1] = (u32)(fpga_buf_list[i].buf_addr + -+ fpga_buf_list[i].buf_off); -+ if ((fpga_buf_list[i].buf_size - -+ fpga_buf_list[i].buf_off) > fpga_buf_size_max) { -+ args[2] = fpga_buf_size_max; -+ fpga_buf_list[i].buf_off += fpga_buf_size_max; -+ } else { -+ args[2] = (u32)(fpga_buf_list[i].buf_size - -+ fpga_buf_list[i].buf_off); -+ fpga_buf_list[i].state = -+ FPGA_BUF_STAT_COMPLETED; -+ } -+ -+ ret = mbox_send_cmd_only_psci(fpga_buf_list[i].buf_id, -+ MBOX_RECONFIG_DATA, MBOX_CMD_INDIRECT, 3, -+ args); -+ if (ret) { -+ fpga_error = 1; -+ fpga_buf_list[i].state = -+ FPGA_BUF_STAT_ERROR; -+ fpga_buf_list[i].submit_count = 0; -+ break; -+ } else { -+ fpga_buf_list[i].submit_count++; -+ fpga_xfer_submitted_count++; -+ } -+ -+ if (fpga_xfer_submitted_count >= fpga_xfer_max) -+ break; -+ } -+ -+ if (IS_BUF_COMPLETED(fpga_buf_list[i]) || -+ IS_BUF_SUCCESS(fpga_buf_list[i])) { -+ i++; -+ i %= FPGA_CONFIG_BUF_MAX; -+ if (i == fpga_buf_write_index) -+ break; -+ } -+ } -+} -+ -+static void __secure smc_config_get_mem(unsigned long function_id) -+{ -+ SMC_ALLOC_REG_MEM(r); -+ -+ SMC_INIT_REG_MEM(r); -+ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, INTEL_SIP_SMC_STATUS_OK); -+ /* Start physical address of reserved memory */ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG1, FPGA_CONFIG_RESEVED_MEM_START); -+ /* Size of reserved memory */ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG2, FPGA_CONFIG_RESERVED_MEM_END - -+ FPGA_CONFIG_RESEVED_MEM_START + 1); -+ -+ SMC_RET_REG_MEM(r); -+} -+ -+static void __secure smc_config_start(unsigned long function_id, -+ unsigned long config_type) -+{ -+ SMC_ALLOC_REG_MEM(r); -+ int ret, i; -+ u32 resp_len = 2; -+ u32 resp_buf[2]; -+ -+ /* Clear any previous pending SDM reponses */ -+ mbox_rcv_resp_psci(NULL, MBOX_RESP_BUFFER_SIZE); -+ -+ SMC_INIT_REG_MEM(r); -+ -+ fpga_error = 0; -+ -+ ret = mbox_send_cmd_psci(MBOX_ID_UBOOT, MBOX_RECONFIG, MBOX_CMD_DIRECT, -+ 0, NULL, 0, &resp_len, resp_buf); -+ if (ret) { -+ fpga_error = 1; -+ goto ret; -+ } -+ -+ /* Initialize the state of the buffer list */ -+ for (i = 0; i < FPGA_CONFIG_BUF_MAX; i++) { -+ fpga_buf_list[i].state = FPGA_BUF_STAT_IDLE; -+ fpga_buf_list[i].buf_id = 0; -+ } -+ -+ /* Read maximum transaction allowed by SDM */ -+ fpga_xfer_max = resp_buf[0]; -+ /* Read maximum buffer size allowed by SDM */ -+ fpga_buf_size_max = resp_buf[1]; -+ fpga_buf_count = 0; -+ fpga_buf_rcv_count = 0; -+ fpga_xfer_submitted_count = 0; -+ fpga_buf_read_index = 0; -+ fpga_buf_write_index = 0; -+ fpga_buf_id = 1; -+ -+ is_partial_reconfig = (u8)config_type; -+ -+ /* Check whether config type is full reconfiguration */ -+ if (!is_partial_reconfig) { -+ /* Disable bridge */ -+ socfpga_bridges_reset_psci(0); -+ } -+ -+ret: -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, INTEL_SIP_SMC_STATUS_OK); -+ -+ SMC_RET_REG_MEM(r); -+} -+ -+static void __secure smc_config_write(unsigned long function_id, -+ unsigned long phys_addr, -+ unsigned long phys_size) -+{ -+ SMC_ALLOC_REG_MEM(r); -+ -+ SMC_INIT_REG_MEM(r); -+ -+ reclaim_completed_buf(); -+ -+ if (fpga_error) { -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG1, -+ fpga_buf_list[fpga_buf_read_index]. -+ buf_addr); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG2, -+ fpga_buf_list[fpga_buf_read_index]. -+ buf_size); -+ goto ret; -+ } -+ -+ do_xfer_buf(); -+ -+ if (fpga_buf_rcv_count == fpga_xfer_max || -+ (fpga_buf_count == FPGA_CONFIG_BUF_MAX && -+ fpga_buf_write_index == fpga_buf_read_index)) { -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED); -+ goto ret; -+ } -+ -+ if (!phys_addr || !phys_size) { -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG1, phys_addr); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG2, phys_size); -+ goto ret; -+ } -+ -+ /* Look for free buffer in buffer list */ -+ if (IS_BUF_FREE(fpga_buf_list[fpga_buf_write_index])) { -+ fpga_buf_list[fpga_buf_write_index].state = -+ FPGA_BUF_STAT_PENDING; -+ fpga_buf_list[fpga_buf_write_index].buf_addr = phys_addr; -+ fpga_buf_list[fpga_buf_write_index].buf_size = phys_size; -+ fpga_buf_list[fpga_buf_write_index].buf_off = 0; -+ fpga_buf_list[fpga_buf_write_index].buf_id = fpga_buf_id++; -+ /* Rollover buffer id */ -+ if (fpga_buf_id > 15) -+ fpga_buf_id = 1; -+ fpga_buf_count++; -+ fpga_buf_write_index++; -+ fpga_buf_write_index %= FPGA_CONFIG_BUF_MAX; -+ fpga_buf_rcv_count++; -+ if (fpga_buf_rcv_count == fpga_xfer_max) -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY); -+ else -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_STATUS_OK); -+ /* Attempt to submit new buffer to SDM */ -+ do_xfer_buf(); -+ } else { -+ /* No free buffer available in buffer list */ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED); -+ } -+ -+ret: -+ SMC_RET_REG_MEM(r); -+} -+ -+static void __secure smc_config_completed_write(unsigned long function_id) -+{ -+ SMC_ALLOC_REG_MEM(r); -+ int i; -+ int count = 3, r_index = 1; -+ -+ SMC_INIT_REG_MEM(r); -+ -+ reclaim_completed_buf(); -+ do_xfer_buf(); -+ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_STATUS_OK); -+ -+ for (i = 0; i < FPGA_CONFIG_BUF_MAX; i++) { -+ if (IS_BUF_SUCCESS(fpga_buf_list[fpga_buf_read_index])) { -+ SMC_ASSIGN_REG_MEM(r, r_index++, -+ fpga_buf_list[fpga_buf_read_index].buf_addr); -+ fpga_buf_list[fpga_buf_read_index].state = -+ FPGA_BUF_STAT_IDLE; -+ fpga_buf_list[fpga_buf_read_index].buf_id = 0; -+ fpga_buf_count--; -+ fpga_buf_read_index++; -+ fpga_buf_read_index %= FPGA_CONFIG_BUF_MAX; -+ fpga_buf_rcv_count--; -+ count--; -+ if (!count) -+ break; -+ } else if (IS_BUF_ERROR(fpga_buf_list[fpga_buf_read_index]) && -+ !fpga_buf_list[fpga_buf_read_index].submit_count) { -+ SMC_INIT_REG_MEM(r); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG1, -+ fpga_buf_list[fpga_buf_read_index].buf_addr); -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG2, -+ fpga_buf_list[fpga_buf_read_index].buf_size); -+ goto ret; -+ } -+ } -+ -+ /* No completed buffers found */ -+ if (r_index == 1 && fpga_xfer_submitted_count) -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY); -+ -+ret: -+ SMC_RET_REG_MEM(r); -+} -+ -+static void __secure smc_config_isdone(unsigned long function_id) -+{ -+ SMC_ALLOC_REG_MEM(r); -+ int ret; -+ -+ SMC_INIT_REG_MEM(r); -+ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY); -+ -+ reclaim_completed_buf(); -+ do_xfer_buf(); -+ -+ if (fpga_error) { -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR); -+ goto ret; -+ } -+ -+ if (fpga_xfer_submitted_count) -+ goto ret; -+ -+ ret = mbox_get_fpga_config_status_psci(MBOX_RECONFIG_STATUS); -+ if (ret) { -+ if (ret != MBOX_CFGSTAT_STATE_CONFIG) { -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, -+ INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR); -+ fpga_error = 1; -+ } -+ goto ret; -+ } -+ -+ /* FPGA configuration completed successfully */ -+ SMC_ASSIGN_REG_MEM(r, SMC_ARG0, INTEL_SIP_SMC_STATUS_OK); -+ -+ /* Check whether config type is full reconfiguration */ -+ if (!is_partial_reconfig) -+ socfpga_bridges_reset_psci(1); /* Enable bridge */ -+ret: -+ SMC_RET_REG_MEM(r); -+} -+ -+DECLARE_SECURE_SVC(config_get_mem, INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM, -+ smc_config_get_mem); -+DECLARE_SECURE_SVC(config_start, INTEL_SIP_SMC_FPGA_CONFIG_START, -+ smc_config_start); -+DECLARE_SECURE_SVC(config_write, INTEL_SIP_SMC_FPGA_CONFIG_WRITE, -+ smc_config_write); -+DECLARE_SECURE_SVC(config_completed_write, -+ INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE, -+ smc_config_completed_write); -+DECLARE_SECURE_SVC(config_isdone, INTEL_SIP_SMC_FPGA_CONFIG_ISDONE, -+ smc_config_isdone); -diff --git a/include/linux/intel-smc.h b/include/linux/intel-smc.h -new file mode 100644 -index 0000000000..5e4c156e42 ---- /dev/null -+++ b/include/linux/intel-smc.h -@@ -0,0 +1,311 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * Copyright (C) 2017-2018, Intel Corporation -+ */ -+ -+#ifndef __INTEL_SMC_H -+#define __INTEL_SMC_H -+ -+#include -+#include -+ -+/* -+ * This file defines the Secure Monitor Call (SMC) message protocol used for -+ * service layer driver in normal world (EL1) to communicate with secure -+ * monitor software in Secure Monitor Exception Level 3 (EL3). -+ * -+ * This file is shared with secure firmware (FW) which is out of kernel tree. -+ * -+ * An ARM SMC instruction takes a function identifier and up to 6 64-bit -+ * register values as arguments, and can return up to 4 64-bit register -+ * value. The operation of the secure monitor is determined by the parameter -+ * values passed in through registers. -+ -+ * EL1 and EL3 communicates pointer as physical address rather than the -+ * virtual address. -+ */ -+ -+/* -+ * Functions specified by ARM SMC Calling convention: -+ * -+ * FAST call executes atomic operations, returns when the requested operation -+ * has completed. -+ * STD call starts a operation which can be preempted by a non-secure -+ * interrupt. The call can return before the requested operation has -+ * completed. -+ * -+ * a0..a7 is used as register names in the descriptions below, on arm32 -+ * that translates to r0..r7 and on arm64 to w0..w7. -+ */ -+ -+#define INTEL_SIP_SMC_STD_CALL_VAL(func_num) \ -+ ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, ARM_SMCCC_SMC_64, \ -+ ARM_SMCCC_OWNER_SIP, (func_num)) -+ -+#define INTEL_SIP_SMC_FAST_CALL_VAL(func_num) \ -+ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64, \ -+ ARM_SMCCC_OWNER_SIP, (func_num)) -+ -+/* -+ * Return values in INTEL_SIP_SMC_* call -+ * -+ * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION: -+ * Secure monitor software doesn't recognize the request. -+ * -+ * INTEL_SIP_SMC_STATUS_OK: -+ * FPGA configuration completed successfully, -+ * In case of FPGA configuration write operation, it means secure monitor -+ * software can accept the next chunk of FPGA configuration data. -+ * -+ * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY: -+ * In case of FPGA configuration write operation, it means secure monitor -+ * software is still processing previous data & can't accept the next chunk -+ * of data. Service driver needs to issue -+ * INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE call to query the -+ * completed block(s). -+ * -+ * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR: -+ * There is error during the FPGA configuration process. -+ * -+ * INTEL_SIP_SMC_REG_ERROR: -+ * There is error during a read or write operation of the protected -+ * registers. -+ */ -+#define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF -+#define INTEL_SIP_SMC_STATUS_OK 0x0 -+#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY 0x1 -+#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x2 -+#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x4 -+#define INTEL_SIP_SMC_REG_ERROR 0x5 -+#define INTEL_SIP_SMC_RSU_ERROR 0x7 -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_START -+ * -+ * Sync call used by service driver at EL1 to request the FPGA in EL3 to -+ * be prepare to receive a new configuration. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_FPGA_CONFIG_START. -+ * a1: flag for full or partial configuration -+ * 0 full reconfiguration. -+ * 1 partial reconfiguration. -+ * a2-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1-3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1 -+#define INTEL_SIP_SMC_FPGA_CONFIG_START \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START) -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_WRITE -+ * -+ * Async call used by service driver at EL1 to provide FPGA configuration data -+ * to secure world. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_FPGA_CONFIG_WRITE. -+ * a1: 64bit physical address of the configuration data memory block -+ * a2: Size of configuration data block. -+ * a3-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or -+ * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1: 64bit physical address of 1st completed memory block if any completed -+ * block, otherwise zero value. -+ * a2: 64bit physical address of 2nd completed memory block if any completed -+ * block, otherwise zero value. -+ * a3: 64bit physical address of 3rd completed memory block if any completed -+ * block, otherwise zero value. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE 2 -+#define INTEL_SIP_SMC_FPGA_CONFIG_WRITE \ -+ INTEL_SIP_SMC_STD_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE) -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE -+ * -+ * Sync call used by service driver at EL1 to track the completed write -+ * transactions. This request is called after INTEL_SIP_SMC_FPGA_CONFIG_WRITE -+ * call returns INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE. -+ * a1-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or -+ * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1: 64bit physical address of 1st completed memory block. -+ * a2: 64bit physical address of 2nd completed memory block if -+ * any completed block, otherwise zero value. -+ * a3: 64bit physical address of 3rd completed memory block if -+ * any completed block, otherwise zero value. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE 3 -+#define INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE \ -+INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_ISDONE -+ * -+ * Sync call used by service driver at EL1 to inform secure world that all -+ * data are sent, to check whether or not the secure world had completed -+ * the FPGA configuration process. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_FPGA_CONFIG_ISDONE. -+ * a1-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or -+ * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1-3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4 -+#define INTEL_SIP_SMC_FPGA_CONFIG_ISDONE \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE) -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM -+ * -+ * Sync call used by service driver at EL1 to query the physical address of -+ * memory block reserved by secure monitor software. -+ * -+ * Call register usage: -+ * a0:INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM. -+ * a1-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1: start of physical address of reserved memory block. -+ * a2: size of reserved memory block. -+ * a3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM 5 -+#define INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM) -+ -+/* -+ * Request INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK -+ * -+ * For SMC loop-back mode only, used for internal integration, debugging -+ * or troubleshooting. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK. -+ * a1-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR. -+ * a1-3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6 -+#define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK) -+ -+/* -+ * Request INTEL_SIP_SMC_REG_READ -+ * -+ * Read a protected register using SMCCC -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_REG_READ. -+ * a1: register address. -+ * a2-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR. -+ * a1: Value in the register -+ * a2-3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_REG_READ 7 -+#define INTEL_SIP_SMC_REG_READ \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_READ) -+ -+/* -+ * Request INTEL_SIP_SMC_REG_WRITE -+ * -+ * Write a protected register using SMCCC -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_REG_WRITE. -+ * a1: register address -+ * a2: value to program into register. -+ * a3-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR. -+ * a1-3: not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_REG_WRITE 8 -+#define INTEL_SIP_SMC_REG_WRITE \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_WRITE) -+ -+/* -+ * Request INTEL_SIP_SMC_FUNCID_REG_UPDATE -+ * -+ * Update one or more bits in a protected register using a -+ * read-modify-write operation. -+ * -+ * Call register usage: -+ * a0: INTEL_SIP_SMC_REG_UPDATE. -+ * a1: register address -+ * a2: Write Mask. -+ * a3: Value to write. -+ * a4-7: not used. -+ * -+ * Return status: -+ * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR. -+ * a1-3: Not used. -+ */ -+#define INTEL_SIP_SMC_FUNCID_REG_UPDATE 9 -+#define INTEL_SIP_SMC_REG_UPDATE \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE) -+ -+/* -+ * Request INTEL_SIP_SMC_RSU_STATUS -+ * -+ * Sync call used by service driver at EL1 to query the RSU status -+ * -+ * Call register usage: -+ * a0 INTEL_SIP_SMC_RSU_STATUS -+ * a1-7 not used -+ * -+ * Return status -+ * a0: Current Image -+ * a1: Last Failing Image -+ * a2: Version [width 32 bit] | State [width 32 bit] -+ * a3: Error details [width 32 bit] | Error location [width 32 bit] -+ * -+ * Or -+ * -+ * a0: INTEL_SIP_SMC_RSU_ERROR -+ */ -+#define INTEL_SIP_SMC_FUNCID_RSU_STATUS 11 -+#define INTEL_SIP_SMC_RSU_STATUS \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS) -+ -+/* -+ * Request INTEL_SIP_SMC_RSU_UPDATE -+ * -+ * Sync call used by service driver at EL1 to tell you next reboot is RSU_UPDATE -+ * -+ * Call register usage: -+ * a0 INTEL_SIP_SMC_RSU_UPDATE -+ * a1 64bit physical address of the configuration data memory in flash -+ * a2-7 not used -+ * -+ * Return status -+ * a0 INTEL_SIP_SMC_STATUS_OK -+ */ -+#define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12 -+#define INTEL_SIP_SMC_RSU_UPDATE \ -+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE) -+ -+ -+#endif --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch b/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch deleted file mode 100644 index 71625cd..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0007-mmc-dwmmc-Enable-small-delay-before-returning-error.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 5dd98b8e0aec2059863ae73d5c83fa043b0a6170 Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Wed, 30 Jan 2019 21:47:36 -0800 -Subject: [PATCH 07/14] mmc: dwmmc: Enable small delay before returning error - -'SET_BLOCKLEN' may occasionally fail on first attempt. -This patch enable a small delay in dwmci_send_cmd() on -busy, I/O or CRC error to allow the MMC controller recovers -from the failure/error on subsequent retries. - -Signed-off-by: Ang, Chee Hong ---- - drivers/mmc/dw_mmc.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c -index 1992d61182..8b9c6a8e60 100644 ---- a/drivers/mmc/dw_mmc.c -+++ b/drivers/mmc/dw_mmc.c -@@ -294,8 +294,11 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, - if (data) - flags = dwmci_set_transfer_mode(host, data); - -- if ((cmd->resp_type & MMC_RSP_136) && (cmd->resp_type & MMC_RSP_BUSY)) -- return -1; -+ if ((cmd->resp_type & MMC_RSP_136) && -+ (cmd->resp_type & MMC_RSP_BUSY)) { -+ ret = -1; -+ goto delay_ret; -+ } - - if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION) - flags |= DWMCI_CMD_ABORT_STOP; -@@ -344,11 +347,13 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, - return -ETIMEDOUT; - } else if (mask & DWMCI_INTMSK_RE) { - debug("%s: Response Error.\n", __func__); -- return -EIO; -+ ret = -EIO; -+ goto delay_ret; - } else if ((cmd->resp_type & MMC_RSP_CRC) && - (mask & DWMCI_INTMSK_RCRC)) { - debug("%s: Response CRC Error.\n", __func__); -- return -EIO; -+ ret = -EIO; -+ goto delay_ret; - } - - -@@ -387,6 +392,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, - } - } - -+delay_ret: - udelay(100); - - return ret; --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0008-ARM-socfpga-stratix10-Enable-DMA330-DMA-controller.patch b/recipes-bsp/u-boot/files/v2019.07/0008-ARM-socfpga-stratix10-Enable-DMA330-DMA-controller.patch deleted file mode 100644 index 8e0e907..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0008-ARM-socfpga-stratix10-Enable-DMA330-DMA-controller.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f4e6b02369f2a7daed5799f27e29198714bda848 Mon Sep 17 00:00:00 2001 -From: "Ang, Chee Hong" -Date: Wed, 30 Jan 2019 21:29:09 -0800 -Subject: [PATCH 08/14] ARM: socfpga: stratix10: Enable DMA330 DMA controller - -Signed-off-by: Ang, Chee Hong ---- - arch/arm/mach-socfpga/include/mach/reset_manager_s10.h | 1 + - arch/arm/mach-socfpga/spl_s10.c | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -index 1939ffa149..85424c28a6 100644 ---- a/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -+++ b/arch/arm/mach-socfpga/include/mach/reset_manager_s10.h -@@ -97,6 +97,7 @@ struct socfpga_reset_manager { - #define RSTMGR_DMA RSTMGR_DEFINE(1, 16) - #define RSTMGR_SPIM0 RSTMGR_DEFINE(1, 17) - #define RSTMGR_SPIM1 RSTMGR_DEFINE(1, 18) -+#define RSTMGR_DMA_OCP RSTMGR_DEFINE(1, 21) - #define RSTMGR_L4WD0 RSTMGR_DEFINE(2, 0) - #define RSTMGR_L4WD1 RSTMGR_DEFINE(2, 1) - #define RSTMGR_L4WD2 RSTMGR_DEFINE(2, 2) -diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c -index ec65e1ce64..04fa1a5696 100644 ---- a/arch/arm/mach-socfpga/spl_s10.c -+++ b/arch/arm/mach-socfpga/spl_s10.c -@@ -158,6 +158,10 @@ void board_init_f(ulong dummy) - writel(SYSMGR_DMA_IRQ_NS | SYSMGR_DMA_MGR_NS, &sysmgr_regs->dma); - writel(SYSMGR_DMAPERIPH_ALL_NS, &sysmgr_regs->dma_periph); - -+ /* enable DMA330 DMA */ -+ socfpga_per_reset(SOCFPGA_RESET(DMA), 0); -+ socfpga_per_reset(SOCFPGA_RESET(DMA_OCP), 0); -+ - spl_disable_firewall_l4_per(); - - spl_disable_firewall_l4_sys(); --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0009-ARM-socfpga-Stratix10-Fix-el3_exception_vectors-relo.patch b/recipes-bsp/u-boot/files/v2019.07/0009-ARM-socfpga-Stratix10-Fix-el3_exception_vectors-relo.patch deleted file mode 100644 index fb060bb..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0009-ARM-socfpga-Stratix10-Fix-el3_exception_vectors-relo.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b4807003314579b069877df69eefbace4c7b6efa Mon Sep 17 00:00:00 2001 -From: Chee Hong Ang -Date: Sat, 18 May 2019 16:42:10 +0800 -Subject: [PATCH 09/14] ARM: socfpga: Stratix10: Fix el3_exception_vectors - relocation issue - -New toolchain has issue relocating the 32-bit pointer to address of -el3_exception_vectors in secure section. This patch make sure the -address pointer to the secure section is 64-bit. - -Signed-off-by: Chee Hong Ang ---- - arch/arm/mach-socfpga/lowlevel_init.S | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/arch/arm/mach-socfpga/lowlevel_init.S b/arch/arm/mach-socfpga/lowlevel_init.S -index 832785a682..342d5190b5 100644 ---- a/arch/arm/mach-socfpga/lowlevel_init.S -+++ b/arch/arm/mach-socfpga/lowlevel_init.S -@@ -12,8 +12,7 @@ - #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI) - .align 3 - _el3_exception_vectors: -- .word el3_exception_vectors; -- .word 0 -+ .quad el3_exception_vectors; - #endif - - ENTRY(lowlevel_init) --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0010-ARM-socfpga-Stratix10-Disable-CONFIG_PSCI_RESET.patch b/recipes-bsp/u-boot/files/v2019.07/0010-ARM-socfpga-Stratix10-Disable-CONFIG_PSCI_RESET.patch deleted file mode 100644 index 030c38b..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0010-ARM-socfpga-Stratix10-Disable-CONFIG_PSCI_RESET.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 31bb5e5583e87e5bc6d7daa3647891374eec708b Mon Sep 17 00:00:00 2001 -From: Chee Hong Ang -Date: Sat, 11 May 2019 00:09:46 +0800 -Subject: [PATCH 10/14] ARM: socfpga: Stratix10: Disable CONFIG_PSCI_RESET - -Avoid invoking 'SYSTEM_RESET' PSCI function because PSCI -function calls are not supported in u-boot running in EL3. - -Signed-off-by: Chee Hong Ang ---- - arch/arm/cpu/armv8/Kconfig | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig -index 92a2b58ed4..f3683bccb4 100644 ---- a/arch/arm/cpu/armv8/Kconfig -+++ b/arch/arm/cpu/armv8/Kconfig -@@ -110,7 +110,8 @@ config PSCI_RESET - !TARGET_LS1046AFRWY && \ - !TARGET_LS2081ARDB && !TARGET_LX2160ARDB && \ - !TARGET_LX2160AQDS && \ -- !ARCH_UNIPHIER && !TARGET_S32V234EVB -+ !ARCH_UNIPHIER && !TARGET_S32V234EVB && \ -+ !TARGET_SOCFPGA_STRATIX10 - help - Most armv8 systems have PSCI support enabled in EL3, either through - ARM Trusted Firmware or other firmware. --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0011-Makefile-Add-target-to-generate-hex-output-for-combi.patch b/recipes-bsp/u-boot/files/v2019.07/0011-Makefile-Add-target-to-generate-hex-output-for-combi.patch deleted file mode 100644 index 640df20..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0011-Makefile-Add-target-to-generate-hex-output-for-combi.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 56332c75a69a9f9ef7928e0f43d1fc509db9c866 Mon Sep 17 00:00:00 2001 -From: Dalon Westergreen -Date: Wed, 20 Mar 2019 11:21:20 -0700 -Subject: [PATCH 11/14] Makefile: Add target to generate hex output for - combined spl and dtb - -Stratix10 requires a hex image of the spl plus spl devicetree offset to -the Stratix10 onchip memory located at SPL_TEXT_BASE. This patch adds -a target to generate a hex file from the u-boot-spl binary including the -dtb offset at SPL_TEST_BASE. - -Objcopy is used to convert the $(SPL_BIN).bin, which includes the spl -dtb, to a hex file. the --change-address option is used to offset the -hex to SPL_TEXT_BASE as objcopy on the spl binary will not result in -a hex file appropriately offset at SPL_TEXT_BASE. - -Signed-off-by: Dalon Westergreen - ---- -Changes in v3: - -> Cleanup commit message and better describe the problem being - resolved - -> Remove extraneous hunk - -> use SPL_BIN instead of u-boot-spl -Changes in v2: - -> Move spl hex file generation to SPL Makefile - -> Create hexfile from $(SPL_BIN).bin which will include the dtb - ifneq(build_dtb,) ---- - Makefile | 8 +++----- - scripts/Makefile.spl | 7 +++++++ - 2 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/Makefile b/Makefile -index 516260f46d..8236f095fc 100644 ---- a/Makefile -+++ b/Makefile -@@ -1136,11 +1136,6 @@ OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \ - $(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec) \ - $(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),-R .bootpg -R .resetvec) - --OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex) -- --spl/u-boot-spl.hex: spl/u-boot-spl FORCE -- $(call if_changed,objcopy) -- - binary_size_check: u-boot-nodtb.bin FORCE - @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \ - map_size=$(shell cat u-boot.map | \ -@@ -1721,6 +1716,9 @@ spl/u-boot-spl.bin: spl/u-boot-spl - @: - $(SPL_SIZE_CHECK) - -+spl/u-boot-spl.hex: spl/u-boot-spl -+ @: -+ - spl/u-boot-spl: tools prepare \ - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \ - $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb) -diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl -index 7af6b120b6..551002194e 100644 ---- a/scripts/Makefile.spl -+++ b/scripts/Makefile.spl -@@ -216,6 +216,8 @@ ifneq ($(CONFIG_TARGET_SOCFPGA_GEN5)$(CONFIG_TARGET_SOCFPGA_ARRIA10),) - ALL-y += $(obj)/$(SPL_BIN).sfp - endif - -+ALL-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += $(obj)/$(SPL_BIN).hex -+ - ifdef CONFIG_ARCH_SUNXI - ALL-y += $(obj)/sunxi-spl.bin - -@@ -363,6 +365,11 @@ endif - $(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE - $(call if_changed,mkimage) - -+OBJCOPYFLAGS_$(SPL_BIN).hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE) -+ -+$(obj)/$(SPL_BIN).hex: $(obj)/$(SPL_BIN).bin FORCE -+ $(call if_changed,objcopy) -+ - quiet_cmd_mksunxiboot = MKSUNXI $@ - cmd_mksunxiboot = $(objtree)/tools/mksunxiboot \ - --default-dt $(CONFIG_DEFAULT_DEVICE_TREE) $< $@ --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0012-ARM-socfpga-stratix10-Remove-CONFIG_OF_EMBED.patch b/recipes-bsp/u-boot/files/v2019.07/0012-ARM-socfpga-stratix10-Remove-CONFIG_OF_EMBED.patch deleted file mode 100644 index 40e7704..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0012-ARM-socfpga-stratix10-Remove-CONFIG_OF_EMBED.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 708a2590681425da62f9027f5ed1144377a001bf Mon Sep 17 00:00:00 2001 -From: Dalon Westergreen -Date: Fri, 10 May 2019 10:30:44 -0700 -Subject: [PATCH 12/14] ARM: socfpga: stratix10: Remove CONFIG_OF_EMBED - -CONFIG_OF_EMBED was primarily enabled to support the stratix10 -spl hex file requirements. Since this option now produces a -warning during build, and the spl hex can be created using -alternate methods, CONFIG_OF_EMBED is no longer needed. - -Signed-off-by: Dalon Westergreen - ---- -Changes in v3: - -> Revert to u-boot.img for SPL payload name -Changes in v2: - -> Change CONFIG_SPL_TARGET back to u-boot-spl.hex ---- - configs/socfpga_stratix10_defconfig | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/configs/socfpga_stratix10_defconfig b/configs/socfpga_stratix10_defconfig -index fbab388b43..f27180385d 100644 ---- a/configs/socfpga_stratix10_defconfig -+++ b/configs/socfpga_stratix10_defconfig -@@ -26,7 +26,6 @@ CONFIG_CMD_CACHE=y - CONFIG_CMD_EXT4=y - CONFIG_CMD_FAT=y - CONFIG_CMD_FS_GENERIC=y --CONFIG_OF_EMBED=y - CONFIG_DEFAULT_DEVICE_TREE="socfpga_stratix10_socdk" - CONFIG_ENV_IS_IN_MMC=y - CONFIG_NET_RANDOM_ETHADDR=y --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0013-ARM-socfpga-update-CONFIG_SPL_FS_LOAD_PAYLOAD_NAME-t.patch b/recipes-bsp/u-boot/files/v2019.07/0013-ARM-socfpga-update-CONFIG_SPL_FS_LOAD_PAYLOAD_NAME-t.patch deleted file mode 100644 index 3b34325..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0013-ARM-socfpga-update-CONFIG_SPL_FS_LOAD_PAYLOAD_NAME-t.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 441ba6f4d508bf77cc543feb00d1d3fca9a80934 Mon Sep 17 00:00:00 2001 -From: Dalon Westergreen -Date: Tue, 4 Jun 2019 13:43:59 -0700 -Subject: [PATCH 13/14] ARM: socfpga: update CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to - u-boot.img - -Bring cyclone5 / arria5 / arria10 in line with convention and use -u-boot.img as CONFIG_SPL_FS_LOAD_PAYLOAD_NAME. - -Signed-off-by: Dalon Westergreen ---- - include/configs/socfpga_common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h -index d1034ac280..36b0ed5459 100644 ---- a/include/configs/socfpga_common.h -+++ b/include/configs/socfpga_common.h -@@ -203,7 +203,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); - /* SPL SDMMC boot support */ - #ifdef CONFIG_SPL_MMC_SUPPORT - #if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) --#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img" -+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" - #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 - #endif - #else --- -2.21.0 - diff --git a/recipes-bsp/u-boot/files/v2019.07/0014-fpga-arria10-Fix-error-in-fpga-pin-configuration.patch b/recipes-bsp/u-boot/files/v2019.07/0014-fpga-arria10-Fix-error-in-fpga-pin-configuration.patch deleted file mode 100644 index 0255efc..0000000 --- a/recipes-bsp/u-boot/files/v2019.07/0014-fpga-arria10-Fix-error-in-fpga-pin-configuration.patch +++ /dev/null @@ -1,38 +0,0 @@ -From db2095305c0fb464f57b001464fb811a86f19834 Mon Sep 17 00:00:00 2001 -From: Dalon Westergreen -Date: Tue, 16 Jul 2019 09:12:53 -0700 -Subject: [PATCH 14/14] fpga: arria10: Fix error in fpga pin configuration - -Pin configuration of the FPGA devicetree block should be done -after core configuration in the arria10 fpga driver. This fix -corrects the check of status, and ensures that the fpga pin mux -is configured on correct configuration of the core fpga image. - -Signed-off-by: Dalon Westergreen ---- - drivers/fpga/socfpga_arria10.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/drivers/fpga/socfpga_arria10.c b/drivers/fpga/socfpga_arria10.c -index 285280e507..5fb9d6a191 100644 ---- a/drivers/fpga/socfpga_arria10.c -+++ b/drivers/fpga/socfpga_arria10.c -@@ -936,10 +936,11 @@ int socfpga_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size) - fpgamgr_program_write(rbf_data, rbf_size); - - status = fpgamgr_program_finish(); -- if (status) { -- config_pins(gd->fdt_blob, "fpga"); -- puts("FPGA: Enter user mode.\n"); -- } -+ if (status) -+ return status; -+ -+ config_pins(gd->fdt_blob, "fpga"); -+ puts("FPGA: Enter user mode.\n"); - - return status; - } --- -2.21.0 - -- cgit v1.2.3-54-g00ecf