1
0
Fork 0
Commit Graph

877869 Commits (e57cffefac29d20b9c5c56885e1728ec33c07440)

Author SHA1 Message Date
Leonard Crestez e57cffefac LF-903 firmware: imx: Align imx SC msg structs to 4
The imx SC api strongly assumes that messages are composed out of
4-bytes words but some of our message structs have sizeof "6" and "7".

This produces many oopses with CONFIG_KASAN=y:

	BUG: KASAN: stack-out-of-bounds in imx_mu_send_data+0x108/0x1f0

It shouldn't cause an issues in normal use because these structs are
always allocated on the stack.

Also upstream: https://patchwork.kernel.org/patch/11376909/

Reported-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit 8ca6d9eb2725152404a5764fc8916f77ee82aa29)
2020-02-26 04:17:47 +08:00
Roy Pledge 444f9e85d6 sdk_qbman: Only create debugfs entries when QBMan is part of device tree
Only create debugfs entries if the QBMan nodes exist in the device
tree.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit 68db373cc5721a31e604604fefeaa66b71204da5)
2020-02-26 04:17:47 +08:00
Grigore Popescu 603554005b soc: fsl: dpio: register dpio irq handlers after dpio create
The dpio irqs must be registered when you can actually
receive interrupts, ie when the dpios are created.
Kernel goes through NULL pointer dereference errors
followed by kernel panic because the dpio irqs are
enabled before the dpio is created.

Tested-by: Grigore Popescu <grigore.popescu@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Grigore Popescu <grigore.popescu@nxp.com>
(cherry picked from commit 50722e6685488ddadf15804c85b6da0a107d6847)
2020-02-26 04:17:46 +08:00
Michael Ellerman 6446af3feb of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc
There's an OF helper called of_dma_is_coherent(), which checks if a
device has a "dma-coherent" property to see if the device is coherent
for DMA.

But on some platforms devices are coherent by default, and on some
platforms it's not possible to update existing device trees to add the
"dma-coherent" property.

So add a Kconfig symbol to allow arch code to tell
of_dma_is_coherent() that devices are coherent by default, regardless
of the presence of the property.

Select that symbol on powerpc when NOT_COHERENT_CACHE is not set, ie.
when the system has a coherent cache.

Fixes: 92ea637ede ("of: introduce of_dma_is_coherent() helper")
Cc: stable@vger.kernel.org # v3.16+
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
(cherry picked from commit dabf6b36b8)
(cherry picked from commit 43557841be9fbf4dc9e053944a2e896c4baea73b)
2020-02-26 04:17:46 +08:00
Xiaoliang Yang 68430e200e LF-457: ocelot: tsn: clean preempt interrupt status
The INTB interrupt is used both for 1588 interrupt and preemption status
change interrupt on each port. So clean preempt status interrupt in IRQ
handle function. Without handling it, driver may get interrupt storm.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Reviewed-by: Po Liu <Po.Liu@nxp.com>
(cherry picked from commit 0df3452eb1dec497ed75a7f804142e30972601b3)
2020-02-26 04:17:46 +08:00
Robert Chiras 728ee5c427 LF-842-2: dt-bindings: display/bridge: nwl-dsi: Document video_pll clock
Add documentation for a new clock 'phy_parent'. This clock is optional
and is used to re-parent the PHY related clocks (phy_ref, tx_esc and
rx_esc) to a valid parent. This clock is needed, in order to make the
re-parenting in driver, since the default re-parenting in dts node
(using assigned-clock-parents) may break the LVDS block, which has it's
PHY shared with MIPI-DSI.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit 7ed3b8738e3103396a5f3a9268c66f11f78cab03)
2020-02-26 04:17:46 +08:00
Robert Chiras a29e420506 LF-842-1: drm/bridge: nwl-dsi: Change mipi clocks re-parenting
The MIPI clock parenting is made in dts file, causing the MIPI clocks to
be parented even if that specific MIPI node is needed or not, causing
issues to the LVDS block (which has a shared PHY with MIPI on 8QXP).
In order to avoid these problems with the shared PHY on 8QXP, store the
MIPI parent clock for phy and escape clocks, along with their rates and
do the re-parenting in the MIPI driver only when a bridge (or panel) is
attached to it.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Tested-by: Dong Aisheng <aisheng.dong@nxp.com>
[Aisheng: Tested on MX8QM/QXP with single LVDS-HDMI or MIPI panel]
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>

