[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ba52543d377b0be558175ab4aaa9b6761e3760a4.1680268101.git.lorenzo@kernel.org>
Date: Fri, 31 Mar 2023 15:12:44 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
kuba@...nel.org, matthias.bgg@...il.com,
linux-mediatek@...ts.infradead.org, nbd@....name, john@...ozen.org,
sean.wang@...iatek.com, Mark-MC.Lee@...iatek.com,
lorenzo.bianconi@...hat.com, daniel@...rotopia.org,
krzysztof.kozlowski+dt@...aro.org, robh+dt@...nel.org,
devicetree@...r.kernel.org
Subject: [PATCH v2 net-next 08/10] net: ethernet: mtk_wed: move dlm a dedicated dts node
Since the dlm memory region is not part of the MT7986 RAM SoC, move dlm
in a deidicated syscon node.
Keep backward-compatibility with older dts version where dlm was defined
as reserved-memory child node.
Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 95d890870984..e479ff924ed6 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -799,6 +799,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device *dev)
struct device_node *np;
int index;
+ np = of_parse_phandle(dev->hw->node, "mediatek,wo-dlm", 0);
+ if (np) {
+ struct resource res;
+ int ret;
+
+ ret = of_address_to_resource(np, 0, &res);
+ of_node_put(np);
+
+ if (ret < 0)
+ return ret;
+
+ dev->rro.miod_phys = res.start;
+ goto out;
+ }
+
+ /* For backward compatibility, we need to check if DLM
+ * node is defined through reserved memory property.
+ */
index = of_property_match_string(dev->hw->node, "memory-region-names",
"wo-dlm");
if (index < 0)
@@ -815,6 +833,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device *dev)
return -ENODEV;
dev->rro.miod_phys = rmem->base;
+out:
dev->rro.fdbk_phys = MTK_WED_MIOD_COUNT + dev->rro.miod_phys;
return mtk_wed_rro_ring_alloc(dev, &dev->rro.ring,
--
2.39.2
Powered by blists - more mailing lists