lkml.org 
[lkml]   [2022]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [Patch v6 1/4] memory: tegra: Add memory controller channels support
From
06.04.2022 08:24, Ashish Mhetre пишет:
> + num_dt_channels = of_property_count_elems_of_size(pdev->dev.of_node, "reg",
> + reg_cells * sizeof(u32));
> + /*
> + * On tegra186 onwards, memory controller support multiple channels.
> + * Apart from regular memory controller channels, there is one broadcast
> + * channel and one for stream-id registers.
> + */
> + if (num_dt_channels < mc->soc->num_channels + 2) {
> + dev_warn(&pdev->dev, "MC channels are missing, please update memory controller DT node with MC channels\n");
> + return 0;
> + }
> +
> + mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "mc-broadcast");
> + if (IS_ERR(mc->bcast_ch_regs))
> + return PTR_ERR(mc->bcast_ch_regs);

Looks to me that you don't need to use of_property_count_elems_of_size()
and could only check the "mc-broadcast" presence to decide whether this
is an older DT.

mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev,
"broadcast");
if (IS_ERR(mc->bcast_ch_regs)) {
dev_warn(&pdev->dev, "Broadcast channel is missing, please update your
device-tree\n");
return PTR_ERR(mc->bcast_ch_regs);
}

\
 
 \ /
  Last update: 2022-04-10 16:19    [W:0.096 / U:1.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site