(cherry picked from commit 2f794bb2f88e18e43dab31f2edea98177fce4e95)
2020-02-26 04:17:46 +08:00
Robin Gong aa8170d1ed LF857-3: ARM: dts: imx6sx-sdb-m4: correct base address of m4_reserved
Correct base address of m4_reserved node.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit d26a53b10b2b9f3f8486aac0c0372b170c088b06)
2020-02-26 04:17:45 +08:00
Robin Gong 1a87217696 LF-857-2: clk: imx: clk-pllv3: remove usleep()
Remove usleep_range in case m4 enabled on i.mx6sx since usleep is not
permitted before imx_sema4_mutex_unlock now.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit ae13a32bec2eb9a0e91a254f20f2d522770dc3e5)
2020-02-26 04:17:45 +08:00
Robin Gong d75952f993 LF-857-1: char: imx_amp: imx_sema4: enlarge lock protect
Currently, there is only spin lock added in imx_sema4_mutex_lock(),but
sema4 driver assume any mutex should be handled one by one and complain
when mutex locked once again before unlocked. Hence, if another lock happens
indeed after the last imx_sema4_mutex_lock(),the complains "imx_sema4_
mutex_lock 135 already locked" would come out over again and again as below.
So delay lock released into imx_sema4_mutex_unlock() to elimate such race
contition.

Thread1:                              Thread2:
  ....                               ....
                                     ------------------------------------------
  imx_sema4_mutex_lock ---->grabbed->|imx_sema4_mutex_lock                     |
                                     |"imx_sema4_mutex_lock 135 already locked"|
                                     ------------------------------------------
  imx_sema4_mutex_unlock             imx_sema4_mutex_unlock
  ....                               .....

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit 362fdbb91f1c2e386adc6147c07f714be6134907)
2020-02-26 04:17:45 +08:00
Stefan-Gabriel Mirea 7392a4f58d LF-632 clk: s32v234: Fix "enetpll_dfs3" position in sdhc_sels
According to the RM, MC_CGM_0_AC15_SC[SELCTL] needs to be 0b100 in order to
select ENET PLL DFS 4 as the source for SDHC_CLK. Omitting such a position
in the parents array will prevent clk_get_rate() (called from
sdhci-esdhc-imx.c) from determining the frequency of ipg_clk_perclk.

Fixes: fba4afe476 ("clk: s32v234: Initial enet clk support")
Signed-off-by: Stefan-Gabriel Mirea <stefan-gabriel.mirea@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit 6f47d7ee76d533622f91533d80d7dc2e89583199)
2020-02-26 04:17:45 +08:00
Gagandeep Singh ae43adb972 LF-881: arm64: dts: add a dts file for dpdk
A new device tree file fsl-ls1028a-rdb-dpdk.dts is added
for user space networking.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Reviewed-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Li Yang <leoyang.li@nxp.com>
(cherry picked from commit 5c1ec7a8a42de9b144ee87177c016270a3334492)
2020-02-26 04:17:45 +08:00
Robert Chiras 50f8a1a77b LF-841: drm/bridge: nwl-dsi: Fix mode_set
Currently, when setting a mode, if the new configuration matches the
existing configuration, the existing one is used instead. Also, the
drm_display_mode object was copied at this point, so if the new
configuration matched the existing one, the mode also wasn't copied,
causing the wrong mode to be used in DPI registers.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit 33523b6a270077488bca2862e3630c7d1e8bc051)
2020-02-26 04:17:45 +08:00
Robert Chiras 3160145163 LF-810: arm64: dts: imx8mq: Add support for dual-display
Add dts file to support dual-display on imx8mq-evk:
1. DCSS + onboard HDMI
2. LCDIF + DSI-HDMI converter: ADV7535

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit f46b5624b3a15874019ebf27d9a27d8742abc22f)
2020-02-26 04:17:44 +08:00
Vladimir Oltean 30c5d071ab net: dsa: felix: Don't error out on disabled ports with no phy-mode
The felix_parse_ports_node function was tested only on device trees
where all ports were enabled. Fix this check so that the driver
continues to probe only with the ports where status is not "disabled",
as expected.

