summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
AgeCommit message (Collapse)Author
2020-11-13Merge commit '70d1232fdbe28e4c765c4cfc3cc5c7580959d5e0' into ↵Igor Opaniuk
toradex_5.4-2.1.x-imx Update 5.4-2.1.x-imx to v5.4.74 from [1]. [1] https://github.com/Freescale/linux-fslc
2020-10-27ARM: 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>
2020-08-27arm: 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>
2020-08-27arm: 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>
2020-08-27arm: 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>
2020-08-27arm: 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>
2020-08-26mach-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>
2020-08-26Revert "mach-imx: busfreq-imx: add ifdef for parts not compiling"Max Krummenacher
This reverts commit 85d5a4fb64792073119c6514f6e9e73ab8d690d0. With this, on our i.MX 6 defconfig, i.e. with no i.MX 7 drivers enabled the busfreq drivers set the DDR frequency to 24 MHz soon after boot and renders a lot useless, i.e. display output. Revert in favour of a better fix. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-08-18ARM: 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) (cherry picked from commit 40a6a98b3f3806edb478bf18d6a28a204a422c2d)
2020-08-18ARM: 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) (cherry picked from commit 8aad5031be0017a3cc2e501da8cfcb56ede05912)
2020-08-18ARM: 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) (cherry picked from commit 134cbb845fc70291428b1483e1622686c54231cd)
2020-08-13ARM: 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>
2020-08-13ARM: 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>
2020-08-13mach-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>
2020-08-13ARM: 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)
2020-08-13arm: 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>
2020-08-13arm: 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)
2020-08-13ARM: 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)
2020-08-13ARM: 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)
2020-08-13imx: Fix 'Expose SoC unique ID' for newer i.MX6Max Krummenacher
i.MX6 SL/UL/ULL use a different node in the device tree for with ocotp. So change to the relevant compatible string for these SoCs. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit 7b02a99744e495f630bdb5081c516d40e8112685) (cherry picked from commit 7ede92752381a58ef8a5ded3612d15e37f3f8e1d)
2020-08-13busfreq-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>
2020-08-13ARM: 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)
2020-08-13apalis-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>
2020-08-13pm-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)
2020-08-13colibri-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>
2020-08-13ARM: 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)
2020-08-13imx: Expose SoC unique IDBhuvanchandra DV
Expose SoC unique ID read from OCOTP registers. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 9090b5b90ccc350611a769230eab3fbc20c9d302) (cherry picked from commit d87ce48dd815f1a0885ad6eb0803e698cc502f4d) Conflicts: arch/arm/mach-imx/cpu.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-08-13mach-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)
2020-08-13mach-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)
2020-08-13ARM: 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)
2020-08-11ARM: imx6: revert changes done by v5.4.52 mergeRicardo Salveti
Commit 567092c5f634cbd7b29472b1063d442b62b3b49b (Merge tag 'v5.4.52' into 5.4-1.0.0-imx) ended up bringing the pm-imx6.c content from upstream, as a consequence of applying 10533390da7cf1e2750c63dae44cacfa5964dce1 (ARM: imx6: add missing put_device() call in imx6q_suspend_init()), making the current version incompatible with the rest of the BSP-based tree. This was noticed when building the kernel for a iMX6-based device that used pm-imx6, as the build failed due missing imx6_pm_map_io. Signed-off-by: Ricardo Salveti <ricardo@foundries.io> (cherry picked from commit 2483a913d814b84b686d6b88e1da366cb3eade19)
2020-08-11Merge tag 'v5.4.52' into 5.4-2.1.x-imxAndrey Zhizhikin
This is the 5.4.52 stable release Conflicts (manual resolve, NXP version kept): arch/arm/mach-imx/pm-imx6.c NXP version has a different PM vectoring scheme, where the IRAM bottom half (8k) is used to store IRAM code and pm_info. Keep this version to be compatible with NXP PM implementation. Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2020-08-11Merge tag 'v5.4.50' into 5.4-2.1.x-imxAndrey Zhizhikin
This is the 5.4.50 stable release Conflicts (manual resolve): arch/arm64/boot/dts/freescale/imx8mm-evk.dts: arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts: NXP patches kept to provide proper LDO setup: imx8mm-evk.dts: 975d8ab07267ded741c4c5d7500e524c85ab40d3 imx8mn-ddr4-evk.dts: e8e35fd0e759965809f3dca5979a908a09286198 drivers/net/ethernet/freescale/enetc/enetc.c Commit [ce06fcb6a66d22b080385768113ee28bf3593984] from upstream merged, base NXP version kept drivers/usb/cdns3/ep0.c Manual merge of commit [be8df027079b856a89e85778330394cea2b0b290] from upstream to protect cdns3_check_new_setup Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2020-07-16ARM: imx6: add missing put_device() call in imx6q_suspend_init()yu kuai
[ Upstream commit 4845446036fc9c13f43b54a65c9b757c14f5141b ] if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Signed-off-by: yu kuai <yukuai3@huawei.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-07Merge tag 'v5.4.47' into 5.4-2.1.x-imxMax Krummenacher
This is the 5.4.47 stable release All conflicts resolved in favour of HEAD, i.e. 5.4-2.1.x-imx Conflicts: arch/arm/boot/dts/imx6qdl.dtsi arch/arm/mach-imx/Kconfig arch/arm/mach-imx/common.h arch/arm/mach-imx/suspend-imx6.S arch/arm64/boot/dts/freescale/imx8qxp-mek.dts arch/powerpc/include/asm/cacheflush.h drivers/cpufreq/imx6q-cpufreq.c drivers/dma/imx-sdma.c drivers/edac/synopsys_edac.c drivers/firmware/imx/imx-scu.c drivers/net/ethernet/freescale/fec.h drivers/net/ethernet/freescale/fec_main.c drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c drivers/net/phy/phy_device.c drivers/perf/fsl_imx8_ddr_perf.c drivers/usb/cdns3/gadget.c drivers/usb/dwc3/gadget.c include/uapi/linux/dma-buf.h Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-06-30ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram()yu kuai
[ Upstream commit 586745f1598ccf71b0a5a6df2222dee0a865954e ] if of_find_device_by_node() succeed, imx_suspend_alloc_ocram() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: 1579c7b9fe01 ("ARM: imx53: Set DDR pins to high impedance when in suspend to RAM.") Signed-off-by: yu kuai <yukuai3@huawei.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-29ARM: imx: provide v7_cpu_resume() only on ARM_CPU_SUSPEND=yAhmad Fatoum
commit f1baca8896ae18e12c45552a4c4ae2086aa7e02c upstream. 512a928affd5 ("ARM: imx: build v7_cpu_resume() unconditionally") introduced an unintended linker error for i.MX6 configurations that have ARM_CPU_SUSPEND=n which can happen if neither CONFIG_PM, CONFIG_CPU_IDLE, nor ARM_PSCI_FW are selected. Fix this by having v7_cpu_resume() compiled only when cpu_resume() it calls is available as well. The C declaration for the function remains unguarded to avoid future code inadvertently using a stub and introducing a regression to the bug the original commit fixed. Cc: <stable@vger.kernel.org> Fixes: 512a928affd5 ("ARM: imx: build v7_cpu_resume() unconditionally") Reported-by: Clemens Gruber <clemens.gruber@pqgruber.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13ARM: imx: only select ARM_ERRATA_814220 for ARMv7-AArnd Bergmann
commit c74067a0f776c1d695a713a4388c3b6a094ee40a upstream. i.MX7D is supported for either the v7-A or the v7-M cores, but the latter causes a warning: WARNING: unmet direct dependencies detected for ARM_ERRATA_814220 Depends on [n]: CPU_V7 [=n] Selected by [y]: - SOC_IMX7D [=y] && ARCH_MXC [=y] && (ARCH_MULTI_V7 [=n] || ARM_SINGLE_ARMV7M [=y]) Make the select statement conditional. Fixes: 4562fa4c86c9 ("ARM: imx: Enable ARM_ERRATA_814220 for i.MX6UL and i.MX7D") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Cc: Christian Eggers <ceggers@arri.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13ARM: imx: Enable ARM_ERRATA_814220 for i.MX6UL and i.MX7DAnson Huang
commit 4562fa4c86c92a2df635fe0697c9e06379738741 upstream. ARM_ERRATA_814220 has below description: The v7 ARM states that all cache and branch predictor maintenance operations that do not specify an address execute, relative to each other, in program order. However, because of this erratum, an L2 set/way cache maintenance operation can overtake an L1 set/way cache maintenance operation. This ERRATA only affected the Cortex-A7 and present in r0p2, r0p3, r0p4, r0p5. i.MX6UL and i.MX7D have Cortex-A7 r0p5 inside, need to enable ARM_ERRATA_814220 for proper workaround. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Cc: Christian Eggers <ceggers@arri.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-09MLK-23763 arm: imx: Remove the redundant code in pm-imx6Jacky Bai
remove the unused node define & related code. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2020-03-12ARM: imx: build v7_cpu_resume() unconditionallyAhmad Fatoum
commit 512a928affd51c2dc631401e56ad5ee5d5dd68b6 upstream. This function is not only needed by the platform suspend code, but is also reused as the CPU resume function when the ARM cores can be powered down completely in deep idle, which is the case on i.MX6SX and i.MX6UL(L). Providing the static inline stub whenever CONFIG_SUSPEND is disabled means that those platforms will hang on resume from cpuidle if suspend is disabled. So there are two problems: - The static inline stub masks the linker error - The function is not available where needed Fix both by just building the function unconditionally, when CONFIG_SOC_IMX6 is enabled. The actual code is three instructions long, so it's arguably ok to just leave it in for all i.MX6 kernel configurations. Fixes: 05136f0897b5 ("ARM: imx: support arm power off in cpuidle for i.mx6sx") Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10LF-388 ARM: imx: Add AXI clock parent switch for i.MX6DL low bus modeAnson Huang
On i.MX6DL, AXI clock is from 540M PFD in normal mode, and from periph clk in low bus mode, so need to make sure AXI clock parent switch correctly in normal mode and low bus mode. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2019-12-04LF-351 ARM: imx: Correct the soc_id on imx6qpJacky Bai
On i.MX6QP, the soc_id exported to the /sys/devices/soc0/soc_id should be 'i.MX6QP'. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Anson Huang <anson.huang@nxp.com>
2019-12-03LF-319 ARM: imx: Enable ARM_ERRATA_814220 for i.MX6UL and i.MX7DAnson Huang
i.MX6UL and i.MX7D have Cortex-A7 inside, need to enable ARM_ERRATA_814220 for proper workaround. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2019-11-28LF-171 ARM: imx: Add cpu type check for imx6ulz in msl codeJacky Bai
Add cpu type check for i.MX6ULZ in MSL code to support low power feature. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2019-11-27LF-176 ARM: imx: mach-imx6q: Revert "ARM: imx: correct the enet_clk_ref ↵Fugang Duan
clock string" enet_clk_ref is the same clock as ptp for i.MX6qdl platform, but dtsi only define ptp clock that source from soc internal anatop clock, and imx6q clock driver already register "enet_ref" clock lookup for the ptp clock, so keep the con_id string as "enet_ref" for clk_get_sys(). This reverts commit a3990871b98587f53548e769c23fda5c2644063c. Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2019-11-25MLK-23008 ARM: imx: Remove unused code on i.MX7D suspend driverAnson Huang
Remove unused code on i.MX7D suspend driver. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2019-11-25MLK-23002 ARM: imx: Make sure system counter frequency change successfullyAnson Huang
During system counter frequency change, the counter will stop, it takes several mS even up to 20mS to finish the frequency change, if system enters STOP mode before the frequency change done, system counter will NOT run during STOP mode, then it will case system time inaccurate and sometimes cause below RCU stall, so system can ONLY enter STOP mode after the system counter frequency change done by checking the ACK of frequency change. rtc_testapp_6 0 TINFO : Waiting 50 seconds for alarm....... fec 30be0000.ethernet eth0: Link is Down PM: suspend devices took 0.670 seconds Disabling non-boot CPUs ... Enabling non-boot CPUs ... rcu: INFO: rcu_sched self-detected stall on CPU rcu: 0-...!: (1 ticks this GP) idle=1f6/1/0x40000002 softirq=5240/5240 fqs=0 (t=4903 jiffies g=3737 q=4) rcu: rcu_sched kthread starved for 4903 jiffies! g3737 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->0 rcu: RCU grace-period kthread stack dump: rcu_sched I 0 10 2 0x00000000 [<c0d85a9c>] (__schedule) from [<c0d85e64>] (schedule+0x50/0xc4) [<c0d85e64>] (schedule) from [<c0d8b8fc>] (schedule_timeout+0x1b8/0x37c) [<c0d8b8fc>] (schedule_timeout) from [<c01b9f2c>] (rcu_gp_kthread+0x8cc/0x1678) [<c01b9f2c>] (rcu_gp_kthread) from [<c015f12c>] (kthread+0x114/0x14c) [<c015f12c>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20) Exception stack(0xd80fdfb0 to 0xd80fdff8) dfa0: 00000000 00000000 00000000 00000000 dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 NMI backtrace for cpu 0 CPU: 0 PID: 834 Comm: rtc_testapp_6 Not tainted 5.4.0-rc7-03214-g56a9ca3 #105 Hardware name: Freescale i.MX7 Dual (Device Tree) [<c01126e4>] (unwind_backtrace) from [<c010cf3c>] (show_stack+0x10/0x14) [<c010cf3c>] (show_stack) from [<c0d691dc>] (dump_stack+0xe4/0x118) [<c0d691dc>] (dump_stack) from [<c0d70678>] (nmi_cpu_backtrace+0xac/0xbc) [<c0d70678>] (nmi_cpu_backtrace) from [<c0d70768>] (nmi_trigger_cpumask_backtrace+0xe0/0x130) [<c0d70768>] (nmi_trigger_cpumask_backtrace) from [<c01be188>] (rcu_dump_cpu_stacks+0x9c/0xd8) [<c01be188>] (rcu_dump_cpu_stacks) from [<c01bd254>] (rcu_sched_clock_irq+0x940/0xbec) [<c01bd254>] (rcu_sched_clock_irq) from [<c01c5758>] (update_process_times+0x2c/0x54) [<c01c5758>] (update_process_times) from [<c01d9cf0>] (tick_sched_timer+0x5c/0xc0) [<c01d9cf0>] (tick_sched_timer) from [<c01c6bf8>] (__hrtimer_run_queues+0x140/0x548) [<c01c6bf8>] (__hrtimer_run_queues) from [<c01c792c>] (hrtimer_interrupt+0x134/0x2bc) [<c01c792c>] (hrtimer_interrupt) from [<c097eb00>] (arch_timer_handler_phys+0x2c/0x34) [<c097eb00>] (arch_timer_handler_phys) from [<c01a6b1c>] (handle_percpu_devid_irq+0xd4/0x384) [<c01a6b1c>] (handle_percpu_devid_irq) from [<c01a072c>] (generic_handle_irq+0x20/0x34) [<c01a072c>] (generic_handle_irq) from [<c01a0d34>] (__handle_domain_irq+0x64/0xe0) [<c01a0d34>] (__handle_domain_irq) from [<c0548510>] (gic_handle_irq+0x4c/0xa0) [<c0548510>] (gic_handle_irq) from [<c0101a70>] (__irq_svc+0x70/0x98) Exception stack(0xd8cedd00 to 0xd8cedd48) dd00: 00000001 d88a5d20 00000000 200a0013 00000000 00000000 c1b3f6f0 0000002a dd20: d8cec000 00000000 c1b3dbf8 c1b3d6f8 c16c82bc d8cedd50 c018fe50 c019dd68 dd40: 200a0013 ffffffff [<c0101a70>] (__irq_svc) from [<c019dd68>] (console_unlock+0x4e0/0x634) [<c019dd68>] (console_unlock) from [<c019f6c8>] (vprintk_emit+0xf4/0x2d0) [<c019f6c8>] (vprintk_emit) from [<c019f8c8>] (vprintk_default+0x24/0x2c) [<c019f8c8>] (vprintk_default) from [<c019fe9c>] (printk+0x2c/0x54) [<c019fe9c>] (printk) from [<c013b560>] (enable_nonboot_cpus+0x38/0x2cc) [<c013b560>] (enable_nonboot_cpus) from [<c019b4d0>] (suspend_devices_and_enter+0x374/0xa44) [<c019b4d0>] (suspend_devices_and_enter) from [<c019be8c>] (pm_suspend+0x2ec/0x3d0) [<c019be8c>] (pm_suspend) from [<c019a088>] (state_store+0x68/0xc8) [<c019a088>] (state_store) from [<c033305c>] (kernfs_fop_write+0xfc/0x1e0) [<c033305c>] (kernfs_fop_write) from [<c029d278>] (__vfs_write+0x2c/0x1d0) [<c029d278>] (__vfs_write) from [<c02a0184>] (vfs_write+0xa0/0x180) [<c02a0184>] (vfs_write) from [<c02a03e0>] (ksys_write+0x5c/0xd8) [<c02a03e0>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28) Exception stack(0xd8cedfa8 to 0xd8cedff0) dfa0: 00036294 00021590 00000004 bef5cd29 00000007 00000000 dfc0: 00036294 00021590 b6fc0d20 00000004 00000000 00000000 b6fc2fa4 00000000 dfe0: 00000004 bef5c8e8 b6f35d4f b6ec1d16 CPU1 is up imx6q-pcie 33800000.pcie: Phy link never came up imx6q-pcie 33800000.pcie: pcie link is down after resume. mmc1: queuing unknown CIS tuple 0x80 (2 bytes) mmc1: queuing unknown CIS tuple 0x80 (7 bytes) mmc1: queuing unknown CIS tuple 0x80 (6 bytes) PM: resume devices took 0.220 seconds OOM killer enabled. Restarting tasks ... done. PM: suspend exit Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com>
2019-11-25ARM: imx: add ipu csi mux setting for imx6qdlRobby Cai
add csi mux setting for imx6qdl Signed-off-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit 2e10c8c02446f4fd20ac98172e86b185892480ba)
2019-11-25ARM: imx: Remove PU power operation for i.MX6QPAnson Huang
The GPC power domain driver add GENPD_FLAG_RPM_ALWAYS_ON to the i.MX6QP's PU power domain flag, that means it is always ON for runtime PM but can be OFF during suspend, so no need to explicitly power ON/OFF PU power for i.MX6QP during suspend/resume to avoid below dump: Unable to handle kernel NULL pointer dereference at virtual address 00000044 pgd = 20824a30 [00000044] *pgd=4e36d831 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: CPU: 0 PID: 732 Comm: sh Tainted: G W 5.3.0-rc3-next-20190809-01770-g0a0b3ec-dir3 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) PC is at regmap_update_bits_base+0x10/0x74 LR is at imx6_pm_domain_power_on+0xbc/0x1b4 pc : [<c070887c>] lr : [<c05e18e4>] psr: 600001d3 sp : e9339d68 ip : e9338000 fp : c1a24158 r10: c1308b08 r9 : 00000260 r8 : c1308b08 r7 : c1426120 r6 : c1426120 r5 : c1373580 r4 : 00000000 r3 : 00000001 r2 : 00000001 r1 : 00000260 r0 : 00000000 Flags: nZCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 3949404a DAC: 00000051 Process sh (pid: 732, stack limit = 0x8ba716d6) Signed-off-by: Anson Huang <Anson.Huang@nxp.com>