summaryrefslogtreecommitdiff
path: root/drivers/soc
AgeCommit message (Collapse)Author
2020-02-07Merge tag 'v4.14.164' into 4.14-2.3.x-imxMarcel Ziswiler
This is the 4.14.164 stable release Conflicts: arch/arm/Kconfig.debug arch/arm/boot/dts/imx7s.dtsi arch/arm/mach-imx/cpuidle-imx6q.c arch/arm/mach-imx/cpuidle-imx6sx.c arch/arm64/kernel/cpu_errata.c arch/arm64/kvm/hyp/tlb.c drivers/crypto/caam/caamalg.c drivers/crypto/mxs-dcp.c drivers/dma/imx-sdma.c drivers/gpio/gpio-vf610.c drivers/gpu/drm/bridge/adv7511/adv7511_drv.c drivers/input/keyboard/imx_keypad.c drivers/input/keyboard/snvs_pwrkey.c drivers/mmc/core/block.c drivers/mmc/core/queue.h drivers/mmc/host/sdhci-esdhc-imx.c drivers/net/can/flexcan.c drivers/net/can/rx-offload.c drivers/net/ethernet/freescale/fec_main.c drivers/net/wireless/ath/ath10k/pci.c drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c drivers/pci/dwc/pci-imx6.c drivers/spi/spi-fsl-lpspi.c drivers/usb/dwc3/gadget.c include/net/tcp.h sound/soc/fsl/Kconfig sound/soc/fsl/fsl_esai.c
2019-12-20MLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domainsRanjani Vaidyanathan
Handle the case when powering down a pd with no active slave domains. Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com> (cherry picked from commit c5403cfa210cd44ba7c427a519a957e24b86dfb7)
2019-12-20MLK-22360 soc: imx8qm/imx8qxp: Fix power state of parent power domainsRanjani Vaidyanathan
Fix power state of parent power domains that have no device associated with them. Current power domain driver does not work well in two cases: 1. A device is controlled by multiple power domains 2. Multiple devices are controlled by a single power domain that is dependent on another power domain(s). This patch attempts to fix these two issues. Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com> (cherry picked from commit eb6a45d743ff61c1a802145a226c203c5ede155f)
2019-12-19drivers: seco_mu: Add support for signed messageSilvano di Ninno
Adding support for the signed message API. Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com> Reviewed-by: Stéphane Dion <stephane.dion_1@nxp.com> (cherry picked from commit bdb4cc7b429bd678255eb3b15f1683a9d916a21a)
2019-12-05SHE-17 soc: imx8: SECO MU driverStephane Dion
Driver to communicate with SECO over messaging unit. Expose a char device to user-space so user can write messages that will be sent to SECO and read messages received from it. Data that should be exchanged with SECO through shared memory are indicated to this driver through ioctl calls. Signed-off-by: Stephane Dion <stephane.dion_1@nxp.com> (cherry picked from commit eb721810fdc309b6a32a7a64c7686eaa6052cdc7) (cherry picked from commit db41bf52c2edf7c0936686d806eb4b2373b385a0)
2019-12-05SSI-87: soc: imx: secvio: Report to audit FW all security violationsFranck LENORMAND
Report to audit framework in case a secure violation is reported to the driver. Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2019-12-05SSI-87: soc: imx: secvio: Add support for SNVS secvio and tamper via SCFWFranck LENORMAND
The driver register an IRQ handle to SCU for security violation interrupt. When an interruption is fired, the driver inform the user. Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
2019-11-21MLK-22998-3 soc:imx: Update SCFW APIRanjani Vaidyanathan
Sync SCFW API to commit 6dcd0242ae Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
2019-11-20soc: qcom: wcnss_ctrl: Avoid string overflowNiklas Cassel
[ Upstream commit 4c96ed170d658d8826d94edec8ac93ee777981a2 ] 'chinfo.name' is used as a NUL-terminated string, but using strncpy() with the length equal to the buffer size may result in lack of the termination: drivers//soc/qcom/wcnss_ctrl.c: In function 'qcom_wcnss_open_channel': drivers//soc/qcom/wcnss_ctrl.c:284:2: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] strncpy(chinfo.name, name, sizeof(chinfo.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This changes it to use the safer strscpy() instead. Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-20soc: imx: gpc: fix PDN delaySven Schmitt
[ Upstream commit 9f4d61d531e0efc9c3283963ae5ef7e314579191 ] imx6_pm_domain_power_off() reads iso and iso2sw from GPC_PGC_PUPSCR_OFFS which stores the power up delays. So use GPC_PGC_PDNSCR_OFFS for the correct delays. Signed-off-by: Sven Schmitt <sven.schmitt@mixed-mode.de> Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-01MLK-22879-02 soc: imx: Update busfreq to support different frequncy setpointJacky Bai
On i.MX8M SOC family, we can support LPDDR4, DDR4 or DDR3L, we may need to support different setpoint for audio & low bus mode on different DDR type, So update the code to get all the supported setpoint info from ATF. The maximum setpoints that can be supported by hardware is 4, if the drate for a setpoint is '0', that means this setpoint is not enabled. We can use these info to find out the lowest drate setpoint for audio & low bus mode. BuildInfo: - ATF 59fe78cfe7 Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Anson Huang <anson.huang@nxp.com>
2019-06-15soc: rockchip: Set the proper PWM for rk3288Douglas Anderson
[ Upstream commit bbdc00a7de24cc90315b1775fb74841373fe12f7 ] The rk3288 SoC has two PWM implementations available, the "old" implementation and the "new" one. You can switch between the two of them by flipping a bit in the grf. The "old" implementation is the default at chip power up but isn't the one that's officially supposed to be used. ...and, in fact, the driver that gets selected in Linux using the rk3288 device tree only supports the "new" implementation. Long ago I tried to get a switch to the right IP block landed in the PWM driver (search for "rk3288: Switch to use the proper PWM IP") but that got rejected. In the mean time the grf has grown a full-fledged driver that already sets other random bits like this. That means we can now get the fix landed. For those wondering how things could have possibly worked for the last 4.5 years, folks have mostly been relying on the bootloader to set this bit. ...but occasionally folks have pointed back to my old patch series [1] in downstream kernels. [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1391597.html Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-15soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipherNathan Chancellor
[ Upstream commit 89e28da82836530f1ac7a3a32fecc31f22d79b3e ] When building with -Wsometimes-uninitialized, Clang warns: drivers/soc/mediatek/mtk-pmic-wrap.c:1358:6: error: variable 'rdata' is used uninitialized whenever '||' condition is true [-Werror,-Wsometimes-uninitialized] If pwrap_write returns non-zero, pwrap_read will not be called to initialize rdata, meaning that we will use some random uninitialized stack value in our print statement. Zero initialize rdata in case this happens. Link: https://github.com/ClangBuiltLinux/linux/issues/401 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-11MLK-21987-1 soc: imx: Add speed grading fuse check for i.MX8MNAnson Huang
Add speed grading fuse check to constrain CPU OPP according to market segment and speed grading fuse map, Market_Segment[1:0]: '00' - Consumer 0C to 95C '01' - Ext. Consumer -20C to 105C '10' - Industrial -40C to 105C '11' - Automotive -40C to 125C SPEED_GRADING[5:0]: SPEED_GRADE[5:4] SPEED_GRADE[3:0] MHz xx 0000 2300 xx 0001 2200 xx 0010 2100 xx 0011 2000 xx 0100 1900 xx 0101 1800 xx 0110 1700 xx 0111 1600 xx 1000 1500 xx 1001 1400 xx 1010 1300 xx 1011 1200 xx 1100 1100 xx 1101 1000 xx 1110 900 xx 1111 800 Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-06-10MLK-21953-01 soc: imx: Add power domain driver support imx8mnJacky Bai
Add compatible string for i.MX8MN for power domain driver support. Signed-off-by: Jacky Bai <ping.bai@nxp.com>
2019-05-27MLK-21823-5 soc: imx: Add i.MX8MN soc id driver supportAnson Huang
This patch adds new SoC i.MX8MN's soc id driver support. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-05-24MLK-21596 soc: imx: make sure MU irq can wake up system from freeze modeAnson Huang
Commit b24e5c5fca92 ("MLK-21078-3 soc: imx: enable RX interrupt for IPC response") adds IPC RX IRQ support and need to add IRQF_NO_SUSPEND flag for MU IRQ to make IPC work during system suspend phase, but with this flag set, IRQD_WAKEUP_ARMED flag will NOT be set during suspend_device_irq() phase, then when MU IRQ arrives, it will NOT wake up system from s2idle. To fix this issue, pm_system_wakeup() is called in general MU IRQ handler to make sure system can be waked up when MU IRQ arrives. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Robin Gong<yibin.gong@nxp.com> (cherry picked from commit 7a51e311f074618ba7bc4b2f5fc80b00b66da5de)
2019-04-20soc/tegra: pmc: Drop locking from tegra_powergate_is_powered()Dmitry Osipenko
[ Upstream commit b6e1fd17a38bd1d97c11d69fd3207b3ef9bfa4b3 ] This fixes splats like the one below if CONFIG_DEBUG_ATOMIC_SLEEP=y and machine (Tegra30) booted with SMP=n or all secondary CPU's are put offline. Locking isn't needed because it protects atomic operation. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:254 in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/0 CPU: 0 PID: 0 Comm: swapper/0 Tainted: G C 4.18.0-next-20180821-00180-gc3ebb6544e44-dirty #823 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) [<c01134f4>] (unwind_backtrace) from [<c010db2c>] (show_stack+0x20/0x24) [<c010db2c>] (show_stack) from [<c0bd0f3c>] (dump_stack+0x94/0xa8) [<c0bd0f3c>] (dump_stack) from [<c0151df8>] (___might_sleep+0x13c/0x174) [<c0151df8>] (___might_sleep) from [<c0151ea0>] (__might_sleep+0x70/0xa8) [<c0151ea0>] (__might_sleep) from [<c0bec2b8>] (mutex_lock+0x2c/0x70) [<c0bec2b8>] (mutex_lock) from [<c0589844>] (tegra_powergate_is_powered+0x44/0xa8) [<c0589844>] (tegra_powergate_is_powered) from [<c0581a60>] (tegra30_cpu_rail_off_ready+0x30/0x74) [<c0581a60>] (tegra30_cpu_rail_off_ready) from [<c0122244>] (tegra30_idle_lp2+0xa0/0x108) [<c0122244>] (tegra30_idle_lp2) from [<c0853438>] (cpuidle_enter_state+0x140/0x540) [<c0853438>] (cpuidle_enter_state) from [<c08538a4>] (cpuidle_enter+0x40/0x4c) [<c08538a4>] (cpuidle_enter) from [<c01595e0>] (call_cpuidle+0x30/0x48) [<c01595e0>] (call_cpuidle) from [<c01599f8>] (do_idle+0x238/0x28c) [<c01599f8>] (do_idle) from [<c0159d28>] (cpu_startup_entry+0x28/0x2c) [<c0159d28>] (cpu_startup_entry) from [<c0be76c8>] (rest_init+0xd8/0xdc) [<c0be76c8>] (rest_init) from [<c1200f50>] (start_kernel+0x41c/0x430) Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-08MLK-21393 soc: imx: update SCFW APIAnson Huang
This patch updates SCFW API to v1.7, based on below commit: 252281d48647 ("SCF-105: Update wiki.") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-04-08MLK-21287 soc: imx: keep resource power ON if subdomain is wakeup sourceAnson Huang
The power mode operation ONLY checks whether the resource being powered OFF is a wakeup source, and skip power OFF operation if it is a wakeup source, but it does NOT consider the power tree status, if any of its children is a wakeup source, it needs to be kept powered ON for its children's wakeup capability. For example, on i.MX8QXP, CAN1 shares CAN0's power, if CAN1 is enabled as wakeup source, CAN0's power needs to be ON even it is NOT a wakeup source, this patch adds support for such scenario. As it uses recursion, to avoid overhead during runtime power management, introduce a variable to make sure this logic is ONLY enabled during suspend/resume. The generic power domain framework for handling device power according to wakeup status does NOT consider the virtual devices, e.g., if debug uart is enabled as wakeup source, the device wakeup capability check for uart device returns false, ONLY the ttydev has wakeup capability, that will cause resume_needed() return false and uart device power will be OFF even its child device "ttydev" is enabeld as wakeup source. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Tested-by: Joakim Zhang <qiangqing.zhang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-04-05soc/tegra: fuse: Fix illegal free of IO base addressTimo Alho
[ Upstream commit 51294bf6b9e897d595466dcda5a3f2751906a200 ] On cases where device tree entries for fuse and clock provider are in different order, fuse driver needs to defer probing. This leads to freeing incorrect IO base address as the fuse->base variable gets overwritten once during first probe invocation. This leads to the following spew during boot: [ 3.082285] Trying to vfree() nonexistent vm area (00000000cfe8fd94) [ 3.082308] WARNING: CPU: 5 PID: 126 at /hdd/l4t/kernel/stable/mm/vmalloc.c:1511 __vunmap+0xcc/0xd8 [ 3.082318] Modules linked in: [ 3.082330] CPU: 5 PID: 126 Comm: kworker/5:1 Tainted: G S 4.19.7-tegra-gce119d3 #1 [ 3.082340] Hardware name: quill (DT) [ 3.082353] Workqueue: events deferred_probe_work_func [ 3.082364] pstate: 40000005 (nZcv daif -PAN -UAO) [ 3.082372] pc : __vunmap+0xcc/0xd8 [ 3.082379] lr : __vunmap+0xcc/0xd8 [ 3.082385] sp : ffff00000a1d3b60 [ 3.082391] x29: ffff00000a1d3b60 x28: 0000000000000000 [ 3.082402] x27: 0000000000000000 x26: ffff000008e8b610 [ 3.082413] x25: 0000000000000000 x24: 0000000000000009 [ 3.082423] x23: ffff000009221a90 x22: ffff000009f6d000 [ 3.082432] x21: 0000000000000000 x20: 0000000000000000 [ 3.082442] x19: ffff000009f6d000 x18: ffffffffffffffff [ 3.082452] x17: 0000000000000000 x16: 0000000000000000 [ 3.082462] x15: ffff0000091396c8 x14: 0720072007200720 [ 3.082471] x13: 0720072007200720 x12: 0720072907340739 [ 3.082481] x11: 0764076607380765 x10: 0766076307300730 [ 3.082491] x9 : 0730073007300730 x8 : 0730073007280720 [ 3.082501] x7 : 0761076507720761 x6 : 0000000000000102 [ 3.082510] x5 : 0000000000000000 x4 : 0000000000000000 [ 3.082519] x3 : ffffffffffffffff x2 : ffff000009150ff8 [ 3.082528] x1 : 3d95b1429fff5200 x0 : 0000000000000000 [ 3.082538] Call trace: [ 3.082545] __vunmap+0xcc/0xd8 [ 3.082552] vunmap+0x24/0x30 [ 3.082561] __iounmap+0x2c/0x38 [ 3.082569] tegra_fuse_probe+0xc8/0x118 [ 3.082577] platform_drv_probe+0x50/0xa0 [ 3.082585] really_probe+0x1b0/0x288 [ 3.082593] driver_probe_device+0x58/0x100 [ 3.082601] __device_attach_driver+0x98/0xf0 [ 3.082609] bus_for_each_drv+0x64/0xc8 [ 3.082616] __device_attach+0xd8/0x130 [ 3.082624] device_initial_probe+0x10/0x18 [ 3.082631] bus_probe_device+0x90/0x98 [ 3.082638] deferred_probe_work_func+0x74/0xb0 [ 3.082649] process_one_work+0x1e0/0x318 [ 3.082656] worker_thread+0x228/0x450 [ 3.082664] kthread+0x128/0x130 [ 3.082672] ret_from_fork+0x10/0x18 [ 3.082678] ---[ end trace 0810fe6ba772c1c7 ]--- Fix this by retaining the value of fuse->base until driver has successfully probed. Signed-off-by: Timo Alho <talho@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05soc: qcom: gsbi: Fix error handling in gsbi_probe()Alexey Khoroshilov
[ Upstream commit 8cd09a3dd3e176c62da67efcd477a44a8d87185e ] If of_platform_populate() fails in gsbi_probe(), gsbi->hclk is left undisabled. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-14MLK-21078-3 soc: imx: enable RX interrupt for IPC responseAnson Huang
For IPC communication, CPU will be busy polling MU RX channel after sending IPC message if IPC response is needed, such mechanism wastes too much CPU resource if SCU takes long time to finish the IPC request, so now enable RX interrupt for IPC response. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-03-14MLK-21078-1 soc: imx: remove early power on operationAnson Huang
Previously, RPMSG uses M4 domain's MU which is inside intmux irq domain, and RPMSG irq has IRQF_EARLY_RESUME set, so intmux needs to be powered up at syscore phase before irqchip resume. Now RPMSG switches to use LSIO's MU which is inside GIC irq domain, so no need to have early power on operation for intmux, remove it. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-03-13soc: fsl: qbman: avoid race in clearing QMan interruptMadalin Bucur
[ Upstream commit 89857a8a5c89a406b967ab2be7bd2ccdbe75e73d ] By clearing all interrupt sources, not only those that already occurred, the existing code may acknowledge by mistake interrupts that occurred after the code checks for them. Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Li Yang <leoyang.li@nxp.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-11MLK-20958-2 imx8: Replace SC_R_LAST with SC_R_NONE in DTBLeonard Crestez
We are currently using SC_R_LAST as a marker for imx8 power domain tree nodes without a resource attached. This value is compiled into dtb as part of the linux build and used by uboot. The SC_R_LAST constant changes frequently as SCFW resources are added (by design) and every time we need to update linux and uboot headers together or boot can fail. Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE defined to be 0xFFF0. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-03-11MLK-20958-1 imx8: Sync SCFW API to v1.4Leonard Crestez
Many whitespace and formatting changes were skipped Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-02-27MLK-20996 soc: imx: update SCFW APIsAnson Huang
Update SCFW APIs to SCFW commit: e7a99eb96207 ("SCF-351: Add API to change boot parms.") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-15MLK-20905: soc: imx: Add speed grading fuse check for imx8mqJacky Bai
Add the speeding grading fuse check to limit the highest speed of cpu. fuse bits value define as below: speed_grading bits[1:0] freq(MHz) 0x0 800 0x1 1000 0x2 1300 0x3 1500 Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2019-02-15MLK-20930-2 soc: imx: update SCFW APIsAnson Huang
Update SCFW APIs to SCFW commit: 004247e14afc ("SCF-341 Fix bug in setting large slice clock divider") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-02-12soc: bcm: brcmstb: Don't leak device tree node referenceYangtao Li
[ Upstream commit 1861a7f07e02292830a1ca256328d370deefea30 ] of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. soc_is_brcmstb() doesn't do that, so fix it. [treding: slightly rewrite to avoid inline comparison] Fixes: d52fad262041 ("soc: add stubs for brcmstb SoC's") Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-12soc/tegra: Don't leak device tree node referenceYangtao Li
[ Upstream commit 9eb40fa2cd2d1f6829e7b49bb22692f754b9cfe0 ] of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. soc_is_tegra() doesn't do that, so fix it. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> [treding: slightly rewrite to avoid inline comparison] Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-12MLK-20890-1 soc: imx8: Add support to read HDCP fuse.Oliver Brown
Added function to read HDCP disable fuse. Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-02-12MLK-20899 soc: imx: update SCFW APIsAnson Huang
Update SCFW APIs to SCFW commit: 5c03342369e8 ("SCF-105: Change links in wiki index.") Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20770-1 soc: imx: add fuse check for i.MX8MM opp tableAnson Huang
The market_segment and speed_grading fuse are used for cpu-freq setpoint definition, according to latest datasheet Rev.0 01/2019: Market_segment: fuse offset(0x440), bit[7:6]: Consumer: 1.8GHz: 0.95V; 1.6GHz: 0.9V; 1.2GHz: 0.805V; Industrial: 1.6GHz: 0.9V; 1.2GHz: 0.805V; Speed_grading: fuse offset(0x440), bit[10:8]: 2GHz: 2b'100 1.8GHz: 2b'011 1.6GHz: 2b'010 1.2GHz: 3b'001 800MHz: 3b'000 The cpu-freq opp table will consider both market_segment and speed_grading fuse settings to runtime disable unused set-point to meet datasheet requirement. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20384 soc: imx: drop xenvm soc dataPeng Fan
Drop xenvm soc data, we have userspace tool stack generate correct model compatile and this soc data will also trigger issue on i.MX8QXP. So drop it. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Flynn xu <flynn.xu@nxp.com>
2019-02-12MLK-20213-3 soc: imx: fix coverity issueAnson Huang
This patch fixes coverity issue of "unchecked return value". Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20213-2 soc: imx: gpc-psci: fix coverity issueAnson Huang
This patch fixes coverity issue of "improper argument type". Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20213-1 soc: imx: gpc: fix coverity issueAnson Huang
This patch fixes coverity issue of "divide by 0". Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20203-4 soc: imx: fix coverity issueAnson Huang
This patch fixes coverity issue of "divide by 0". Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-20222-1 soc: Update SCFW APIRanjani Vaidyanathan
Update SCFW API to the following commit: " ("430d1e3646fbe75e339e18abf2330565eac906e0") Author: Chuck Cannon <chuck.cannon@nxp.com> Date: Fri Nov 2 15:25:45 2018 -0500 SCF-105: RN updates. " Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2019-02-12MLK-20136-03 driver: soc: imx: add 100mts support for imx8mq low bus modeBai Ping
The 100MTS low bus mode can be only supported by i.MX8MQ Rev2.1 and future TO. So necessary check is added to identify the chip revision when doing busfreq mode switch. Signed-off-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2019-02-12MLK-20124-1: soc: imx: keep hdmi tx power domains always onSandor Yu
HDMI TX should keep in power on state in suspend mode. Otherwise HDMI FW will lost. Add flag GENPD_FLAG_ALWAYS_ON to hdmi tx power domains. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-02-12MLK-19947-2 soc: imx: select CLKSRC_IMX_GPT for i.MX8QXPAnson Huang
Select CLKSRC_IMX_GPT for i.MX8QXP by default. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-19884: soc: imx: sc: main: ipc: fix onoff key can't wakeup kernel from ↵Robin Gong
'freeze' mode That caused by commit d5c4a949522f6 ("MLK-19515 soc: imx: ipc: remove unnecessary set wake for mu") which remove irq_set_irq_wakeup directly. Actually, we can keep that in driver without set_irq_wake() interface in GIC driver if cherry-pick commit 4110b5cbb014e ("irqchip/gic-v3: Allow interrupt to be configured as wake-up sources") from upstreaming kernel. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2019-02-12MLK-19612 soc: imx: fix kernel warning when detaching dev for certain power ↵Anson Huang
domain For i.MX8QM/i.MX8QXP, one power domain could have several devices inside, such as cs42888 and wm8960 both belong to pd_mclk_out0 power domain, when these two devices probed, imx8_attach_dev() will be called and these two devices' clocks will be add to pd_mclk_out0's clock list, then if the second device probe failed and imx8_detach_dev() will be called, the original code will go through the whole pd_mclk_out0 power domian's clock list and delete all the clock nodes, when the clock node are NOT belonging to this device, below kernel warning will show out by devm_kfree() function: [ 4.998488] [<ffff0000086a8cac>] devm_kfree+0x2c/0x38 [ 5.003543] [<ffff000008595b60>] imx8_detach_dev+0xb4/0x14c [ 5.009121] [<ffff0000086b8e8c>] genpd_remove_device+0x70/0xe8 [ 5.014959] [<ffff0000086b98d8>] genpd_dev_pm_detach+0x3c/0xc8 [ 5.020797] [<ffff0000086adc68>] dev_pm_domain_detach+0x20/0x28 [ 5.026722] [<ffff000008928940>] i2c_device_probe+0x1d4/0x35c [ 5.032472] [<ffff0000086a4d50>] driver_probe_device+0x220/0x2d4 [ 5.038484] [<ffff0000086a4ea8>] __driver_attach+0xa4/0xa8 [ 5.043978] [<ffff0000086a2ea4>] bus_for_each_dev+0x58/0x98 [ 5.049552] [<ffff0000086a4678>] driver_attach+0x20/0x28 [ 5.054869] [<ffff0000086a41f4>] bus_add_driver+0x1c0/0x224 [ 5.060446] [<ffff0000086a57cc>] driver_register+0x68/0x108 [ 5.066024] [<ffff00000892a35c>] i2c_register_driver+0x44/0x84 [ 5.071862] [<ffff0000093b68a4>] wm8960_i2c_driver_init+0x18/0x20 [ 5.077961] [<ffff000008084144>] do_one_initcall+0x38/0x124 [ 5.083538] [<ffff000009350d28>] kernel_init_freeable+0x18c/0x228 [ 5.089638] [<ffff000008d409c0>] kernel_init+0x10/0x100 [ 5.094869] [<ffff000008085348>] ret_from_fork+0x10/0x18 The correct operation is to just delete those clock nodes belonged to the device being detached, to avoid this case, we can add a device point which can be assigned to device during attach_dev phase, then in detach_dev phase, check the device pointer to make sure ONLY delete those clock nodes belonged to its own and keep other clock nodes in the same power domain there. Reported-by: Chen Guoyin <guoyin.chen@nxp.com> Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-12MLK-19588-1 imx: rpmsg: use timeout for MU_SendMessage functionRichard Zhu
- Add the timeout mu msg send api. - Use the timeout mu send message function to do the notification when multi-vdev is enabled on one channel. Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2019-02-12MLK-19515 soc: imx: ipc: remove unnecessary set wake for muAnson Huang
Since MU now is NOT in WU irq domain, so there is no irq_set_wake callback available, below message will come out during kernel boot up: imx8mu_init: set_irq_wake failed: -6 GIC/MU now are powered off during suspend, so it is unnecessary to call irq_set_irq_wake() for MU, we can remove it to avoid the failure message. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Robin Gong <yibin.gong@nxp.com>
2019-02-12MLK-19435 soc: imx8: pm-domains: Report failures to pm coreLeonard Crestez
Right now power_on always returns true even if SCFW reports a failure. Since the target resource is still unpowered this quickly turns into a hang when we attempt to access it. Handle this by reporting an error to the PM core instead and also print the sc_err number to help with debugging. This fixes boot on 8qm A0: instead of hanging on boot we print an error and refuse to probe the VPU. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Dong Aisheng <Aisheng.dong@nxp.com>
2019-02-12MLK-19380 driver: soc: update the noc QoS setting on imx8mqBai Ping
update the noc QoS setting for CPU & VPU on i.MX8MQ. Signed-off-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Jian Li <jian.li@nxp.com> (cherry picked from commit 45d2dcaecce6d83e5c4a7e9488c651a05b0f05ac)