Fixes: bdeced75b1 ("net: dsa: felix: Add PCS operations for PHYLINK")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9b9a8e9d4e65332e5b9679401d54a33cffc59b50)
2020-02-26 04:17:44 +08:00
Alex Marginean da7b2dcc47 drivers: net: dsa: felix: don't restart PCS SGMII AN if not needed
Some PHYs like VSC8234 don't like it when AN restarts on their system side
and they restart line side AN too, going into an endless link up/down loop.
Don't restart PCS AN if link is up already.

Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit b44d30035850423fda60c932e866c70a01bd1250)
2020-02-26 04:17:44 +08:00
Sachin Saxena 7dcadb8d92 fsl_qbman: Framework for enabling Link status notification
-  This will enable link update event notification for
    user space USDPAA application.

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
DPDK-2128
(cherry picked from commit fb53c813a779cc3fc28c8ed3fc8bc0dde24db0ea)

(cherry picked from commit 13efcd6d3c9078d22880e23c022b521935e4d78c)
2020-02-26 04:17:44 +08:00
Roy Pledge 40693b4108 drivers/staging/fsl_qbman: Disable Portal Channel IRQs
Disable portal channel IRQs to avoid them stopping QBMan from
entering idle mode. Since push mode is used in this driver these
interrupts are not needed/used.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
(cherry picked from commit 977cf95ef173bf22b1816e7dbafcbb0f8a151133)
(cherry picked from commit 1d40832f4fa7a166b8c142b0baf9541ebb2a80c5)
2020-02-26 04:17:44 +08:00
Dong Aisheng c40ba5e597 LF-789-2 arm64: dts: add overlay support for ls1028a-qds
Now seems only ls1028a-qds using overlay by adding fragment dtbs.
Add their support in Makefile.

This is one of approach suggested by DT maintainer Rob here:
https://lore.kernel.org/patchwork/patch/821645/

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Alex Marginean <alexandru.marginean@nxp.com>
Tested-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 7220fa2e1a02e471f5d3276601709f3df372ee63)
2020-02-26 04:17:44 +08:00
Jason Liu 2f5be29292 LF-789-1 Revert "scripts: Makefile: Enable creation of _symbols_ DT node for overlays"
This reverts commit 432071b7a106060fa4e451e10249cef021af0b7c.

commit: 432071b7a106 scripts: Makefile: Enable creation of _symbols_ DT node for overlays
changes the common Makefile and force creation of __symbols__ node on all platforms.

This is not good and not acceptible under some cases due to this change will increase
the final DTB size a lot and bring big impact for others who does not need creation
of _symbols_ DT node for overlays.For example, on i.MX OP-TEE, the maxsize of DT is 1MB,
this patch will break some of the i.MX6/i.MX7 boards to boot with OP-TEE enabled.

BTW, community has the similar patch but rejected. The following post discuss about this:
https://lore.kernel.org/patchwork/patch/821645/

