diff mbox series

[RFC,10/11] soc: realtek: chip: Detect RTD1294

Message ID 20191103013645.9856-11-afaerber@suse.de (mailing list archive)
State New, archived
Headers show
Series ARM: Realtek RTD1195/RTD1295 SoC info | expand

Commit Message

Andreas Färber Nov. 3, 2019, 1:36 a.m. UTC
Detection logic from downstream include/soc/realtek/rtd129x_cpu.h.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 drivers/soc/realtek/chip.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/soc/realtek/chip.c b/drivers/soc/realtek/chip.c
index f4b26fb048c7..e13339a4ca2e 100644
--- a/drivers/soc/realtek/chip.c
+++ b/drivers/soc/realtek/chip.c
@@ -54,6 +54,14 @@  static const char *rtd1295_name(struct device *dev, const struct rtd_soc *s)
 {
 	void __iomem *base;
 
+	base = of_iomap(dev->of_node, 2);
+	if (base) {
+		u32 efuse = readl_relaxed(base);
+		iounmap(base);
+		if ((efuse & 0x3) == 0x1)
+			return "RTD1294";
+	}
+
 	base = of_iomap(dev->of_node, 1);
 	if (base) {
 		u32 chipinfo1 = readl_relaxed(base);