Josep Orga [Thu, 16 Jan 2020 11:57:13 +0000 (12:57 +0100)]
imx6ull-somdevices.dtsi: Renamed imx6ull-somdevices.dts -> imx6ull-somdevices.dtsi.
imx6ull-somdevices-C0P1.dts: Added and changed Makefile.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Thu, 16 Jan 2020 11:44:56 +0000 (12:44 +0100)]
imx6ull-somdevices.dts: Added LED heartbeat, MMC_SPI functionallity, GPIOs and enet RST pins bug.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Thu, 28 Nov 2019 09:11:43 +0000 (10:11 +0100)]
ARM:imx6ull_somdevices_defconfig: Added SMSC PHY and WILC functionallity.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Thu, 28 Nov 2019 08:55:08 +0000 (09:55 +0100)]
ARM:imx6ull_somdevices_defconfig: Create file based on imx_v7_defconfig.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 16:58:37 +0000 (17:58 +0100)]
imx6ull-somdevices.dts: Added LCD, ecspi2, changed UART2 pins and corrected indent.
spidev: Added spidev not to have kernel warnings.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 15:32:26 +0000 (16:32 +0100)]
imx6ull-somdevices.dts: Removed not used peripherals flexcan2, spi4, qspi, tsc and indent tabs.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 12:26:03 +0000 (13:26 +0100)]
imx6ull-somdevices.dtb: Added WiFi WILC1000 fuinctionallity.
wilc1000: Added drivers.
TODO: Check all functionallity and fix this warning related to regs:
Warning (reg_format): "reg" property in /soc/aips-bus@
02100000/usdhc@
02190000/wilc_sdio@0 has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (avoid_default_addr_size): Relying on default #address-cells value for /soc/aips-bus@
02100000/usdhc@
02190000/wilc_sdio@0
Warning (avoid_default_addr_size): Relying on default #size-cells value for /soc/aips-bus@
02100000/usdhc@
02190000/wilc_sdio@0
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 10:55:12 +0000 (11:55 +0100)]
imx6ull-somdevices.dts: Added support to pf1510/pf1550 PMIC and removed other I2C devices.
TODO: Check if the PMIC has full functionallity.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 10:40:34 +0000 (11:40 +0100)]
imx6ull-somdevices.dts: Add support to single/dual ethernet.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 09:57:15 +0000 (10:57 +0100)]
Changed machine model to "Freescale i.MX6 ULL µSMARC SOMDEVICES Board" arch/arm/boot/dts/imx6ull-somdevices.dts.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 09:42:02 +0000 (10:42 +0100)]
Added arch/arm/boot/dts/imx6ull-somdevices.dts copying arch/arm/boot/dts/imx6ull-14x14-evk.dts.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Wed, 27 Nov 2019 09:39:27 +0000 (10:39 +0100)]
Enable ENET1_TX_CLK during board startup.
TODO: Check if it is necessary when hard reset is present.
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Mon, 6 May 2019 09:25:17 +0000 (11:25 +0200)]
add "phy-reset-in-suspend" device tree option
Based on: https://github.com/digi-embedded/linux/commit/
f0ddbc0153b269bfd21b84dbd4ad16acdfd21f29#diff-28c0935b4b5bf1738a0ee788d25a18ffR3408
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Mon, 6 May 2019 08:45:17 +0000 (10:45 +0200)]
Enable PHY reset line when the fec is probed
Based on: https://github.com/digi-embedded/linux/commit/
f0ddbc0153b269bfd21b84dbd4ad16acdfd21f29#diff-
28c0935b4b5bf1738a0ee788d25a18ff
Signed-off-by: Josep Orga <jorga@somdevices.com>
Josep Orga [Thu, 2 May 2019 18:19:04 +0000 (20:19 +0200)]
Function fec_enet_clk_enable() was disabling this line leaving the PHY
without a running clock. This makes the PHY lose its internal state
requiring a reset of the PHY to be reactivated.
This patch enables the clk_enet_out once at probe() so that it remains
enabled during all MDIO accesses.
References: https://github.com/digi-embedded/linux/commit/
fa3f9ab2d2650ba6b24f2ef62ddedbf971e56d07#diff-28c0935b4b5bf1738a0ee788d25a18ffR1952
https://patchwork.ozlabs.org/patch/549391/
Signed-off-by: Josep Orga <jorga@somdevices.com>
Marc Zyngier [Thu, 1 Feb 2018 11:07:34 +0000 (11:07 +0000)]
arm: Invalidate BTB on prefetch abort outside of user mapping on Cortex A8, A9, A12 and A17
** Not yet queued for inclusion in mainline **
In order to prevent aliasing attacks on the branch predictor,
invalidate the BTB on CPUs that are known to be affected when taking
a prefetch abort on a address that is outside of a user task limit.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Thu, 1 Feb 2018 11:07:33 +0000 (11:07 +0000)]
arm: Add BTB invalidation on switch_mm for Cortex-A9, A12 and A17
** Not yet queued for inclusion in mainline **
In order to avoid aliasing attacks against the branch predictor,
some implementations require to invalidate the BTB when switching
from one user context to another.
For this, we reuse the existing implementation for Cortex-A8, and
apply it to A9, A12 and A17.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Andy Duan [Fri, 11 May 2018 02:01:57 +0000 (10:01 +0800)]
MLK-18276-02 ARM64: defconfig: add regulatory rules database config
Enable regulatory rules database config:
CONFIG_CFG80211_INTERNAL_REGDB
(Run "make savedefconfig" to change the defconfig)
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit:
2044e8f366119b79b17cfe47bb91c40c39e9b440)
Andy Duan [Fri, 11 May 2018 02:26:51 +0000 (10:26 +0800)]
MLK-18276-01 ARM: imx_v7_defconfig: add regulatory rules t database config
Enable regulatory rules database config:
CONFIG_CFG80211_INTERNAL_REGDB
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit:
99a27c4880a091d74ab5e3fb112a2d778f7c26b0)
Andy Duan [Thu, 10 May 2018 11:49:48 +0000 (19:49 +0800)]
MLK-18275 wireless: bcmdhd: fix the un-supported country code set by regdb
Driver should return when un-supported country code set by regdb.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit:
9b3b65ec3df5ed7b404784ae4ef4cf9f906c0520)
Antoine Bouyer [Fri, 4 May 2018 09:48:09 +0000 (11:48 +0200)]
MLK-18261 irqchip: imx-irqsteer: fix idx calculation for mask callback
Fixes:
a2e6a7833495 (MLK-16136-9 irqchip: imx-irqsteer: adjust irq config
via 'endian')
This patch fixes mask register offset calculation, when endian is not
default value 0 (i.e imx8mq).
Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit
8a5643a5bd1f5b6490431bd96ef3cd004efd83b1)
Haibo Chen [Tue, 8 May 2018 01:49:08 +0000 (09:49 +0800)]
MLK-18218 ARM: dts: imx7ulp-evk: delete property to support SD3.0
commit
b62dd733a100 ("MLK-18127 ARM: dts: imx7ulp-evk: few correction
for usdhc1") add property "no-1-8-v" for the usdhc1 which limit the
wifi. The sd slot on base board share this usdhc1, so the usdhc1
in imx7ulp-evk-sd1.dts also inherit this property.
delete the "no-1-8-v" property, then the sd slot can support SD3.0
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
6cb30044642b43f9e55d63beca61bc1397d3d996)
Richard Zhu [Thu, 3 May 2018 04:44:12 +0000 (12:44 +0800)]
MLK-18180 ARM64: dts: correct the pad configurations of pcie
The correct default should be 0x04000021. In which we have the open
drain input option for field [25:26] with a pull up resistor and low
drive strength. This will allow the end point device to drive low the
wake and clkreq signals when necessary and don't have the PCIe
driving back to the endpoint device.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit
2d3e439c1b32d78807bfc74dfc90f62aa897a709)
Richard Zhu [Tue, 10 Apr 2018 02:43:26 +0000 (10:43 +0800)]
MLK-17951 ARM: imx_v7_defconfig: enable AHCI_IMX in default
Enable the AHCI_IMX defaultly in imx_v7_defconfig
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit
a090146de2ef4be0ac9ccf2225a5bb4926a503dd)
Xianzhong [Mon, 23 Apr 2018 13:09:14 +0000 (21:09 +0800)]
MGS-3705-2 [#imx-939] fix build break for 4.14 linux kernel
remove the obsolete code to fix build break for 4.14 kernel
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
17ef2e4e9f62f2ab24d5c6d3e053da38687b4519)
Yuchou Gan [Fri, 2 Mar 2018 09:58:29 +0000 (17:58 +0800)]
MGS-3705-1 [#imx-939] fix gpu build for 4.14 linux kernel
"DRIVER_ATTR" no longer supported in 4.14 linux kernel,
using "DRIVER_ATTR_RW" to replace it.
Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
(cherry picked from commit
cee4766bd6dc3d48e95578098ef981ec67af8153)
Xianzhong [Fri, 4 May 2018 11:19:39 +0000 (19:19 +0800)]
MGS-3856-2 [#imx-1018] disable openvg2d for arm64 build
MX8 chips does not have GC355. So no need to build the drivers
Signed-off-by : Xianzhong Li <xianzhong.li@nxp.com>
Reviewed-by : Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
(cherry picked from commit
a85b9583d459d6a0888db30564f0136739d7ec26)
Haibo Chen [Thu, 3 May 2018 03:16:05 +0000 (11:16 +0800)]
MLK-18069 ARM: dts: imx7ulp-evk: correct the touch setting
The MIPI DSI config the DPI as 480 * 854, so correct the touch
display-coords property, to aligned with MIPI DSI.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
a00aa0ea7199fb04e425a49a4221d9202782eecf)
Cedric Neveux [Tue, 17 Apr 2018 16:04:39 +0000 (18:04 +0200)]
MLK-17909 RNG Instantation done in Secure Firmware
- For i.MX 6 and 7 check if the Secure Firmware (OPTEE) is present.
If present don't do the RNG instantation in the CAAM driver
Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit
2b9489d18b6eca5b1f72689602f0eed16e88db84)
Andy Duan [Fri, 27 Apr 2018 04:07:27 +0000 (12:07 +0800)]
MLK-18167 ARM64: defconfig: enable wilrless configs for Qca6174 qcacld-2.0
Add some necessary configs for qualcomm wifi QCA6174 qcacld-2.0
and remove the ath10k configs.
(Run "make savedefconfig" to change the defconfig)
Reviewed-by: Andy Tian <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Andy Duan [Wed, 25 Apr 2018 08:54:26 +0000 (16:54 +0800)]
MLK-18001 wireless: bcmdhd_1363: fix the build warning with [-Wpointer-compare]
Fix the build warning with [-Wpointer-compare] parameters.
Reviewed-by: Bough Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:
414b9eb9d5dd309988e409698ae4173967305a74)
Yuchou Gan [Fri, 27 Apr 2018 10:15:01 +0000 (18:15 +0800)]
MLK-18101-6 gpu: imx: imx8_dprc: Dynamic enable/disable SC_C_SEL0
If enable _BLIT0:SC_C_SEL0, the prg for _BLIT0
will connect to _BLIT1, so _BLIT1 will have two prgs,
and _BLIT1 could works for multi planes conversion.
Check the plane num and dynamic enable or disable SC_C_SEL0.
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
Yuchou Gan [Fri, 27 Apr 2018 10:14:07 +0000 (18:14 +0800)]
MLK-18101-5 gpu: imx: imx8_prg: Add prg_put_auxiliary() helper support
This patch adds prg_put_auxiliary() helper support so that users may
set a particular PRG not serve as an auxiliary one.
Signed-off-by: Yuchou Gan <yuchou.gan@nxp.com>
Yuchou Gan [Fri, 20 Apr 2018 15:46:22 +0000 (23:46 +0800)]
MLK-18101-4 gpu: imx: dpu-blit: Refine the first frame irq handle
As the display will also use dprc0-irq, which will disturb the
interrupt for blit engine if blit engine use irq.
Refine the first frame process so that blit engine never use irq any more.
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
Yuchou Gan [Fri, 20 Apr 2018 17:33:15 +0000 (01:33 +0800)]
MLK-18101-3 gpu: imx: imx8_dprc: Set has_aux_prg as true for _BLIT1
On qxp b0 board, _BLIT1 will have aux_prg if enable PRG0_SEL.
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
Yuchou Gan [Fri, 20 Apr 2018 15:15:50 +0000 (23:15 +0800)]
MLK-18101-2 arm64: dtsi: fsl-imx8qxp: Add prg1 for dpr1_channel2
On QXP B0 board, prg1 can alternative connect to
dpr_channel1 and channel2. And if enable PRG0_SEL:BLIT0,
prg1 will connect to channel2, so it could
support 2-plane format tile to linear convert.
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
Yuchou Gan [Fri, 30 Mar 2018 09:41:19 +0000 (17:41 +0800)]
MLK-18101-1 include: soc: imx8: sc: types: Add SC_C_SEL0 for B0 imx8qxp board
Add SC_C_SEL0 for imx8qm/qxp B0.
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
Xianzhong [Thu, 26 Apr 2018 15:33:37 +0000 (23:33 +0800)]
MGS-3848-5 [#imx-854] OCL1.2: test_image_streams failures
there are 2 test failed on 8QXP FB. CL151757 fixed bug #20196,
for image objects using host ptr, set the cacheable flag correctly.
merged CL151774 fix build error cause by CL151757.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
0be7546b8798645cea95e7dc935c43380f763458)
Xianzhong [Wed, 25 Apr 2018 20:00:09 +0000 (04:00 +0800)]
MGS-3848-4 [#imx-854] correct hw-event synchronization between pm and other threads
When pm is running power ON to OFF (not broadcast), gckCOMMAND_Stall is called for synchronization.
But it does not blocks more events.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
1e2fae3d33a5e4b0690722dc112fd5a77eb90eac)
Xianzhong [Wed, 25 Apr 2018 19:58:25 +0000 (03:58 +0800)]
MGS-3848-3 [#imx-854] correct command commit synchronization between pm and other threads
When power ON to other mode with broadcast (SUSPEND_BROADCAST,
IDLE_BROADCAST, OFF_BROADCAST), command->powerSemaphore is acquired after check idle.
code sequence:
check commit atom
check idle
>>> at this point, other thread may have new commits at this
>>> point.
Acquire command->powerSemaphore
... do clock off
This can cause unexpected interrupts after clock OFF or power
OFF.
To fix: try to acquire powerSemaphore before check commit atom,
abort when failure, because command commit is in progress.
fix bug #19216, #19230.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
5228271314e8f575e4bbd9d3087c220b6a344b7d)
Xianzhong [Wed, 25 Apr 2018 19:56:08 +0000 (03:56 +0800)]
MGS-3848-2 [#imx-854] fix events stuck issue when clock off
When pm (SetPowerManagementState) is running power ON to
SUSPEND_BROADCAST, it only checks wait-link FE, but not Async FE. Clock
can be off when read AsyncFE Acknowledge register and other.
pm thread:
...
check commit atom ok
>> check idle OK
(former stopIsr before cl144673 is here)
set GPU clock off
...
isr:
gcmkONERROR(ReadRegister(AQ_INTR_ACKNOWLEDGE_Address));
gckEVENT_Interrupt
>>> here, at this point, all interrupt comes, check idle in
>>> pm thread can pass.
gcmkONERROR(ReadRegister(AQ_INTR_ACKNOWLEDGE_EX_Address));
gckFE_UpdateAvaiable -> ReadRegister(GCREG_FE_ASYNC_STATUS_Address)
If gcmkONERROR(ReadRegister(AQ_INTR_ACKNOWLEDGE_EX_Address))
fail of clock off, then gckHARDWARE_Interrupt fails. In isrRoutine, it
won't wake up threadRoutine. Then it's stuck!
ReadRegister(GCREG_FE_ASYNC_STATUS_Address) failure can cause
unexpected behavior, too.
Former stopIsr (free_irq, before cl144673) can remove isr before
GPU clock off. So the issue is hidden.
To fix:
1. We should return success when either FE or AsyncFE reports
correct interrupts, so that isr can wake up threadRoutine for either FE.
That means, only need return ERROR when both FEs reports ERROR.
2. Add check for status of
ReadRegister(GCREG_FE_ASYNC_STATUS_Address).
Fix bug #19216, #19230.
merged BUG#19216 BUG#19230 CL152073 add missing part for CL151955
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
274841e0b05704726e28cc10185b6fb5973969f4)
Xianzhong [Wed, 25 Apr 2018 19:53:47 +0000 (03:53 +0800)]
MGS-3848-1 [#imx-854] refinements for pm and isr
1. slightly increate performance for interrupt handler
2. refine powerMutex lock
3. remove obsolete power management mode
4. code refinement preparing fix for bug #19216, #19230
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
e002022c3143b3e266af893b02bb913e3d156c54)
Yuchou Gan [Thu, 26 Apr 2018 10:52:58 +0000 (18:52 +0800)]
MGS-3846 [#imx-1015] fix coverity high impact issue
Using uninitialized value minf when calling snprintf.
Initilize it to fix.
Date: 25th Apr, 2018
Signed-off-by: Yuchou Gan<yuchou.gan@nxp.com>
Haibo Chen [Wed, 25 Apr 2018 08:03:24 +0000 (16:03 +0800)]
MLK-18127 ARM: dts: imx7ulp-evk: few correction for usdhc1
Currently, WiFi only work on SDIO2.0 mode, so add property
"no-1-8-v", otherwise following warning log will be print
sdhci-esdhc-imx
40380000.usdhc: could not get ultra high speed state, work on normal mode
The regulator reg_vsd_3v3 and reg_sd1_vmmc has the same
regulator name, so will trigger the following error log:
VSD_3V3: Failed to create debugfs directory
So change the regulator name of reg_sd1_vmmc.
According to the spec suggestion, ibe need to be enabled
for usdhc clock pin, and clock is better to pull down.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit
b62dd733a100e35e93543642149bcf8b61e13242)
James Hogan [Thu, 19 Oct 2017 14:17:23 +0000 (15:17 +0100)]
clockevents: Retry programming min delta up to 10 times
When CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=n, the call path
hrtimer_reprogram -> clockevents_program_event ->
clockevents_program_min_delta will not retry if the clock event driver
returns -ETIME.
If the driver could not satisfy the program_min_delta for any reason, the
lack of a retry means the CPU may not receive a tick interrupt, potentially
until the counter does a full period. This leads to rcu_sched timeout
messages as the stalled CPU is detected by other CPUs, and other issues if
the CPU is holding locks or other resources at the point at which it
stalls.
There have been a couple of observed mechanisms through which a clock event
driver could not satisfy the requested min_delta and return -ETIME.
With the MIPS GIC driver, the shared execution resource within MT cores
means inconventient latency due to execution of instructions from other
hardware threads in the core, within gic_next_event, can result in an event
being set in the past.
Additionally under virtualisation it is possible to get unexpected latency
during a clockevent device's set_next_event() callback which can make it
return -ETIME even for a delta based on min_delta_ns.
It isn't appropriate to use MIN_ADJUST in the virtualisation case as
occasional hypervisor induced high latency will cause min_delta_ns to
quickly increase to the maximum.
Instead, borrow the retry pattern from the MIN_ADJUST case, but without
making adjustments. Retry up to 10 times, each time increasing the
attempted delta by min_delta, before giving up.
[ Matt: Reworked the loop and made retry increase the delta. ]
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: "Martin Schwidefsky" <schwidefsky@de.ibm.com>
Cc: James Hogan <james.hogan@mips.com>
Link: https://lkml.kernel.org/r/1508422643-6075-1-git-send-email-matt.redfearn@mips.com
Chenyan Feng [Tue, 24 Apr 2018 15:13:42 +0000 (23:13 +0800)]
MGS-3832 [#imx-921] Fix the cl_convolution of ACL which cause MMU exception
Dump the error info only when there is an error. If the gcdALLOC_ON_FAULT is not enabled, still need to check
the HW status to decide whether to dump the exception info or not
Signed-off-by: Ella Feng <ella.feng@nxp.com>
Reviewed-by: Xianzhong Li <xianzhong.li@nxp.com>
Yong Gan [Tue, 17 Apr 2018 23:20:55 +0000 (07:20 +0800)]
MGS-3694 [#imx-913] enable fb fd and tile status fd in GPU and DCSS on wayland
Save the meta data info in the _gcsVIDMEM_NODE.
DCSS can query the meta data, and get the tile statust buffer info.
Date: Apr 13, 2018
Signed-off-by: Yong Gan yong.gan@nxp.com
(cherry picked from commit
cea92256fec8380e6e185d65c7746988e7c6426e)
Fancy Fang [Mon, 23 Apr 2018 10:52:13 +0000 (18:52 +0800)]
MLK-18031 video: mxsfb: enable global alpha when grayscale is 0 for 32bpp format
For overlay framebuffer, when its grayscale is '0' and the format
bpp is 32, enable the global alpha blending by default which can
make the overlay fb can display the framebuffer content as long as
it is unblanked.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
fede70b9066b03c24347619775fd7d007c5ddafb)
Bai Ping [Mon, 23 Apr 2018 09:55:16 +0000 (17:55 +0800)]
MLK-18051 arm: imx: fix the audio bus hang when tee enabled
fix audio bus mode hang issue on imx6sl. The root cause of
this issue is that busfreq mode passed to TEE side is wrong,
it will lead to ccm setting is wrong in TEE.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Tested-by: Anson huang <anson.huang@nxp.com>
Leonard Crestez [Fri, 20 Apr 2018 14:40:51 +0000 (17:40 +0300)]
MLK-18036-3: ARM: dts: Remove imx optee dts files from Makefile
Fixes:
a6fd1613cca4 ("MLK-18036-2 Delete *optee.dts files")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Clement Faure <clement.faure@nxp.com>
(cherry picked from commit
4706425bb745850c8d28608ebcaffd239a945e63)
Clement Faure [Tue, 17 Apr 2018 12:43:21 +0000 (14:43 +0200)]
MLK-18036-2 Delete *optee.dts files
A specific node for OCRAM mapping in optee as been added in
the device tree. These dedicated optee device trees can be
removed.
Signed-off-by: Clement Faure <clement.faure@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit
a6fd1613cca4a5008c347d4473b92b119385644c)
Clement Faure [Fri, 13 Apr 2018 09:11:36 +0000 (11:11 +0200)]
MLK-18036-1 Add "fsl,optee-lpm-sram" node for optee os power management.
This node will be used by the OCRAM driver in optee to:
* Get the OCRAM start address for power management in optee.
* Add an entry that will overwrite ocrams nodes and dynamically reduce
the OCRAM available for mmio-sram in Linux.
That way we do not touch the legacy Linux boot and remove the dedicated
optee device tree.
Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit
e96a3bcd754dee0aef3519bc08979985493be52c)
Cedric Neveux [Tue, 14 Nov 2017 16:42:42 +0000 (16:42 +0000)]
MLK-16912 PL310: unlock ways during initialization
This change affects all i.MX 6 with PL310 L2 Cache controller.
When Linux runs in Non-secure World the PL310 has already
been initialized by the ARM secure World running OP-TEE os.
However, in order to have a proper Linux Initialization all the
L2 cache ways have been locked by the secure world.
This patch unlock all the ways during pl310 initialization.
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
(cherry picked from commit
be7971b62e0c77cf70f828868a5d5a4184a926d2)
Shenwei Wang [Thu, 19 Apr 2018 21:06:43 +0000 (16:06 -0500)]
MLK-18088: arm: dts: enable the 7ulp mmdc profiling feature
7ULP uses the same mmdc profiling block as i.mx6q. Added the
"fsl,imx6q-mmdc" compatible string to enable the mmdc profiling
feature.
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Johannes Berg [Thu, 4 May 2017 05:52:10 +0000 (07:52 +0200)]
cfg80211: improve warnings in VHT rate calculation
Linus reported hitting the bandwidth warning, but it is indeed
pretty useless - improve it by printing the rate configuration
and make it only warn once, for both warnings here.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Anson Huang [Wed, 18 Apr 2018 07:20:03 +0000 (15:20 +0800)]
MGS-3806: clocksource: tpm: make sure returning -ETIME case correct
Incorrect condition check causes -ETIME return only
happen when next event is equal to current counter, and
it would cause various system issue like RCU stalls etc.,
the correct case should be whenever next event is less
than current counter, -ETIME should be returned. Correct
the type cast during return condition check to make it
work right.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Franck LENORMAND [Tue, 17 Apr 2018 12:28:14 +0000 (14:28 +0200)]
MLK-18011: imx7ulp: caam: Configure CAAM clocks
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit
0b122f882429a82274fc99439b5d73986b731672)
Franck LENORMAND [Wed, 11 Apr 2018 11:57:33 +0000 (13:57 +0200)]
MLK-17992: caam: sm: Fix compilation warnings
Fix the following warnings in CAAM SM:
drivers/crypto/caam/sm_store.c: In function 'blacken_key_jobdesc':
drivers/crypto/caam/sm_store.c:141:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c:153:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)key;
^
drivers/crypto/caam/sm_store.c: In function 'blob_encap_jobdesc':
drivers/crypto/caam/sm_store.c:274:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)secretbuf;
^
drivers/crypto/caam/sm_store.c: In function 'blob_decap_jobdesc':
drivers/crypto/caam/sm_store.c:390:19: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
tmpdesc[idx++] = (u32)outbuf;
^
drivers/crypto/caam/sm_store.c: In function 'slot_get_base':
drivers/crypto/caam/sm_store.c:569:9: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
return (u32)(ksdata->base_address);
^
drivers/crypto/caam/sm_store.c: In function 'sm_keystore_slot_load':
drivers/crypto/caam/sm_store.c:789:6:
warning: unused variable 'i' [-Wunused-variable]
u32 i;
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit
b6bd87e624bbe30b9be19c3f8ccb8f5526e4186b)
Bai Ping [Tue, 17 Apr 2018 06:00:14 +0000 (14:00 +0800)]
MLK-18042-02 arm: dts: update the backlight brightness on imx7ulp evk
On the i.MX7ULP EVK Rev.B baord, the backlight brigntness driver circuit
is updated. A RC filter is added on the MP3301's EN pin. So the PWM's frequency
should be change to 20KHZ. for EN pin, A DC voltage from 0.7V to 1.4V can control
the LED current from 0% to 100%. the backlight brightness level also need to be
updated.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit
82555e15a5f958c09492d0103425dc30bc7cd927)
Bai Ping [Tue, 17 Apr 2018 05:57:21 +0000 (13:57 +0800)]
MLK-18042-01 driver: pwm: fix pwm pre-scale div config
In i.MX7ULP TPM PWM module, it has a pre-scale divider,
this divider setting is missed, so fix it.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit
3ffd915e44320a8142698ca3f6e19c30ec434f61)
Shenwei Wang [Wed, 11 Apr 2018 03:38:13 +0000 (22:38 -0500)]
MLK-17993: arm: dts: rename the dts to match i.MX7ULP board design
The default display interface on i.MX7ULP EVK board is the HDMI
interface, and a hardware rework is required to support the MIPI
panel. To match the current board design, added the HDMI node in
the imx7ulp-evk.dts and created a new file named imx7ulp-evk-mipi.dts.
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Haibo Chen [Fri, 13 Apr 2018 07:03:00 +0000 (15:03 +0800)]
MLK-18026 dts: imx7ulp-evk-sd1: delete non-removable property for sd1 slot
commit
a56e6e190015 ("MLK-17961 dts: imx7ulp-evk: add non-removable
property for wifi sdio") add non-removable property, sd1 slot on
base board share the same usdhc with wifi, and the sd1 slot support
card detect, so for sd1 slot, need to remove the non-removable
property.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Duan <fuguang.duan@nxp.com>
(cherry picked from commit
2a40d8123aff4b4fb7a5cbf286d0c308a42c2fc7)
Robin Gong [Fri, 13 Apr 2018 11:35:12 +0000 (19:35 +0800)]
MLK-18004: ARM: imx: pm-imx7ulp: fix resume failure in freeze mode
This patch fix resume failure in freeze suspend mode on i.mx7ULP
("echo freeze > /sys/power/state") while pressing onoff key or
enabling rtc alarm wakeup. In freeze mode, kernel can only be woken
up by drivers which register wakup source such as 'device_init_wakeup'
or 'irq_set_irq_wake', otherwise, kernel will wait for irq handler
freeze_wake(). Unfortunately, our NMI interrupt which used to wakeup
A7 by M4 is not a common device and request irq as 'IRQF_NO_SUSPEND'
which means feeze_wake() never get chance to run while wakeup by any
event from M4 such as RTC, ONOFF. In this case, use pm_system_wakeup()
instead in NMI interrupt handle to trigger freeze_wake() directly.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Shengjiu Wang [Wed, 11 Apr 2018 06:42:05 +0000 (14:42 +0800)]
MLK-17979: ASoC: rpmsg_wm8960: add mixer control for ADC input
The microphone only connect to left input, when record stereo channel
data, the right channel is mute. Add 'ADC Data Output Select' mixer
control that user can select the wanted configure. The default setting
is 'Left Data = Left ADC; Right Data = Left ADC'.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit
cce63c3e843b7d705df6e36adffc0226bfe40e42)
Bai Ping [Mon, 9 Apr 2018 05:11:02 +0000 (13:11 +0800)]
MLK-17971 clk: imx: fix pll set rate failure issue on imx7ulp
The logic of 'if' check for the mult is wrong, this will lead
to set rate to PLL type failed. Additionally, remove the
unnecessary 'CLK_IS_CRITICAL' flags.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit
a67aa226b9d0d294b51cfc43371fe78a005dfae4)
Yuchou Gan [Fri, 30 Mar 2018 17:45:52 +0000 (01:45 +0800)]
MGS-3786 [#ccc] Cncrease the clock rate of GPU3D/GPU2D for 7ulp B0 board
The gpu3d/2d clock rate for 7ulp B0 board is 400M, increase it
Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
(cherry picked from commit
b51ae7e98ccfd9e25697d3e5b9795699917496ea)
Xianzhong [Thu, 29 Mar 2018 11:46:42 +0000 (19:46 +0800)]
MGS-3778 [#imx-989] fix GPU performance regression with 6.2.4.p1
the original patch will skip CMA memory allocation with CMA_LIMIT flag,
that enforces GPU memory allocation from virtual pool with MMU mapping,
then both 2D and 3D performance will have performance regression on i.MX6.
Revert "6.2.4.p1-0044-CL142820-check-flag-match-even-try-to-allocate-from-"
This reverts commit
8a8cbf389ad56dc49685ea078698087be867655a.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit
951e42c0ec05d4cdaf739eadd5fd40c2b8321b10)
Robin Gong [Mon, 2 Apr 2018 09:42:43 +0000 (17:42 +0800)]
MLK-17944: ARM: dts: imx7ulp-evk: add poweron key
Add poweron key support on i.mx7ulp-evk board since M4 take
over snvs on B0 chip.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
Fugang Duan [Sat, 31 Mar 2018 09:00:38 +0000 (17:00 +0800)]
MLK-17961 dts: imx7ulp-evk: add non-removable property for wifi sdio
Add non-removable property for usdhc1 that is used as Murata
1PJ wifi sdio interface, which means wifi card always is present.
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Fugang Duan <fugang.duan@nxp.com>
Fugang Duan [Fri, 30 Mar 2018 08:45:26 +0000 (16:45 +0800)]
MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO
If GPIO is connected to an IRQ then it should not request it as
GPIO function only when free its IRQ resouce.
Tested-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com
Liu Ying [Mon, 26 Mar 2018 08:05:03 +0000 (16:05 +0800)]
MLK-17924 gpu: imx: imx8_dprc: Do not set FRAME_2P_PIX_X/Y_CTRL for updated IP
We've got some fixups for DPR IP in the new i.MX8QXP silicon.
To address the cropping issue(TKT344978), the new IP changes the
FRAME_2P_PIX_X/Y_CTRL(@F0h and @100h) register definitions to be
FRAME_PIX_X/Y_ULC_CTRL. Thus, we should not set the two registers
for the new IP. FRAME_PIX_X/Y_ULC_CTRL will be programmed after
we figure out how to use them to do fb x/y offset for tile formats.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Liu Ying [Mon, 26 Mar 2018 08:19:37 +0000 (16:19 +0800)]
MLK-17923 drm/imx: dpu: plane: Do not support fb x/y src offset for tile fmts
We don't have correct support for fb x/y source offset for tile formats.
The buffer address calculation is wrong when the offset is non-zero.
Also, finer offset needs a fix in silicon(TKT344978). So, let's do not
support the offset currently. We may add it back after we figure out
how the updated silicon supports the offset.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Marc Zyngier [Tue, 6 Feb 2018 17:56:21 +0000 (17:56 +0000)]
arm64: Kill PSCI_GET_VERSION as a variant-2 workaround
commit
3a0a397ff5ff upstream.
Now that we've standardised on SMCCC v1.1 to perform the branch
prediction invalidation, let's drop the previous band-aid.
If vendors haven't updated their firmware to do SMCCC 1.1, they
haven't updated PSCI either, so we don't loose anything.
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
no falkor/thunderx2/vulcan in arch/arm64/kernel/cpu_errata.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:20 +0000 (17:56 +0000)]
arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support
commit
b092201e0020 upstream.
Add the detection and runtime code for ARM_SMCCC_ARCH_WORKAROUND_1.
It is lovely. Really.
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
no qcom hyp functions in
arch/arm64/kernel/bpi.S
arch/arm64/kernel/cpu_errata.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:19 +0000 (17:56 +0000)]
arm/arm64: smccc: Implement SMCCC v1.1 inline primitive
commit
f2d3b2e8759a upstream.
One of the major improvement of SMCCC v1.1 is that it only clobbers
the first 4 registers, both on 32 and 64bit. This means that it
becomes very easy to provide an inline version of the SMC call
primitive, and avoid performing a function call to stash the
registers that would otherwise be clobbered by SMCCC v1.0.
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:18 +0000 (17:56 +0000)]
arm/arm64: smccc: Make function identifiers an unsigned quantity
commit
ded4c39e93f3 upstream.
Function identifiers are a 32bit, unsigned quantity. But we never
tell so to the compiler, resulting in the following:
4ac:
b26187e0 mov x0, #0xffffffff80000001
We thus rely on the firmware narrowing it for us, which is not
always a reasonable expectation.
Cc: stable@vger.kernel.org
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:17 +0000 (17:56 +0000)]
firmware/psci: Expose SMCCC version through psci_ops
commit
e78eef554a91 upstream.
Since PSCI 1.0 allows the SMCCC version to be (indirectly) probed,
let's do that at boot time, and expose the version of the calling
convention as part of the psci_ops structure.
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:16 +0000 (17:56 +0000)]
firmware/psci: Expose PSCI conduit
commit
09a8d6d48499 upstream.
In order to call into the firmware to apply workarounds, it is
useful to find out whether we're using HVC or SMC. Let's expose
this through the psci_ops.
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:15 +0000 (17:56 +0000)]
arm64: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling
commit
f72af90c3783 upstream.
We want SMCCC_ARCH_WORKAROUND_1 to be fast. As fast as possible.
So let's intercept it as early as we can by testing for the
function call number as soon as we've identified a HVC call
coming from the guest.
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:14 +0000 (17:56 +0000)]
arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support
commit
6167ec5c9145 upstream.
A new feature of SMCCC 1.1 is that it offers firmware-based CPU
workarounds. In particular, SMCCC_ARCH_WORKAROUND_1 provides
BP hardening for CVE-2017-5715.
If the host has some mitigation for this issue, report that
we deal with it using SMCCC_ARCH_WORKAROUND_1, as we apply the
host workaround on every guest exit.
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
no sve support in arch/arm64/include/asm/kvm_host.h
mv changes from virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
using cpus_have_cap instead of cpus_have_const_cap
Marc Zyngier [Tue, 6 Feb 2018 17:56:13 +0000 (17:56 +0000)]
arm/arm64: KVM: Turn kvm_psci_version into a static inline
commit
a4097b351118 upstream.
We're about to need kvm_psci_version in HYP too. So let's turn it
into a static inline, and pass the kvm structure as a second
parameter (so that HYP can do a kern_hyp_va on it).
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv changes from virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
Marc Zyngier [Wed, 3 Jan 2018 16:38:37 +0000 (16:38 +0000)]
arm64: KVM: Make PSCI_VERSION a fast path
commit
90348689d500 upstream.
For those CPUs that require PSCI to perform a BP invalidation,
going all the way to the PSCI code for not much is a waste of
precious cycles. Let's terminate that call as early as possible.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Tue, 6 Feb 2018 17:56:12 +0000 (17:56 +0000)]
arm/arm64: KVM: Advertise SMCCC v1.1
commit
09e6be12effd upstream.
The new SMC Calling Convention (v1.1) allows for a reduced overhead
when calling into the firmware, and provides a new feature discovery
mechanism.
Make it visible to KVM guests.
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv change from virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:11 +0000 (17:56 +0000)]
arm/arm64: KVM: Implement PSCI 1.0 support
commit
58e0b2239a4d upstream.
PSCI 1.0 can be trivially implemented by providing the FEATURES
call on top of PSCI 0.2 and returning 1.0 as the PSCI version.
We happily ignore everything else, as they are either optional or
are clarifications that do not require any additional change.
PSCI 1.0 is now the default until we decide to add a userspace
selection API.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv chagnes from virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
Marc Zyngier [Sat, 24 Feb 2018 07:38:00 +0000 (15:38 +0800)]
arm/arm64: KVM: Add smccc accessors to PSCI code
commit
84684fecd7ea upstream.
Instead of open coding the accesses to the various registers,
let's add explicit SMCCC accessors.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv change from virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:09 +0000 (17:56 +0000)]
arm/arm64: KVM: Add PSCI_VERSION helper
commit
d0a144f12a7c upstream.
As we're about to trigger a PSCI version explosion, it doesn't
hurt to introduce a PSCI_VERSION helper that is going to be
used everywhere.
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv change form virt/kvm/arm/psci.c to arch/arm/kvm/psci.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:08 +0000 (17:56 +0000)]
arm/arm64: KVM: Consolidate the PSCI include files
commit
1a2fb94e6a77 upstream.
As we're about to update the PSCI support, and because I'm lazy,
let's move the PSCI include file to include/kvm so that both
ARM architectures can find it.
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
need kvm/arm_psci.h in files:
arch/arm64/kvm/handle_exit.c
arch/arm/kvm/psci.c and arch/arm/kvm/arm.c
no virt/kvm/arm/arm.c and virt/kvm/arm/psci.c
Marc Zyngier [Tue, 6 Feb 2018 17:56:07 +0000 (17:56 +0000)]
arm64: KVM: Increment PC after handling an SMC trap
commit
f5115e8869e1 upstream.
When handling an SMC trap, the "preferred return address" is set
to that of the SMC, and not the next PC (which is a departure from
the behaviour of an SMC that isn't trapped).
Increment PC in the handler, as the guest is otherwise forever
stuck...
Cc: stable@vger.kernel.org
Fixes:
acfb3b883f6d ("arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls")
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Will Deacon [Wed, 3 Jan 2018 12:46:21 +0000 (12:46 +0000)]
arm64: Implement branch predictor hardening for affected Cortex-A CPUs
commit
aa6acde65e03 upstream.
Cortex-A57, A72, A73 and A75 are susceptible to branch predictor aliasing
and can theoretically be attacked by malicious code.
This patch implements a PSCI-based mitigation for these CPUs when available.
The call into firmware will invalidate the branch predictor state, preventing
any malicious entries from affecting other victim contexts.
Co-developed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
no falkor in arch/arm64/kernel/cpu_errata.c
Will Deacon [Fri, 2 Feb 2018 17:31:40 +0000 (17:31 +0000)]
arm64: entry: Apply BP hardening for suspicious interrupts from EL0
commit
30d88c0e3ace upstream.
It is possible to take an IRQ from EL0 following a branch to a kernel
address in such a way that the IRQ is prioritised over the instruction
abort. Whilst an attacker would need to get the stars to align here,
it might be sufficient with enough calibration so perform BP hardening
in the rare case that we see a kernel address in the ELR when handling
an IRQ from EL0.
Reported-by: Dan Hettena <dhettena@nvidia.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Will Deacon [Fri, 2 Feb 2018 17:31:39 +0000 (17:31 +0000)]
arm64: entry: Apply BP hardening for high-priority synchronous exceptions
commit
5dfc6ed27710 upstream.
Software-step and PC alignment fault exceptions have higher priority than
instruction abort exceptions, so apply the BP hardening hooks there too
if the user PC appears to reside in kernel space.
Reported-by: Dan Hettena <dhettena@nvidia.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
expand enable_da_f to 'msr daifclr, #(8 | 4 | 1)'
in arch/arm64/kernel/entry.S
Marc Zyngier [Wed, 3 Jan 2018 16:38:35 +0000 (16:38 +0000)]
arm64: KVM: Use per-CPU vector when BP hardening is enabled
commit
6840bdd73d07 upstream
Now that we have per-CPU vectors, let's plug then in the KVM/arm64 code.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
mv changes from virt/kvm/arm/arm.c to arch/arm/kvm/arm.c
Marc Zyngier [Fri, 19 Jan 2018 15:42:09 +0000 (15:42 +0000)]
arm64: Move BP hardening to check_and_switch_context
commit
a8e4c0a919ae upstream.
We call arm64_apply_bp_hardening() from post_ttbr_update_workaround,
which has the unexpected consequence of being triggered on every
exception return to userspace when ARM64_SW_TTBR0_PAN is selected,
even if no context switch actually occured.
This is a bit suboptimal, and it would be more logical to only
invalidate the branch predictor when we actually switch to
a different mm.
In order to solve this, move the call to arm64_apply_bp_hardening()
into check_and_switch_context(), where we're guaranteed to pick
a different mm context.
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
no sw pan in arch/arm64/mm/context.c
Will Deacon [Wed, 3 Jan 2018 11:17:58 +0000 (11:17 +0000)]
arm64: Add skeleton to harden the branch predictor against aliasing attacks
commit
0f15adbb2861 upstream.
Aliasing attacks against CPU branch predictors can allow an attacker to
redirect speculative control flow on some CPUs and potentially divulge
information from one context to another.
This patch adds initial skeleton code behind a new Kconfig option to
enable implementation-specific mitigations against these attacks for
CPUs that are affected.
Co-developed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
expand enable_da_f in entry.S
use 5 parameters ARM64_FTR_BITS()
add percpu.h in mm_types.h for percpu functions
use cpus_have_cap instead of cpus_have_const_cap
arch/arm64/Kconfig
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/mmu.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/entry.S
arch/arm64/mm/fault.c
Marc Zyngier [Tue, 30 Jan 2018 04:02:03 +0000 (12:02 +0800)]
arm64: Move post_ttbr_update_workaround to C code
commit
95e3de3590e3 upstream.
We will soon need to invoke a CPU-specific function pointer after changing
page tables, so move post_ttbr_update_workaround out into C code to make
this possible.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
don't include PAN related changes
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/entry.S
arch/arm64/mm/proc.S
Will Deacon [Tue, 2 Jan 2018 21:37:25 +0000 (21:37 +0000)]
arm64: cpufeature: Pass capability structure to ->enable callback
commit
0a0d111d40fd upstream.
In order to invoke the CPU capability ->matches callback from the ->enable
callback for applying local-CPU workarounds, we need a handle on the
capability structure.
This patch passes a pointer to the capability structure to the ->enable
callback.
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Conflicts:
arch/arm64/kernel/cpufeature.c
Suzuki K Poulose [Wed, 17 Jan 2018 17:42:20 +0000 (17:42 +0000)]
arm64: Run enable method for errata work arounds on late CPUs
commit
55b35d070c25 upstream.
When a CPU is brought up after we have finalised the system
wide capabilities (i.e, features and errata), we make sure the
new CPU doesn't need a new errata work around which has not been
detected already. However we don't run enable() method on the new
CPU for the errata work arounds already detected. This could
cause the new CPU running without potential work arounds.
It is upto the "enable()" method to decide if this CPU should
do something about the errata.
Fixes: commit
6a6efbb45b7d95c84 ("arm64: Verify CPU errata work arounds on hotplugged CPU")
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Dave Martin <dave.martin@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Marc Zyngier [Wed, 1 Feb 2017 14:38:46 +0000 (14:38 +0000)]
arm64: cpu_errata: Allow an erratum to be match for all revisions of a core
commit
06f1494f837 upstream.
Some minor erratum may not be fixed in further revisions of a core,
leading to a situation where the workaround needs to be updated each
time an updated core is released.
Introduce a MIDR_ALL_VERSIONS match helper that will work for all
versions of that MIDR, once and for all.
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
James Morse [Fri, 23 Feb 2018 14:31:42 +0000 (22:31 +0800)]
arm64: cpufeature: __this_cpu_has_cap() shouldn't stop early
commit
edf298cfce47 upstream.
Alex Shi rewrite this commit on func this_cpu_has_cap(). The following commit
log is still meaningful.
this_cpu_has_cap() tests caps->desc not caps->matches, so it stops
walking the list when it finds a 'silent' feature, instead of
walking to the end of the list.
Prior to v4.6's
644c2ae198412 ("arm64: cpufeature: Test 'matches' pointer
to find the end of the list") we always tested desc to find the end of
a capability list. This was changed for dubious things like PAN_NOT_UAO.
v4.7's
e3661b128e53e ("arm64: Allow a capability to be checked on
single CPU") added this_cpu_has_cap() using the old desc style test.
CC: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Will Deacon [Tue, 2 Jan 2018 21:45:41 +0000 (21:45 +0000)]
drivers/firmware: Expose psci_get_version through psci_ops structure
commit
d68e3ba5303f upstream.
Entry into recent versions of ARM Trusted Firmware will invalidate the CPU
branch predictor state in order to protect against aliasing attacks.
This patch exposes the PSCI "VERSION" function via psci_ops, so that it
can be invoked outside of the PSCI driver where necessary.
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>