For specifc plaform/board which need the creation of _symbols_ DT node for overlays, user can
define DTC_FLAGS_target either trough dtc build command line(#1) or with board specific Makefile(#2)

For example:#1

make DTC_FLAGS_fsl-ls1028a-qds=-@ freescale/fsl-ls1028a-qds.dtb

For example:#2

--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -1,4 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
+# required for overlay support
+#DTC_FLAGS_fsl-ls1028a-qds := -@
+

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Alex Marginean <alexandru.marginean@nxp.com>
Tested-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 8d0eaf37fa9091941de1f03e1e55cbe6a7c61660)
2020-02-26 04:17:43 +08:00
Robert Chiras 3b2bef07ca MLK-23221: drm/bridge: nwl-dsi: Call panel enable early
Right now, if we have a panel attached (referenced by panel_bridge), it
is still treated as bridge in the display pipe-line. Since we need to
make sure that the DPI reset de-asserted after the panel is initialized,
but the callbacks pre_enable and enable from drm_bridge helper functions
are executed in reverse order, the best way is to manually call enable
on the panel_bridge right after our pre_enable call.

Without this manual call, the order of execution is as follows:
1. panel_bridge pre_enable (translated into panel prepare)
2. nwl-dsi pre_enable
3. nwl-dsi enable
4. panel_bridge enable (translated into panel enable)

Since there is no way to move 4. before 3., this is the reason for which
step 4. is manually executed right after step 2.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit d8c1f57f1bc8fa32eb56976423239d2592c10c4a)
2020-02-26 04:17:43 +08:00
Bhupesh Sharma b5b0fe902d LF-419 arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo
vabits_actual variable on arm64 indicates the actual VA space size,
and allows a single binary to support both 48-bit and 52-bit VA
spaces.

If the ARMv8.2-LVA optional feature is present, and we are running
with a 64KB page size; then it is possible to use 52-bits of address
space for both userspace and kernel addresses. However, any kernel
binary that supports 52-bit must also be able to fall back to 48-bit
at early boot time if the hardware feature is not present.

Since TCR_EL1.T1SZ indicates the size offset of the memory region
addressed by TTBR1_EL1 (and hence can be used for determining the
vabits_actual value) it makes more sense to export the same in
vmcoreinfo rather than vabits_actual variable, as the name of the
variable can change in future kernel versions, but the architectural
constructs like TCR_EL1.T1SZ can be used better to indicate intended
specific fields to user-space.

User-space utilities like makedumpfile and crash-utility, need to
read/write this value from/to vmcoreinfo for determining if a virtual
address lies in the linear map range.

The user-space computation for determining whether an address lies in
the linear map range is the same as we have in kernel-space:

  #define __is_lm_address(addr)	(!(((u64)addr) & BIT(vabits_actual - 1)))

I have sent out user-space patches for makedumpfile and crash-utility
to add features for obtaining vabits_actual value from TCR_EL1.T1SZ (see
[0] and [1]).

Akashi reported that he was able to use this patchset and the user-space
changes to get user-space working fine with the 52-bit kernel VA
changes (see [2]).

[0]. http://lists.infradead.org/pipermail/kexec/2019-November/023966.html
[1]. http://lists.infradead.org/pipermail/kexec/2019-November/024006.html
[2]. http://lists.infradead.org/pipermail/kexec/2019-November/023992.html

Cc: James Morse <james.morse@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Steve Capper <steve.capper@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: kexec@lists.infradead.org
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
Tested-by: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
(cherry picked from commit 9b27020c75fe40ef3d959d6660d09278577a5931)
2020-02-26 04:17:43 +08:00
Anji Jagarlmudi 01868891ee staging: fsl_ppfe/eth: Enhance error checking in platform probe
Fix the kernel crash when MAC addr is not passed in dtb.

Signed-off-by: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
(cherry picked from commit 2be5e9c740060b58e962db4c9c20161b0c656ea9)
2020-02-26 04:17:43 +08:00
Clark Wang 65dccc3684 LF-749 ARM: dts: imx6qdl: add bus recovery for i2c buses
Add bus recovery for all i2c buses to avoid bus dead lock.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit d1300cec8a03c46d803d04fea7389bb397f20b3d)
2020-02-26 04:17:42 +08:00
Michael Walle 3e7f50351a enetc: add ioctl() support for PHY-related ops
If there is an attached PHY try to handle the requested ioctl with its
handler, which allows the userspace to access PHY registers, for
example. This will make mii-diag and similar tools work.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2d8ba65722952a996053acf3345dafe6b8564137)
2020-02-26 04:17:42 +08:00
Camelia Groza cfb5d53ffa sdk_dpaa: ceetm: fix recursive dependencies
Due to dependencies between the fsl_ceetm and fsl_dpa modules, remove
the module support for the ceetm driver and integrate it into the main
DPAA Ethernet driver.

