summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-02-07 09:47:47 -0500
committerTom Rini <trini@konsulko.com>2024-02-07 09:47:47 -0500
commit0101a2ffe125911ebf89172b495f5ff14f2fd058 (patch)
tree212616307e61b5b6e6cab83dfba3a45a2f58c6aa /drivers
parent7ebc77fede4bb8f1c0b1239c7093d1fa69ccc5a9 (diff)
parente5e7d8bbcffb26f5ac9a8fab7909225f527e157d (diff)
downloadu-boot-0101a2ffe125911ebf89172b495f5ff14f2fd058.tar.gz
u-boot-0101a2ffe125911ebf89172b495f5ff14f2fd058.tar.bz2
u-boot-0101a2ffe125911ebf89172b495f5ff14f2fd058.zip
Merge branch '2024-02-06-assorted-fixes'
A number of assorted fixes
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/host_dev.c1
-rw-r--r--drivers/dma/ti/k3-udma.c11
-rw-r--r--drivers/firmware/ti_sci.c18
3 files changed, 22 insertions, 8 deletions
diff --git a/drivers/block/host_dev.c b/drivers/block/host_dev.c
index 30c7415793..52313435a0 100644
--- a/drivers/block/host_dev.c
+++ b/drivers/block/host_dev.c
@@ -61,6 +61,7 @@ static int host_sb_attach_file(struct udevice *dev, const char *filename)
if (size % desc->blksz) {
printf("The size of host backing file '%s' is not multiple of "
"the device block size\n", filename);
+ ret = -EINVAL;
goto err_fname;
}
desc->lba = size / desc->blksz;
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 8a62d63dfe..eea9ec9659 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -876,13 +876,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc)
{
struct k3_nav_ring_cfg ring_cfg;
struct udma_dev *ud = uc->ud;
- int ret;
+ struct udma_tchan *tchan;
+ int ring_idx, ret;
ret = udma_get_tchan(uc);
if (ret)
return ret;
- ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, uc->tchan->id, -1,
+ tchan = uc->tchan;
+ if (tchan->tflow_id >= 0)
+ ring_idx = tchan->tflow_id;
+ else
+ ring_idx = ud->bchan_cnt + tchan->id;
+
+ ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, ring_idx, -1,
&uc->tchan->t_ring,
&uc->tchan->tc_ring);
if (ret) {
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 6e9f93e9a3..ee09218558 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -236,21 +236,27 @@ static int ti_sci_do_xfer(struct ti_sci_info *info,
{
struct k3_sec_proxy_msg *msg = &xfer->tx_message;
u8 secure_buf[info->desc->max_msg_size];
- struct ti_sci_secure_msg_hdr secure_hdr;
+ struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf;
int ret;
+ /*
+ * The reason why we need the is_secure code is because of boot R5.
+ * boot R5 starts off in "secure mode" when it hands off from Boot
+ * ROM over to the Secondary bootloader. The initial set of calls
+ * we have to make need to be on a secure pipe.
+ */
if (info->is_secure) {
/* ToDo: get checksum of the entire message */
- secure_hdr.checksum = 0;
- secure_hdr.reserved = 0;
- memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf,
+ secure_hdr->checksum = 0;
+ secure_hdr->reserved = 0;
+ memcpy(&secure_buf[sizeof(*secure_hdr)], xfer->tx_message.buf,
xfer->tx_message.len);
xfer->tx_message.buf = (u32 *)secure_buf;
- xfer->tx_message.len += sizeof(secure_hdr);
+ xfer->tx_message.len += sizeof(*secure_hdr);
if (xfer->rx_len)
- xfer->rx_len += sizeof(secure_hdr);
+ xfer->rx_len += sizeof(*secure_hdr);
}
/* Send the message */