[PATCH 03/10] soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers
Chintan Vankar
c-vankar at ti.com
Wed Apr 24 14:52:21 CEST 2024
On 16/01/24 17:13, Roger Quadros wrote:
> Hi,
>
> On 12/01/2024 08:47, Siddharth Vadapalli wrote:
>> From: Kishon Vijay Abraham I <kishon at ti.com>
>>
>> Initialize base address of ring config registers required to natively
>> setup ring cfg registers in the absence of Device Manager (DM) services
>> at R5 SPL stage.
>>
>> Signed-off-by: Kishon Vijay Abraham I <kishon at ti.com>
>> Signed-off-by: Siddharth Vadapalli <s-vadapalli at ti.com>
>> ---
>> drivers/soc/ti/k3-navss-ringacc.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/ti/k3-navss-ringacc.c b/drivers/soc/ti/k3-navss-ringacc.c
>> index 7a2fbb0db6..31e9b372ee 100644
>> --- a/drivers/soc/ti/k3-navss-ringacc.c
>> +++ b/drivers/soc/ti/k3-navss-ringacc.c
>> @@ -1030,8 +1030,8 @@ static int k3_nav_ringacc_init(struct udevice *dev, struct k3_nav_ringacc *ringa
>> struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev,
>> struct k3_ringacc_init_data *data)
>> {
>> + void __iomem *base_rt, *base_cfg;
>> struct k3_nav_ringacc *ringacc;
>> - void __iomem *base_rt;
>> int i;
>>
>> ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);
>> @@ -1049,6 +1049,10 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev,
>> if (!base_rt)
>> return ERR_PTR(-EINVAL);
>>
>> + base_cfg = dev_read_addr_name_ptr(dev, "cfg");
>> + if (!base_cfg)
>> + return ERR_PTR(-EINVAL);
>> +
>
> Should this be restricted only for R5 SPL case? else we conflict with
> Device Manager services?
>
I don't see any conflict in it, you can go through this:
https://github.com/u-boot/u-boot/commit/86e58800fd7cdba4fa9229aeee3a54a2ccece406
>> ringacc->rings = devm_kzalloc(dev,
>> sizeof(*ringacc->rings) *
>> ringacc->num_rings * 2,
>> @@ -1063,6 +1067,7 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev,
>> for (i = 0; i < ringacc->num_rings; i++) {
>> struct k3_nav_ring *ring = &ringacc->rings[i];
>>
>> + ring->cfg = base_cfg + KNAV_RINGACC_CFG_REGS_STEP * i;
>> ring->rt = base_rt + K3_DMARING_RING_RT_REGS_STEP * i;
>> ring->parent = ringacc;
>> ring->ring_id = i;
>
More information about the U-Boot
mailing list