The registration of the CEETM Qdisc was the only operation done at
module init. Pass the management of the Qdisc register and unregister
operations to the loading and unloading of the DPAA driver.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
(cherry picked from commit cf4ac5f9d4e98941257af15fd90b3389f0a88c4d)
2020-02-26 04:17:41 +08:00
Yangbo Lu 02b7e8038d LF-183 ptp: depend on !FSL_SDK_FMAN_RTC_API for ptp_qoriq
When kernel uses SDK version DPAA/FMan drivers, user could
select to use ptp_qoriq driver, or FMan RTC driver to manage
1588 timer. But neither should not be enabled together.
This patch is to add dependency !FSL_SDK_FMAN_RTC_API for
ptp_qoriq driver.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
(cherry picked from commit 88573b6472bf6d91c69f024b0f2a4e85533f6c0e)
2020-02-26 04:17:41 +08:00
Yangbo Lu b660c46a24 LF-183 sdk_fman: add an option for RTC (1588 timer) initialization and APIs
The RTC (1588 timer) could be managed by either ptp_qoriq driver
or sdk_fman RTC driver. So add an option for sdk_fman RTC
(1588 timer) initialization and APIs, so that user could select
it or not.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
(cherry picked from commit 060790e63a86eaa0326b2cab0b434197028e8060)
2020-02-26 04:17:41 +08:00
Liu Ying 013dd4f13e MLK-23187-2 drm/imx: dpu: crtc: Disable DPRC repeat_en in ->atomic_disable()
In order to avoid garbage data left in RTRAM after disabling CRTC,
the SoC designer suggests us to disable DPRC repeat_en after FrameGen
FGEN is cleared and before ENSTS is cleared.  Also, it is suggested
that FGEN clearing should be done in the frame prior to DPRC repeat_en
disablement. So, syncing to FrameGen frame counter moving is needed.
The disablement procedure should be done as soon as possible, so we
disable local irq and preemption during the procedure to ensure this.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit b73861cc5ed15d1f809147d055165f3cd6ce030e)
2020-02-26 04:17:41 +08:00
Liu Ying 2ae575ffac MLK-23187-1 gpu: imx: dpu: framegen: Increase timeout again when waiting for moving
In the coming patch, we would wait for FrameGen counter moving in
->atomic_disable() to get synchronization before disabling DPRC
repeat_en.  It appears that waiting for 50ms for video mode
1920x1080@24Hz is not enough in this case and increasing timeout
to 100ms looks ok.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 910d3b8759bb8635b2b9d563cc934748e5aeaa81)
2020-02-26 04:17:41 +08:00
Liu Ying 6e4eb62cbe MLK-23107-2 drm/imx: dpu: kms: Disable DPRC repeat_en in ->atomic_flush() where necessary
The SoC designer suggests us to disable DPRC repeat_en right after
FrameGen frame counter moving so that a plane with prefetch engine
can be disabled correctly on-the-fly.  This helps the plane be
enabled again later without flashing at the initial several lines
fetched by the plane.  The DPRC repeat_en disablement should be done
as soon as the FrameGen frame counter moving, which requires us to
disable preemption and irq.  However, based on tests, there is no
malfunction observed without the strict sequence implemented.
So, tag this as FIXME to achieve some simplicity for now.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 692f5c61782f5edbb15a60ed00e0c614dd263591)
2020-02-26 04:17:40 +08:00
Liu Ying 9de96e60ce MLK-23107-1 gpu: imx: imx8_dprc: Add helper dprc_disable_repeat_en()
This patch adds helper dprc_disable_repeat_en() so that callers
may disable DPRC repeat_en.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 37b68e353a2dc8e3370fb27a4aebf42f5da63047)
2020-02-26 04:17:40 +08:00
Liu Ying 4fc7a44373 MLK-23109 drm/imx: dpu: plane: Always enable DPRC when prefetch is needed
dprc_enable() essentially clears BYPASS bit of PRG.  So, instead of
checking prefetch_start or uv_prefetch_start flags beforehand, it
doesn't hurt to call it unconditionally when prefetch is needed.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit bdadcd85442d05e5de3aa71f81ce619bed9280af)
2020-02-26 04:17:40 +08:00
Liu Ying 1859342961 MLK-23102-2 gpu: imx: dpu: fetchunit: Remove pin-off operations
No one is using pin-off operations, so let's remove them.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 7243d962bb29a35ba4ee1328bdb5d011cf1471cd)
2020-02-26 04:17:40 +08:00
Liu Ying b1297822a6 MLK-23102-1 drm/imx: dpu: kms: Remove fetchunit pin-off mechanism
The pin-off mechanism tries to avoid disabling primary plane's
fetchunit together with CRTC and just leave it be untouched.
However, this shouldn't be something unsupported by the hardware.

Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 311774969072a977618dbf5560a4d39cd146d16e)
2020-02-26 04:17:40 +08:00
Shengzhou Liu 75d5ceac34 security/keys/secure_key: Fix the path of included header file
Fix the path of included header file.

