Skip to contentSkip to conversation

soc: imx: Add SCU SoC info driver support

PATCH Applied Anson Huang 2 participants 3 messages May 24, 2019 – Jun 3, 2019 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/2 soc: imx: Add SCU SoC info driver support

Add i.MX SCU SoC info driver to support i.MX8QXP SoC, introduce driver dependency into Kconfig as CONFIG_IMX_SCU must be selected to support i.MX SCU SoC driver, also need to use platform driver model to make sure IMX_SCU driver is probed before i.MX SCU SoC driver.

With this patch, SoC info can be read from sysfs:

i.mx8qxp-mek# cat /sys/devices/soc0/family
Freescale i.MX

i.mx8qxp-mek# cat /sys/devices/soc0/soc_id
0x2

i.mx8qxp-mek# cat /sys/devices/soc0/machine
Freescale i.MX8QXP MEK

i.mx8qxp-mek# cat /sys/devices/soc0/revision
1.1

---
Changes since V6:
- remove the "unknown" soc_id and revision support, as they are NOT useful and could introduce kernel opps in the failure path, as the "unknown" can NOT be freed;
- minor improvement for platform device name, IPC structure definition.

---
 drivers/soc/imx/Kconfig       |   9 +++
 drivers/soc/imx/Makefile      |   1 +
 drivers/soc/imx/soc-imx-scu.c | 144 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 154 insertions(+)
 create mode 100644 drivers/soc/imx/soc-imx-scu.c
drivers/soc/imx/Kconfig +9 -0
index ade1b46..8aaebf1 100644
@@ -8,4 +8,13 @@ config IMX_GPCV2_PM_DOMAINS
 	select PM_GENERIC_DOMAINS
 	default y if SOC_IMX7D
 
+config IMX_SCU_SOC
+	bool "i.MX System Controller Unit SoC info support"
+	depends on IMX_SCU
+	select SOC_BUS
+	help
+	  If you say yes here you get support for the NXP i.MX System
+	  Controller Unit SoC info module, it will provide the SoC info
+	  like SoC family, ID and revision etc.
+
 endmenu
drivers/soc/imx/Makefile +1 -0
index caa8653..cf9ca42 100644
@@ -2,3 +2,4 @@
 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
 obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o
 obj-$(CONFIG_ARCH_MXC) += soc-imx8.o
+obj-$(CONFIG_IMX_SCU_SOC) += soc-imx-scu.o
drivers/soc/imx/soc-imx-scu.c new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v7 2/2 arm64: defconfig: Add i.MX SCU SoC info driver

This patch selects CONFIG_IMX_SCU_SOC by default to support i.MX system controller unit SoC info driver.

---
No changes.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index c91642d..aaca4a0 100644
@@ -694,6 +694,7 @@ CONFIG_RPMSG_QCOM_GLINK_RPM=y
 CONFIG_RPMSG_QCOM_GLINK_SMEM=m
 CONFIG_RPMSG_QCOM_SMD=y
 CONFIG_RASPBERRYPI_POWER=y
+CONFIG_IMX_SCU_SOC=y
 CONFIG_QCOM_COMMAND_DB=y
 CONFIG_QCOM_GENI_SE=y
 CONFIG_QCOM_GLINK_SSR=m
Signature · 1 line
2.7.4
Applied
#2 lore raw
In reply to Anson Huang
Quoted 17 lines · Anson Huang

Add i.MX SCU SoC info driver to support i.MX8QXP SoC, introduce driver dependency into Kconfig as CONFIG_IMX_SCU must be selected to support i.MX SCU SoC driver, also need to use platform driver model to make sure IMX_SCU driver is probed before i.MX SCU SoC driver.

With this patch, SoC info can be read from sysfs:

i.mx8qxp-mek# cat /sys/devices/soc0/family
Freescale i.MX

i.mx8qxp-mek# cat /sys/devices/soc0/soc_id
0x2

i.mx8qxp-mek# cat /sys/devices/soc0/machine
Freescale i.MX8QXP MEK

Quoted 6 lines

i.mx8qxp-mek# cat /sys/devices/soc0/revision
1.1

Applied, thanks.