summaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorNeha Malcom Francis <[email protected]>2025-08-12 18:13:21 +0530
committerTom Rini <[email protected]>2025-08-19 11:26:20 -0600
commit2310aac8ae0180ad78da1d44657f846610296e4d (patch)
tree4167bbf4a2eeaa98c86f540b88af9eac4a280c9a /drivers/ram
parent3a0793fe9be3f0e6026d31dec8545a6b0e102ccd (diff)
ram: k3-ddrss: Add support for number of controllers under MSMC
In K3 multi-DDR systems, the MSMC is responsible for the interleave mechanism across all the DDR controllers. Add support for MSMC to obtain the number of controllers it's responsible for using the DT. Reviewed-by: Udit Kumar <[email protected]> Signed-off-by: Neha Malcom Francis <[email protected]>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/k3-ddrss/k3-ddrss.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ram/k3-ddrss/k3-ddrss.c b/drivers/ram/k3-ddrss/k3-ddrss.c
index 61d4f3d7aa4..075e664ff1a 100644
--- a/drivers/ram/k3-ddrss/k3-ddrss.c
+++ b/drivers/ram/k3-ddrss/k3-ddrss.c
@@ -134,6 +134,7 @@ struct k3_msmc {
enum ecc_enable enable;
enum emif_config config;
enum emif_active active;
+ u32 num_ddr_controllers;
};
struct k3_ddrss_desc {
@@ -1013,6 +1014,13 @@ static int k3_msmc_probe(struct udevice *dev)
return -EINVAL;
}
+ ret = device_get_child_count(dev);
+ if (ret <= 0) {
+ dev_err(dev, "no child ddr nodes present");
+ return -EINVAL;
+ }
+ msmc->num_ddr_controllers = ret;
+
return 0;
}