Merge branch '2023-12-19-assorted-platform-updates' into next

- Assorted platform updates for TI K3, vexpress64, mediatek and related
  cleanups to the DW GPIO driver and OPTEE
This commit is contained in:
Tom Rini 2023-12-19 10:07:56 -05:00
commit 298419ba4d
6 changed files with 26 additions and 17 deletions

View file

@ -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;

View file

@ -5,21 +5,15 @@
* DesignWare APB GPIO driver
*/
#include <common.h>
#include <log.h>
#include <malloc.h>
#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <dm.h>
#include <dm/device.h>
#include <dm/device-internal.h>
#include <dm/device_compat.h>
#include <dm/devres.h>
#include <dm/lists.h>
#include <dm/root.h>
#include <dm/read.h>
#include <errno.h>
#include <reset.h>
#include <linux/bitops.h>
#define GPIO_SWPORT_DR(p) (0x00 + (p) * 0xc)
#define GPIO_SWPORT_DDR(p) (0x04 + (p) * 0xc)

View file

@ -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;

View file

@ -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);

View file

@ -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);
@ -841,7 +847,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:

View file

@ -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)