Thread (9 messages) 9 messages, 4 authors, 2016-11-08
STALE3509d
Revisions (21)
  1. v1 [diff vs current]
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]
  5. v6 [diff vs current]
  6. v7 [diff vs current]
  7. v7 [diff vs current]
  8. v7 [diff vs current]
  9. v7 current
  10. v7 [diff vs current]
  11. v8 [diff vs current]
  12. v8 [diff vs current]
  13. v8 [diff vs current]
  14. v8 [diff vs current]
  15. v8 [diff vs current]
  16. v8 [diff vs current]
  17. v8 [diff vs current]
  18. v8 [diff vs current]
  19. v8 [diff vs current]
  20. v8 [diff vs current]
  21. v9 [diff vs current]

[PATCH v7 1/2] soc: samsung: add exynos chipid driver support

From: arnd@arndb.de (Arnd Bergmann)
Date: 2016-11-07 08:35:19
Also in: linux-samsung-soc

On Saturday, November 5, 2016 5:33:46 PM CET Pankaj Dubey wrote:
quoted hunk ↗ jump to hunk
Exynos SoCs have Chipid, for identification of product IDs
and SoC revisions. This patch intends to provide initialization
code for all these functionalities, at the same time it provides some
sysfs entries for accessing these information to user-space.

This driver uses existing binding for exynos-chipid.

CC: Grant Likely <redacted>
CC: Rob Herring <robh+dt@kernel.org>
CC: Linus Walleij <redacted>
Signed-off-by: Pankaj Dubey <redacted>
---
 drivers/soc/samsung/Kconfig         |   5 ++
 drivers/soc/samsung/Makefile        |   1 +
 drivers/soc/samsung/exynos-chipid.c | 148 ++++++++++++++++++++++++++++++++++++
 3 files changed, 154 insertions(+)
 create mode 100644 drivers/soc/samsung/exynos-chipid.c
diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
index 2455339..f9ab858 100644
--- a/drivers/soc/samsung/Kconfig
+++ b/drivers/soc/samsung/Kconfig
@@ -14,4 +14,9 @@ config EXYNOS_PM_DOMAINS
 	bool "Exynos PM domains" if COMPILE_TEST
 	depends on PM_GENERIC_DOMAINS || COMPILE_TEST
 
+config EXYNOS_CHIPID
+	bool "Exynos Chipid controller driver" if COMPILE_TEST
+	depends on (ARM && ARCH_EXYNOS) || ((ARM || ARM64) && COMPILE_TEST)
+	select SOC_BUS
+
Please add a help text.

Why is this not enabled for ARM64 EXYNOS?
+	exynos_chipid_base = of_iomap(np, 0);
+
+	if (!exynos_chipid_base)
+		return PTR_ERR(exynos_chipid_base);
+
+	product_id  = __raw_readl(exynos_chipid_base);
+	revision = product_id & EXYNOS_REV_MASK;
+	iounmap(exynos_chipid_base);
Never use __raw_readl/__raw_writel in device drivers, they are not endian
safe, and we just removed all instances for Exynos a while back.
+	return 0;
+}
+early_initcall(exynos_chipid_early_init);
Why is this early? Please add a code comment if it's really needed to be
an early_initcall, otherwise make it a device_initcall.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help