summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
AgeCommit message (Collapse)Author
2021-11-10LF-2663-3 ARM: imx: Correct DT path for i.MX7D LPSR featureAnson Huang
Some DT node path are changed, correct them to support i.MX7D 12x12 LPDDR3 validation board. Related-to: ELB-4064 Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com> Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit eb0b5039ea485a6fd86d51884d95c26e3eddbd02)
2021-11-08Merge remote-tracking branch 'fscl/5.4-2.3.x-imx' into toradex_5.4-2.3.x-imxDenys Drozdov
2021-11-08Merge tag 'v5.4.153' into 5.4-2.3.x-imxDenys Drozdov
This is the 5.4.153 stable release
2021-10-13ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequenceOleksij Rempel
[ Upstream commit 783f3db030563f7bcdfe2d26428af98ea1699a8e ] Any pending interrupt can prevent entering standby based power off state. To avoid it, disable the GIC CPU interface. Fixes: 8148d2136002 ("ARM: imx6: register pm_power_off handler if "fsl,pmic-stby-poweroff" is set") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-23Revert "MLK-24940 arm: imx: correctly check the return value of ↵Otavio Salvador
"of_get_mac_address"" This reverts commit 845620ec5d3b836956c2eee09cab8dcf0ba89636.
2021-08-16Merge tag 'v5.4.140' into 5.4-2.3.x-imxAndrey Zhizhikin
This is the 5.4.140 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-08-12ARM: imx: fix missing 3rd argument in macro imx_mmdc_perf_initColin Ian King
[ Upstream commit 20fb73911fec01f06592de1cdbca00b66602ebd7 ] The function imx_mmdc_perf_init recently had a 3rd argument added to it but the equivalent macro was not updated and is still the older 2 argument version. Fix this by adding in the missing 3rd argumement mmdc_ipg_clk. Fixes: f07ec8536580 ("ARM: imx: add missing clk_disable_unprepare()") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-12ARM: imx: add missing clk_disable_unprepare()Yang Yingliang
[ Upstream commit f07ec85365807b3939f32d0094a6dd5ce065d1b9 ] clock source is prepared and enabled by clk_prepare_enable() in probe function, but no disable or unprepare in remove and error path. Fixes: 9454a0caff6a ("ARM: imx: add mmdc ipg clock operation for mmdc") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-12ARM: imx: add missing iounmap()Yang Yingliang
[ Upstream commit f9613aa07f16d6042e74208d1b40a6104d72964a ] Commit e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") introduced imx_mmdc_remove(), the mmdc_base need be unmapped in it if config PERF_EVENTS is enabled. If imx_mmdc_perf_init() fails, the mmdc_base also need be unmapped. Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-04Merge tag 'v5.4.135' into 5.4-2.3.x-imxAndrey Zhizhikin
This is the 5.4.135 stable release Conflicts (manual resolve): - drivers/usb/cdns3/gadget.c: Use NXP version, as upstream commit f53729b828db7 ("usb: cdns3: Enable TDL_CHK only for OUT ep") is already applied. - arch/arm64/boot/dts/freescale/imx8mq.dtsi: Merge upstream commit 556cf02830351 ("arm64: dts: imx8mq: assign PCIe clocks") manually into NXP tree. Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-07-25ARM: imx: pm-imx5: Fix references to imx5_cpu_suspend_infoJonathan Neuschäfer
[ Upstream commit 89b759469d525f4d5f9c29cd3b1f490311c67f85 ] The name of the struct, as defined in arch/arm/mach-imx/pm-imx5.c, is imx5_cpu_suspend_info. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-05Merge commit '28910e01c43d9735f06fddbeaa42df3e112d1b3e' into ↵Marcel Ziswiler
toradex_5.4-2.3.x-imx This basically contains NXP BSP Patch L5.4.70_2.3.2 plus kernel.org v5.4.115 from https://github.com/Freescale/linux-fslc/tree/5.4-2.3.x-imx. Related-to: ELB-3958 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2021-02-04Merge tag 'v5.4.95' into 5.4-2.3.x-imxAndrey Zhizhikin
This is the 5.4.95 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-02-03ARM: imx: build suspend-imx6.S with arm instruction setMax Krummenacher
commit a88afa46b86ff461c89cc33fc3a45267fff053e8 upstream. When the kernel is configured to use the Thumb-2 instruction set "suspend-to-memory" fails to resume. Observed on a Colibri iMX6ULL (i.MX 6ULL) and Apalis iMX6 (i.MX 6Q). It looks like the CPU resumes unconditionally in ARM instruction mode and then chokes on the presented Thumb-2 code it should execute. Fix this by using the arm instruction set for all code in suspend-imx6.S. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Fixes: df595746fa69 ("ARM: imx: add suspend in ocram support for i.mx6q") Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-28ARM: imx6: fix setting up pm_power_off callbackOleksandr Suvorov
It is not necessarily that the system with set up the POWER_RESET_GPIO config option has the enabled device "gpio-poweroff". Without this device the "pm_power_off" callback remains uninitialized and the syscall "reboot" converts the signal LINUX_REBOOT_CMD_POWER_OFF into LINUX_REBOOT_CMD_HALT. This leads to skip calling the callback "pm_power_off_prepare" that should do an important work for iMX6+PF0100 systems: it should turns down all power rails of PMIC PF0100 to emulate a "power off" state as a workaround for a PMIC PF0100 with PMIC_ON_REQ and VCC_BATT is supplied from a battery, leading to unable to restart the module either by RESET or power cycle. Note, that gpio-poweroff device still can grab the pm_power_off callback using the property "force-mode" introduced in the commit: 964f69e00a4d ("power: reset: gpio-poweroff: add force-mode") Enable setting pm_power_off callback on the system with POWER_RESET_GPIO config option. Related-to: ELB-3008 Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2021-01-27mach-imx: Kconfig: fix have_imx_busfreqMax Krummenacher
The busfreq driver works also for i.MX6 but currently HAVE_IMX_BUSFREQ is not selected when one only selects HAVE_IMX_MMDC. (I.e. one removes the i.MX 7 form defconfing). This results in compile errors. | arch/arm/mach-imx/busfreq-imx.c:176:5: error: redefinition of ‘register_busfreq_notifier’ | int register_busfreq_notifier(struct notifier_block *nb) | ^~~~~~~~~~~~~~~~~~~~~~~~~ | In file included from arch/arm/mach-imx/busfreq-imx.c:23:0: | ./include/linux/busfreq-imx.h:64:19: note: previous definition of ‘register_busfreq_notifier’ was here | static inline int register_busfreq_notifier(struct notifier_block *nb) | ... Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-01-27ARM: mach-imx: Makefile: add missing files to SOC_IMX6ULPhilippe Schenker
Our iMX6ULL needs definitions from ddr3_freq_imx6sx.S and lpddr2_freq_imx6sx.S. Make sure those files get also compiled if only SOC_IMX6UL is selected without SOC_IMX6SX Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Conflicts: arch/arm/mach-imx/Makefile Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2021-01-27ARM: imx: Add support for iMX7Philippe Schenker
iMX7 did not compile due to missing compilation of platsmp.o that is selected with CONFIG_SMP. This commit fixes that Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2021-01-27mach-imx: busfreq-imx: add ifdef for parts not compilingPhilippe Schenker
not compiling if HAVE_IMX_BUSFREQ is set. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2021-01-27ARM: mach-imx6q: add ksz9131rn_phy_fixupPhilippe Schenker
The MAC of the i.MX6 SoC is compliant with RGMII v1.3. The KSZ9131 PHY is like KSZ9031 adhering to RGMII v2.0 specification. This means the MAC should provide a delay to the TXC line. Because the i.MX6 MAC does not provide this delay this has to be done in the PHY. This patch adds by default ~1.4ns delay to the TXC line. This should be good for all boards that have all RGMII signals routed with the same length. The KSZ9131 has relatively high tolerances on skew registers from MMD 2.4 to MMD 2.8. Therefore the new DLL-based delay of 2ns is used and then as little as possibly subtracted from that so we get more accurate delay. This is actually needed because the i.MX6 SoC has an asyn skew on TXC from -100ps to 900ps. Related-to: ELB-1299 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> (cherry picked from commit 0cf423645e21389cf64d2e1b3a99c38eb1db60a8)
2021-01-27arm: imx: fix handling power stuff without psciMarcel Ziswiler
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit d0d18d2cef51b12704f8c3c3bad6fb6cf9b3cdf3) Conflicts: arch/arm/mach-imx/pm-imx6.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2021-01-27arm: imx: gpc: do not poweroff M/F mix in suspendMax Krummenacher
The Colibri iMX6ULL 256MB crashes in resume if the M/F mix domain is powered down when suspending. With this workaround this does not happen. Crash looks as follows: root@colibri-imx6ull:~# echo +3 > /sys/class/rtc/rtc1/wakealarm; echo mem > /sys/power/state [ 52.800741] PM: Syncing filesystems ... done. [ 52.856715] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 52.865669] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 52.875024] Suspending console(s) (use no_console_suspend to debug) [ 52.950638] PM: suspend of devices complete after 68.211 msecs [ 52.952506] PM: late suspend of devices complete after 1.835 msecs [ 52.954292] PM: noirq suspend of devices complete after 1.757 msecs [ 52.954300] Disabling non-boot CPUs ... [ 52.954307] Turn off M/F mix! [ 52.955663] PM: noirq resume of devices complete after 1.222 msecs [ 52.956767] imx-sdma 20ec000.sdma: loaded firmware 3.3 [ 52.957669] PM: early resume of devices complete after 1.411 msecs [ 52.959140] gpmi-nand 1806000.gpmi-nand: use legacy bch geometry [ 53.005653] Suspended for 2.907 seconds [ 53.012207] PM: resume of devices complete after 54.507 msecs [ 53.073751] Restarting tasks ... done. root@colibri-imx6ull:~# [ 55.049753] gpmi-nand 1806000.gpmi-nand: DMA timeout, last DMA :2 [ 55.056377] gpmi-nand 1806000.gpmi-nand: Show GPMI registers : [ 55.062835] gpmi-nand 1806000.gpmi-nand: offset 0x000 : 0x00000000 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 42adf593bd4eb47fe0929301558398a1ec8b3cf7)
2021-01-27ARM: imx: mach-imx7d: configure clock source per FEC instanceStefan Agner
Configure Ethernet clock source for each FEC instance individually. This allows to use different clock source setting for the two FEC controllers. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 6e8c92325b34a787c6f75bc96a4cf852cd5a6bed)
2021-01-27ARM: imx: mach-imx7d: put external ethernet clock in error caseStefan Agner
Exit early in case General-Purpose Registers are missing. This makes sure that clock is always freed properly (clk_put). Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 40e8d2e6a9bfc21a7248dca77a96c82c150bfbca)
2021-01-27busfreq-imx: only use existing global variablesMax Krummenacher
The struct arm_reg and soc_reg are declared in by a extern statement in include/linux/busfreq-imx.h. However they are only declared when imx6-cpufreq.c is compiled and linked. Qualify the use of arm_reg and soc_reg with the relevant config option and change KConfig to switch that option on for the SoCs which use it. This fixes the following build issue when building for i.MX 7 with option ARM_IMX6Q_CPUFREQ not set: arch/arm/mach-imx/built-in.o: In function `imx6ull_lower_cpu_rate': platform-imx-dma.c:(.text+0x5514): undefined reference to `arm_reg' platform-imx-dma.c:(.text+0x551c): undefined reference to `arm_reg' platform-imx-dma.c:(.text+0x553c): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x5544): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x5598): undefined reference to `arm_reg' platform-imx-dma.c:(.text+0x55a0): undefined reference to `arm_reg' platform-imx-dma.c:(.text+0x55ac): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x55b4): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x55c8): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x55d0): undefined reference to `soc_reg' platform-imx-dma.c:(.text+0x55f0): undefined reference to `arm_reg' platform-imx-dma.c:(.text+0x55f8): undefined reference to `arm_reg' Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Dominik Sliwa <dominik.sliwa@toradex.com> (cherry picked from commit 3f68dc7c600c0354f5df7f06b931661319addafb) (cherry picked from commit e9289b70128d018c12adb591d62724e09cc5b1a6) Conflicts: arch/arm/mach-imx/Kconfig Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-01-27ARM: imx: spare the first 16KiB of OCRAM_S for Cortex-M4Stefan Agner
The Cortex-M4 boot vector table is located in the OCRAM_S. When building a firmware with a complete vector table at 0x00000000 Linux overwrites the vector table with suspend information. Use the higher 16KiB for suspend related information so that we can use the lower 16KiB for the Cortex-M4 core. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit a8e0d437843393309b6db46c0e19f9da0b5d213b) (cherry picked from commit 00a4494d5be2134b620b6f006f41a0b31c543b9c)
2021-01-27apalis-imx6: use stopmode for poweroffMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 051ee1a1c24058db62f10a177b1271daebbd2ebe) (cherry picked from commit 3893dd0996832c23e959ce22c00873c08c0028ee) Conflicts: drivers/power/reset/imx-snvs-poweroff.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-01-27pm-imx6.c: fix power off by stop modeMax Krummenacher
With the 3.14.28 release of the kernel imx6_stop_mode_poweroff() does not enter stop mode. Thus the function does not switch of power but returns. This seems to be caused by the second processor which has been stopped. Set the WFI event mask for the stopped processor works around the issue. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry-picked from commit 2acff0eaece38533e85e08431e7ae9f3027c677a) (cherry picked from commit 894914718e9e563eb601e0090e1ae2ddadf426a9) (cherry picked from commit 8f6f5d08f22518078a41b1d87db7d4aecfc2d275)
2021-01-27colibri-imx6: use stopmode for poweroffMax Krummenacher
After the system has been shutdown with PMIC_ON_REQ and VCC_BATT is supplied from a battery it will never restart either by RESET or power cycle. So use the PMIC_STBY_REQ after shutdown to switch off power rails. Conflicts: arch/arm/mach-imx/pm-imx6.c drivers/regulator/pfuze100-regulator.c (cherry-picked from commit c8b186404065c4502b485820ad4a51515924795c) (cherry-picked from commit ee4c5c4da3b32f65528a2d523ca4bce574dee3c5) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 29ff2389ecf7cb4e30924c80b8d42165cf306936) (cherry picked from commit efeecd9892caa4e6c35a314c73a38c1f45969ab1) Conflicts: drivers/power/reset/imx-snvs-poweroff.c drivers/regulator/pfuze100-regulator.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-01-27ARM: imx: mu: let Cortex-M4 know about A7 stateStefan Agner
Introduce two new messages to let the Cortex-M4 know in what state the Linux system is in. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit a86db1f7117a62019106e343ff894c6bd4da053d) (cherry picked from commit 44be297f22261a4cd6c725213333eabf7ddcf491)
2021-01-27mach-imx6q.c: handle RESET_MOCI when PCIe is disabledMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 02110528b45ae331d89f7e7bb6a29b5494ec0be1) (cherry picked from commit 8d07763eb1d6a2a11e9b237ac94b8de43183b02e) Conflicts: arch/arm/mach-imx/mach-imx6q.c (cherry picked from commit bea05755680df306e93e5a13f730fd1db203f947) (cherry picked from commit 0b65ce13931d602032e32181f6f2ddb80058b11d)
2021-01-27mach-imx7d.c: use enet_out clk to decide on PHY clockMax Krummenacher
The i.MX 7 can provide a reference clock to the PHY or use a reference clock from an external circuit. If the device-tree node with compatible "fsl,imx7d-fec" has a clock named enet_out then provide the clock from the i.MX 7, if such a clock is missing use a clock provided from an external circuit. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit 73c06d69321c45b69ffc864cbaaa7143da87d186) (cherry picked from commit d46df0826a9f948f05b71da80aa9397cb9337537) (cherry picked from commit 6cc8215ec5dc009d87a8ae862ee2f8a0ae46ac62)
2021-01-27ARM: imx: enet1: output reference clockMax Krummenacher
Enable output driver of Ethernet reference clock. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit dab46121a94916a253d7283c8b85ea6dcfb6e628) (cherry picked from commit 0adde3fe0129ae91e71e079c495b5c28974663c8) (cherry picked from commit 76f5adda796b70dfd13eed83b0358d2585266430)
2021-01-11arm: imx: include i.MX6SX DDR freq implementation for i.MX6ULMatthias Schiffer
Fixes a build failure because of undefined symbols in i.MX6UL-only configurations. The same is done in rel_imx_4.14.78_1.0.0_ga. Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com> (cherry picked from commit 129a6fad43b89565af5a6463e29d1cf42b62bc0b) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11arm: imx: do not include smp_wfe_imx6.S for i.MX6SXMatthias Schiffer
smp_wfe_imx6 is only used for i.MX6Q. Including it in i.MX6SX-only configurations causes two build issues: - The symbols it defines conflict with fallback definitions in common.c - It scu_power_mode, which is undefined without HAVE_ARM_SCU Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com> (cherry picked from commit e85ce3157725a6e3e77a17d6c4e0acec9de1d690) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11arm: imx: enable HAVE_IMX_BUSFREQ for i.MX6Matthias Schiffer
All i.MX6 variants reference imx_busfreq_map_io() and thus fail to build without Busfreq. Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com> (cherry picked from commit 4f49200132e6d252cca49d5d97be69a7a26495a2) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11arm: imx: do not build busfreq without HAVE_IMX_BUSFREQMatthias Schiffer
busfreq-imx.c fails to build when HAVE_IMX_BUSFREQ is not set. Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com> (cherry picked from commit 5d229c51b5a5265abdb16f4e8a082816020da7a7) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11ARM: imx: Fix boot crash if ocotp is not foundLeonard Crestez
The imx_soc_device_init functions tries to fetch the ocotp regmap in order to soc serial number. If regmap fetch fails then a message is printed but regmap_read is called anyway and the system crashes. Failing to lookup ocotp regmap shouldn't be a fatal boot error so check that the pointer is valid. Only side-effect of ocotp lookup failure now is that serial number will be reported as all-zeros which is acceptable. Cc: stable@vger.kernel.org Fixes: 8267ff89b713 ("ARM: imx: Add serial number support for i.MX6/7 SoCs") Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Tested-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> (cherry picked from commit 7947e3238b64c00c396e6f5738f94c4d653bc6a2) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11ARM: imx: Correct ocotp id for serial number support of i.MX6ULL/ULZ SoCsChristoph Niedermaier
After the commit 8267ff89b713 ("ARM: imx: Add serial number support for i.MX6/7 SoCs") the kernel doesn't start on i.MX6ULL/ULZ SoC. Tested on next-20191205. For i.MX6ULL/ULZ the variable "ocotp_compat" is set to "fsl,imx6ul-ocotp", but with commit ffbc34bf0e9c ("nvmem: imx-ocotp: Implement i.MX6ULL/ULZ support") and commit f243bc821ee3 ("ARM: dts: imx6ull: Fix i.MX6ULL/ULZ ocotp compatible") the value "fsl,imx6ull-ocotp" is already defined and set in device tree... By setting "ocotp_compat" to "fsl,imx6ull-ocotp" the kernel does boot. Fixes: 8267ff89b713 ("ARM: imx: Add serial number support for i.MX6/7 SoCs") Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> (cherry picked from commit 125ad46f3861520fdebd15c38e4bc412a7add01c) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2021-01-11ARM: imx: Add serial number support for i.MX6/7 SoCsAnson Huang
i.MX6/7 SoCs have a 64-bit SoC unique ID stored in OCOTP, it can be used as SoC serial number, add this support for i.MX6Q/6DL/6SL/6SX/6SLL/6UL/6ULL/6ULZ/7D, see below example on i.MX6Q: root@imx6qpdlsolox:~# cat /sys/devices/soc0/serial_number 240F31D4E1FDFCA7 Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> (cherry picked from commit 8267ff89b71317407f2c6938bd66f3a87070e45f) Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2020-10-30MLK-24940 arm: imx: correctly check the return value of "of_get_mac_address"Fugang Duan
commit d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") introduces more return value types, so it has to use IS_ERR to check the return value. Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2020-10-08Merge tag 'v5.4.70' into imx_5.4.yJason Liu
* tag 'v5.4.70': (3051 commits) Linux 5.4.70 netfilter: ctnetlink: add a range check for l3/l4 protonum ep_create_wakeup_source(): dentry name can change under you... ... Conflicts: arch/arm/mach-imx/pm-imx6.c arch/arm64/boot/dts/freescale/imx8mm-evk.dts arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts drivers/crypto/caam/caamalg.c drivers/gpu/drm/imx/dw_hdmi-imx.c drivers/gpu/drm/imx/imx-ldb.c drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c drivers/mmc/host/sdhci-esdhc-imx.c drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c drivers/net/ethernet/freescale/enetc/enetc.c drivers/net/ethernet/freescale/enetc/enetc_pf.c drivers/thermal/imx_thermal.c drivers/usb/cdns3/ep0.c drivers/xen/swiotlb-xen.c sound/soc/fsl/fsl_esai.c sound/soc/fsl/fsl_sai.c Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2020-09-24MLK-24836 ARM: imx: Refresh wdog should consider the CMD mode on i.MX7ULPAnson Huang
When refresh i.MX7ULP wdog during resume, need to check if wdog is power gate or NOT, as the command mode is different, if using incorrect refresh command, it will trigger system reset immediately, so add CMD32 bit check to make it work for both standby and mem mode suspend. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2020-09-23MLK-24824-3 ARM: imx: Refresh wdog1 to make sure it is NOT timeout before ↵Anson Huang
disabled i.MX7ULP's wdog1 is enabled by default when it is out of reset, the default timeout value is 0x400 which is NOT safe enough to make sure NOT timeout before wdog driver resume, so need to refresh wdog1 to buy more time for wdog driver resume which will reconfigurate the wdog. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2020-09-22MLK-24828 ARM: imx: Add revision support for i.MX7ULP rev 2.2Anson Huang
On i.MX7ULP rev 2.2, the rev value is 3, so add support for this revision, otherwise, it will use default revision of 1.0 which is incorrect. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2020-09-22MLK-24821 ARM: imx: Increase RBC counter to for successful LPM mode enter on ↵Anson Huang
i.MX7D Current RBC counter value of 0x8(~240us) is NOT enough to block interrupt when entering low power mode, when interrupt arrives during the window of GIC dist disabled and low power mode enter NOT finished, system will stuck at WFI and never wake up, increasing RBC counter can avoid this situation, since the latency introduced by RBC counter is quite trivial, so here just use the MAX value of 0x3f(~2ms) to make it safe enough. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2020-07-23MLK-20389 Changed OPTEE busfreq traceCedric Neveux
To be able to constat that busfreq is started/done vith OPTEE OS, changed the mach-imx/busfreq_optee.c pr_debug macro with printk(KERN_DEBUG ...) Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com> Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com> (cherry picked from commit 8e416ebaada127eeb408cf2e2ffc41202933eebb)
2020-07-23MLK-20582 Fix busfreq compilation CONFIG_OPTEE=nCedric Neveux
Compilation error with busfreq optee when CONFIG_OPTEE=n Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com> Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com> (cherry picked from commit db9e345f9bd67048bcb17d9df306b35f64abbb14)
2020-07-23MLK-20450 Fix Linux NO SMP kernel with OPTEECedric Neveux
- Fix busfreq optee mode to not install the linux assembly function used to synchronize all CPU in case of SMP mode - Fix l2cache OPTEE/Linux share mutex operations Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> (cherry picked from commit 68f47bb3328e56c63d647f855fc654f4736658ce) Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
2020-07-23MLK-20023 Move Busfreq support to OPTEE OSCedric Neveux
- When OPTEE OS is present and if it support the busfreq for the running the i.MX, the busfreq is executed in the OPTEE OS by calling a specific SMC function - Only a WFE function is copied into the OCRAM to synchronize all Cores in multi-core devices - OPTEE OS add a DT property 'busfreq=1' in the 'firmware/optee' node to indicate the busfreq support Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>