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

From: Andreas FÃrber
Date: Sat Nov 02 2019 - 21:37:11 EST


Detection logic from downstream include/soc/realtek/rtd129x_cpu.h.

Signed-off-by: Andreas FÃrber <afaerber@xxxxxxx>
---
drivers/soc/realtek/chip.c | 8 ++++++++
1 file changed, 8 insertions(+)

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);
--
2.16.4