Signed-off-by: Shengzhou Liu <shengzhou.liu@nxp.com>
(cherry picked from commit 578084b64f5e4cbe802c95244681ea321b655ef2)
2020-02-26 04:17:39 +08:00
Alex Marginean 9cdef9a04a arm64: dts: fsl-ls1028a: add labels to Ethernet switch ports
Labels are used to name switch port net devices in Linux, use more
convenient names to make it simpler for users.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 3ad82375cfc4d4f6df68ebe02164995de654001c)
2020-02-26 04:17:39 +08:00
Alex Marginean 164095b242 drivers: net: mscc_ocelot: don't flood unicast traffic to cpu
Switch cpu port doesn't learn MAC addresses and the local bridge dev_addr
must be explicitly added to the bridge.
This is done whenever a port is added to a bridge, ports following the
1st one will just overwrite the same entry.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 9330e20682ce0bfad00c5ad72d1f10004bc824e9)
2020-02-26 04:17:39 +08:00
Alex Marginean 1839242ad3 drivers: net: dsa: felix: Handle PAUSE Rx regardless of AN result
Flow control is used with 2500Base-X and AQR PHYs to do rate adapation
between line side 100/1000 links and MAC running at 2.5G.  This is
independent of the flow control configuration settled on line side though
AN.  In general allowing MAC to handle flow control even though AN did
not enable it explicitly should not be a problem, so the patch enables
it in all cases.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 3d5fc94dc664e426c380092c13ee23493af22fdd)
2020-02-26 04:17:39 +08:00
Alex Marginean 0f89f7f838 drivers: net: dsa: felix: Allow PHY to AN 10/100/1000 with 2500 serdes link
If the serdes link is set to 2500 using interfce type 2500base-X, lower
link speeds over on the line side should still be supported.
Rate adaptation is done out of band, in our case using AQR PHYs this is
done using flow control.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 4685de1192e3453d3233f9417f3c05810c936020)
2020-02-26 04:17:39 +08:00
Alex Marginean 79a17fee26 drivers: net: phy: don't crash in phy_read/_write_mmd without a PHY driver
The APIs can be used by Ethernet drivers to configure internal PHYs
without actually loading a PHY driver.  Check that drv is not NULL before
reading from it.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 209b01104beff05c934b0c2bb5db9972dca80c3c)
2020-02-26 04:17:39 +08:00
Alex Marginean 0b5b1c553d drivers: net: phylink: in-band AN for USXGMII
USXGMII supports passing link information in-band between PHY and MAC PCS,
add it to the list of protocls that support in-band AN mode.

