aboutsummaryrefslogtreecommitdiff
path: root/drivers/soc/fsl/guts.c
AgeCommit message (Collapse)AuthorFilesLines
2022-07-05soc: fsl: guts: check return value after calling of_iomap() in ↵Yang Yingliang1-0/+4
fsl_guts_get_soc_uid() of_iomap() may return NULL, so we need check the return value. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Michael Walle <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-07-05soc: fsl: guts: fix return value check in fsl_guts_init()Yang Yingliang1-2/+2
In case of error, of_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test and return -ENOMEM as error value. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Michael Walle <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: add serial_number supportMichael Walle1-2/+46
Most layerscapes provide a security fuse processor where the vendor will store a unique id per part. Unfortunately, we cannot use the corresponding efuse driver because this driver needs to be ready early during the boot phase. To get the unique identifier, we just need to access two registers. Thus we just search the device tree for the corresponding device, map its memory to read the id and then unmap it again. Because it is likely that the offset within the fuses is dependent on the SoC, we need a per SoC data. Also, the compatible string is different among the SoCs. For now, this add support for the LS1028A SoC. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: drop platform driverMichael Walle1-63/+71
This driver cannot be unloaded and it will be needed very early in the boot process because other driver (weakly) depend on it (eg. for chip errata handling). Drop all the platform driver and devres stuff and simply make it a core_initcall. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: use of_root instead of own referenceMichael Walle1-8/+4
There is already a global of_root reference. Use that instead of getting one on our own. We don't need to care about the reference count either this way. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: allocate soc_dev_attr on the heapMichael Walle1-19/+21
This is the last global static variable. Drop it and allocate the memory on the heap instead. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: embed fsl_guts_get_svr() in probe()Michael Walle1-31/+11
Move the reading of the SVR into the probe function as fsl_guts_get_svr() is the only user of the static guts variable and this lets us drop that as well as the malloc() for this variable. Also, we can unmap the memory region after we accessed it, which will simplify error handling later. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: remove module_exit() and fsl_guts_remove()Michael Walle1-14/+1
This driver will never be unloaded. Firstly, it is not available as a module, but more importantly, other drivers will depend on this one to apply possible chip errata. Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-06-27soc: fsl: guts: machine variable might be unsetMichael Walle1-1/+1
If both the model and the compatible properties are missing, then machine will not be set. Initialize it with NULL. Fixes: 34c1c21e94ac ("soc: fsl: fix section mismatch build warnings") Signed-off-by: Michael Walle <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-02-18soc: fsl: guts: Add a missing memory allocation failure checkChristophe JAILLET1-2/+7
If 'devm_kstrdup()' fails, we should return -ENOMEM. While at it, move the 'of_node_put()' call in the error handling path and after the 'machine' has been copied. Better safe than sorry. Fixes: a6fc3b698130 ("soc: fsl: add GUTS driver for QorIQ platforms") Depends-on: fddacc7ff4dd ("soc: fsl: guts: Revert commit 3c0d64e867ed") Suggested-by: Tyrel Datwyler <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Li Yang <[email protected]>
2022-02-18soc: fsl: guts: Revert commit 3c0d64e867edChristophe JAILLET1-4/+3
This reverts commit 3c0d64e867ed ("soc: fsl: guts: reuse machine name from device tree"). A following patch will fix the missing memory allocation failure check instead. Suggested-by: Tyrel Datwyler <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Li Yang <[email protected]>
2021-10-21soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource()Cai Huoqing1-3/+1
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <[email protected]> Signed-off-by: Li Yang <[email protected]>
2021-04-06soc: fsl: guts: remove unneeded semicolonYang Li1-1/+1
Eliminate the following coccicheck warning: ./drivers/soc/fsl/guts.c:120:2-3: Unneeded semicolon Reported-by: Abaci Robot <[email protected]> Signed-off-by: Yang Li <[email protected]> Signed-off-by: Li Yang <[email protected]>
2019-08-15soc: fsl: guts: Add definition for LS1028AYinbo Zhu1-0/+6
Adding compatible string "ls1028a-dcfg" to initialize guts driver for ls1028 and SoC die attribute definition for LS1028A Signed-off-by: Yinbo Zhu <[email protected]> Signed-off-by: Li Yang <[email protected]>
2019-06-17Merge tag 'soc-fsl-next-v5.3' of ↵Olof Johansson1-0/+6
git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/drivers NXP/FSL SoC driver updates for v5.3 DPAA2 Console driver - Add driver to export two char devices to dump logs for MC and AIOP DPAA2 DPIO driver - Add support for memory backed QBMan portals - Increase the timeout period to prevent false error - Add APIs to retrieve QBMan portal probing status DPAA Qman driver - Only make liodn fixup on powerpc SoCs with PAMU iommu * tag 'soc-fsl-next-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: qbman_portals: add APIs to retrieve the probing status soc: fsl: qman: fixup liodns only on ppc targets soc: fsl: dpio: Add support for memory backed QBMan portals bus: mc-bus: Add support for mapping shareable portals soc: fsl: dpio: Increase timeout for QBMan Management Commands soc: fsl: add DPAA2 console support Documentation: DT: Add entry for DPAA2 console soc: fsl: guts: Add definition for LX2160A Signed-off-by: Olof Johansson <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-20soc: fsl: guts: Add definition for LX2160AVabhav Sharma1-0/+6
Adding compatible string "lx2160a-dcfg" to initialize guts driver for lx2160 and SoC die attribute definition for LX2160A Signed-off-by: Vabhav Sharma <[email protected]> Signed-off-by: Yinbo Zhu <[email protected]> Signed-off-by: Li Yang <[email protected]>
2019-02-26soc: fsl: guts: make fsl_guts_get_svr() staticHoria Geantă1-2/+1
The export of fsl_guts_get_svr() is a left-over, it's currently used only internally and users needing SoC information should use the generic soc_device infrastructure. Signed-off-by: Horia Geantă <[email protected]> Acked-by: Yangbo Lu <[email protected]> Signed-off-by: Li Yang <[email protected]>
2019-01-11soc: fsl: guts: reuse machine name from device treeLi Yang1-3/+4
Reuse the string machine from the device tree data structure instead of duplicating the data again. This also prevents a potential memory allocation failure that was not handled previously. Also fixes an early put of root device node. Reported-by: Nicholas Mc Guire <[email protected]> Signed-off-by: Li Yang <[email protected]>
2018-01-22soc: fsl: guts: Add a NULL check for devm_kasprintf()Fabio Estevam1-0/+6
devm_kasprintf() may fail, so we should better add a NULL check and propagate an error on failure. Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Yangbo Lu <[email protected]> Signed-off-by: Li Yang <[email protected]>
2017-12-08soc: fsl: support GUTS driver for ls1012a/ls1046ayangbo lu1-0/+2
This patch is to add compatible strings "fsl,ls1021a-dcfg" and "fsl,ls1043a-dcfg" into device match table of GUTS driver. Signed-off-by: Yangbo Lu <[email protected]> Signed-off-by: Li Yang <[email protected]>
2017-09-22soc/fsl/guts: Add compatible string for LS1088ashish kumar1-0/+1
Adding compatible string "ls1088a-dcfg" so that guts driver can be init for ls1088 Signed-off-by: Ashish Kumar <[email protected]> Signed-off-by: Amrita Kumari <[email protected]> Signed-off-by: Li Yang <[email protected]>
2016-11-29soc: fsl: fix section mismatch build warningsSudeep Holla1-2/+5
We get the following warning with the driver is compiled in: WARNING: modpost: Found 1 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' With CONFIG_DEBUG_SECTION_MISMATCH enabled, the details are reported: WARNING: vmlinux.o(.text+0x55d014): Section mismatch in reference from the function fsl_guts_probe() to the function .init.text:of_flat_dt_get_machine_name() The function fsl_guts_probe() references the function __init of_flat_dt_get_machine_name(). This is often because fsl_guts_probe lacks a __init annotation or the annotation of of_flat_dt_get_machine_name is wrong. This patch fixes the issue by using the normal DT/OF API rather than the of_flat_* one. Cc: Scott Wood <[email protected]> Cc: Yangbo Lu <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Ulf Hansson <[email protected]> Signed-off-by: Sudeep Holla <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2016-11-29soc: fsl: add GUTS driver for QorIQ platformsyangbo lu1-0/+236
The global utilities block controls power management, I/O device enabling, power-onreset(POR) configuration monitoring, alternate function selection for multiplexed signals,and clock control. This patch adds a driver to manage and access global utilities block. Initially only reading SVR and registering soc device are supported. Other guts accesses, such as reading RCW, should eventually be moved into this driver as well. Signed-off-by: Yangbo Lu <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>