From c86c1d0383e56e4ac08bf21227a2fdd0af167e4b Mon Sep 17 00:00:00 2001 From: Robert Catherall Date: Thu, 23 Nov 2023 18:22:58 +0000 Subject: [PATCH 1/7] arm: vexpress64: juno: Allow boot from VirtIO The AEM and Juno FVPs (Fixed Virtual Platforms) support a VirtIO disc interface. Adding VIRTIO to the list of boot devices allows these FastModel platforms to boot from 'disc' in the same way the hardware counterpart can boot from SATA or USB. This is a NOP if CONFIG_CMD_VIRTIO is not enabled, so no impact on Juno hardware (which is built with vexpress_aemv8a_juno_defconfig) Signed-off-by: Robert Catherall Reviewed-by: Andre Przywara --- include/configs/vexpress_aemv8.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h index 24d8ca08665..8020689e39e 100644 --- a/include/configs/vexpress_aemv8.h +++ b/include/configs/vexpress_aemv8.h @@ -187,6 +187,7 @@ func(USB, usb, 0) \ func(SATA, sata, 0) \ func(SATA, sata, 1) \ + FUNC_VIRTIO(func) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) \ func(AFS, afs, na) From 34fc1861239f1c6b92252359127eb3b74ca792a5 Mon Sep 17 00:00:00 2001 From: Udit Kumar Date: Sat, 25 Nov 2023 23:59:39 +0530 Subject: [PATCH 2/7] remoteproc: k3-dsp: Avoid reloading of firmware DSP core is going into abnormal state when load callback is called after starting of DSP core. Reload of firmware needs core to be stopped first, followed by load. So avoid loading of firmware, when core is started. Signed-off-by: Udit Kumar --- drivers/remoteproc/ti_k3_dsp_rproc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/remoteproc/ti_k3_dsp_rproc.c b/drivers/remoteproc/ti_k3_dsp_rproc.c index 576de4bb26e..1c6515f9ab7 100644 --- a/drivers/remoteproc/ti_k3_dsp_rproc.c +++ b/drivers/remoteproc/ti_k3_dsp_rproc.c @@ -56,6 +56,7 @@ struct k3_dsp_boot_data { * @data: Pointer to DSP specific boot data structure * @mem: Array of available memories * @num_mem: Number of available memories + * @in_use: flag to tell if the core is already in use. */ struct k3_dsp_privdata { struct reset_ctl dsp_rst; @@ -63,6 +64,7 @@ struct k3_dsp_privdata { struct k3_dsp_boot_data *data; struct k3_dsp_mem *mem; int num_mems; + bool in_use; }; /* @@ -128,6 +130,13 @@ static int k3_dsp_load(struct udevice *dev, ulong addr, ulong size) u32 boot_vector; int ret; + if (dsp->in_use) { + dev_err(dev, + "Invalid op: Trying to load/start on already running core %d\n", + dsp->tsp.proc_id); + return -EINVAL; + } + dev_dbg(dev, "%s addr = 0x%lx, size = 0x%lx\n", __func__, addr, size); ret = ti_sci_proc_request(&dsp->tsp); if (ret) @@ -195,6 +204,7 @@ static int k3_dsp_start(struct udevice *dev) ti_sci_proc_power_domain_off(&dsp->tsp); } + dsp->in_use = true; proc_release: ti_sci_proc_release(&dsp->tsp); @@ -207,6 +217,7 @@ static int k3_dsp_stop(struct udevice *dev) dev_dbg(dev, "%s\n", __func__); + dsp->in_use = false; ti_sci_proc_request(&dsp->tsp); reset_assert(&dsp->dsp_rst); ti_sci_proc_power_domain_off(&dsp->tsp); From ab9500e9c3fa1a4512eeebcc616f7ba73cf938ef Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Wed, 29 Nov 2023 13:37:52 +0100 Subject: [PATCH 3/7] tee: optee: don't fail on services enumeration failure Change optee probe function to only warn when service enumeration sequence fails instead of reporting an optee driver probe failure. Indeed U-Boot can still use OP-TEE even if some OP-TEE services are not discovered. Fixes: 94ccfb78a4d6 ("drivers: tee: optee: discover OP-TEE services") Signed-off-by: Etienne Carriere Reviewed-by: Patrice Chotard Reviewed-by: Jens Wiklander --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 9a9b697e91f..5308dd58ce9 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -841,7 +841,7 @@ static int optee_probe(struct udevice *dev) if (IS_ENABLED(CONFIG_OPTEE_SERVICE_DISCOVERY)) { ret = bind_service_drivers(dev); if (ret) - return ret; + dev_warn(dev, "optee service enumeration failed: %d\n", ret); } else if (IS_ENABLED(CONFIG_RNG_OPTEE)) { /* * Discovery of TAs on the TEE bus is not supported in U-Boot: From 51774b3b03a60a553cf183e6b8f5f8ee80afe625 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Wed, 29 Nov 2023 13:37:53 +0100 Subject: [PATCH 4/7] tee: optee: don't enumerate services if there ain't any Change optee driver service enumeration to not enumerate (and allocate a zero sized shared memory buffer) when OP-TEE reports that there is no service to enumerate. This change fixes an existing issue that occurs when the such zero sized shared memory buffer allocated from malloc() has a physical address of offset 0 of a physical 4kB page. In such case, OP-TEE secure world refuses to register the zero-sized shared memory area and makes U-Boot optee service enumeration to fail. Fixes: 94ccfb78a4d6 ("drivers: tee: optee: discover OP-TEE services") Signed-off-by: Etienne Carriere Reviewed-by: Patrice Chotard Reviewed-by: Jens Wiklander --- drivers/tee/optee/core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 5308dd58ce9..47f845cffe3 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -139,6 +139,11 @@ static int enum_services(struct udevice *dev, struct tee_shm **shm, size_t *coun if (ret) return ret; + if (!shm_size) { + *count = 0; + return 0; + } + ret = tee_shm_alloc(dev, shm_size, 0, shm); if (ret) { dev_err(dev, "Failed to allocated shared memory: %d\n", ret); @@ -185,14 +190,15 @@ static int bind_service_drivers(struct udevice *dev) ret = enum_services(dev, &service_list, &service_count, tee_sess, PTA_CMD_GET_DEVICES); - if (!ret) + if (!ret && service_count) ret = bind_service_list(dev, service_list, service_count); tee_shm_free(service_list); + service_list = NULL; ret2 = enum_services(dev, &service_list, &service_count, tee_sess, PTA_CMD_GET_DEVICES_SUPP); - if (!ret2) + if (!ret2 && service_count) ret2 = bind_service_list(dev, service_list, service_count); tee_shm_free(service_list); From 00b049339850ecd57c518fde72cd2739a3bc0bb1 Mon Sep 17 00:00:00 2001 From: Maksim Kiselev Date: Thu, 30 Nov 2023 00:47:31 +0300 Subject: [PATCH 5/7] gpio: dw: Drop unused headers Drop headers which are not used or needed in this file. Signed-off-by: Maksim Kiselev --- drivers/gpio/dwapb_gpio.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index e6e919444f5..7a6eae9ba18 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -5,21 +5,15 @@ * DesignWare APB GPIO driver */ -#include -#include -#include -#include #include #include -#include +#include #include #include #include -#include -#include +#include #include #include -#include #define GPIO_SWPORT_DR(p) (0x00 + (p) * 0xc) #define GPIO_SWPORT_DDR(p) (0x04 + (p) * 0xc) From fd8de9730c3d35625b471df1cc77dc28ed7a9888 Mon Sep 17 00:00:00 2001 From: Julien Masson Date: Mon, 4 Dec 2023 14:41:45 +0100 Subject: [PATCH 6/7] mmc: mediatek: set b_max according CONFIG_SYS_MMC_MAX_BLK_COUNT The block count limit on MMC based devices should be set according to CONFIG_SYS_MMC_MAX_BLK_COUNT instead of hardcoding value. Signed-off-by: Julien Masson --- drivers/mmc/mtk-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index d21a30c9543..5a0c61daed5 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -1665,7 +1665,7 @@ static int msdc_drv_probe(struct udevice *dev) if (cfg->f_max < cfg->f_min || cfg->f_max > host->src_clk_freq) cfg->f_max = host->src_clk_freq; - cfg->b_max = 1024; + cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; host->mmc = &plat->mmc; From 66459346463439c72f84cfd1f985496b8a6142d8 Mon Sep 17 00:00:00 2001 From: Michael Trimarchi Date: Fri, 8 Dec 2023 08:53:05 +0100 Subject: [PATCH 7/7] arm: mach-k3: am625: Relax emmc boot condition spl_mmc_emmc_boot_partition return a number different from 0 if the partition is a boot one. We can have the uboot img for instance in a raw offset in emmc partition 0 so we would like to continue to load the next stage. If the user want to use EMMC as boot device allow him to use any part of the emmc and not only boot partition Signed-off-by: Michael Trimarchi --- arch/arm/mach-k3/am625_init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c index 1d4ef35e7b4..6c96e881146 100644 --- a/arch/arm/mach-k3/am625_init.c +++ b/arch/arm/mach-k3/am625_init.c @@ -222,11 +222,8 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) switch (bootmode) { case BOOT_DEVICE_EMMC: - if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) { - if (spl_mmc_emmc_boot_partition(mmc)) - return MMCSD_MODE_EMMCBOOT; - return MMCSD_MODE_FS; - } + if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) + return MMCSD_MODE_EMMCBOOT; if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4)) return MMCSD_MODE_FS; return MMCSD_MODE_EMMCBOOT;