TODO:
Add 2500baseT, 5GbaseT, 10GbaseT.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit c163d0bf3d7b1860192ec3f8baec3eca99931725)
2020-02-26 04:17:38 +08:00
Alex Marginean 9c284f5b8c drivers: net: felix: set link based on BMSR, not LPA
At least some PHYs don't advertise link up during system side AN, rely on
local indication from internal PHYs for link state.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit bfd807a70e76731d7e448abbee13bad5305c2ccd)
2020-02-26 04:17:38 +08:00
Alex Marginean 42865ca7d7 scripts: Makefile: Enable creation of _symbols_ DT node for overlays
DT compiler supports -@ flag which indicates that _symbols_ node should be
automatically created during compilation.  This node is required for
using DT overlays.  The generated DTB is backward compatible, the _symbols_
node can be safely ignored if overlays are not used.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 432071b7a106060fa4e451e10249cef021af0b7c)
2020-02-26 04:17:38 +08:00
Alex Marginean 80bcf697df arm64: dts: fsl-ls1028a-qds: Add overlays for various serdes protocols
Adds overlays for various serdes protocols on LS1028A QDS board using
different PHY cards.  These should be applied at boot, based on serdes
configuration.  If no overlay is applied, only the RGMII interface on
the QDS is available in Linux.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 779c69e4ae9d1535e958cda7309f030293e3c45c)
2020-02-26 04:17:38 +08:00
Alex Marginean af9560bd3b arm64: dts: fsl-ls1028a: prepare dts for overlay
Named the ports node of the Felix Eth switch so it can be used in DT
overlays to associate the ports with proper PHYs.
Ports are now by default disabled in dtsi, so if the board dts doesn't
do anything about them they stay disabled.
Updated RDB and QDS dts files to match.
Replaced all 'phy-connection-type' with 'phy-mode'.
The set-up for protocol 7777 on QDS was changed to a single quad port card
in slot 1.  This requires a QDS board with no lane B rework and a AQR412
or similar PHY card without any lane rework done on it.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 0462421755cb92b3ee9ace632d15a9a19db9f14c)
2020-02-26 04:17:38 +08:00
Alex Marginean fe7299f8a1 arm64: dts: fsl-ls1028a-rdb: fix QSGMII PHY node names
Use ethernet-phy@ADDR, previously the numbers were wrong.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 4085dc853441dd17b53a95d19f324d76d946fee3)
2020-02-26 04:17:37 +08:00
Alex Marginean b329ce9355 drivers: net: phy: aquantia: Add XFI counters
Adds XFI counters and enables counters for AQR112/412.  These are gen 3
PHYs, the register map is compatible with AQR107 which is gen 2.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
(cherry picked from commit 8d938182eee9dcd3f48dca3162f5ec5f0cf1dc34)
2020-02-26 04:17:37 +08:00
Vladimir Oltean 3a2eb6f453 arm64: dts: ls1028a: Disable swp5 by default
This was missed when moving the CPU port and disabling eno3.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
(cherry picked from commit b180bb294ef127e40f11d186443aed162cd5d270)
2020-02-26 04:17:37 +08:00
Alex Marginean 6469b97591 net: phy: vsc8514: enable in-band SGMII auto-negotiation setting
The default in-band AN setting for the VSC8514 PHY is not very reliable:
its out-of-reset state is with SerDes AN disabled, but certain boot
firmware (such as U-Boot) enables it during the boot process.

So its final state as seen by Linux depends on whether the U-Boot PHY
driver has run or not.

If SGMII auto-negotiation is enabled but not acknowledged by the MAC,
the PHY does not pass traffic.

But otherwise, it is able to pass traffic both with AN disabled, and
with AN enabled.

We would like to make this explicitly configurable rather than hardcoded
as "on" as we are doing right now, but we'd rather hardcode it in LSDK
and wait until a solution lands upstream, than invent a solution for
this here.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
(cherry picked from commit 485ce40d18b8ff08620997f5eada324cd67111a1)
2020-02-26 04:17:37 +08:00