1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-05 14:30:10 +00:00

arm-bsp/corstone1000: bump u-boot version to 2022.01

Bump version of u-boot from 2021.10 to 2022.01, as at it, take
the chance to squash some patches and reduce the number of
them.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Rui Miguel Silva
2022-04-08 13:09:03 +01:00
committed by Jon Mason
parent 9c0e0c01cb
commit 5063ad85c3
60 changed files with 1321 additions and 2633 deletions
@@ -24,7 +24,7 @@ TFM_SIGN_PRIVATE_KEY = "${S}/bl2/ext/mcuboot/root-RSA-3072_1.pem"
RE_IMAGE_OFFSET = "0x1000"
# u-boot
PREFERRED_VERSION_u-boot ?= "2021.10"
PREFERRED_VERSION_u-boot ?= "2022.01"
EXTRA_IMAGEDEPENDS += "u-boot"
UBOOT_CONFIG ??= "EFI"
@@ -1,328 +0,0 @@
From 90608c0ac1636136f51b504805bdc81c7b22a0c4 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Fri, 4 Jun 2021 10:58:24 +0100
Subject: [PATCH] arm: add corstone1000 platform
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Add support for new corstone1000 platform.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
---
arch/arm/Kconfig | 9 +++
board/armltd/corstone1000/Kconfig | 12 ++++
board/armltd/corstone1000/MAINTAINERS | 6 ++
board/armltd/corstone1000/Makefile | 7 ++
board/armltd/corstone1000/corstone1000.c | 92 ++++++++++++++++++++++++
configs/corstone1000_defconfig | 39 ++++++++++
include/configs/corstone1000.h | 80 +++++++++++++++++++++
7 files changed, 245 insertions(+)
create mode 100644 board/armltd/corstone1000/Kconfig
create mode 100644 board/armltd/corstone1000/MAINTAINERS
create mode 100644 board/armltd/corstone1000/Makefile
create mode 100644 board/armltd/corstone1000/corstone1000.c
create mode 100644 configs/corstone1000_defconfig
create mode 100644 include/configs/corstone1000.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5bd3284cd1c..392e147756ee 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1186,6 +1186,13 @@ config TARGET_VEXPRESS64_JUNO
select BLK
select USB
+config TARGET_CORSTONE1000
+ bool "Support Corstone1000 Platform"
+ select ARM64
+ select PL01X_SERIAL
+ select DM
+ select OF_BOARD
+
config TARGET_TOTAL_COMPUTE
bool "Support Total Compute Platform"
select ARM64
@@ -2046,6 +2053,8 @@ source "arch/arm/mach-nexell/Kconfig"
source "board/armltd/total_compute/Kconfig"
+source "board/armltd/corstone1000/Kconfig"
+
source "board/bosch/shc/Kconfig"
source "board/bosch/guardian/Kconfig"
source "board/CarMediaLab/flea3/Kconfig"
diff --git a/board/armltd/corstone1000/Kconfig b/board/armltd/corstone1000/Kconfig
new file mode 100644
index 000000000000..709674d4cf7d
--- /dev/null
+++ b/board/armltd/corstone1000/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_CORSTONE1000
+
+config SYS_BOARD
+ default "corstone1000"
+
+config SYS_VENDOR
+ default "armltd"
+
+config SYS_CONFIG_NAME
+ default "corstone1000"
+
+endif
diff --git a/board/armltd/corstone1000/MAINTAINERS b/board/armltd/corstone1000/MAINTAINERS
new file mode 100644
index 000000000000..313ed7133ecc
--- /dev/null
+++ b/board/armltd/corstone1000/MAINTAINERS
@@ -0,0 +1,6 @@
+CORSTONE1000 BOARD
+M: Rui Miguel Silva <rui.silva@linaro.org>
+S: Maintained
+F: board/armltd/corstone1000/
+F: include/configs/corstone1000.h
+F: configs/corstone1000_defconfig
diff --git a/board/armltd/corstone1000/Makefile b/board/armltd/corstone1000/Makefile
new file mode 100644
index 000000000000..c26e609e2c01
--- /dev/null
+++ b/board/armltd/corstone1000/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2021 Arm Limited
+# (C) Copyright 2021 Linaro
+# Rui Miguel Silva <rui.silva@linaro.org>
+
+obj-y := corstone1000.o
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
new file mode 100644
index 000000000000..ab98fa87fbcd
--- /dev/null
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2021 ARM Limited
+ * (C) Copyright 2021 Linaro
+ * Rui Miguel Silva <rui.silva@linaro.org>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/platform_data/serial_pl01x.h>
+#include <asm/armv8/mmu.h>
+#include <asm/global_data.h>
+
+
+static const struct pl01x_serial_plat serial_plat = {
+ .base = V2M_UART0,
+ .type = TYPE_PL011,
+ .clock = CONFIG_PL011_CLOCK,
+};
+
+U_BOOT_DRVINFO(corstone1000_serials) = {
+ .name = "serial_pl01x",
+ .plat = &serial_plat,
+};
+
+static struct mm_region corstone1000_mem_map[] = {
+ {
+ /* CVM */
+ .virt = 0x02000000UL,
+ .phys = 0x02000000UL,
+ .size = 0x02000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* QSPI */
+ .virt = 0x08000000UL,
+ .phys = 0x08000000UL,
+ .size = 0x08000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* Host Peripherals */
+ .virt = 0x1A000000UL,
+ .phys = 0x1A000000UL,
+ .size = 0x26000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* OCVM */
+ .virt = 0x80000000UL,
+ .phys = 0x80000000UL,
+ .size = 0x80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = corstone1000_mem_map;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+#ifdef PHYS_SDRAM_2
+ gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+ gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+#endif
+
+
+ return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+}
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
new file mode 100644
index 000000000000..bc983e65557e
--- /dev/null
+++ b/configs/corstone1000_defconfig
@@ -0,0 +1,39 @@
+CONFIG_ARM=y
+CONFIG_ARM64=y
+CONFIG_TARGET_CORSTONE1000=y
+CONFIG_SYS_TEXT_BASE=0x02100000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING=" corstone1000 aarch64 "
+CONFIG_BOOTDELAY=3
+CONFIG_OF_BOARD=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9"
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="corstone1000# "
+# CONFIG_CMD_CONSOLE is not set
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_BOOTM=y
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_EDITENV is not set
+# CONFIG_CMD_ENV_EXISTS is not set
+# CONFIG_CMD_ARMFLASH=y
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_FIT=y
+# CONFIG_CMD_MISC is not set
+CONFIG_CMD_FAT=y
+CONFIG_DM=y
+# CONFIG_MMC is not set
+# CONFIG_MTD_NOR_FLASH=y
+CONFIG_DM_ETH=y
+CONFIG_DM_SERIAL=y
+CONFIG_OF_LIBFDT=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
new file mode 100644
index 000000000000..1fe909463f93
--- /dev/null
+++ b/include/configs/corstone1000.h
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2020 ARM Limited
+ * (C) Copyright 2020 Linaro
+ * Rui Miguel Silva <rui.silva@linaro.org>
+ * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+ *
+ * Configuration for Corstone1000. Parts were derived from other ARM
+ * configurations.
+ */
+
+#ifndef __CORSTONE1000_H
+#define __CORSTONE1000_H
+
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+#define CONFIG_SYS_HZ 1000
+
+#define V2M_SRAM0 0x02000000
+#define V2M_QSPI 0x08000000
+
+#define V2M_DEBUG 0x10000000
+#define V2M_BASE_PERIPH 0x1A000000
+
+#define V2M_BASE 0x80000000
+
+#define V2M_PERIPH_OFFSET(x) (x << 16)
+
+#define V2M_SYSID (V2M_BASE_PERIPH)
+#define V2M_SYSCTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(1))
+
+#define V2M_COUNTER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(32))
+#define V2M_COUNTER_READ (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(33))
+
+#define V2M_TIMER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(34))
+#define V2M_TIMER_BASE0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(35))
+
+#define V2M_UART0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(81))
+#define V2M_UART1 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(82))
+
+#define CONFIG_PL011_CLOCK 50000000
+
+/* Physical Memory Map */
+#define PHYS_SDRAM_1 (V2M_BASE)
+#define PHYS_SDRAM_2 (V2M_QSPI)
+
+/* Top 16MB reserved for secure world use (maybe not needed) */
+#define DRAM_SEC_SIZE 0x01000000
+#define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE
+
+#define PHYS_SDRAM_2_SIZE 0x02000000
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (8 << 20))
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LOAD_ADDR (V2M_BASE + 0x10000000)
+
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_MAXARGS 64 /* max command args */
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "fdt_addr=0x08330000\0" \
+ "fdt_addr_r=0x82000000\0" \
+ "kernel_addr=0x08430000\0" \
+ "kernel_addr_r=0x82100000\0" \
+ "fdt_high=0xffffffff\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "echo Copying devicetree to memory ... ;" \
+ "cp.b $fdt_addr $fdt_addr_r 0x100000;" \
+ "echo Copying Kernel to memory ... ;" \
+ "cp.b $kernel_addr $kernel_addr_r 0xa00000;" \
+ "bootm $kernel_addr_r - $fdt_addr_r; "
+
+#endif
@@ -1,10 +1,7 @@
From 4a22ea96d4352a87e39e8a9a74ccf8bb052f6293 Mon Sep 17 00:00:00 2001
From 967aea010ca9c73ce6ef1b88a62c353b9b727a4b Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Thu, 24 Jun 2021 09:25:00 +0100
Subject: [PATCH] cmd: load: add load command for memory mapped
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Subject: [PATCH 01/27] cmd: load: add load command for memory mapped
cp.b is used a lot as a way to load binaries to memory and execute
them, however we may need to integrate this with the efi subsystem to
@@ -19,20 +16,32 @@ with this a kernel with CONFIG_EFI_STUB enabled will be loaded and
then subsequently booted with bootefi command.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
README | 1 +
cmd/Kconfig | 6 ++++
cmd/bootefi.c | 12 ++++++++
cmd/load.c | 49 ++++++++++++++++++++++++++++++++
cmd/load.c | 48 ++++++++++++++++++++++++++++++++
include/efi_loader.h | 2 ++
lib/efi_loader/efi_device_path.c | 10 +++++++
5 files changed, 79 insertions(+)
lib/efi_loader/efi_device_path.c | 9 ++++++
6 files changed, 78 insertions(+)
diff --git a/README b/README
index 9606a8b3acf5..e78d816eea14 100644
--- a/README
+++ b/README
@@ -2923,6 +2923,7 @@ rarpboot- boot image via network using RARP/TFTP protocol
diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd'
loads - load S-Record file over serial line
loadb - load binary file over serial line (kermit mode)
+loadm - load binary blob from source address to destination address
md - memory display
mm - memory modify (auto-incrementing)
nm - memory modify (constant address)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 3a857b3f6e2e..a33b2a2a123b 100644
index 02c298fdbe4b..6262c08fd3a1 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1048,6 +1048,12 @@ config CMD_LOADB
@@ -1076,6 +1076,12 @@ config CMD_LOADB
help
Load a binary file over serial line.
@@ -69,10 +78,10 @@ index 83eab0bd7f18..698698a7d257 100644
* efi_clear_bootdev() - clear boot device
*/
diff --git a/cmd/load.c b/cmd/load.c
index 381ed1b3e25b..fea81a4e027a 100644
index 7e4a552d90ef..1224a7f85bb3 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -1020,6 +1020,45 @@ static ulong load_serial_ymodem(ulong offset, int mode)
@@ -1063,6 +1063,44 @@ static ulong load_serial_ymodem(ulong offset, int mode)
#endif
@@ -92,9 +101,8 @@ index 381ed1b3e25b..fea81a4e027a 100644
+
+ size = simple_strtoul(argv[3], NULL, 16);
+
+
+ if (!size) {
+ puts ("can not load zero bytes\n");
+ printf("loadm: can not load zero bytes\n");
+ return 1;
+ }
+
@@ -118,7 +126,7 @@ index 381ed1b3e25b..fea81a4e027a 100644
/* -------------------------------------------------------------------- */
#if defined(CONFIG_CMD_LOADS)
@@ -1094,3 +1133,13 @@ U_BOOT_CMD(
@@ -1137,3 +1175,13 @@ U_BOOT_CMD(
);
#endif /* CONFIG_CMD_LOADB */
@@ -126,17 +134,17 @@ index 381ed1b3e25b..fea81a4e027a 100644
+#if defined(CONFIG_CMD_LOADM)
+U_BOOT_CMD(
+ loadm, 4, 0, do_load_memory_bin,
+ "load binary blob from two addresses",
+ "load binary blob from source address to destination address",
+ "[src_addr] [dst_addr] [size]\n"
+ " - load a binary blob from one memory location to other"
+ " from src_addr to dst_addr by size bytes"
+);
+#endif /* CONFIG_CMD_LOADM */
diff --git a/include/efi_loader.h b/include/efi_loader.h
index c440962fe522..611aae64a9ba 100644
index f4860e87fc1f..1866439ab51e 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -577,6 +577,8 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
@@ -581,6 +581,8 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
void efi_save_gd(void);
/* Call this to relocate the runtime section to an address space */
void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map);
@@ -146,10 +154,10 @@ index c440962fe522..611aae64a9ba 100644
void efi_add_handle(efi_handle_t obj);
/* Create handle */
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index cbdb466da41c..537f7b8c5f9a 100644
index 735ed0bd0f4c..ccea2cd2a9dd 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -1176,6 +1176,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
@@ -1122,6 +1122,8 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
{
struct blk_desc *desc = NULL;
struct disk_partition fs_partition;
@@ -158,12 +166,11 @@ index cbdb466da41c..537f7b8c5f9a 100644
int part = 0;
char *filename;
char *s;
@@ -1191,6 +1193,14 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
@@ -1137,6 +1139,13 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
} else if (!strcmp(dev, "Uart")) {
if (device)
*device = efi_dp_from_uart();
+ } else if (!strcmp(dev, "Mem")) {
+
+ efi_get_image_parameters(&image_addr, &image_size);
+
+ if (device)
@@ -173,3 +180,6 @@ index cbdb466da41c..537f7b8c5f9a 100644
} else {
part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition,
1);
--
2.35.1
@@ -0,0 +1,677 @@
From 04b82ccd9ae7620039dff6cfb6445e62bd3be0b5 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 15 Feb 2022 09:44:10 +0000
Subject: [PATCH 02/27] arm: add support to corstone1000 platform
Corstone1000 is a platform from arm, which includes pre
verified Corstone SSE710 sub-system that combines Cortex-A and
Cortex-M processors [0].
This code adds the support for the Cortex-A35 implementation
at host side, it contains also the necessary bits to support
the Corstone 1000 FVP (Fixed Virtual Platform) [1] and also the
FPGA MPS3 board implementation of this platform. [2]
0: https://documentation-service.arm.com/static/619e02b1f45f0b1fbf3a8f16
1: https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps
2: https://documentation-service.arm.com/static/61f3f4d7fa8173727a1b71bf
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
arch/arm/Kconfig | 8 ++
arch/arm/dts/Makefile | 3 +
arch/arm/dts/corstone1000-fvp.dts | 23 +++
arch/arm/dts/corstone1000-mps3.dts | 32 +++++
arch/arm/dts/corstone1000.dtsi | 169 +++++++++++++++++++++++
board/armltd/corstone1000/Kconfig | 12 ++
board/armltd/corstone1000/MAINTAINERS | 7 +
board/armltd/corstone1000/Makefile | 7 +
board/armltd/corstone1000/corstone1000.c | 121 ++++++++++++++++
configs/corstone1000_defconfig | 80 +++++++++++
include/configs/corstone1000.h | 86 ++++++++++++
11 files changed, 548 insertions(+)
create mode 100644 arch/arm/dts/corstone1000-fvp.dts
create mode 100644 arch/arm/dts/corstone1000-mps3.dts
create mode 100644 arch/arm/dts/corstone1000.dtsi
create mode 100644 board/armltd/corstone1000/Kconfig
create mode 100644 board/armltd/corstone1000/MAINTAINERS
create mode 100644 board/armltd/corstone1000/Makefile
create mode 100644 board/armltd/corstone1000/corstone1000.c
create mode 100644 configs/corstone1000_defconfig
create mode 100644 include/configs/corstone1000.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f7f03837feb4..71c1e93eb7cf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1250,6 +1250,12 @@ config TARGET_VEXPRESS64_JUNO
select BLK
select USB
+config TARGET_CORSTONE1000
+ bool "Support Corstone1000 Platform"
+ select ARM64
+ select PL01X_SERIAL
+ select DM
+
config TARGET_TOTAL_COMPUTE
bool "Support Total Compute Platform"
select ARM64
@@ -2152,6 +2158,8 @@ source "arch/arm/mach-nexell/Kconfig"
source "board/armltd/total_compute/Kconfig"
+source "board/armltd/corstone1000/Kconfig"
+
source "board/bosch/shc/Kconfig"
source "board/bosch/guardian/Kconfig"
source "board/Marvell/octeontx/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b3e2a9c9d77b..5f91fd0ad707 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1163,6 +1163,9 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE_OPTEE) += imx8mm-cl-iot-gate-optee.dtb
dtb-$(CONFIG_TARGET_EA_LPC3250DEVKITV2) += lpc3250-ea3250.dtb
+dtb-$(CONFIG_TARGET_CORSTONE1000) += corstone1000-mps3.dtb \
+ corstone1000-fvp.dtb
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
new file mode 100644
index 000000000000..1fcc137a493c
--- /dev/null
+++ b/arch/arm/dts/corstone1000-fvp.dts
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+/*
+ * Copyright (c) 2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited. All rights reserved.
+ *
+ */
+
+/dts-v1/;
+
+#include "corstone1000.dtsi"
+
+/ {
+ model = "ARM Corstone1000 FVP (Fixed Virtual Platform)";
+ compatible = "arm,corstone1000-fvp";
+
+ smsc: ethernet@4010000 {
+ compatible = "smsc,lan91c111";
+ reg = <0x40100000 0x10000>;
+ phy-mode = "mii";
+ interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+ reg-io-width = <2>;
+ };
+};
diff --git a/arch/arm/dts/corstone1000-mps3.dts b/arch/arm/dts/corstone1000-mps3.dts
new file mode 100644
index 000000000000..e3146747c2d9
--- /dev/null
+++ b/arch/arm/dts/corstone1000-mps3.dts
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+/*
+ * Copyright (c) 2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited. All rights reserved.
+ *
+ */
+
+/dts-v1/;
+
+#include "corstone1000.dtsi"
+
+/ {
+ model = "ARM Corstone1000 FPGA MPS3 board";
+ compatible = "arm,corstone1000-mps3";
+
+ smsc: ethernet@4010000 {
+ compatible = "smsc,lan9220", "smsc,lan9115";
+ reg = <0x40100000 0x10000>;
+ phy-mode = "mii";
+ interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+ reg-io-width = <2>;
+ smsc,irq-push-pull;
+ };
+
+ usb_host: usb@40200000 {
+ compatible = "nxp,usb-isp1763";
+ reg = <0x40200000 0x100000>;
+ interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+ bus-width = <16>;
+ dr_mode = "host";
+ };
+};
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
new file mode 100644
index 000000000000..d0194aa893f2
--- /dev/null
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: GPL-2.0 or MIT
+/*
+ * Copyright (c) 2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited. All rights reserved.
+ *
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+ interrupt-parent = <&gic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ aliases {
+ serial0 = &uart0;
+ serial1 = &uart1;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu: cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a35";
+ reg = <0>;
+ next-level-cache = <&L2_0>;
+ };
+ };
+
+ memory@88200000 {
+ device_type = "memory";
+ reg = <0x88200000 0x77e00000>;
+ };
+
+ gic: interrupt-controller@1c000000 {
+ compatible = "arm,gic-400";
+ #interrupt-cells = <3>;
+ #address-cells = <0>;
+ interrupt-controller;
+ reg = <0x1c010000 0x1000>,
+ <0x1c02f000 0x2000>,
+ <0x1c04f000 0x1000>,
+ <0x1c06f000 0x2000>;
+ interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(1) |
+ IRQ_TYPE_LEVEL_LOW)>;
+ };
+
+ L2_0: l2-cache0 {
+ compatible = "cache";
+ cache-level = <2>;
+ cache-size = <0x80000>;
+ cache-line-size = <64>;
+ cache-sets = <1024>;
+ };
+
+ refclk100mhz: refclk100mhz {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <100000000>;
+ clock-output-names = "apb_pclk";
+ };
+
+ smbclk: refclk24mhzx2 {
+ /* Reference 24MHz clock x 2 */
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <48000000>;
+ clock-output-names = "smclk";
+ };
+
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) |
+ IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) |
+ IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) |
+ IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) |
+ IRQ_TYPE_LEVEL_LOW)>;
+ };
+
+ uartclk: uartclk {
+ /* UART clock - 50MHz */
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <50000000>;
+ clock-output-names = "uartclk";
+ };
+
+ psci {
+ compatible = "arm,psci-1.0", "arm,psci-0.2";
+ method = "smc";
+ };
+
+ soc {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ interrupt-parent = <&gic>;
+ ranges;
+
+ timer@1a220000 {
+ compatible = "arm,armv7-timer-mem";
+ reg = <0x1a220000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clock-frequency = <50000000>;
+ ranges;
+
+ frame@1a230000 {
+ frame-number = <0>;
+ interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+ reg = <0x1a230000 0x1000>;
+ };
+ };
+
+ uart0: serial@1a510000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x1a510000 0x1000>;
+ interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&uartclk>, <&refclk100mhz>;
+ clock-names = "uartclk", "apb_pclk";
+ };
+
+ uart1: serial@1a520000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x1a520000 0x1000>;
+ interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&uartclk>, <&refclk100mhz>;
+ clock-names = "uartclk", "apb_pclk";
+ };
+
+ mhu_hse1: mailbox@1b820000 {
+ compatible = "arm,mhuv2-tx", "arm,primecell";
+ reg = <0x1b820000 0x1000>;
+ clocks = <&refclk100mhz>;
+ clock-names = "apb_pclk";
+ interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+ #mbox-cells = <2>;
+ arm,mhuv2-protocols = <0 0>;
+ secure-status = "okay"; /* secure-world-only */
+ status = "disabled";
+ };
+
+ mhu_seh1: mailbox@1b830000 {
+ compatible = "arm,mhuv2-rx", "arm,primecell";
+ reg = <0x1b830000 0x1000>;
+ clocks = <&refclk100mhz>;
+ clock-names = "apb_pclk";
+ interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
+ #mbox-cells = <2>;
+ arm,mhuv2-protocols = <0 0>;
+ secure-status = "okay"; /* secure-world-only */
+ status = "disabled";
+ };
+ };
+
+ arm_ffa: arm_ffa {
+ compatible = "arm,ffa";
+ method = "smc";
+ };
+};
diff --git a/board/armltd/corstone1000/Kconfig b/board/armltd/corstone1000/Kconfig
new file mode 100644
index 000000000000..709674d4cf7d
--- /dev/null
+++ b/board/armltd/corstone1000/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_CORSTONE1000
+
+config SYS_BOARD
+ default "corstone1000"
+
+config SYS_VENDOR
+ default "armltd"
+
+config SYS_CONFIG_NAME
+ default "corstone1000"
+
+endif
diff --git a/board/armltd/corstone1000/MAINTAINERS b/board/armltd/corstone1000/MAINTAINERS
new file mode 100644
index 000000000000..8c905686de76
--- /dev/null
+++ b/board/armltd/corstone1000/MAINTAINERS
@@ -0,0 +1,7 @@
+CORSTONE1000 BOARD
+M: Rui Miguel Silva <rui.silva@linaro.org>
+M: Vishnu Banavath <vishnu.banavath@arm.com>
+S: Maintained
+F: board/armltd/corstone1000/
+F: include/configs/corstone1000.h
+F: configs/corstone1000_defconfig
diff --git a/board/armltd/corstone1000/Makefile b/board/armltd/corstone1000/Makefile
new file mode 100644
index 000000000000..77a82c28929b
--- /dev/null
+++ b/board/armltd/corstone1000/Makefile
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2022 Arm Limited
+# (C) Copyright 2022 Linaro
+# Rui Miguel Silva <rui.silva@linaro.org>
+
+obj-y := corstone1000.o
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
new file mode 100644
index 000000000000..eff1739f0b02
--- /dev/null
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2022 ARM Limited
+ * (C) Copyright 2022 Linaro
+ * Rui Miguel Silva <rui.silva@linaro.org>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/platform_data/serial_pl01x.h>
+#include <asm/armv8/mmu.h>
+#include <asm/global_data.h>
+
+
+static const struct pl01x_serial_plat serial_plat = {
+ .base = V2M_UART0,
+ .type = TYPE_PL011,
+ .clock = CONFIG_PL011_CLOCK,
+};
+
+U_BOOT_DRVINFO(corstone1000_serials) = {
+ .name = "serial_pl01x",
+ .plat = &serial_plat,
+};
+
+static struct mm_region corstone1000_mem_map[] = {
+ {
+ /* CVM */
+ .virt = 0x02000000UL,
+ .phys = 0x02000000UL,
+ .size = 0x02000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* QSPI */
+ .virt = 0x08000000UL,
+ .phys = 0x08000000UL,
+ .size = 0x08000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* Host Peripherals */
+ .virt = 0x1A000000UL,
+ .phys = 0x1A000000UL,
+ .size = 0x26000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* USB */
+ .virt = 0x40200000UL,
+ .phys = 0x40200000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* ethernet */
+ .virt = 0x40100000UL,
+ .phys = 0x40100000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* OCVM */
+ .virt = 0x80000000UL,
+ .phys = 0x80000000UL,
+ .size = 0x80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = corstone1000_mem_map;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+/*
+ * Board specific ethernet initialization routine.
+ * */
+int board_eth_init(struct bd_info *bis)
+{
+ int rc = 0;
+
+#ifndef CONFIG_DM_ETH
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+#ifdef CONFIG_SMC911X
+ rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+#endif
+
+ return rc;
+}
+
+void reset_cpu(ulong addr)
+{
+}
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
new file mode 100644
index 000000000000..02f931b0d469
--- /dev/null
+++ b/configs/corstone1000_defconfig
@@ -0,0 +1,80 @@
+CONFIG_ARM=y
+CONFIG_TARGET_CORSTONE1000=y
+CONFIG_SYS_TEXT_BASE=0x80000000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_MALLOC_LEN=0x2000000
+CONFIG_SYS_LOAD_ADDR=0x82100000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING=" corstone1000 aarch64 "
+CONFIG_FIT=y
+CONFIG_BOOTDELAY=3
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9 ip=dhcp earlyprintk"
+CONFIG_LOGLEVEL=7
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="corstone1000# "
+# CONFIG_CMD_CONSOLE is not set
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_BOOTM=y
+CONFIG_CMD_LOADM=y
+CONFIG_CMD_BOOTEFI=y
+CONFIG_EFI_LOADER=y
+CONFIG_EFI_PARTITION=y
+CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
+CONFIG_CMD_BOOTEFI_HELLO=y
+# CONFIG_CMD_XIMG is not set
+# CONFIG_CMD_ENV_EXISTS is not set
+CONFIG_CMD_NVEDIT_EFI=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_USB=y
+CONFIG_CMD_ITEST=y
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_MII=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EFIDEBUG=y
+CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_REGMAP=y
+# CONFIG_MMC is not set
+CONFIG_DM_SERIAL=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_STORAGE=y
+CONFIG_EFI_MM_COMM_TEE=y
+# CONFIG_OPTEE is not set
+# CONFIG_GENERATE_SMBIOS_TABLE is not set
+# CONFIG_HEXDUMP is not set
+CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+# CONFIG_EFI_CAPSULE_ON_DISK_EARLY is not set
+# CONFIG_EFI_CAPSULE_AUTHENTICATE is not set
+CONFIG_EFI_HAVE_CAPSULE_SUPPORT=y
+CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_SECURE_BOOT=y
+CONFIG_DM_RTC=y
+CONFIG_CMD_RTC=y
+CONFIG_EFI_GET_TIME=y
+CONFIG_EFI_SET_TIME=y
+CONFIG_RTC_EMULATION=y
+CONFIG_PSCI_RESET=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_CMD_DHCP=y
+CONFIG_SMC911X=y
+CONFIG_SMC911X_BASE=0x40100000
+CONFIG_DM_ETH=y
+CONFIG_PHY_SMSC=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_GETTIME=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_PHYLIB=y
+CONFIG_PHY=y
+CONFIG_RAM=y
+CONFIG_ERRNO_STR=y
+CONFIG_CMD_EDITENV=y
+CONFIG_MISC=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
new file mode 100644
index 000000000000..cf166f107efd
--- /dev/null
+++ b/include/configs/corstone1000.h
@@ -0,0 +1,86 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2022 ARM Limited
+ * (C) Copyright 2022 Linaro
+ * Rui Miguel Silva <rui.silva@linaro.org>
+ * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
+ *
+ * Configuration for Corstone1000. Parts were derived from other ARM
+ * configurations.
+ */
+
+#ifndef __CORSTONE1000_H
+#define __CORSTONE1000_H
+
+#include <linux/sizes.h>
+
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+#define CONFIG_SYS_HZ 1000
+
+#define V2M_SRAM0 0x02000000
+#define V2M_QSPI 0x08000000
+
+#define V2M_DEBUG 0x10000000
+#define V2M_BASE_PERIPH 0x1A000000
+
+#define V2M_BASE 0x80000000
+
+#define V2M_PERIPH_OFFSET(x) (x << 16)
+
+#define V2M_SYSID (V2M_BASE_PERIPH)
+#define V2M_SYSCTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(1))
+
+#define V2M_COUNTER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(32))
+#define V2M_COUNTER_READ (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(33))
+
+#define V2M_TIMER_CTL (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(34))
+#define V2M_TIMER_BASE0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(35))
+
+#define V2M_UART0 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(81))
+#define V2M_UART1 (V2M_BASE_PERIPH + V2M_PERIPH_OFFSET(82))
+
+#define CONFIG_PL011_CLOCK 50000000
+
+/* Physical Memory Map */
+#define PHYS_SDRAM_1 (V2M_BASE)
+#define PHYS_SDRAM_1_SIZE 0x80000000
+
+#define CONFIG_ENV_SECT_SIZE SZ_64K
+
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
+#define CONFIG_SYS_MAXARGS 64 /* max command args */
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "usb_pgood_delay=250\0" \
+ "boot_bank_flag=0x08002000\0" \
+ "kernel_addr_bank_0=0x083EE000\0" \
+ "kernel_addr_bank_1=0x0936E000\0" \
+ "retrieve_kernel_load_addr=" \
+ "if itest.l *${boot_bank_flag} == 0; then " \
+ "setenv kernel_addr $kernel_addr_bank_0;" \
+ "else " \
+ "setenv kernel_addr $kernel_addr_bank_1;" \
+ "fi;" \
+ "\0" \
+ "kernel_addr_r=0x88200000\0" \
+ "fdt_high=0xffffffff\0"
+
+/*
+ * config_distro_bootcmd define the boot command to distro_bootcmd, but we here
+ * want to first try to load a kernel if exists, override that config then
+ */
+#undef CONFIG_BOOTCOMMAND
+
+#define CONFIG_BOOTCOMMAND \
+ "run retrieve_kernel_load_addr;" \
+ "echo Loading kernel from $kernel_addr to memory ... ;" \
+ "loadm $kernel_addr $kernel_addr_r 0xc00000;" \
+ "usb start; usb reset;" \
+ "run distro_bootcmd;" \
+ "bootefi $kernel_addr_r $fdtcontroladdr;"
+#endif
--
2.35.1
@@ -1,57 +0,0 @@
From 9c2c00f9aeb727c12096e6065cc2bab994bffa4f Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 22 Jun 2021 17:00:24 +0100
Subject: [PATCH] arm: corstone1000: enable devicetree in defconfig
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Add support and setup the default device tree for corstone1000.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
---
configs/corstone1000_defconfig | 3 ++-
include/configs/corstone1000.h | 10 +++-------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index bc983e65557e..54c746d829cb 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -6,7 +6,8 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_IDENT_STRING=" corstone1000 aarch64 "
CONFIG_BOOTDELAY=3
-CONFIG_OF_BOARD=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="corstone1000-mps3"
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9"
# CONFIG_DISPLAY_CPUINFO is not set
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 1fe909463f93..389ac45a5819 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -64,17 +64,13 @@
#define CONFIG_SYS_MAXARGS 64 /* max command args */
#define CONFIG_EXTRA_ENV_SETTINGS \
- "fdt_addr=0x08330000\0" \
"fdt_addr_r=0x82000000\0" \
- "kernel_addr=0x08430000\0" \
+ "kernel_addr=0x08330000\0" \
"kernel_addr_r=0x82100000\0" \
"fdt_high=0xffffffff\0"
#define CONFIG_BOOTCOMMAND \
- "echo Copying devicetree to memory ... ;" \
- "cp.b $fdt_addr $fdt_addr_r 0x100000;" \
"echo Copying Kernel to memory ... ;" \
- "cp.b $kernel_addr $kernel_addr_r 0xa00000;" \
- "bootm $kernel_addr_r - $fdt_addr_r; "
-
+ "cp.b $kernel_addr $kernel_addr_r 0xc00000;" \
+ "booti $kernel_addr_r - $fdtcontroladdr; "
#endif
@@ -1,16 +1,12 @@
From 546a7151f29b5cec9de1b653594e004c7de259dd Mon Sep 17 00:00:00 2001
From c16e273f6ee7de6f1d226ac321c680340edc19f9 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Mon, 28 Jun 2021 23:20:55 +0100
Subject: [PATCH] usb: common: move urb code to common
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Subject: [PATCH 03/27] usb: common: move urb code to common
Move urb code from musb only use to a more common scope, so other
drivers in the future can use the handling of urb in usb.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
drivers/usb/common/Makefile | 2 +
drivers/usb/common/usb_urb.c | 160 ++++++++++++++++++
@@ -20,11 +16,11 @@ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
drivers/usb/musb-new/musb_host.h | 2 +-
drivers/usb/musb-new/musb_uboot.c | 38 +----
drivers/usb/musb-new/musb_uboot.h | 2 +-
.../linux/usb/usb_urb_compat.h | 52 ++++--
.../linux/usb/usb_urb_compat.h | 46 ++++-
include/usb_defs.h | 32 ++++
10 files changed, 240 insertions(+), 82 deletions(-)
10 files changed, 240 insertions(+), 76 deletions(-)
create mode 100644 drivers/usb/common/usb_urb.c
rename drivers/usb/musb-new/usb-compat.h => include/linux/usb/usb_urb_compat.h (57%)
rename drivers/usb/musb-new/usb-compat.h => include/linux/usb/usb_urb_compat.h (60%)
diff --git a/drivers/usb/common/Makefile b/drivers/usb/common/Makefile
index 3bedbf213f47..dc05cb0a5077 100644
@@ -295,7 +291,7 @@ index afc8fa35a738..5a604bdb0cf2 100644
static inline struct usb_hcd *musb_to_hcd(struct musb *musb)
diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c
index 8ac2f0a78adb..85794356b0bc 100644
index 61ff68def2fa..d186facc7e02 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -8,10 +8,10 @@
@@ -365,10 +361,10 @@ index 18282efccc9d..6b162f03b19e 100644
struct musb_host_data {
diff --git a/drivers/usb/musb-new/usb-compat.h b/include/linux/usb/usb_urb_compat.h
similarity index 57%
similarity index 60%
rename from drivers/usb/musb-new/usb-compat.h
rename to include/linux/usb/usb_urb_compat.h
index 1c66c4fe3637..438e70b56a63 100644
index 1c66c4fe3637..c166301659a6 100644
--- a/drivers/usb/musb-new/usb-compat.h
+++ b/include/linux/usb/usb_urb_compat.h
@@ -1,16 +1,31 @@
@@ -416,16 +412,8 @@ index 1c66c4fe3637..438e70b56a63 100644
typedef void (*usb_complete_t)(struct urb *);
struct urb {
@@ -68,12 +81,27 @@ static inline int usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd,
return 0;
}
-/**
- * usb_dev_get_parent() - Get the parent of a USB device
- *
- * @udev: USB struct containing information about the device
- * @return associated device for which udev == dev_get_parent_priv(dev)
- */
@@ -76,4 +89,25 @@ static inline int usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd,
*/
struct usb_device *usb_dev_get_parent(struct usb_device *udev);
+int usb_urb_submit_control(struct usb_hcd *hcd, struct urb *urb,
@@ -504,3 +492,6 @@ index 6dd2c997f9b3..ec00161710a5 100644
/*
* Hub Status & Hub Change bit masks
--
2.35.1
@@ -1,16 +1,12 @@
From d2c4f00c05cc3c5ac25f46d69403de21de4e993d Mon Sep 17 00:00:00 2001
From 9be02586557731eaab9387d440e3ba3e535b7073 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Mon, 28 Jun 2021 23:31:25 +0100
Subject: [PATCH] usb: add isp1760 family driver
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Subject: [PATCH 04/27] usb: add isp1760 family driver
ISP1760/61/63 are a family of usb controllers, blah, blah, more info
here.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
Makefile | 1 +
drivers/usb/Kconfig | 2 +
@@ -23,9 +19,9 @@ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
drivers/usb/isp1760/isp1760-hcd.h | 82 +
drivers/usb/isp1760/isp1760-if.c | 127 ++
drivers/usb/isp1760/isp1760-regs.h | 292 +++
drivers/usb/isp1760/isp1760-uboot.c | 64 +
drivers/usb/isp1760/isp1760-uboot.c | 76 +
drivers/usb/isp1760/isp1760-uboot.h | 27 +
13 files changed, 3662 insertions(+)
13 files changed, 3674 insertions(+)
create mode 100644 drivers/usb/isp1760/Kconfig
create mode 100644 drivers/usb/isp1760/Makefile
create mode 100644 drivers/usb/isp1760/isp1760-core.c
@@ -38,10 +34,10 @@ Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
create mode 100644 drivers/usb/isp1760/isp1760-uboot.h
diff --git a/Makefile b/Makefile
index 20c1aa3f58a5..fa3c5d9d2407 100644
index a30098c66f8d..39907c548c00 100644
--- a/Makefile
+++ b/Makefile
@@ -842,6 +842,7 @@ libs-y += drivers/usb/host/
@@ -833,6 +833,7 @@ libs-y += drivers/usb/host/
libs-y += drivers/usb/mtu3/
libs-y += drivers/usb/musb/
libs-y += drivers/usb/musb-new/
@@ -76,7 +72,7 @@ index dc05cb0a5077..f08b064d2493 100644
obj-$(CONFIG_USB_EHCI_FSL) += fsl-dt-fixup.o fsl-errata.o
diff --git a/drivers/usb/isp1760/Kconfig b/drivers/usb/isp1760/Kconfig
new file mode 100644
index 000000000000..9657dcfd8045
index 000000000000..993d71e74cd2
--- /dev/null
+++ b/drivers/usb/isp1760/Kconfig
@@ -0,0 +1,12 @@
@@ -84,6 +80,7 @@ index 000000000000..9657dcfd8045
+
+config USB_ISP1760
+ tristate "NXP ISP 1760/1761/1763 support"
+ select DM_USB
+ select USB_HOST
+ help
+ Say Y or M here if your system as an ISP1760/1761/1763 USB host
@@ -91,7 +88,6 @@ index 000000000000..9657dcfd8045
+
+ This USB controller is usually attached to a non-DMA-Master
+ capable bus.
+
diff --git a/drivers/usb/isp1760/Makefile b/drivers/usb/isp1760/Makefile
new file mode 100644
index 000000000000..2c809c01b118
@@ -3691,10 +3687,10 @@ index 000000000000..94ea60c20b2a
+#endif
diff --git a/drivers/usb/isp1760/isp1760-uboot.c b/drivers/usb/isp1760/isp1760-uboot.c
new file mode 100644
index 000000000000..9f2eaa75f3ca
index 000000000000..7635210fe2b4
--- /dev/null
+++ b/drivers/usb/isp1760/isp1760-uboot.c
@@ -0,0 +1,64 @@
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Driver for the NXP ISP1760 chip
@@ -3753,12 +3749,24 @@ index 000000000000..9f2eaa75f3ca
+ pipe, buffer, length, interval);
+}
+
+struct dm_usb_ops isp1760_usb_ops = {
+ .control = isp1760_msg_submit_control,
+ .bulk = isp1760_msg_submit_bulk,
+ .interrupt = isp1760_msg_submit_irq,
+};
+static int isp1760_get_max_xfer_size(struct udevice *dev, size_t *size)
+{
+ struct isp1760_host_data *host = dev_get_priv(dev);
+ struct isp1760_hcd *priv = host->hcd.hcd_priv;
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
+
+ *size = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
+
+ return 0;
+}
+
+
+struct dm_usb_ops isp1760_usb_ops = {
+ .control = isp1760_msg_submit_control,
+ .bulk = isp1760_msg_submit_bulk,
+ .interrupt = isp1760_msg_submit_irq,
+ .get_max_xfer_size = isp1760_get_max_xfer_size,
+};
diff --git a/drivers/usb/isp1760/isp1760-uboot.h b/drivers/usb/isp1760/isp1760-uboot.h
new file mode 100644
index 000000000000..2486de6f9e27
@@ -3792,3 +3800,6 @@ index 000000000000..2486de6f9e27
+extern struct dm_usb_ops isp1760_usb_ops;
+
+#endif
--
2.35.1
@@ -1,89 +0,0 @@
From 41d82f4dc4473803d1447a0eac524112bed032d1 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 27 Jul 2021 23:34:57 +0100
Subject: [PATCH] corstone1000: enable isp1763 and usb stack
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
MPS3 board have a ISP1763 usb controller, add the correspondent mmio
area and enable it to be used for mass storage access for example.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
board/armltd/corstone1000/corstone1000.c | 8 ++++++++
configs/corstone1000_defconfig | 18 ++++++++----------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
index ab98fa87fbcd..a51f5ddfa002 100644
--- a/board/armltd/corstone1000/corstone1000.c
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -46,6 +46,14 @@ static struct mm_region corstone1000_mem_map[] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* USB */
+ .virt = 0x40200000UL,
+ .phys = 0x40200000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
/* OCVM */
.virt = 0x80000000UL,
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 54c746d829cb..8c0329611ba8 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -1,13 +1,12 @@
CONFIG_ARM=y
-CONFIG_ARM64=y
CONFIG_TARGET_CORSTONE1000=y
CONFIG_SYS_TEXT_BASE=0x02100000
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_IDENT_STRING=" corstone1000 aarch64 "
-CONFIG_BOOTDELAY=3
-CONFIG_OF_CONTROL=y
CONFIG_DEFAULT_DEVICE_TREE="corstone1000-mps3"
+CONFIG_FIT=y
+CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9"
# CONFIG_DISPLAY_CPUINFO is not set
@@ -16,12 +15,11 @@ CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="corstone1000# "
# CONFIG_CMD_CONSOLE is not set
CONFIG_CMD_BOOTZ=y
-CONFIG_CMD_BOOTM=y
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EDITENV is not set
# CONFIG_CMD_ENV_EXISTS is not set
-# CONFIG_CMD_ARMFLASH=y
# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_USB=y
# CONFIG_CMD_ITEST is not set
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
@@ -29,12 +27,12 @@ CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
-CONFIG_FIT=y
-# CONFIG_CMD_MISC is not set
CONFIG_CMD_FAT=y
-CONFIG_DM=y
+CONFIG_OF_CONTROL=y
+CONFIG_REGMAP=y
# CONFIG_MMC is not set
-# CONFIG_MTD_NOR_FLASH=y
CONFIG_DM_ETH=y
CONFIG_DM_SERIAL=y
-CONFIG_OF_LIBFDT=y
+CONFIG_USB=y
+CONFIG_USB_ISP1760=y
+CONFIG_USB_STORAGE=y
@@ -0,0 +1,48 @@
From 19adc1dd6e5e8d530310fb8a703c473660e1d83d Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Thu, 3 Mar 2022 16:52:02 +0000
Subject: [PATCH 05/27] corstone1000: enable isp1763 usb controller
MPS3 board have a ISP1763 usb controller, add the
correspondent mmio area and enable it to be used for mass
storage access for example.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
configs/corstone1000_defconfig | 1 +
include/configs/corstone1000.h | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 02f931b0d469..e573fe6fe6a2 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -42,6 +42,7 @@ CONFIG_REGMAP=y
CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_DM_USB=y
+CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
CONFIG_EFI_MM_COMM_TEE=y
# CONFIG_OPTEE is not set
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index cf166f107efd..8ba0effb0ab2 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -55,7 +55,13 @@
#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
#define CONFIG_SYS_MAXARGS 64 /* max command args */
+#define BOOT_TARGET_DEVICES(func) \
+ func(USB, usb, 0)
+
+#include <config_distro_bootcmd.h>
+
#define CONFIG_EXTRA_ENV_SETTINGS \
+ BOOTENV \
"usb_pgood_delay=250\0" \
"boot_bank_flag=0x08002000\0" \
"kernel_addr_bank_0=0x083EE000\0" \
--
2.35.1
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From ebba432b1cfda2b6f0219a8ac220a9b9d3b42a22 Mon Sep 17 00:00:00 2001
From fb63805bdd396264a30eee9ce7b0dc0e4b2aa2b2 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Wed, 24 Nov 2021 21:04:41 +0000
Subject: [PATCH 1/5] arm_ffa: introducing Arm FF-A low-level driver
Date: Tue, 16 Nov 2021 12:34:52 +0000
Subject: [PATCH 06/27] arm_ffa: introducing Arm FF-A low-level driver
This driver implements Arm Firmware Framework for Armv8-A on u-boot
@@ -25,6 +22,7 @@ These helper functions allow clients to pass data and select the
FF-A function to use for the communication with secure world.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
MAINTAINERS | 8 +
arch/arm/cpu/armv8/smccc-call.S | 27 +
@@ -60,10 +58,10 @@ Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
create mode 100644 lib/arm-ffa/arm_ffa_helper.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 5370b55064..3f61e374aa 100644
index 90666ce376cd..6e791039c024 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -215,6 +215,14 @@ F: board/CZ.NIC/
@@ -224,6 +224,14 @@ F: board/CZ.NIC/
F: configs/turris_*_defconfig
F: include/configs/turris_*.h
@@ -79,7 +77,7 @@ index 5370b55064..3f61e374aa 100644
M: Stefano Babic <sbabic@denx.de>
M: Fabio Estevam <festevam@gmail.com>
diff --git a/arch/arm/cpu/armv8/smccc-call.S b/arch/arm/cpu/armv8/smccc-call.S
index dc92b28777..ffc39c9fef 100644
index dc92b28777c3..ffc39c9fefa2 100644
--- a/arch/arm/cpu/armv8/smccc-call.S
+++ b/arch/arm/cpu/armv8/smccc-call.S
@@ -1,6 +1,8 @@
@@ -121,7 +119,7 @@ index dc92b28777..ffc39c9fef 100644
+
+#endif
diff --git a/arch/arm/lib/asm-offsets.c b/arch/arm/lib/asm-offsets.c
index 1a306ec415..0a94eb6669 100644
index 22fd541f9a28..45eca83a473c 100644
--- a/arch/arm/lib/asm-offsets.c
+++ b/arch/arm/lib/asm-offsets.c
@@ -9,6 +9,8 @@
@@ -133,7 +131,7 @@ index 1a306ec415..0a94eb6669 100644
*/
#include <common.h>
@@ -201,6 +203,10 @@ int main(void)
@@ -115,6 +117,10 @@ int main(void)
#ifdef CONFIG_ARM_SMCCC
DEFINE(ARM_SMCCC_RES_X0_OFFS, offsetof(struct arm_smccc_res, a0));
DEFINE(ARM_SMCCC_RES_X2_OFFS, offsetof(struct arm_smccc_res, a2));
@@ -145,10 +143,10 @@ index 1a306ec415..0a94eb6669 100644
DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, state));
#endif
diff --git a/common/board_r.c b/common/board_r.c
index 630c2451a2..3fde3acf62 100644
index 31a59c585a8d..d3ebae718976 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -77,6 +77,9 @@
@@ -78,6 +78,9 @@
#ifdef CONFIG_EFI_SETUP_EARLY
#include <efi_loader.h>
#endif
@@ -169,7 +167,7 @@ index 630c2451a2..3fde3acf62 100644
initr_post,
#endif
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 417d6f88c2..75e78f339e 100644
index b26ca8cf70c9..e83c23789d1b 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -6,6 +6,8 @@ source "drivers/core/Kconfig"
@@ -182,10 +180,10 @@ index 417d6f88c2..75e78f339e 100644
source "drivers/axi/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index fd218c9056..d006fe9d1c 100644
index 4e7cf284405a..6671d2a604ab 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -113,6 +113,7 @@ obj-y += input/
@@ -107,6 +107,7 @@ obj-y += iommu/
obj-y += smem/
obj-y += thermal/
obj-$(CONFIG_TEE) += tee/
@@ -195,7 +193,7 @@ index fd218c9056..d006fe9d1c 100644
obj-$(CONFIG_W1) += w1/
diff --git a/drivers/arm-ffa/Kconfig b/drivers/arm-ffa/Kconfig
new file mode 100644
index 0000000000..d71444c1fa
index 000000000000..d71444c1fa90
--- /dev/null
+++ b/drivers/arm-ffa/Kconfig
@@ -0,0 +1,26 @@
@@ -227,7 +225,7 @@ index 0000000000..d71444c1fa
+ all the interactions between Normal world and Secure World.
diff --git a/drivers/arm-ffa/Makefile b/drivers/arm-ffa/Makefile
new file mode 100644
index 0000000000..9fb5bea522
index 000000000000..9fb5bea52299
--- /dev/null
+++ b/drivers/arm-ffa/Makefile
@@ -0,0 +1,3 @@
@@ -236,7 +234,7 @@ index 0000000000..9fb5bea522
+obj-y += arm-ffa-uclass.o core.o
diff --git a/drivers/arm-ffa/arm-ffa-uclass.c b/drivers/arm-ffa/arm-ffa-uclass.c
new file mode 100644
index 0000000000..43f6066281
index 000000000000..43f6066281fe
--- /dev/null
+++ b/drivers/arm-ffa/arm-ffa-uclass.c
@@ -0,0 +1,67 @@
@@ -309,7 +307,7 @@ index 0000000000..43f6066281
+}
diff --git a/drivers/arm-ffa/arm_ffa_prv.h b/drivers/arm-ffa/arm_ffa_prv.h
new file mode 100644
index 0000000000..38ea4ba83e
index 000000000000..38ea4ba83efc
--- /dev/null
+++ b/drivers/arm-ffa/arm_ffa_prv.h
@@ -0,0 +1,199 @@
@@ -514,7 +512,7 @@ index 0000000000..38ea4ba83e
+#endif
diff --git a/drivers/arm-ffa/core.c b/drivers/arm-ffa/core.c
new file mode 100644
index 0000000000..98e2d2fa17
index 000000000000..98e2d2fa1767
--- /dev/null
+++ b/drivers/arm-ffa/core.c
@@ -0,0 +1,1484 @@
@@ -2004,7 +2002,7 @@ index 0000000000..98e2d2fa17
+};
diff --git a/include/arm_ffa.h b/include/arm_ffa.h
new file mode 100644
index 0000000000..313f46f747
index 000000000000..313f46f74764
--- /dev/null
+++ b/include/arm_ffa.h
@@ -0,0 +1,191 @@
@@ -2201,7 +2199,7 @@ index 0000000000..313f46f747
+#endif
diff --git a/include/arm_ffa_helper.h b/include/arm_ffa_helper.h
new file mode 100644
index 0000000000..0e143e5451
index 000000000000..0e143e54511e
--- /dev/null
+++ b/include/arm_ffa_helper.h
@@ -0,0 +1,45 @@
@@ -2251,11 +2249,11 @@ index 0000000000..0e143e5451
+int ffa_uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin);
+#endif
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index e7edd409f3..fc7de08add 100644
index 0e26e1d13824..a1181b8f48e7 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -51,6 +51,7 @@ enum uclass_id {
UCLASS_EFI, /* EFI managed devices */
@@ -52,6 +52,7 @@ enum uclass_id {
UCLASS_EFI_MEDIA, /* Devices provided by UEFI firmware */
UCLASS_ETH, /* Ethernet device */
UCLASS_ETH_PHY, /* Ethernet PHY device */
+ UCLASS_FFA, /* Arm Firmware Framework for Armv8-A */
@@ -2263,7 +2261,7 @@ index e7edd409f3..fc7de08add 100644
UCLASS_FS_FIRMWARE_LOADER, /* Generic loader */
UCLASS_GPIO, /* Bank of general-purpose I/O pins */
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 7f2be23394..54980a130f 100644
index 7f2be2339475..54980a130fdb 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -1,6 +1,8 @@
@@ -2322,10 +2320,10 @@ index 7f2be23394..54980a130f 100644
#define arm_smccc_smc_quirk(...) __arm_smccc_smc(__VA_ARGS__)
diff --git a/lib/Kconfig b/lib/Kconfig
index 130fa0630a..58d313cb13 100644
index 807a4c6ade06..333e35a90964 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -709,6 +709,7 @@ config SMBIOS_PARSER
@@ -771,6 +771,7 @@ config SMBIOS_PARSER
source lib/efi/Kconfig
source lib/efi_loader/Kconfig
source lib/optee/Kconfig
@@ -2334,7 +2332,7 @@ index 130fa0630a..58d313cb13 100644
config TEST_FDTDEC
bool "enable fdtdec test"
diff --git a/lib/Makefile b/lib/Makefile
index 93be86c34a..28e56c710b 100644
index 5ddbc77ed6d8..ddfd70997da4 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_EFI) += efi/
@@ -2347,7 +2345,7 @@ index 93be86c34a..28e56c710b 100644
obj-$(CONFIG_TIZEN) += tizen/
diff --git a/lib/arm-ffa/Kconfig b/lib/arm-ffa/Kconfig
new file mode 100644
index 0000000000..79acbc5a8f
index 000000000000..79acbc5a8fe3
--- /dev/null
+++ b/lib/arm-ffa/Kconfig
@@ -0,0 +1,6 @@
@@ -2359,7 +2357,7 @@ index 0000000000..79acbc5a8f
+ pass the data and the FF-A function ID to the low level driver
diff --git a/lib/arm-ffa/Makefile b/lib/arm-ffa/Makefile
new file mode 100644
index 0000000000..c30c0f3981
index 000000000000..c30c0f398126
--- /dev/null
+++ b/lib/arm-ffa/Makefile
@@ -0,0 +1,8 @@
@@ -2373,7 +2371,7 @@ index 0000000000..c30c0f3981
+obj-y += arm_ffa_helper.o
diff --git a/lib/arm-ffa/arm_ffa_helper.c b/lib/arm-ffa/arm_ffa_helper.c
new file mode 100644
index 0000000000..623899d380
index 000000000000..623899d38044
--- /dev/null
+++ b/lib/arm-ffa/arm_ffa_helper.c
@@ -0,0 +1,188 @@
@@ -2566,7 +2564,7 @@ index 0000000000..623899d380
+ return 0;
+}
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index f0283b539e..6f5f32b903 100644
index 20b69699fe94..eaa43d784ef1 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -23,6 +23,10 @@
@@ -2580,7 +2578,7 @@ index f0283b539e..6f5f32b903 100644
DECLARE_GLOBAL_DATA_PTR;
/* Task priority level */
@@ -2108,6 +2112,10 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
@@ -2114,6 +2118,10 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
struct efi_event *evt, *next_event;
efi_status_t ret = EFI_SUCCESS;
@@ -2591,7 +2589,7 @@ index f0283b539e..6f5f32b903 100644
EFI_ENTRY("%p, %zx", image_handle, map_key);
/* Check that the caller has read the current memory map */
@@ -2157,6 +2165,15 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
@@ -2174,6 +2182,15 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL);
}
@@ -2608,5 +2606,5 @@ index f0283b539e..6f5f32b903 100644
efi_runtime_detach();
--
2.17.1
2.35.1
@@ -1,238 +0,0 @@
From 7db0cdef0831189e0cb33175a4c49be91e98d8e0 Mon Sep 17 00:00:00 2001
From: "Arpita S.K" <Arpita.S.K@arm.com>
Date: Mon, 11 Oct 2021 11:41:25 +0530
Subject: [PATCH] corstone1000: enable support for FVP
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Introduces a new device tree for the FVP.
Signed-off-by: Arpita S.K <Arpita.S.K@arm.com>
---
arch/arm/dts/Makefile | 2 +
arch/arm/dts/corstone1000-fvp.dts | 28 ++++++
arch/arm/dts/corstone1000.dtsi | 152 ++++++++++++++++++++++++++++++
configs/corstone1000_defconfig | 1 -
4 files changed, 182 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/dts/corstone1000-fvp.dts
create mode 100644 arch/arm/dts/corstone1000.dtsi
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index fc16a57e60b0..0a694f19ba66 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1130,6 +1130,8 @@ dtb-$(CONFIG_TARGET_IMX8MM_CL_IOT_GATE) += imx8mm-cl-iot-gate.dtb
dtb-$(CONFIG_TARGET_EA_LPC3250DEVKITV2) += lpc3250-ea3250.dtb
+dtb-$(CONFIG_TARGET_CORSTONE1000) += $(DEVICE_TREE).dtb
+
targets += $(dtb-y)
# Add any required device tree compiler flags here
diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
new file mode 100644
index 000000000000..2188ca5e0e4f
--- /dev/null
+++ b/arch/arm/dts/corstone1000-fvp.dts
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/dts-v1/;
+
+#include "corstone1000.dtsi"
+
+/ {
+ model = "corstone1000-fvp";
+
+ ethernet: eth@4010000 {
+ compatible = "smsc,lan91c111";
+ reg = <0x40100000 0x10000>;
+ phy-mode = "mii";
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 116 0xf04>;
+ reg-io-width = <2>;
+ smsc,irq-push-pull;
+ };
+
+};
+
+&refclk {
+ clock-frequency = <50000000>;
+};
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
new file mode 100644
index 000000000000..b863193fb642
--- /dev/null
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+ compatible = "arm,corstone1000";
+ interrupt-parent = <&gic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ chosen { };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0>;
+ next-level-cache = <&L2_0>;
+ };
+ };
+
+ memory@80000000 {
+ device_type = "memory";
+ reg = <0x80000000 0x80000000>;
+ };
+
+ gic: interrupt-controller@1c000000 {
+ compatible = "arm,gic-400";
+ #interrupt-cells = <3>;
+ #address-cells = <0>;
+ interrupt-controller;
+ reg = <0x1c010000 0x1000>,
+ <0x1c02f000 0x2000>,
+ <0x1c04f000 0x1000>,
+ <0x1c06f000 0x2000>;
+ interrupts = <1 9 0xf08>;
+ };
+
+ L2_0: l2-cache0 {
+ compatible = "cache";
+ };
+
+ refclk100mhz: refclk100mhz {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <100000000>;
+ clock-output-names = "apb_pclk";
+ };
+
+ smbclk: refclk24mhzx2 {
+ /* Reference 24MHz clock x 2 */
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <48000000>;
+ clock-output-names = "smclk";
+ };
+
+ uartclk: uartclk {
+ /* UART clock - 50MHz */
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <50000000>;
+ clock-output-names = "uartclk";
+ };
+
+ serial0: uart@1a510000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x1a510000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 19 4>;
+ clocks = <&uartclk>, <&refclk100mhz>;
+ clock-names = "uartclk", "apb_pclk";
+ };
+
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <1 13 0xf08>,
+ <1 14 0xf08>,
+ <1 11 0xf08>,
+ <1 10 0xf08>;
+ };
+
+ refclk: refclk@1a220000 {
+ compatible = "arm,armv7-timer-mem";
+ reg = <0x1a220000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ frame@1a230000 {
+ frame-number = <0>;
+ interrupts = <0 2 0xf04>;
+ reg = <0x1a230000 0x1000>;
+ };
+ };
+
+ mbox_es0mhu0: mhu@1b000000 {
+ compatible = "arm,mhuv2","arm,primecell";
+ reg = <0x1b000000 0x1000>,
+ <0x1b010000 0x1000>;
+ clocks = <&refclk100mhz>;
+ clock-names = "apb_pclk";
+ interrupts = <0 12 4>;
+ interrupt-names = "mhu_rx";
+ #mbox-cells = <1>;
+ mbox-name = "arm-es0-mhu0";
+ };
+
+ mbox_es0mhu1: mhu@1b020000 {
+ compatible = "arm,mhuv2","arm,primecell";
+ reg = <0x1b020000 0x1000>,
+ <0x1b030000 0x1000>;
+ clocks = <&refclk100mhz>;
+ clock-names = "apb_pclk";
+ interrupts = <0 47 4>;
+ interrupt-names = "mhu_rx";
+ #mbox-cells = <1>;
+ mbox-name = "arm-es0-mhu1";
+ };
+
+ mbox_semhu1: mhu@1b820000 {
+ compatible = "arm,mhuv2","arm,primecell";
+ reg = <0x1b820000 0x1000>,
+ <0x1b830000 0x1000>;
+ clocks = <&refclk100mhz>;
+ clock-names = "apb_pclk";
+ interrupts = <0 45 4>;
+ interrupt-names = "mhu_rx";
+ #mbox-cells = <1>;
+ mbox-name = "arm-se-mhu1";
+ };
+
+ client {
+ compatible = "arm,client";
+ mboxes = <&mbox_es0mhu0 0>, <&mbox_es0mhu1 0>, <&mbox_semhu1 0>;
+ mbox-names = "es0mhu0", "es0mhu1", "semhu1";
+ };
+
+ extsys0: extsys@1A010310 {
+ compatible = "arm,extsys_ctrl";
+ reg = <0x1A010310 0x4>,
+ <0x1A010314 0x4>;
+ reg-names = "rstreg", "streg";
+ };
+};
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 8c0329611ba8..941837355c98 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -4,7 +4,6 @@ CONFIG_SYS_TEXT_BASE=0x02100000
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_IDENT_STRING=" corstone1000 aarch64 "
-CONFIG_DEFAULT_DEVICE_TREE="corstone1000-mps3"
CONFIG_FIT=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
@@ -1,33 +0,0 @@
From a18f97b17c84006d7b73b40490f0cd135cce2361 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Wed, 25 Aug 2021 16:50:40 +0100
Subject: [PATCH] arm: corstone1000: sharing PSCI DTS node between FVP
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
and MPS3
At this level of development PSCI is needed to initialize the SMCCC.
SMCCC is needed by FF-A and it is relevant to the MPS3 and FVP.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
arch/arm/dts/corstone1000.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
index b863193fb642..da1725e01f5f 100644
--- a/arch/arm/dts/corstone1000.dtsi
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -149,4 +149,8 @@
<0x1A010314 0x4>;
reg-names = "rstreg", "streg";
};
+ psci {
+ compatible = "arm,psci-1.0", "arm,psci-0.2";
+ method = "smc";
+ };
};
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From fcb1d508e144b6239cf97dddfcb62d5f1e91ccd2 Mon Sep 17 00:00:00 2001
From 67b65583edcea5b519f196741f523df8b4b48162 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Tue, 16 Nov 2021 12:36:27 +0000
Subject: [PATCH 2/5] arm_ffa: introducing armffa command
Subject: [PATCH 07/27] arm_ffa: introducing armffa command
A new armffa command is provided as an example of how to use
the FF-A helper functions to communicate with secure world.
@@ -13,6 +10,7 @@ The armffa command allows to query secure partitions data from
the secure world and exchanging messages with the partitions.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
MAINTAINERS | 1 +
cmd/Kconfig | 10 ++
@@ -22,10 +20,10 @@ Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
create mode 100644 cmd/armffa.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 3f61e374aa..7db7b7d637 100644
index 6e791039c024..71c77b58b0ce 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -218,6 +218,7 @@ F: include/configs/turris_*.h
@@ -227,6 +227,7 @@ F: include/configs/turris_*.h
ARM FF-A
M: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
S: Maintained
@@ -34,10 +32,10 @@ index 3f61e374aa..7db7b7d637 100644
F: include/arm_ffa.h
F: include/arm_ffa_helper.h
diff --git a/cmd/Kconfig b/cmd/Kconfig
index a33b2a2a12..c34cf6dc8d 100644
index 6262c08fd3a1..a6108d156311 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -785,6 +785,16 @@ endmenu
@@ -813,6 +813,16 @@ endmenu
menu "Device access commands"
@@ -55,7 +53,7 @@ index a33b2a2a12..c34cf6dc8d 100644
#depends on FLASH_CFI_DRIVER
bool "armflash"
diff --git a/cmd/Makefile b/cmd/Makefile
index ed3669411e..ccd4882676 100644
index e31ac15ef757..e41d4a3d0651 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -12,6 +12,8 @@ obj-y += panic.o
@@ -69,7 +67,7 @@ index ed3669411e..ccd4882676 100644
obj-$(CONFIG_CMD_AES) += aes.o
diff --git a/cmd/armffa.c b/cmd/armffa.c
new file mode 100644
index 0000000000..71a6ebb656
index 000000000000..71a6ebb656d1
--- /dev/null
+++ b/cmd/armffa.c
@@ -0,0 +1,266 @@
@@ -340,5 +338,5 @@ index 0000000000..71a6ebb656
+ "devlist\n"
+ " - displays the arm_ffa device info\n");
--
2.17.1
2.35.1
@@ -1,30 +0,0 @@
From 36ed6e56242b342af38072b0ac3d26d4800a4db1 Mon Sep 17 00:00:00 2001
From: "Arpita S.K" <Arpita.S.K@arm.com>
Date: Mon, 11 Oct 2021 11:45:41 +0530
Subject: [PATCH] arm: corstone1000: Emulated RTC Support
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
This patch adds the options that should be
enabled to turn on emulated RTC support.
Signed-off-by: Arpita S.K <Arpita.S.K@arm.com>
---
configs/corstone1000_defconfig | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 941837355c98..81fd067c2a79 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -35,3 +35,8 @@ CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
+CONFIG_DM_RTC=y
+CONFIG_CMD_RTC=y
+CONFIG_EFI_GET_TIME=y
+CONFIG_EFI_SET_TIME=y
+CONFIG_RTC_EMULATION=y
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From aa7d7298547c5e1c0e1c2aaafc28f3fdb5084780 Mon Sep 17 00:00:00 2001
From 4445ccbdd5ef52a6ca041d670f46d9aff104c0a0 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Wed, 13 Oct 2021 17:51:44 +0100
Subject: [PATCH 4/5] arm_ffa: introducing MM communication with FF-A
Subject: [PATCH 08/27] arm_ffa: introducing MM communication with FF-A
This commit allows to perform MM communication using FF-A transport.
@@ -26,16 +23,17 @@ with response data.
The response data is copied back to the communication buffer.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/Kconfig | 14 +-
lib/efi_loader/efi_variable_tee.c | 255 +++++++++++++++++++++++++++++-
2 files changed, 263 insertions(+), 6 deletions(-)
lib/efi_loader/efi_variable_tee.c | 265 +++++++++++++++++++++++++++++-
2 files changed, 273 insertions(+), 6 deletions(-)
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index f48d9e8b51..5a31a42456 100644
index 24f9a2bb7571..4c914c712275 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -55,13 +55,23 @@ config EFI_VARIABLE_FILE_STORE
@@ -56,13 +56,23 @@ config EFI_VARIABLE_FILE_STORE
stored as file /ubootefi.var on the EFI system partition.
config EFI_MM_COMM_TEE
@@ -62,15 +60,15 @@ index f48d9e8b51..5a31a42456 100644
config EFI_VARIABLES_PRESEED
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 51920bcb51..b363ec92bf 100644
index a2c65e369478..97c41b69dd78 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -15,7 +15,28 @@
@@ -15,6 +15,28 @@
#include <malloc.h>
#include <mm_communication.h>
+#if (IS_ENABLED(CONFIG_OPTEE))
#define OPTEE_PAGE_SIZE BIT(12)
+#define OPTEE_PAGE_SIZE BIT(12)
+#endif
+
+#if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
@@ -94,7 +92,7 @@ index 51920bcb51..b363ec92bf 100644
extern struct efi_var_file __efi_runtime_data *efi_var_buf;
static efi_uintn_t max_buffer_size; /* comm + var + func + data */
static efi_uintn_t max_payload_size; /* func + data */
@@ -25,6 +46,7 @@ struct mm_connection {
@@ -24,6 +46,7 @@ struct mm_connection {
u32 session;
};
@@ -102,7 +100,7 @@ index 51920bcb51..b363ec92bf 100644
/**
* get_connection() - Retrieve OP-TEE session for a specific UUID.
*
@@ -140,16 +162,229 @@ static efi_status_t optee_mm_communicate(void *comm_buf, ulong dsize)
@@ -143,16 +166,229 @@ static efi_status_t optee_mm_communicate(void *comm_buf, ulong dsize)
return ret;
}
@@ -231,8 +229,9 @@ index 51920bcb51..b363ec92bf 100644
+
+ return 0;
+}
+
+/**
/**
- * mm_communicate() - Adjust the cmonnucation buffer to StandAlonneMM and send
+ * ffa_mm_communicate() - Exchange EFI services data with the MM partition using FF-A
+ * @comm_buf: locally allocated communication buffer used for for rx/tx
+ * @dsize: communication buffer size
@@ -313,9 +312,8 @@ index 51920bcb51..b363ec92bf 100644
+ }
+}
+#endif
/**
- * mm_communicate() - Adjust the cmonnucation buffer to StandAlonneMM and send
+
+/**
+ * mm_communicate() - Adjust the communication buffer to the MM SP and send
* it to OP-TEE
*
@@ -335,7 +333,7 @@ index 51920bcb51..b363ec92bf 100644
{
efi_status_t ret;
struct efi_mm_communicate_header *mm_hdr;
@@ -159,7 +394,11 @@ static efi_status_t mm_communicate(u8 *comm_buf, efi_uintn_t dsize)
@@ -162,7 +398,11 @@ static efi_status_t mm_communicate(u8 *comm_buf, efi_uintn_t dsize)
mm_hdr = (struct efi_mm_communicate_header *)comm_buf;
var_hdr = (struct smm_variable_communicate_header *)mm_hdr->data;
@@ -347,19 +345,21 @@ index 51920bcb51..b363ec92bf 100644
if (ret != EFI_SUCCESS) {
log_err("%s failed!\n", __func__);
return ret;
@@ -255,6 +494,8 @@ efi_status_t EFIAPI get_max_payload(efi_uintn_t *size)
@@ -258,6 +498,23 @@ efi_status_t EFIAPI get_max_payload(efi_uintn_t *size)
goto out;
}
*size = var_payload->size;
+
+ #if (IS_ENABLED(CONFIG_OPTEE))
/*
* Although the max payload is configurable on StMM, we only share a
* single page from OP-TEE for the non-secure buffer used to communicate
@@ -264,6 +505,12 @@ efi_status_t EFIAPI get_max_payload(efi_uintn_t *size)
if (*size > OPTEE_PAGE_SIZE)
*size = OPTEE_PAGE_SIZE - MM_COMMUNICATE_HEADER_SIZE -
MM_VARIABLE_COMMUNICATE_SIZE;
+ /*
+ * Although the max payload is configurable on StMM, we only share a
+ * single page from OP-TEE for the non-secure buffer used to communicate
+ * with StMM. Since OP-TEE will reject to map anything bigger than that,
+ * make sure we are in bounds.
+ */
+ if (*size > OPTEE_PAGE_SIZE)
+ *size = OPTEE_PAGE_SIZE - MM_COMMUNICATE_HEADER_SIZE -
+ MM_VARIABLE_COMMUNICATE_SIZE;
+ #elif (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
+ if (*size > FFA_SHARED_MM_BUFFER_SIZE)
+ *size = FFA_SHARED_MM_BUFFER_SIZE - MM_COMMUNICATE_HEADER_SIZE -
@@ -369,7 +369,7 @@ index 51920bcb51..b363ec92bf 100644
/*
* There seems to be a bug in EDK2 miscalculating the boundaries and
* size checks, so deduct 2 more bytes to fulfill this requirement. Fix
@@ -690,7 +937,7 @@ void efi_variables_boot_exit_notify(void)
@@ -688,7 +945,7 @@ void efi_variables_boot_exit_notify(void)
ret = EFI_NOT_FOUND;
if (ret != EFI_SUCCESS)
@@ -379,5 +379,5 @@ index 51920bcb51..b363ec92bf 100644
/*
--
2.17.1
2.35.1
@@ -1,29 +0,0 @@
From cf14e676dc61b91609ddc940663cdc876ec126fe Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Wed, 1 Sep 2021 18:33:32 +0100
Subject: [PATCH] arm: corstone1000: execute uboot from DDR
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Previously uboot was executing from CVM. With the addition of
secure partitions in optee, uboot has been moved to DDR.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
---
configs/corstone1000_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 81fd067c2a79..d26932dd487c 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -1,6 +1,6 @@
CONFIG_ARM=y
CONFIG_TARGET_CORSTONE1000=y
-CONFIG_SYS_TEXT_BASE=0x02100000
+CONFIG_SYS_TEXT_BASE=0x80000000
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_NR_DRAM_BANKS=1
CONFIG_IDENT_STRING=" corstone1000 aarch64 "
@@ -1,14 +1,12 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 236c75ffffd580427c52e1a4dcaf4b058d4b0891 Mon Sep 17 00:00:00 2001
From 66bfe0c863c75d5e82d3a3d5eb0967fa702e4792 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Tue, 16 Nov 2021 12:38:48 +0000
Subject: [PATCH 3/5] arm_ffa: introducing test module for UCLASS_FFA
Subject: [PATCH 09/27] arm_ffa: introducing test module for UCLASS_FFA
This is the test module for the UCLASS_FFA class.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
MAINTAINERS | 1 +
test/dm/Makefile | 1 +
@@ -19,10 +17,10 @@ Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
create mode 100644 test/dm/ffa.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 7db7b7d637..c2762ad5d0 100644
index 71c77b58b0ce..9608fa30af7d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -223,6 +223,7 @@ F: drivers/arm-ffa/
@@ -232,6 +232,7 @@ F: drivers/arm-ffa/
F: include/arm_ffa.h
F: include/arm_ffa_helper.h
F: lib/arm-ffa/
@@ -31,10 +29,10 @@ index 7db7b7d637..c2762ad5d0 100644
ARM FREESCALE IMX
M: Stefano Babic <sbabic@denx.de>
diff --git a/test/dm/Makefile b/test/dm/Makefile
index 55162e9499..0403b3c622 100644
index d46552fbf320..ddac250cdff0 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -77,6 +77,7 @@ obj-$(CONFIG_POWER_DOMAIN) += power-domain.o
@@ -79,6 +79,7 @@ obj-$(CONFIG_POWER_DOMAIN) += power-domain.o
obj-$(CONFIG_ACPI_PMC) += pmc.o
obj-$(CONFIG_DM_PMIC) += pmic.o
obj-$(CONFIG_DM_PWM) += pwm.o
@@ -44,7 +42,7 @@ index 55162e9499..0403b3c622 100644
obj-y += regmap.o
diff --git a/test/dm/ffa.c b/test/dm/ffa.c
new file mode 100644
index 0000000000..b937cea57b
index 000000000000..b937cea57b80
--- /dev/null
+++ b/test/dm/ffa.c
@@ -0,0 +1,56 @@
@@ -106,7 +104,7 @@ index 0000000000..b937cea57b
+DM_TEST(dm_test_ffa_uclass, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
diff --git a/test/dm/ffa.h b/test/dm/ffa.h
new file mode 100644
index 0000000000..a0802bd692
index 000000000000..a0802bd6928a
--- /dev/null
+++ b/test/dm/ffa.h
@@ -0,0 +1,19 @@
@@ -130,5 +128,5 @@ index 0000000000..a0802bd692
+
+#endif /*__TEST_DM_FFA_H */
--
2.17.1
2.35.1
@@ -0,0 +1,57 @@
From 7c5cad61d72f76d55e5d49ba412c94823a1a6113 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Tue, 2 Nov 2021 16:44:39 +0000
Subject: [PATCH 10/27] arm_ffa: corstone1000: enable FF-A and MM support
This commit allows corstone1000 platform to perform
MM communication between u-boot and the secure world
using FF-A transport.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
configs/corstone1000_defconfig | 1 +
include/configs/corstone1000.h | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index e573fe6fe6a2..b042d4e49419 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -44,6 +44,7 @@ CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
+CONFIG_ARM_FFA_TRANSPORT=y
CONFIG_EFI_MM_COMM_TEE=y
# CONFIG_OPTEE is not set
# CONFIG_GENERATE_SMBIOS_TABLE is not set
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 8ba0effb0ab2..afc9ccfc192b 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -14,6 +14,21 @@
#include <linux/sizes.h>
+/* MM SP UUID binary data (little-endian format) */
+#define MM_SP_UUID_DATA \
+ 0xed, 0x32, 0xd5, 0x33, \
+ 0x99, 0xe6, 0x42, 0x09, \
+ 0x9c, 0xc0, 0x2d, 0x72, \
+ 0xcd, 0xd9, 0x98, 0xa7
+
+#define FFA_SHARED_MM_BUFFER_SIZE SZ_4K /* 4 KB */
+
+/*
+ * shared buffer physical address used for communication between
+ * u-boot and the MM SP
+ */
+#define FFA_SHARED_MM_BUFFER_ADDR (0x023F8000)
+
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
#define CONFIG_SKIP_LOWLEVEL_INIT
--
2.35.1
@@ -1,59 +0,0 @@
From be832406f95d4d057871a30097d2b1223b356414 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Wed, 23 Jun 2021 00:45:38 +0100
Subject: [PATCH] arm: corstone1000: enable boot using uefi
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
In a way to prepare future use of uefi features, enable booting using
the bootefi binary loading.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Rui Miguel Silva <rui.silva@arm.com>
---
configs/corstone1000_defconfig | 7 +++++++
include/configs/corstone1000.h | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index d26932dd487c..46ce1780c4b4 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
CONFIG_TARGET_CORSTONE1000=y
CONFIG_SYS_TEXT_BASE=0x80000000
CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SYS_LOAD_ADDR=0x82100000
CONFIG_NR_DRAM_BANKS=1
CONFIG_IDENT_STRING=" corstone1000 aarch64 "
CONFIG_FIT=y
@@ -14,6 +15,12 @@ CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="corstone1000# "
# CONFIG_CMD_CONSOLE is not set
CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_BOOTM=y
+CONFIG_CMD_LOADM=y
+CONFIG_CMD_BOOTEFI=y
+CONFIG_EFI_LOADER=y
+CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
+CONFIG_CMD_BOOTEFI_HELLO=y
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EDITENV is not set
# CONFIG_CMD_ENV_EXISTS is not set
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 389ac45a5819..5e22e075ad07 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -70,7 +70,7 @@
"fdt_high=0xffffffff\0"
#define CONFIG_BOOTCOMMAND \
- "echo Copying Kernel to memory ... ;" \
- "cp.b $kernel_addr $kernel_addr_r 0xc00000;" \
- "booti $kernel_addr_r - $fdtcontroladdr; "
+ "echo Loading Kernel to memory ... ;" \
+ "loadm $kernel_addr $kernel_addr_r 0xc00000;" \
+ "bootefi $kernel_addr_r $fdtcontroladdr;"
#endif
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 666463acdd3dbf090952b8bc8b0f2508137804a4 Mon Sep 17 00:00:00 2001
From e6a9c52b70e53d359e24ec024716c40391b77572 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Thu, 11 Nov 2021 16:27:59 +0000
Subject: [PATCH] efi: corstone1000: introduce EFI capsule update
Subject: [PATCH 11/27] efi: corstone1000: introduce EFI capsule update
This commit provides capsule update feature for Corstone1000.
@@ -22,48 +19,17 @@ On ExitBootServices() a kernel started event is sent to the
SE Proxy FW update service. This event is generated on each boot.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
arch/arm/dts/corstone1000.dtsi | 4 +-
configs/corstone1000_defconfig | 3 +-
include/configs/corstone1000.h | 30 +++++---
include/configs/corstone1000.h | 18 +++++
include/efi_loader.h | 4 +-
lib/efi_loader/efi_boottime.c | 47 +++++++++++
lib/efi_loader/efi_capsule.c | 137 ++++++++++++++++++++++++++++++++-
lib/efi_loader/efi_boottime.c | 47 ++++++++++++
lib/efi_loader/efi_capsule.c | 135 ++++++++++++++++++++++++++++++++-
lib/efi_loader/efi_setup.c | 15 ++++
7 files changed, 224 insertions(+), 16 deletions(-)
5 files changed, 215 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
index 97dfac9ae7..0ea3a19698 100644
--- a/arch/arm/dts/corstone1000.dtsi
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -26,9 +26,9 @@
};
};
- memory@80000000 {
+ memory@88200000 {
device_type = "memory";
- reg = <0x80000000 0x80000000>;
+ reg = <0x88200000 0x77e00000>;
};
gic: interrupt-controller@1c000000 {
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 48ec37f641..c5eb9af101 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -53,7 +53,8 @@ CONFIG_EFI_MM_COMM_TEE=y
CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
CONFIG_EFI_CAPSULE_ON_DISK=y
CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y
-CONFIG_EFI_CAPSULE_AUTHENTICATE=y
+# CONFIG_EFI_CAPSULE_AUTHENTICATE is not set
+CONFIG_EFI_HAVE_CAPSULE_SUPPORT=y
CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
CONFIG_EFI_SECURE_BOOT=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 7b644fb52b..ce50bd5cc9 100644
index afc9ccfc192b..a400cdef69d0 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -14,6 +14,24 @@
@@ -77,11 +43,11 @@ index 7b644fb52b..ce50bd5cc9 100644
+#define CORSTONE1000_SEPROXY_UPDATE_SVC_ID (0x4)
+
+/* Notification events used with SE Proxy update service */
+#define CORSTONE1000_BUFFER_READY_EVT (0x1)
+#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
+#define CORSTONE1000_BUFFER_READY_EVT (0x1)
+#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
+
+/* Size in 4KB pages of the EFI capsule buffer */
+#define CORSTONE1000_CAPSULE_BUFFER_SIZE (8192) /* 32 MB */
+#define CORSTONE1000_CAPSULE_BUFFER_SIZE (8192) /* 32 MB */
+
+/* Capsule GUID */
+#define EFI_CORSTONE1000_CAPSULE_ID_GUID \
@@ -91,35 +57,11 @@ index 7b644fb52b..ce50bd5cc9 100644
/* MM SP UUID binary data (little-endian format) */
#define MM_SP_UUID_DATA \
0xed, 0x32, 0xd5, 0x33, \
@@ -57,20 +75,14 @@
/* Physical Memory Map */
#define PHYS_SDRAM_1 (V2M_BASE)
-#define PHYS_SDRAM_2 (V2M_QSPI)
-
-/* Top 16MB reserved for secure world use (maybe not needed) */
-#define DRAM_SEC_SIZE 0x01000000
-#define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE
+#define PHYS_SDRAM_1_SIZE 0x80000000
-#define PHYS_SDRAM_2_SIZE 0x02000000
+/* Default load address for the source command */
+#define CONFIG_SYS_LOAD_ADDR (V2M_BASE + 0x10000000)
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (8 << 20))
-/* Miscellaneous configurable options */
-#define CONFIG_SYS_LOAD_ADDR (V2M_BASE + 0x10000000)
-
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
/* Monitor Command Prompt */
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 611aae64a9..ebee330c68 100644
index 1866439ab51e..529051c83206 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -950,11 +950,11 @@ extern const struct efi_firmware_management_protocol efi_fmp_fit;
@@ -957,11 +957,11 @@ extern const struct efi_firmware_management_protocol efi_fmp_fit;
extern const struct efi_firmware_management_protocol efi_fmp_raw;
/* Capsule update */
@@ -134,10 +76,10 @@ index 611aae64a9..ebee330c68 100644
efi_uintn_t capsule_count,
u64 *maximum_capsule_size,
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 6f5f32b903..8175177a1c 100644
index eaa43d784ef1..c3e67f791312 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2090,6 +2090,44 @@ static void efi_exit_caches(void)
@@ -2096,6 +2096,44 @@ static void efi_exit_caches(void)
#endif
}
@@ -182,7 +124,7 @@ index 6f5f32b903..8175177a1c 100644
/**
* efi_exit_boot_services() - stop all boot services
* @image_handle: handle of the loaded image
@@ -2195,6 +2233,15 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
@@ -2209,6 +2247,15 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
/* Recalculate CRC32 */
efi_update_table_header_crc32(&systab.hdr);
@@ -199,10 +141,10 @@ index 6f5f32b903..8175177a1c 100644
efi_set_watchdog(0);
WATCHDOG_RESET();
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index b75e4bcba1..f180555faf 100644
index 8301eed6317d..5a5936b03325 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -20,6 +20,14 @@
@@ -23,6 +23,14 @@
#include <crypto/pkcs7_parser.h>
#include <linux/err.h>
@@ -214,10 +156,10 @@ index b75e4bcba1..f180555faf 100644
+efi_guid_t corstone1000_capsule_guid = EFI_CORSTONE1000_CAPSULE_ID_GUID;
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
const efi_guid_t efi_guid_capsule_report = EFI_CAPSULE_REPORT_GUID;
static const efi_guid_t efi_guid_firmware_management_capsule_id =
EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID;
@@ -472,6 +480,89 @@ static efi_status_t efi_capsule_update_firmware(
@@ -508,6 +516,89 @@ static efi_status_t efi_capsule_update_firmware(
}
#endif /* CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT */
@@ -307,7 +249,7 @@ index b75e4bcba1..f180555faf 100644
/**
* efi_update_capsule() - process information from operating system
* @capsule_header_array: Array of virtual address pointers
@@ -485,7 +576,7 @@ static efi_status_t efi_capsule_update_firmware(
@@ -521,7 +612,7 @@ static efi_status_t efi_capsule_update_firmware(
*
* Return: status code
*/
@@ -316,7 +258,7 @@ index b75e4bcba1..f180555faf 100644
struct efi_capsule_header **capsule_header_array,
efi_uintn_t capsule_count,
u64 scatter_gather_list)
@@ -502,6 +593,13 @@ efi_status_t EFIAPI efi_update_capsule(
@@ -538,6 +629,13 @@ efi_status_t EFIAPI efi_update_capsule(
goto out;
}
@@ -330,13 +272,12 @@ index b75e4bcba1..f180555faf 100644
ret = EFI_SUCCESS;
for (i = 0, capsule = *capsule_header_array; i < capsule_count;
i++, capsule = *(++capsule_header_array)) {
@@ -514,6 +612,41 @@ efi_status_t EFIAPI efi_update_capsule(
@@ -550,6 +648,39 @@ efi_status_t EFIAPI efi_update_capsule(
log_debug("Capsule[%d] (guid:%pUl)\n",
i, &capsule->capsule_guid);
+
+#if CONFIG_IS_ENABLED(TARGET_CORSTONE1000)
+
+ if (guidcmp(&corstone1000_capsule_guid, &capsule->capsule_guid)) {
+ ret = EFI_INVALID_PARAMETER;
+ log_err("Corstone1000: Invalid capsule GUID\n");
@@ -366,13 +307,12 @@ index b75e4bcba1..f180555faf 100644
+ }
+
+ goto out;
+
+#endif
+
if (!guidcmp(&capsule->capsule_guid,
&efi_guid_firmware_management_capsule_id)) {
ret = efi_capsule_update_firmware(capsule);
@@ -552,7 +685,7 @@ out:
@@ -588,7 +719,7 @@ out:
*
* Return: status code
*/
@@ -382,7 +322,7 @@ index b75e4bcba1..f180555faf 100644
efi_uintn_t capsule_count,
u64 *maximum_capsule_size,
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index a2338d74af..9e3399a28c 100644
index 49172e357989..bac1873d77db 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -16,6 +16,13 @@
@@ -415,5 +355,5 @@ index a2338d74af..9e3399a28c 100644
ret = efi_set_variable_int(L"CapsuleMax",
&efi_guid_capsule_report,
--
2.17.1
2.35.1
@@ -1,30 +0,0 @@
From ae0e151a224ad01870be570d6e8587e3e1c6dde9 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 14 Sep 2021 10:46:49 +0100
Subject: [PATCH] arm: corstone1000: enable uefi secure boot
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
To make it possible to have a secure way to execute UEFI images
enable UEFI secure boot support and by inherit the
cryptographic functionalities.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
configs/corstone1000_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 46ce1780c4b4..fc3a9a21f7ae 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -42,6 +42,7 @@ CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
+CONFIG_EFI_SECURE_BOOT=y
CONFIG_DM_RTC=y
CONFIG_CMD_RTC=y
CONFIG_EFI_GET_TIME=y
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 313b89315d93ace166e2312a8e09aa85f1beb747 Mon Sep 17 00:00:00 2001
From caf37b5d45d43929de5c076b24b14a17682ce9e1 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Wed, 17 Nov 2021 15:28:06 +0000
Subject: [PATCH 06/10] corstone1000: Update FFA shared buffer address
Subject: [PATCH 12/27] corstone1000: Update FFA shared buffer address
FFA shared buffer address changed to 0x02000000.
@@ -16,23 +13,25 @@ Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
%% original patch: 0025-Update-FFA-shared-buffer-address.patch
%% original patch: 0025-Update-FFA-shared-buffer-address.patch
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/configs/corstone1000.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 7f8c61ba93..0451121b79 100644
index a400cdef69d0..db0f91335cef 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -42,7 +42,7 @@
#define FFA_SHARED_MM_BUFFER_SIZE SZ_4K /* 4 KB */
/* shared buffer physical address used for communication between u-boot and the MM SP */
-#define FFA_SHARED_MM_BUFFER_ADDR (0x023F8000)
+#define FFA_SHARED_MM_BUFFER_ADDR (0x02000000)
@@ -45,7 +45,7 @@
* shared buffer physical address used for communication between
* u-boot and the MM SP
*/
-#define FFA_SHARED_MM_BUFFER_ADDR (0x023F8000)
+#define FFA_SHARED_MM_BUFFER_ADDR (0x02000000)
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
#define CONFIG_SKIP_LOWLEVEL_INIT
--
2.17.1
2.35.1
@@ -1,45 +0,0 @@
From b1fba083c3bd3b7ee7a3ba7fcef8e9c2ac2e49af Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 14 Sep 2021 22:00:47 +0100
Subject: [PATCH] arm: corstone1000: enable handlers for uefi variables
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Enable the setenv/printenv -e option to handle uefi
variables and the efidebug command.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
configs/corstone1000_defconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index fc3a9a21f7ae..afa79bbf26cb 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -24,6 +24,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EDITENV is not set
# CONFIG_CMD_ENV_EXISTS is not set
+CONFIG_CMD_NVEDIT_EFI=y
# CONFIG_CMD_LOADS is not set
CONFIG_CMD_USB=y
# CONFIG_CMD_ITEST is not set
@@ -33,6 +34,7 @@ CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
+CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_FAT=y
CONFIG_OF_CONTROL=y
CONFIG_REGMAP=y
@@ -42,6 +44,7 @@ CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
+# CONFIG_HEXDUMP is not set
CONFIG_EFI_SECURE_BOOT=y
CONFIG_DM_RTC=y
CONFIG_CMD_RTC=y
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 5d53e40021d7fca594bb86307b0851a958047b6b Mon Sep 17 00:00:00 2001
From ba83ce7fae42ced6ec25108cd96dd31c534d2706 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Thu, 18 Nov 2021 16:42:59 +0000
Subject: [PATCH 08/10] corstone1000: Make sure shared buffer contents are not
Subject: [PATCH 13/27] corstone1000: Make sure shared buffer contents are not
cached
After updating the shared buffer, it is required to flush the cache
@@ -20,15 +17,25 @@ Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
%% original patch: 0027-Make-sure-shared-buffer-contents-are-not-cached.patch
%% original patch: 0027-Make-sure-shared-buffer-contents-are-not-cached.patch
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_variable_tee.c | 5 +++++
1 file changed, 5 insertions(+)
lib/efi_loader/efi_variable_tee.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index b363ec92bf..9375aa6a63 100644
index 97c41b69dd78..a32f119c8c2b 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -331,6 +331,11 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
@@ -22,6 +22,7 @@
#if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
#include <arm_ffa_helper.h>
+#include <cpu_func.h>
#include <mapmem.h>
/* MM return codes */
@@ -335,6 +336,11 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
virt_shared_buf = (void *)map_sysmem((phys_addr_t)FFA_SHARED_MM_BUFFER_ADDR, 0);
efi_memcpy_runtime(virt_shared_buf, comm_buf, tx_data_size);
@@ -41,5 +48,5 @@ index b363ec92bf..9375aa6a63 100644
ffa_ret = ffa_notify_mm_sp();
--
2.17.1
2.35.1
@@ -1,34 +0,0 @@
From 1ebe573020c9730f4a3f009328fc3d1f7f350b55 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 14 Sep 2021 22:07:15 +0100
Subject: [PATCH] arm: dipha: enable efi capsule options
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
Enable the set of efi capsule config options to enable the
variables.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
configs/corstone1000_defconfig | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index afa79bbf26cb..776e9c6f6223 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -45,6 +45,12 @@ CONFIG_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
# CONFIG_HEXDUMP is not set
+CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
+CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
CONFIG_EFI_SECURE_BOOT=y
CONFIG_DM_RTC=y
CONFIG_CMD_RTC=y
@@ -0,0 +1,30 @@
From 06956d4795504870bcb74c93d9cef27878d462e6 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Fri, 4 Mar 2022 15:56:09 +0000
Subject: [PATCH 14/27] arm: corstone1000: fix unrecognized filesystem type
Some usb sticks are not recognized by usb, just add a
delay before checking status.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
common/usb_storage.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index c9e2d7343ce2..ae72338323ba 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -769,6 +769,9 @@ static int usb_stor_BBB_transport(struct scsi_cmd *srb, struct us_data *us)
st:
retry = 0;
again:
+ if (srb->cmd[0] == SCSI_TST_U_RDY)
+ mdelay(100);
+
debug("STATUS phase\n");
result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,
&actlen, USB_CNTL_TIMEOUT*5);
--
2.35.1
@@ -1,64 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
From a3b3ff8fc2d4e52748989aa61f155fc92a63261a Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 22 Jun 2021 11:35:10 +0100
Subject: [PATCH 15/16] arm: dts: add initial devicetree corstone1000 mps3
Corstone1000 is a platform enabled on MPS3 FPGA Arm board. It is a cortex-a35
with with 8MB of CVM and 32MB of QSPI, with the peripherals USB,
ethernet and others available on the MPS3 board.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
arch/arm/dts/corstone1000-mps3.dts | 37 ++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 arch/arm/dts/corstone1000-mps3.dts
diff --git a/arch/arm/dts/corstone1000-mps3.dts b/arch/arm/dts/corstone1000-mps3.dts
new file mode 100644
index 0000000000..d93915dbb7
--- /dev/null
+++ b/arch/arm/dts/corstone1000-mps3.dts
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/dts-v1/;
+
+#include "corstone1000.dtsi"
+
+/ {
+ model = "corstone1000-mps3";
+
+ ethernet: eth@4010000 {
+ compatible = "smsc,lan9220", "smsc,lan9115";
+ reg = <0x40100000 0x10000>;
+ phy-mode = "mii";
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+ reg-io-width = <2>;
+ smsc,irq-push-pull;
+ };
+
+ usb: usb@40200000 {
+ compatible = "nxp,usb-isp1763";
+ reg = <0x40200000 0x100000>;
+ interrupts-parent = <&gic>;
+ interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+ bus-width = <16>;
+ dr_mode = "host";
+ };
+
+};
+
+&refclk {
+ clock-frequency = <50000000>;
+};
--
2.33.0
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 44e0b661c90d83b64b38023ebc27a836ae687b6a Mon Sep 17 00:00:00 2001
From e41722d9079dec5d0cd01884c5ac8855035e7ebb Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 10 Dec 2021 20:03:35 +0000
Subject: [PATCH 1/2] efi_capsule: corstone1000: pass interface id and buffer
Subject: [PATCH 15/27] efi_capsule: corstone1000: pass interface id and buffer
event id using register w4
Initially the interface/event IDs are passed to the SP using register
@@ -18,35 +15,34 @@ firmware update.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/configs/corstone1000.h | 8 ++++++++
include/configs/corstone1000.h | 6 ++++++
lib/efi_loader/efi_capsule.c | 11 +++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 31fc0cb29e..4a78e1a3c5 100644
index db0f91335cef..a7445e61348b 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -24,6 +24,14 @@
#define CORSTONE1000_BUFFER_READY_EVT (0x1)
#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
@@ -24,6 +24,12 @@
#define CORSTONE1000_BUFFER_READY_EVT (0x1)
#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
+#define PREP_SEPROXY_SVC_ID_MASK GENMASK(31, 16)
+#define PREP_SEPROXY_SVC_ID(x) \
+ (FIELD_PREP(PREP_SEPROXY_SVC_ID_MASK, (x)))
+#define PREP_SEPROXY_SVC_ID_MASK GENMASK(31, 16)
+#define PREP_SEPROXY_SVC_ID(x) (FIELD_PREP(PREP_SEPROXY_SVC_ID_MASK, (x)))
+
+#define PREP_SEPROXY_EVT_MASK GENMASK(15, 0)
+#define PREP_SEPROXY_EVT(x) \
+ (FIELD_PREP(PREP_SEPROXY_EVT_MASK, (x)))
+#define PREP_SEPROXY_EVT(x) (FIELD_PREP(PREP_SEPROXY_EVT_MASK, (x)))
+
/* Size in 4KB pages of the EFI capsule buffer */
#define CORSTONE1000_CAPSULE_BUFFER_SIZE (8192) /* 32 MB */
#define CORSTONE1000_CAPSULE_BUFFER_SIZE (8192) /* 32 MB */
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 089eba0fd0..6917bb4925 100644
index 5a5936b03325..598451f71b09 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -21,6 +21,8 @@
@@ -26,6 +26,8 @@
#ifdef CONFIG_TARGET_CORSTONE1000
#include <arm_ffa_helper.h>
#include <cpu_func.h>
@@ -55,7 +51,7 @@ index 089eba0fd0..6917bb4925 100644
void *__efi_runtime_data corstone1000_capsule_buf; /* capsule shared buffer virtual address */
efi_guid_t corstone1000_capsule_guid = EFI_CORSTONE1000_CAPSULE_ID_GUID;
@@ -495,11 +497,12 @@ static int __efi_runtime efi_corstone1000_buffer_ready_event(u32 capsule_image_s
@@ -586,11 +588,12 @@ static int __efi_runtime efi_corstone1000_buffer_ready_event(u32 capsule_image_s
func_data.data0 = &part_id;
/*
@@ -73,5 +69,5 @@ index 089eba0fd0..6917bb4925 100644
func_data.data1_size = sizeof(msg);
func_data.data1 = &msg;
--
2.17.1
2.35.1
@@ -1,34 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
From b5ec956659c3e419fd2e95431d9359db497e4afb Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Thu, 22 Jul 2021 18:11:33 +0100
Subject: [PATCH 16/16] arm: corstone1000: adding PSCI device tree node
At this level of development PSCI is needed to initialize the SMCCC.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
arch/arm/dts/corstone1000-mps3.dts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/dts/corstone1000-mps3.dts b/arch/arm/dts/corstone1000-mps3.dts
index d93915dbb7..a3726f1e1f 100644
--- a/arch/arm/dts/corstone1000-mps3.dts
+++ b/arch/arm/dts/corstone1000-mps3.dts
@@ -30,6 +30,11 @@
dr_mode = "host";
};
+ psci {
+ compatible = "arm,psci-1.0", "arm,psci-0.2";
+ method = "smc";
+ };
+
};
&refclk {
--
2.33.0
@@ -1,11 +1,8 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 51600b4385ddd45ce480bdb58769205072ddadf2 Mon Sep 17 00:00:00 2001
From d6de873b77cdb748b3bd0e4a5de7f82bcf1241df Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 10 Dec 2021 20:10:41 +0000
Subject: [PATCH 2/2] efi_boottime: corstone1000: pass interface id and kernel
event id using register w4
Subject: [PATCH 16/27] efi_boottime: corstone1000: pass interface id and
kernel event id using register w4
Initially the interface/event IDs are passed to the SP using register
w3 and w5.
@@ -18,15 +15,16 @@ secure enclave just before ExitbootService().
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_boottime.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index be49030717..17cc692064 100644
index c3e67f791312..6743ec6483b4 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -26,6 +26,11 @@
@@ -27,6 +27,11 @@
#include <arm_ffa_helper.h>
#endif
@@ -38,7 +36,7 @@ index be49030717..17cc692064 100644
DECLARE_GLOBAL_DATA_PTR;
/* Task priority level */
@@ -2114,10 +2119,12 @@ static int efi_corstone1000_kernel_started_event(void)
@@ -2121,10 +2126,12 @@ static int efi_corstone1000_kernel_started_event(void)
func_data.data0 = &part_id;
/*
@@ -55,5 +53,5 @@ index be49030717..17cc692064 100644
func_data.data1_size = sizeof(msg);
func_data.data1 = &msg;
--
2.17.1
2.35.1
@@ -1,32 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 3ee38ef07bd82c843497dc4e69a4d4c5f21dbbf7 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Tue, 26 Oct 2021 18:29:05 +0100
Subject: [PATCH] arm: corstone1000: amend kernel bootargs with ip=dhcp
earlyprintk
This change is to
* pass ip=dhcp required for ethernet to get and ip
* enable earlyprintk to print kernel logs before the actual
kernel driver comes up
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index cfe80cf5f4..7574553e83 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -8,7 +8,7 @@ CONFIG_IDENT_STRING=" corstone1000 aarch64 "
CONFIG_FIT=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9"
+CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9 ip=dhcp earlyprintk"
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_HUSH_PARSER=y
--
2.17.1
@@ -1,40 +1,26 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From b68c852e4334a4e8c2d0013714e70c69d2e56daa Mon Sep 17 00:00:00 2001
From 3b3e08c2960713f613dd5ef671b3fe468f351e3c Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Sat, 11 Dec 2021 22:19:42 +0000
Subject: [PATCH] efi_loader: corstone1000: remove guid check from corstone1000
config option
Date: Sat, 11 Dec 2021 13:23:55 +0000
Subject: [PATCH 17/27] efi_loader: corstone1000: remove guid check from
corstone1000 config option
Use generic fmp guid and no separte check is required for
CORSTONE1000 target.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_capsule.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
lib/efi_loader/efi_capsule.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index dcbbd1d635..eaa26f36c9 100644
index 598451f71b09..1475bef7030b 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -613,17 +613,18 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
continue;
}
+ if (guidcmp(&capsule->capsule_guid,
+ &efi_guid_firmware_management_capsule_id)) {
+ log_err("Unsupported capsule type: %pUl\n", &capsule->capsule_guid);
+ ret = EFI_UNSUPPORTED;
+ goto out;
+ }
+
log_debug("Capsule[%d] (guid:%pUl)\n",
@@ -653,12 +653,6 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
i, &capsule->capsule_guid);
#if CONFIG_IS_ENABLED(TARGET_CORSTONE1000)
- if (guidcmp(&corstone1000_capsule_guid, &capsule->capsule_guid)) {
- ret = EFI_INVALID_PARAMETER;
- log_err("Corstone1000: Invalid capsule GUID\n");
@@ -44,8 +30,8 @@ index dcbbd1d635..eaa26f36c9 100644
if (efi_size_in_pages(capsule->capsule_image_size) >
CORSTONE1000_CAPSULE_BUFFER_SIZE) {
log_err("Corstone1000: Capsule data size exceeds the shared buffer size\n");
@@ -650,15 +651,7 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
@@ -684,14 +678,7 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
goto out;
#endif
- if (!guidcmp(&capsule->capsule_guid,
@@ -56,11 +42,10 @@ index dcbbd1d635..eaa26f36c9 100644
- &capsule->capsule_guid);
- ret = EFI_UNSUPPORTED;
- }
-
+ ret = efi_capsule_update_firmware(capsule);
+ ret = efi_capsule_update_firmware(capsule);
if (ret != EFI_SUCCESS)
goto out;
}
--
2.17.1
2.35.1
@@ -1,11 +1,8 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 8907d857321de362ee545d3c86e39e9b49380c70 Mon Sep 17 00:00:00 2001
From 12522dd5d6146abbf49e917bbd1b2b67ae8f9b56 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Sat, 11 Dec 2021 21:05:10 +0000
Subject: [PATCH] arm_ffa: removing the cast when using binary OR on FIELD_PREP
macros
Subject: [PATCH 18/27] arm_ffa: removing the cast when using binary OR on
FIELD_PREP macros
When the GENMASK used is above 16-bits wide a u16 cast will cause
loss of data.
@@ -13,12 +10,13 @@ loss of data.
This commit fixes that.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
drivers/arm-ffa/arm_ffa_prv.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/arm-ffa/arm_ffa_prv.h b/drivers/arm-ffa/arm_ffa_prv.h
index 38ea4ba83e..d0db3ef508 100644
index 38ea4ba83efc..d0db3ef508a1 100644
--- a/drivers/arm-ffa/arm_ffa_prv.h
+++ b/drivers/arm-ffa/arm_ffa_prv.h
@@ -40,13 +40,13 @@
@@ -38,5 +36,5 @@ index 38ea4ba83e..d0db3ef508 100644
/* The FF-A SMC function prototype definition */
--
2.17.1
2.35.1
@@ -1,25 +1,23 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 048d07817e1508022dc9a623ae9410e8f142fd46 Mon Sep 17 00:00:00 2001
From 127588a2e1eef934a33d67b2eebd8ca4f9fd20a7 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Sun, 12 Dec 2021 17:51:17 +0000
Subject: [PATCH 1/3] Return proper error code when rx buffer is larger
Subject: [PATCH 19/27] Return proper error code when rx buffer is larger
ffa_mm_communicate should return EFI_BUFFER_TOO_SMALL when
the buffer received from the secure world is larger than the
comm buffer as this value is forwarded by mm_communicate.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_variable_tee.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 3ffc35ea1e..ec68994e0f 100644
index a32f119c8c2b..03cc379482f8 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -354,7 +354,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
@@ -358,7 +358,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
if (rx_data_size > comm_buf_size) {
unmap_sysmem(virt_shared_buf);
@@ -29,5 +27,5 @@ index 3ffc35ea1e..ec68994e0f 100644
efi_memcpy_runtime(comm_buf, virt_shared_buf, rx_data_size);
--
2.17.1
2.35.1
@@ -1,22 +1,20 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From d2ae8c021185ac1d067c5b78f21467bda4b7591b Mon Sep 17 00:00:00 2001
From 6a1d4ea19a4a46e43948fa753ed37c0bafda6356 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Mon, 13 Dec 2021 15:25:23 +0000
Subject: [PATCH] Use correct buffer size
Subject: [PATCH 20/27] Use correct buffer size
The comm buffer created has additional 4 bytes length which
needs to be trimmed. This change will reduce the size of the
comm buffer to what is expected.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/mm_communication.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mm_communication.h b/include/mm_communication.h
index e65fbde60d..bb99190956 100644
index e65fbde60d0a..bb9919095649 100644
--- a/include/mm_communication.h
+++ b/include/mm_communication.h
@@ -123,7 +123,7 @@ struct __packed efi_mm_communicate_header {
@@ -38,5 +36,5 @@ index e65fbde60d..bb99190956 100644
efi_uintn_t data_size;
efi_uintn_t name_size;
--
2.17.1
2.35.1
@@ -1,25 +1,23 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 7bd96f322f42ae577cd201465f618849605c1e85 Mon Sep 17 00:00:00 2001
From d220bf1805862c953d8adab799deaf7d0d3b2754 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Sun, 12 Dec 2021 17:58:08 +0000
Subject: [PATCH 3/3] Update comm_buf when EFI_BUFFER_TOO_SMALL
Subject: [PATCH 21/27] Update comm_buf when EFI_BUFFER_TOO_SMALL
When the received buffer is larger than the comm buffer,
the contents of the shared buffer which can fit in the
comm buffer should be read before returning.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_variable_tee.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 1d7a033e98..c948eed491 100644
index 03cc379482f8..fe3a5a7083fd 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -355,6 +355,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
@@ -357,6 +357,7 @@ static efi_status_t __efi_runtime ffa_mm_communicate(void *comm_buf, ulong comm_
sizeof(size_t);
if (rx_data_size > comm_buf_size) {
@@ -28,5 +26,5 @@ index 1d7a033e98..c948eed491 100644
return EFI_BUFFER_TOO_SMALL;
}
--
2.17.1
2.35.1
@@ -1,112 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 202f8d5783b8bcf1119574fd1b3a47ec6ff4f520 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Wed, 24 Nov 2021 21:07:44 +0000
Subject: [PATCH] arm_ffa: corstone1000: enable FF-A and MM support
This commit allows corstone1000 platform to perform
MM communication between u-boot and the secure world
using FF-A transport.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
arch/arm/dts/corstone1000-fvp.dts | 4 ++++
arch/arm/dts/corstone1000-mps3.dts | 4 ++++
arch/arm/dts/corstone1000.dtsi | 7 +++++++
configs/corstone1000_defconfig | 5 +++++
include/configs/corstone1000.h | 14 ++++++++++++++
5 files changed, 34 insertions(+)
diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
index 2188ca5e0e..92da15df4e 100644
--- a/arch/arm/dts/corstone1000-fvp.dts
+++ b/arch/arm/dts/corstone1000-fvp.dts
@@ -26,3 +26,7 @@
&refclk {
clock-frequency = <50000000>;
};
+
+&arm_ffa {
+ status = "okay";
+};
diff --git a/arch/arm/dts/corstone1000-mps3.dts b/arch/arm/dts/corstone1000-mps3.dts
index a3726f1e1f..6842395405 100644
--- a/arch/arm/dts/corstone1000-mps3.dts
+++ b/arch/arm/dts/corstone1000-mps3.dts
@@ -40,3 +40,7 @@
&refclk {
clock-frequency = <50000000>;
};
+
+&arm_ffa {
+ status = "okay";
+};
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
index da1725e01f..97dfac9ae7 100644
--- a/arch/arm/dts/corstone1000.dtsi
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -153,4 +153,11 @@
compatible = "arm,psci-1.0", "arm,psci-0.2";
method = "smc";
};
+
+ arm_ffa: arm_ffa {
+ compatible = "arm,ffa";
+ method = "smc";
+ status = "disabled";
+ };
+
};
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index dd85193c0f..48ec37f641 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -9,6 +9,7 @@ CONFIG_FIT=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyAMA0 loglevel=9 ip=dhcp earlyprintk"
+CONFIG_LOGLEVEL=7
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_HUSH_PARSER=y
@@ -44,6 +45,10 @@ CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_USB_ISP1760=y
CONFIG_USB_STORAGE=y
+CONFIG_ARM_FFA_TRANSPORT=y
+CONFIG_EFI_MM_COMM_TEE=y
+# CONFIG_OPTEE is not set
+# CONFIG_GENERATE_SMBIOS_TABLE is not set
# CONFIG_HEXDUMP is not set
CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
CONFIG_EFI_CAPSULE_ON_DISK=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 5e22e075ad..8014b2f688 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -12,6 +12,20 @@
#ifndef __CORSTONE1000_H
#define __CORSTONE1000_H
+#include <linux/sizes.h>
+
+/* MM SP UUID binary data (little-endian format) */
+#define MM_SP_UUID_DATA \
+ 0xed, 0x32, 0xd5, 0x33, \
+ 0x99, 0xe6, 0x42, 0x09, \
+ 0x9c, 0xc0, 0x2d, 0x72, \
+ 0xcd, 0xd9, 0x98, 0xa7
+
+#define FFA_SHARED_MM_BUFFER_SIZE SZ_4K /* 4 KB */
+
+/* shared buffer physical address used for communication between u-boot and the MM SP */
+#define FFA_SHARED_MM_BUFFER_ADDR (0x023F8000)
+
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f00000)
#define CONFIG_SKIP_LOWLEVEL_INIT
--
2.17.1
@@ -1,25 +1,23 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From b9126620d74aed1a0ddd286e4c70344626dd72c3 Mon Sep 17 00:00:00 2001
From 00192c17937fabc7b15191325b66b0616e2a4b77 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 17 Dec 2021 19:49:02 +0000
Subject: [PATCH 2/3] efi_loader: populate ESRT table if EFI_ESRT config option
is set
Subject: [PATCH 22/27] efi_loader: populate ESRT table if EFI_ESRT config
option is set
This change is to call efi_esrt_populate function if CONFIG_EFI_ESRT
is set. This will populte esrt table with firmware image info
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_capsule.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index ec89865c98..00b3b21105 100644
index 1475bef7030b..9ffc46375341 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -591,6 +591,13 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
@@ -675,6 +675,13 @@ efi_status_t __efi_runtime EFIAPI efi_update_capsule(
ret = EFI_SUCCESS;
}
@@ -31,8 +29,8 @@ index ec89865c98..00b3b21105 100644
+ }
+
goto out;
#endif
--
2.25.1
2.35.1
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 6a3f1d425321545869f00295d9173e3a3519a6c6 Mon Sep 17 00:00:00 2001
From 87aa9028bc939ed5924f72cd61835b8737790d41 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 17 Dec 2021 19:50:25 +0000
Subject: [PATCH] efi_firmware: add get_image_info for corstone1000
Subject: [PATCH 23/27] efi_firmware: add get_image_info for corstone1000
This change is to populate get_image_info which eventually
will be populated in ESRT table
@@ -13,8 +10,13 @@ Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
%% original patch: 0047-efi_firmware-add-get_image_info-for-corstone1000.patch
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_firmware.c | 64 ++++++++++++++++++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index a1b88dbfc2..85fb5254eb 100644
index a1b88dbfc286..85fb5254ebd5 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -238,6 +238,7 @@ const efi_guid_t efi_firmware_image_type_uboot_fit =
@@ -115,5 +117,5 @@ index a1b88dbfc2..85fb5254eb 100644
NULL, NULL))
return EFI_EXIT(EFI_DEVICE_ERROR);
--
2.17.1
2.35.1
@@ -1,24 +1,23 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 152ff06c983b7b1a685d82bc229efdd6260d9a12 Mon Sep 17 00:00:00 2001
From bcf3c59b1a73c7291d1acdbb23a36341020db32a Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Fri, 24 Dec 2021 14:22:52 +0000
Subject: [PATCH] Comment mm_communicate failure log
Subject: [PATCH 24/27] Comment mm_communicate failure log
When a getVariable() call is made with data size set to 0,
mm_communicate should return EFI_BUFFER_TOO_SMALL. This is
an expected behavior. There should not be any failure logs
in this case. So the error log is commented here.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_variable_tee.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index b466702983..fc4d684669 100644
index fe3a5a7083fd..8e2496a840a4 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -407,7 +407,10 @@ static efi_status_t __efi_runtime mm_communicate(u8 *comm_buf, efi_uintn_t dsize
@@ -411,7 +411,10 @@ static efi_status_t __efi_runtime mm_communicate(u8 *comm_buf, efi_uintn_t dsize
ret = ffa_mm_communicate(comm_buf, dsize);
#endif
if (ret != EFI_SUCCESS) {
@@ -31,5 +30,5 @@ index b466702983..fc4d684669 100644
}
--
2.17.1
2.35.1
@@ -1,34 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 1617ecbbf163c921468fee224c92a8f79b43e2fb Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Thu, 11 Nov 2021 16:34:54 +0000
Subject: [PATCH 7/7] corstone1000: adjust the environment and heap sizes
env size set to 64 KB
heap size 64 KB + 32 MB
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
include/configs/corstone1000.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 7f8a8ee254..7d63dd4ad9 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -75,8 +75,9 @@
/* Default load address for the source command */
#define CONFIG_SYS_LOAD_ADDR (V2M_BASE + 0x10000000)
+#define CONFIG_ENV_SECT_SIZE SZ_64K
/* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (8 << 20))
+#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SECT_SIZE + SZ_32M)
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
--
2.17.1
@@ -1,10 +1,7 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From b315c9e23e38341cd105802e85f606b64e0f0449 Mon Sep 17 00:00:00 2001
From 69bded9c0eddae50a9346a316c359f75057bd5c3 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Wed, 5 Jan 2022 17:56:09 +0000
Subject: [PATCH] efi_loader: send bootcomplete message to secure enclave
Subject: [PATCH 25/27] efi_loader: send bootcomplete message to secure enclave
On corstone1000 platform, Secure Enclave will be expecting
an event from uboot when it performs capsule update. Previously,
@@ -13,24 +10,32 @@ when user wants to interrupt at UEFI shell, hence, it is required
to send an uboot efi initialized event at efi sub-system initialization
stage.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
include/configs/corstone1000.h | 2 +-
lib/efi_loader/efi_boottime.c | 49 ----------------------------------
lib/efi_loader/efi_firmware.c | 2 +-
lib/efi_loader/efi_setup.c | 48 +++++++++++++++++++++++++++++++++
4 files changed, 50 insertions(+), 51 deletions(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 4a78e1a3c5..c4a1146b52 100644
index a7445e61348b..06b605e43bdf 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -22,7 +22,7 @@
/* Notification events used with SE Proxy update service */
#define CORSTONE1000_BUFFER_READY_EVT (0x1)
-#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
#define CORSTONE1000_BUFFER_READY_EVT (0x1)
-#define CORSTONE1000_KERNEL_STARTED_EVT (0x2)
+#define CORSTONE1000_UBOOT_EFI_STARTED_EVT (0x2)
#define PREP_SEPROXY_SVC_ID_MASK GENMASK(31, 16)
#define PREP_SEPROXY_SVC_ID(x) \
#define PREP_SEPROXY_SVC_ID_MASK GENMASK(31, 16)
#define PREP_SEPROXY_SVC_ID(x) (FIELD_PREP(PREP_SEPROXY_SVC_ID_MASK, (x)))
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 17cc692064..154b69e514 100644
index 6743ec6483b4..28185c0d7750 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2094,46 +2094,6 @@ static void efi_exit_caches(void)
@@ -2101,46 +2101,6 @@ static void efi_exit_caches(void)
#endif
}
@@ -77,7 +82,7 @@ index 17cc692064..154b69e514 100644
/**
* efi_exit_boot_services() - stop all boot services
* @image_handle: handle of the loaded image
@@ -2239,15 +2199,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
@@ -2254,15 +2214,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
/* Recalculate CRC32 */
efi_update_table_header_crc32(&systab.hdr);
@@ -94,7 +99,7 @@ index 17cc692064..154b69e514 100644
efi_set_watchdog(0);
WATCHDOG_RESET();
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index 85fb5254eb..a7f7598eab 100644
index 85fb5254ebd5..a7f7598eab02 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -353,7 +353,7 @@ static efi_status_t efi_corstone1000_img_info_get (
@@ -107,7 +112,7 @@ index 85fb5254eb..a7f7598eab 100644
}
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 9e3399a28c..25524fafe4 100644
index bac1873d77db..d55992715c67 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -17,6 +17,9 @@
@@ -182,5 +187,5 @@ index 9e3399a28c..25524fafe4 100644
if (ret != EFI_SUCCESS) {
printf("EFI: Corstone-1000: cannot allocate caspsule shared buffer\n");
--
2.17.1
2.35.1
@@ -1,58 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 524c865ae37f9cb9278988120e508c5314c2cd73 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Wed, 17 Nov 2021 15:28:53 +0000
Subject: [PATCH 07/10] corstone1000: Disable set/get of NV variables
This is a temporary change which uses only the volatile memory
for get and set variable calls.
The non volatile storage access is via openAmp in se proxy which is still not
integrated to the system. So when an efi_set_variable_int() call is made for
NV variables, mm_commmunicate results in failure. This change will direct
PlatformLang and OsIndications to volatile memory which would be a
temporary solution.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
%% original patch: 0026-Disable-set-get-of-NV-variables.patch
%% original patch: 0026-Disable-set-get-of-NV-variables.patch
---
lib/efi_loader/efi_setup.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 9e3399a28c..fcf2eae9cd 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -83,7 +83,11 @@ static efi_status_t efi_init_platform_lang(void)
ret = efi_set_variable_int(L"PlatformLang",
&efi_global_variable_guid,
- EFI_VARIABLE_NON_VOLATILE |
+ /*
+ * This is a temporary change until NV memory is accessible
+ * through OpenAmp.
+ */
+ //EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
1 + strlen(lang), lang, false);
@@ -210,7 +214,11 @@ static efi_status_t efi_clear_os_indications(void)
os_indications &=
~EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED;
ret = efi_set_variable_int(L"OsIndications", &efi_global_variable_guid,
- EFI_VARIABLE_NON_VOLATILE |
+ /*
+ * This is a temporary change until NV memory is accessible
+ * through OpenAmp.
+ */
+ //EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(os_indications), &os_indications,
--
2.17.1
@@ -1,10 +1,8 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From f4d3fcdd4ba747a0fd6875f9626c06ad01b889c7 Mon Sep 17 00:00:00 2001
From c1b959c9a3a4f09bbe69d088211bd0ecd0d0a071 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 14 Jan 2022 15:24:18 +0000
Subject: [PATCH] efi_loader: fix null pointer exception with get_image_info
Subject: [PATCH 26/27] efi_loader: fix null pointer exception with
get_image_info
get_img_info API implemented for corstone1000 target does not
check the input attributes and as a result uboot crash's with
@@ -12,9 +10,13 @@ null pointer access. This change is to fix the null pointer
exception.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
lib/efi_loader/efi_firmware.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index a7f7598eab..d5f4788c8f 100644
index a7f7598eab02..d5f4788c8fdb 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -344,26 +344,29 @@ static efi_status_t efi_corstone1000_img_info_get (
@@ -56,5 +58,5 @@ index a7f7598eab..d5f4788c8f 100644
IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED;
image_info[i].attributes_setting = IMAGE_ATTRIBUTE_IMAGE_UPDATABLE;
--
2.17.1
2.35.1
@@ -0,0 +1,148 @@
From fcae21d3dc049dd5a54e7515085b04ac1f887486 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Tue, 5 Apr 2022 10:24:38 +0100
Subject: [PATCH 27/27] arm:corstone1000: add mmc for fvp
Enable support mmc/sdcard for the corstone1000 FVP.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
arch/arm/dts/corstone1000-fvp.dts | 28 +++++++++++++++
board/armltd/corstone1000/corstone1000.c | 46 ++++++++++++++++--------
configs/corstone1000_defconfig | 8 ++++-
include/configs/corstone1000.h | 4 ++-
4 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
index 1fcc137a493c..26b0f1b3cea6 100644
--- a/arch/arm/dts/corstone1000-fvp.dts
+++ b/arch/arm/dts/corstone1000-fvp.dts
@@ -20,4 +20,32 @@
interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
reg-io-width = <2>;
};
+
+ vmmc_v3_3d: fixed_v3_3d {
+ compatible = "regulator-fixed";
+ regulator-name = "vmmc_supply";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ sdmmc0: mmc@40300000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ reg = <0x40300000 0x1000>;
+ interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+ max-frequency = <12000000>;
+ vmmc-supply = <&vmmc_v3_3d>;
+ clocks = <&smbclk>, <&refclk100mhz>;
+ clock-names = "smclk", "apb_pclk";
+ };
+
+ sdmmc1: mmc@50000000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ reg = <0x50000000 0x10000>;
+ interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+ max-frequency = <12000000>;
+ vmmc-supply = <&vmmc_v3_3d>;
+ clocks = <&smbclk>, <&refclk100mhz>;
+ clock-names = "smclk", "apb_pclk";
+ };
};
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
index eff1739f0b02..936a6c9f8b89 100644
--- a/board/armltd/corstone1000/corstone1000.c
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -46,22 +46,38 @@ static struct mm_region corstone1000_mem_map[] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
PTE_BLOCK_PXN | PTE_BLOCK_UXN
- }, {
- /* USB */
- .virt = 0x40200000UL,
- .phys = 0x40200000UL,
- .size = 0x00100000UL,
- .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
- PTE_BLOCK_NON_SHARE |
- PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
- /* ethernet */
- .virt = 0x40100000UL,
- .phys = 0x40100000UL,
- .size = 0x00100000UL,
- .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
- PTE_BLOCK_NON_SHARE |
- PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ /* USB */
+ .virt = 0x40200000UL,
+ .phys = 0x40200000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* MMC0 */
+ .virt = 0x40300000UL,
+ .phys = 0x40300000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* ethernet */
+ .virt = 0x40100000UL,
+ .phys = 0x40100000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* MMC1 */
+ .virt = 0x50000000UL,
+ .phys = 0x50000000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
/* OCVM */
.virt = 0x80000000UL,
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index b042d4e49419..147c14c94865 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -38,7 +38,13 @@ CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_FAT=y
CONFIG_OF_CONTROL=y
CONFIG_REGMAP=y
-# CONFIG_MMC is not set
+CONFIG_CLK=y
+CONFIG_CMD_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_ARM_PL180_MMCI=y
+CONFIG_MMC_SDHCI_ADMA_HELPERS=y
+CONFIG_MMC_WRITE=y
+CONFIG_DM_GPIO=y
CONFIG_DM_SERIAL=y
CONFIG_USB=y
CONFIG_DM_USB=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 06b605e43bdf..d9855bf91ebf 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -95,7 +95,9 @@
#define CONFIG_SYS_MAXARGS 64 /* max command args */
#define BOOT_TARGET_DEVICES(func) \
- func(USB, usb, 0)
+ func(USB, usb, 0) \
+ func(MMC, mmc, 0) \
+ func(MMC, mmc, 1)
#include <config_distro_bootcmd.h>
--
2.35.1
@@ -1,96 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Harry Moulton <harry.moulton@arm.com>
From 224d5d7ca9359a1c383ee417d934d2a6dfca53df Mon Sep 17 00:00:00 2001
From: Harry Moulton <harmou01@e123741.cambridge.arm.com>
Date: Mon, 29 Nov 2021 13:13:17 +0000
Subject: [PATCH] arm: corstone1000: fix unrecognized filesystem type
error.
Fix the 'unrecognized filesystem type' error when attempting to boot
from an EFI image on attached USB formated as GPT.
Signed-off-by: Harry Moulton <harry.moulton@arm.com>
---
common/usb_storage.c | 3 +++
configs/corstone1000_defconfig | 3 ++-
drivers/usb/isp1760/isp1760-uboot.c | 12 ++++++++++++
include/configs/corstone1000.h | 1 +
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 946c6b2b32..77b8b55010 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -769,6 +769,9 @@ static int usb_stor_BBB_transport(struct scsi_cmd *srb, struct us_data *us)
st:
retry = 0;
again:
+ if (srb->cmd[0] == SCSI_TST_U_RDY)
+ mdelay(100);
+
debug("STATUS phase\n");
result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,
&actlen, USB_CNTL_TIMEOUT*5);
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index c5eb9af101..fe77bdc63f 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_BOOTM=y
CONFIG_CMD_LOADM=y
CONFIG_CMD_BOOTEFI=y
CONFIG_EFI_LOADER=y
+CONFIG_EFI_PARTITION=y
CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
CONFIG_CMD_BOOTEFI_HELLO=y
# CONFIG_CMD_XIMG is not set
@@ -52,7 +53,7 @@ CONFIG_EFI_MM_COMM_TEE=y
# CONFIG_HEXDUMP is not set
CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
CONFIG_EFI_CAPSULE_ON_DISK=y
-CONFIG_EFI_CAPSULE_ON_DISK_EARLY=y
+# CONFIG_EFI_CAPSULE_ON_DISK_EARLY is not set
# CONFIG_EFI_CAPSULE_AUTHENTICATE is not set
CONFIG_EFI_HAVE_CAPSULE_SUPPORT=y
CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
diff --git a/drivers/usb/isp1760/isp1760-uboot.c b/drivers/usb/isp1760/isp1760-uboot.c
index 9f2eaa75f3..cb03bc5d8c 100644
--- a/drivers/usb/isp1760/isp1760-uboot.c
+++ b/drivers/usb/isp1760/isp1760-uboot.c
@@ -56,9 +56,21 @@ static int isp1760_msg_submit_irq(struct udevice *dev, struct usb_device *udev,
pipe, buffer, length, interval);
}
+static int isp1760_get_max_xfer_size(struct udevice *dev, size_t *size)
+{
+ struct isp1760_host_data *host = dev_get_priv(dev);
+ struct isp1760_hcd *priv = host->hcd.hcd_priv;
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
+
+ *size = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
+
+ return 0;
+}
+
struct dm_usb_ops isp1760_usb_ops = {
.control = isp1760_msg_submit_control,
.bulk = isp1760_msg_submit_bulk,
.interrupt = isp1760_msg_submit_irq,
+ .get_max_xfer_size = isp1760_get_max_xfer_size,
};
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 87682406d6..4c7993649d 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -91,6 +91,7 @@
#define CONFIG_SYS_MAXARGS 64 /* max command args */
#define CONFIG_EXTRA_ENV_SETTINGS \
+ "usb_pgood_delay=250\0" \
"fdt_addr_r=0x82000000\0" \
"kernel_addr=0x08330000\0" \
"kernel_addr_r=0x82100000\0" \
--
2.17.1
@@ -1,27 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
From 8b85cddde48f31266349277980a65d25dfae302e Mon Sep 17 00:00:00 2001
From: Emekcan Aras <Emekcan.Aras@arm.com>
Date: Wed, 17 Nov 2021 18:48:35 +0000
Subject: [PATCH] corstone1000: set CONFIG_PSCI_RESET
set CONFIG_PSCI_RESET to allow efi_reset_system API to use PSCI.
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
---
configs/corstone1000_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index b59b75df3e..55f93b0a2c 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -64,3 +64,5 @@ CONFIG_CMD_RTC=y
CONFIG_EFI_GET_TIME=y
CONFIG_EFI_SET_TIME=y
CONFIG_RTC_EMULATION=y
+CONFIG_PSCI_RESET=y
+
--
2.25.1
@@ -1,64 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
From e51542907203c46bdbbd78aa1c76058204fd75f1 Mon Sep 17 00:00:00 2001
From: Emekcan Aras <Emekcan.Aras@arm.com>
Date: Thu, 25 Nov 2021 16:54:57 +0000
Subject: [PATCH] arm-bsp/u-boot: corstone1000: Implement autoboot
storage device selection
This commit implements distro_bootcmd in config_bootcommand in u-boot.
This command traverses all the USB devices connected to the board and
finds a usb device that has bootable image to boot from it. If it cannot
find a usb device with the bootable image, it will boot the system using
the existing flash.
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
---
configs/corstone1000_defconfig | 2 +-
include/configs/corstone1000.h | 15 ++++++++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 10b7c3ea18..0b9ead461b 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -66,4 +66,4 @@ CONFIG_EFI_GET_TIME=y
CONFIG_EFI_SET_TIME=y
CONFIG_RTC_EMULATION=y
CONFIG_PSCI_RESET=y
-
+CONFIG_DISTRO_DEFAULTS=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index b0932f9f33..d029059a81 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -85,15 +85,20 @@
#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
#define CONFIG_SYS_MAXARGS 64 /* max command args */
-#define CONFIG_EXTRA_ENV_SETTINGS \
+#define BOOT_TARGET_DEVICES(func) \
+ func(USB, usb, 0)
+#include <config_distro_bootcmd.h>
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ BOOTENV \
"usb_pgood_delay=250\0" \
"fdt_addr_r=0x82000000\0" \
"kernel_addr=0x08330000\0" \
- "kernel_addr_r=0x82100000\0" \
+ "kernel_addr_r=0x88200000\0" \
"fdt_high=0xffffffff\0"
-
-#define CONFIG_BOOTCOMMAND \
- "echo Loading Kernel to memory ... ;" \
+#define CONFIG_BOOTCOMMAND \
+ "echo Loading Kernel to memory ... ;" \
"loadm $kernel_addr $kernel_addr_r 0xc00000;" \
+ "usb start; usb reset;" \
+ "run distro_bootcmd;" \
"bootefi $kernel_addr_r $fdtcontroladdr;"
#endif
--
2.25.1
@@ -1,47 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
From 1e76c4b70c8539c56b4b9ae6b8fd415d811a1812 Mon Sep 17 00:00:00 2001
From: Satish Kumar <satish.kumar01@arm.com>
Date: Wed, 1 Dec 2021 19:04:59 +0000
Subject: [PATCH] corstone1000: change base address of kernel in the flash
More space in the flash is reserved up front for metadata
parser and UEFI variables. That requires change in the flash
base address of where images are present.
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
---
include/configs/corstone1000.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index bb3b099806..baa0720fb5 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -94,16 +94,16 @@
func(USB, usb, 0)
#include <config_distro_bootcmd.h>
#define CONFIG_EXTRA_ENV_SETTINGS \
- BOOTENV \
- "usb_pgood_delay=250\0" \
+ BOOTENV \
+ "usb_pgood_delay=250\0" \
"fdt_addr_r=0x82000000\0" \
- "kernel_addr=0x08330000\0" \
+ "kernel_addr=0x083EE000\0" \
"kernel_addr_r=0x88200000\0" \
"fdt_high=0xffffffff\0"
-#define CONFIG_BOOTCOMMAND \
+#define CONFIG_BOOTCOMMAND \
"echo Loading Kernel to memory ... ;" \
"loadm $kernel_addr $kernel_addr_r 0xc00000;" \
- "usb start; usb reset;" \
- "run distro_bootcmd;" \
+ "usb start; usb reset;" \
+ "run distro_bootcmd;" \
"bootefi $kernel_addr_r $fdtcontroladdr;"
#endif
--
2.17.1
@@ -1,66 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
From abc455d29aa9c983c6af2fa75870a7ee95da2496 Mon Sep 17 00:00:00 2001
From: Satish Kumar <satish.kumar01@arm.com>
Date: Wed, 1 Dec 2021 19:17:57 +0000
Subject: [PATCH] arm: corstone1000: identify which bank to load kernel from
Secure enclave, based on the firmware update state of the
system, decides the boot bank. In this commit, u-boot
identifies the selected boot bank and loads the kernel
from it.
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
---
configs/corstone1000_defconfig | 2 +-
include/configs/corstone1000.h | 18 ++++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 0b9ead461b..3c00e13ceb 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -29,7 +29,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
CONFIG_CMD_NVEDIT_EFI=y
# CONFIG_CMD_LOADS is not set
CONFIG_CMD_USB=y
-# CONFIG_CMD_ITEST is not set
+CONFIG_CMD_ITEST=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_DHCP=y
# CONFIG_CMD_NFS is not set
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index baa0720fb5..7c6f66c891 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -97,12 +97,22 @@
BOOTENV \
"usb_pgood_delay=250\0" \
"fdt_addr_r=0x82000000\0" \
- "kernel_addr=0x083EE000\0" \
- "kernel_addr_r=0x88200000\0" \
+ "boot_bank_flag=0x08002000\0" \
+ "kernel_addr_bank_0=0x083EE000\0" \
+ "kernel_addr_bank_1=0x0936E000\0" \
+ "retrieve_kernel_load_addr=" \
+ "if itest.l *${boot_bank_flag} == 0; then " \
+ "setenv kernel_addr $kernel_addr_bank_0;" \
+ "else " \
+ "setenv kernel_addr $kernel_addr_bank_1;" \
+ "fi;" \
+ "\0" \
+ "kernel_addr_r=0x88200000\0" \
"fdt_high=0xffffffff\0"
#define CONFIG_BOOTCOMMAND \
- "echo Loading Kernel to memory ... ;" \
- "loadm $kernel_addr $kernel_addr_r 0xc00000;" \
+ "run retrieve_kernel_load_addr;" \
+ "echo Loading kernel from $kernel_addr to memory ... ;" \
+ "loadm $kernel_addr $kernel_addr_r 0xc00000;" \
"usb start; usb reset;" \
"run distro_bootcmd;" \
"bootefi $kernel_addr_r $fdtcontroladdr;"
--
2.17.1
@@ -1,33 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From d26f38e9b677ddbfa4e92e250058630ecd275908 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Mon, 6 Dec 2021 14:46:06 +0000
Subject: [PATCH] corstone1000: dts: setting the boot console output
Setting stdout-path in the chosen node.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
arch/arm/dts/corstone1000.dtsi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/corstone1000.dtsi b/arch/arm/dts/corstone1000.dtsi
index 0ea3a19698..88fb1576b9 100644
--- a/arch/arm/dts/corstone1000.dtsi
+++ b/arch/arm/dts/corstone1000.dtsi
@@ -12,7 +12,9 @@
#address-cells = <1>;
#size-cells = <1>;
- chosen { };
+ chosen {
+ stdout-path = "/uart@1a510000:115200n8";
+ };
cpus {
#address-cells = <1>;
--
2.17.1
@@ -1,34 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 871521cf90dabb1634af4e47cdf198f979f1907d Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Mon, 6 Dec 2021 15:53:56 +0000
Subject: [PATCH] corstone1000: dts: remove the use of fdt_addr_r
The device tree is embedded in the u-boot binary
and located at the end of the DDR. Its address
is specified in fdtcontroladdr environment variable.
No need to use fdt_addr_r anymore.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
include/configs/corstone1000.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index 7c6f66c891..31fc0cb29e 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -96,7 +96,6 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
"usb_pgood_delay=250\0" \
- "fdt_addr_r=0x82000000\0" \
"boot_bank_flag=0x08002000\0" \
"kernel_addr_bank_0=0x083EE000\0" \
"kernel_addr_bank_1=0x0936E000\0" \
--
2.17.1
@@ -1,32 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
From 42676bed67b8f0b87e7b3bc1a7f43afc6f7ba505 Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Sat, 11 Dec 2021 21:18:59 +0000
Subject: [PATCH] efi_loader: add the header file for invalidate_dcache_all
function
The invalidate_dcache_all function has been implicitly declared.
This commit fixes that.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
lib/efi_loader/efi_variable_tee.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index b7de80cd39..bebe2325b8 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -22,6 +22,7 @@
#if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT))
#include <arm_ffa_helper.h>
+#include <cpu_func.h>
#include <mapmem.h>
/* MM return codes */
--
2.17.1
@@ -1,31 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From e6b420ce5d56fcc08aac2812ee5402686fa56fae Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Thu, 16 Dec 2021 17:25:29 +0000
Subject: [PATCH] Disable DHCP, PING config parameters
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
configs/corstone1000_defconfig | 2 --
1 file changed, 2 deletions(-)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 3c00e13ceb..e11ffbfc89 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -31,10 +31,8 @@ CONFIG_CMD_NVEDIT_EFI=y
CONFIG_CMD_USB=y
CONFIG_CMD_ITEST=y
# CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_DHCP=y
# CONFIG_CMD_NFS is not set
CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_FAT=y
--
2.17.1
@@ -1,48 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
From 2a8d1b3fb89ae68d126e16f8346405df8fcc3ed6 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Thu, 16 Dec 2021 19:36:18 +0000
Subject: [PATCH] Revert "corstone1000: Disable set/get of NV variables"
This reverts commit 5c77e9883ea29472c353d63c66a7f8ffd6ea367f.
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
---
lib/efi_loader/efi_setup.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index fcf2eae9cd..9e3399a28c 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -83,11 +83,7 @@ static efi_status_t efi_init_platform_lang(void)
ret = efi_set_variable_int(L"PlatformLang",
&efi_global_variable_guid,
- /*
- * This is a temporary change until NV memory is accessible
- * through OpenAmp.
- */
- //EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
1 + strlen(lang), lang, false);
@@ -214,11 +210,7 @@ static efi_status_t efi_clear_os_indications(void)
os_indications &=
~EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED;
ret = efi_set_variable_int(L"OsIndications", &efi_global_variable_guid,
- /*
- * This is a temporary change until NV memory is accessible
- * through OpenAmp.
- */
- //EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
sizeof(os_indications), &os_indications,
--
2.17.1
@@ -1,31 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 4820222f24901fbed8e0a87487603c0e06dfff5a Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 17 Dec 2021 19:46:52 +0000
Subject: [PATCH 1/3] corstone1000/defconfig: enable CAPSULE_FIRMWARE_RAW
config option
This change is to enable CAPSULE_FIRMWARE_RAW config option as
we use RAW image on corstone1000 target. Also, disable
CONFIG_EFI_CAPSULE_FIRMWARE_FIT
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
---
configs/corstone1000_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index e11ffbfc89..d576ee1b67 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -65,3 +65,5 @@ CONFIG_EFI_SET_TIME=y
CONFIG_RTC_EMULATION=y
CONFIG_PSCI_RESET=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+# CONFIG_EFI_CAPSULE_FIRMWARE_FIT is not set
--
2.25.1
@@ -1,83 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 0f90466c2d435534ea19669515c6e0af389d430b Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Wed, 22 Dec 2021 11:31:28 +0000
Subject: [PATCH] corstone1000: enable ethernet device
This change is to enable ethernet device (SMC911x) and few
other config options which are required by EDK-2 conformance test
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
index a51f5ddfa0..113a8238c7 100644
--- a/board/armltd/corstone1000/corstone1000.c
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -54,6 +54,14 @@ static struct mm_region corstone1000_mem_map[] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* ethernet */
+ .virt = 0x40100000UL,
+ .phys = 0x40100000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
/* OCVM */
.virt = 0x80000000UL,
@@ -95,6 +103,23 @@ int dram_init_banksize(void)
return 0;
}
+/*
+ * Board specific ethernet initialization routine.
+ * */
+int board_eth_init(struct bd_info *bis)
+{
+ int rc = 0;
+#ifndef CONFIG_DM_ETH
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+#ifdef CONFIG_SMC911X
+ rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+#endif
+ return rc;
+}
+
void reset_cpu(ulong addr)
{
}
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index d576ee1b67..45904ec98d 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -67,3 +67,19 @@ CONFIG_PSCI_RESET=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
# CONFIG_EFI_CAPSULE_FIRMWARE_FIT is not set
+CONFIG_CMD_DHCP=y
+CONFIG_SMC911X=y
+CONFIG_SMC911X_BASE=0x40100000
+CONFIG_DM_ETH=y
+CONFIG_PHY_SMSC=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_GETTIME=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_PHYLIB=y
+CONFIG_PHY=y
+CONFIG_RAM=y
+CONFIG_ERRNO_STR=y
+CONFIG_CMD_EDITENV=y
+CONFIG_MISC=y
--
2.25.1
@@ -1,137 +0,0 @@
Upstream-Status: Backport [ebdea88d57d5e67b8f6e6cf615300eedbc7200a9]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From 2b41b8308f5389a40df07ea263501fecfcde2962 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Thu, 23 Dec 2021 11:47:13 +0000
Subject: [PATCH] efi_loader: Fix loaded image alignment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We are ignoring the alignment communicated via the PE/COFF header.
Starting 5.10 the Linux kernel will loudly complain about it. For more
details look at [1] (in linux kernel).
So add a function that can allocate aligned EFI memory and use it for
our
relocated loaded image.
[1] c32ac11da3f83 ("efi/libstub: arm64: Double check image alignment at
entry")
Signed-off-by: Ilias Apalodimas's avatarIlias Apalodimas
<ilias.apalodimas@linaro.org>
Tested-by: default avatarVincent Stehlé <vincent.stehle@arm.com>
Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Reviewed-by: Heinrich Schuchardt's avatarHeinrich Schuchardt
<xypron.glpk@gmx.de>
diff --git a/include/efi_loader.h b/include/efi_loader.h
index ebee330c68..f805ce25f0 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -677,6 +677,8 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid);
#define efi_size_in_pages(size) (((size) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT)
/* Generic EFI memory allocator, call this to get memory */
void *efi_alloc(uint64_t len, int memory_type);
+/* Allocate pages on the specified alignment */
+void *efi_alloc_aligned_pages(u64 len, int memory_type, size_t align);
/* More specific EFI memory allocator, called by EFI payloads */
efi_status_t efi_allocate_pages(enum efi_allocate_type type,
enum efi_memory_type memory_type,
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index e9572d4d5d..1fa61217be 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -898,9 +898,9 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
image_base = opt->ImageBase;
efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
handle->image_type = opt->Subsystem;
- virt_size = ALIGN(virt_size, opt->SectionAlignment);
- efi_reloc = efi_alloc(virt_size,
- loaded_image_info->image_code_type);
+ efi_reloc = efi_alloc_aligned_pages(virt_size,
+ loaded_image_info->image_code_type,
+ opt->SectionAlignment);
if (!efi_reloc) {
log_err("Out of memory\n");
ret = EFI_OUT_OF_RESOURCES;
@@ -914,9 +914,9 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
image_base = opt->ImageBase;
efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
handle->image_type = opt->Subsystem;
- virt_size = ALIGN(virt_size, opt->SectionAlignment);
- efi_reloc = efi_alloc(virt_size,
- loaded_image_info->image_code_type);
+ efi_reloc = efi_alloc_aligned_pages(virt_size,
+ loaded_image_info->image_code_type,
+ opt->SectionAlignment);
if (!efi_reloc) {
log_err("Out of memory\n");
ret = EFI_OUT_OF_RESOURCES;
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index f4acbee4f9..7f0b507281 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -549,6 +549,58 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
return ret;
}
+/**
+ * efi_alloc_aligned_pages - allocate
+ *
+ * @len: len in bytes
+ * @memory_type: usage type of the allocated memory
+ * @align: alignment in bytes
+ * Return: aligned memory or NULL
+ */
+void *efi_alloc_aligned_pages(u64 len, int memory_type, size_t align)
+{
+ u64 req_pages = efi_size_in_pages(len);
+ u64 true_pages = req_pages + efi_size_in_pages(align) - 1;
+ u64 free_pages;
+ u64 aligned_mem;
+ efi_status_t r;
+ u64 mem;
+
+ /* align must be zero or a power of two */
+ if (align & (align - 1))
+ return NULL;
+
+ /* Check for overflow */
+ if (true_pages < req_pages)
+ return NULL;
+
+ if (align < EFI_PAGE_SIZE) {
+ r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, memory_type,
+ req_pages, &mem);
+ return (r == EFI_SUCCESS) ? (void *)(uintptr_t)mem : NULL;
+ }
+
+ r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, memory_type,
+ true_pages, &mem);
+ if (r != EFI_SUCCESS)
+ return NULL;
+
+ aligned_mem = ALIGN(mem, align);
+ /* Free pages before alignment */
+ free_pages = efi_size_in_pages(aligned_mem - mem);
+ if (free_pages)
+ efi_free_pages(mem, free_pages);
+
+ /* Free trailing pages */
+ free_pages = true_pages - (req_pages + free_pages);
+ if (free_pages) {
+ mem = aligned_mem + req_pages * EFI_PAGE_SIZE;
+ efi_free_pages(mem, free_pages);
+ }
+
+ return (void *)(uintptr_t)aligned_mem;
+}
+
/**
* efi_allocate_pool - allocate memory from pool
*
--
2.17.1
@@ -1,140 +0,0 @@
Upstream-Status: Pending [Not submitted to upstream yet]
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
From b9997c508abf0e129789b07d583329d650186362 Mon Sep 17 00:00:00 2001
From: Vishnu Banavath <vishnu.banavath@arm.com>
Date: Fri, 1 Apr 2022 15:11:06 +0100
Subject: [PATCH] plat/corstone1000: add support for SDCard
These changes are to add SDCard support for corstone1000 FVP.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
index 92da15df4e..fc2fabd1cd 100644
--- a/arch/arm/dts/corstone1000-fvp.dts
+++ b/arch/arm/dts/corstone1000-fvp.dts
@@ -21,6 +21,42 @@
smsc,irq-push-pull;
};
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ corstone1000_fixed_3v3: fixed-regulator-0 {
+ compatible = "regulator-fixed";
+ regulator-name = "3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+ };
+
+ mmc0: mmci@40300000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ reg = <0x40300000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 117 0xf04>;
+ max-frequency = <12000000>;
+ vmmc-supply = <&corstone1000_fixed_3v3>;
+ clocks = <&smbclk>, <&refclk100mhz>;
+ clock-names = "smclk", "apb_pclk";
+ };
+
+ mmc1: mmci@50000000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ reg = <0x50000000 0x10000>;
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 115 0xf04>;
+ max-frequency = <12000000>;
+ vmmc-supply = <&corstone1000_fixed_3v3>;
+ clocks = <&smbclk>, <&refclk100mhz>;
+ clock-names = "smclk", "apb_pclk";
+ };
+
};
&refclk {
diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
index 113a8238c7..32e5d3034f 100644
--- a/board/armltd/corstone1000/corstone1000.c
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -46,14 +46,30 @@ static struct mm_region corstone1000_mem_map[] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
PTE_BLOCK_NON_SHARE |
PTE_BLOCK_PXN | PTE_BLOCK_UXN
- }, {
- /* USB */
- .virt = 0x40200000UL,
- .phys = 0x40200000UL,
- .size = 0x00100000UL,
- .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
- PTE_BLOCK_NON_SHARE |
- PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* USB */
+ .virt = 0x40200000UL,
+ .phys = 0x40200000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* MMC0 */
+ .virt = 0x40300000UL,
+ .phys = 0x40300000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* MMC1 */
+ .virt = 0x50000000UL,
+ .phys = 0x50000000UL,
+ .size = 0x00100000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
/* ethernet */
.virt = 0x40100000UL,
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index aab06f13cc..769a1a2837 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -38,7 +38,13 @@ CONFIG_CMD_EFIDEBUG=y
CONFIG_CMD_FAT=y
CONFIG_OF_CONTROL=y
CONFIG_REGMAP=y
-# CONFIG_MMC is not set
+CONFIG_CLK=y
+CONFIG_CMD_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_ARM_PL180_MMCI=y
+CONFIG_MMC_SDHCI_ADMA_HELPERS=y
+CONFIG_MMC_WRITE=y
+CONFIG_DM_GPIO=y
CONFIG_DM_ETH=y
CONFIG_DM_SERIAL=y
CONFIG_USB=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index c4a1146b52..114aca2059 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -99,7 +99,10 @@
#define CONFIG_SYS_MAXARGS 64 /* max command args */
#define BOOT_TARGET_DEVICES(func) \
- func(USB, usb, 0)
+ func(USB, usb, 0) \
+ func(MMC, mmc, 0) \
+ func(MMC, mmc, 1)
+
#include <config_distro_bootcmd.h>
#define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
--
2.25.1
@@ -17,59 +17,33 @@ EXTRA_OEMAKE:append:corstone1000 = ' DEVICE_TREE=${CORSTONE1000_DEVICE_TREE}'
SYSROOT_DIRS:append:corstone1000 = " /boot"
SRC_URI:append:corstone1000 = " \
file://0001-arm-add-corstone1000-platform.patch \
file://0002-arm-corstone1000-enable-devicetree-in-defconfig.patch \
file://0003-usb-common-move-urb-code-to-common.patch \
file://0004-usb-add-isp1760-family-driver.patch \
file://0005-corstone1000-enable-isp1763-and-usb-stack.patch \
file://0006-corstone1000-enable-support-for-FVP.patch \
file://0007-arm-corstone1000-sharing-PSCI-DTS-node-between-FVP-a.patch \
file://0008-arm-corstone1000-Emulated-RTC-Support.patch \
file://0009-arm-corstone1000-execute-uboot-from-DDR.patch \
file://0010-cmd-load-add-load-command-for-memory-mapped.patch \
file://0011-arm-corstone1000-enable-boot-using-uefi.patch \
file://0012-arm-corstone1000-enable-uefi-secure-boot.patch \
file://0013-arm-corstone1000-enable-handlers-for-uefi-variables.patch \
file://0014-arm-corstone1000-enable-efi-capsule-options.patch \
file://0015-arm-dts-add-initial-devicetree-corstone1000-mps3.patch \
file://0016-arm-corstone1000-adding-PSCI-device-tree-node.patch \
file://0017-arm-corstone1000-amend-kernel-bootargs-with-ip-dhcp-.patch \
file://0018-arm_ffa-introducing-Arm-FF-A-low-level-driver.patch \
file://0019-arm_ffa-introducing-armffa-command.patch \
file://0020-arm_ffa-introducing-test-module-for-UCLASS_FFA.patch \
file://0021-arm_ffa-introducing-MM-communication-with-FF-A.patch \
file://0022-arm_ffa-corstone1000-enable-FF-A-and-MM-support.patch \
file://0023-efi-corstone1000-introduce-EFI-capsule-update.patch \
file://0024-corstone1000-adjust-the-environment-and-heap-sizes.patch \
file://0025-corstone1000-Update-FFA-shared-buffer-address.patch \
file://0026-corstone1000-Disable-set-get-of-NV-variables.patch \
file://0027-corstone1000-Make-sure-shared-buffer-contents-are-no.patch \
file://0028-arm-corstone1000-fix-unrecognized-filesystem-type-error.patch \
file://0029-corstone1000-set-CONFIG_PSCI_RESET.patch \
file://0030-arm-bsp-u-boot-corstone1000-Implement-autoboot-script.patch \
file://0031-corstone1000-change-base-address-of-kernel-in-the-fl.patch \
file://0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch \
file://0033-corstone1000-dts-setting-the-boot-console-output.patch \
file://0034-corstone1000-dts-remove-the-use-of-fdt_addr_r.patch \
file://0035-efi_capsule-corstone1000-pass-interface-and-buffer-event-ids-in-w4.patch \
file://0036-efi_boottime-corstone1000-pass-interface-and-kernel-event-ids-in-w4.patch \
file://0037-efi_loader-remove-guid-check-from-corstone1000-confi.patch \
file://0038-arm_ffa-removing-the-cast-when-using-binary-OR-on-FIELD_PREP.patch \
file://0039-efi_loader-add-the-header-file-for-invalidate_dcache_all.patch \
file://0040-Return-proper-error-code-when-rx-buffer-is-larger.patch \
file://0041-Use-correct-buffer-size.patch \
file://0042-Update-comm_buf-when-EFI_BUFFER_TOO_SMALL.patch \
file://0043-Disable-DHCP-PING-config-parameters.patch \
file://0044-Revert-corstone1000-Disable-set-get-of-NV-variables.patch \
file://0045-corstone1000-defconfig-enable-CAPSULE_FIRMWARE_RAW-c.patch \
file://0046-efi_loader-populate-ESRT-table-if-EFI_ESRT-config-op.patch \
file://0047-efi_firmware-add-get_image_info-for-corstone1000.patch \
file://0048-corstone1000-enable-ethernet-device.patch \
file://0049-efi_loader-Fix-loaded-image-alignment.patch \
file://0050-Comment-mm_communicate-failure-log.patch \
file://0051-efi_loader-send-bootcomplete-message-to-secure-encla.patch \
file://0052-efi_loader-fix-null-pointer-exception-with-get_image.patch \
file://0053-plat-corstone1000-add-support-for-SDCard.patch \
file://0001-cmd-load-add-load-command-for-memory-mapped.patch \
file://0002-arm-add-support-to-corstone1000-platform.patch \
file://0003-usb-common-move-urb-code-to-common.patch \
file://0004-usb-add-isp1760-family-driver.patch \
file://0005-corstone1000-enable-isp1763-usb-controller.patch \
file://0006-arm_ffa-introducing-Arm-FF-A-low-level-driver.patch \
file://0007-arm_ffa-introducing-armffa-command.patch \
file://0008-arm_ffa-introducing-MM-communication-with-FF-A.patch \
file://0009-arm_ffa-introducing-test-module-for-UCLASS_FFA.patch \
file://0010-arm_ffa-corstone1000-enable-FF-A-and-MM-support.patch \
file://0011-efi-corstone1000-introduce-EFI-capsule-update.patch \
file://0012-corstone1000-Update-FFA-shared-buffer-address.patch \
file://0013-corstone1000-Make-sure-shared-buffer-contents-are-no.patch \
file://0014-arm-corstone1000-fix-unrecognized-filesystem-type.patch \
file://0015-efi_capsule-corstone1000-pass-interface-id-and-buffe.patch \
file://0016-efi_boottime-corstone1000-pass-interface-id-and-kern.patch \
file://0017-efi_loader-corstone1000-remove-guid-check-from-corst.patch \
file://0018-arm_ffa-removing-the-cast-when-using-binary-OR-on-FI.patch \
file://0019-Return-proper-error-code-when-rx-buffer-is-larger.patch \
file://0020-Use-correct-buffer-size.patch \
file://0021-Update-comm_buf-when-EFI_BUFFER_TOO_SMALL.patch \
file://0022-efi_loader-populate-ESRT-table-if-EFI_ESRT-config-op.patch \
file://0023-efi_firmware-add-get_image_info-for-corstone1000.patch \
file://0024-Comment-mm_communicate-failure-log.patch \
file://0025-efi_loader-send-bootcomplete-message-to-secure-encla.patch \
file://0026-efi_loader-fix-null-pointer-exception-with-get_image.patch \
file://0027-arm-corstone1000-add-mmc-for-fvp.patch \
"
#