linux-stable/drivers/soc/imx
Stephan Gerhold 4ebd29f916 soc: imx: Register SoC device only on i.MX boards
At the moment, using the ARM32 multi_v7_defconfig always results in two
SoCs being exposed in sysfs. This is wrong, as far as I'm aware the
Qualcomm DragonBoard 410c does not actually make use of a i.MX SoC. :)

  qcom-db410c:/sys/devices/soc0$ grep . *
  family:Freescale i.MX
  machine:Qualcomm Technologies, Inc. APQ 8016 SBC
  revision:0.0
  serial_number:0000000000000000
  soc_id:Unknown

  qcom-db410c:/sys/devices/soc1$ grep . *
  family:Snapdragon
  machine:APQ8016
  ...

This happens because imx_soc_device_init() registers the soc device
unconditionally, even when running on devices that do not make use of i.MX.
Arnd already reported this more than a year ago and even suggested a fix
similar to this commit, but for some reason it was never submitted.

Fix it by checking if the "__mxc_cpu_type" variable was actually
initialized by earlier platform code. On devices without i.MX it will
simply stay 0.

Cc: Peng Fan <peng.fan@nxp.com>
Fixes: d2199b3487 ("ARM: imx: use device_initcall for imx_soc_device_init")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2021-12-08 20:30:00 +08:00
..
Kconfig imx: soc: Select REGMAP_MMIO 2021-10-05 13:54:44 +08:00
Makefile soc: imx: add i.MX8M blk-ctrl driver 2021-10-06 20:13:47 +08:00
gpc.c soc: imx: gpc: fix power up sequencing 2020-03-16 11:39:02 +08:00
gpcv2.c soc: imx: gpcv2: support system suspend/resume 2021-10-06 20:13:45 +08:00
imx8m-blk-ctrl.c soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset 2021-12-06 10:28:30 +08:00
soc-imx.c soc: imx: Register SoC device only on i.MX boards 2021-12-08 20:30:00 +08:00
soc-imx8m.c Revert "soc: imx8m: change to use platform driver" 2021-07-15 19:02:44 +08:00