]> git.dujemihanovic.xyz Git - u-boot.git/commit
arm: mvebu: a38x: serdes: Move non-serdes PCIe code to pci_mvebu.c
authorPali Rohár <pali@kernel.org>
Tue, 21 Dec 2021 11:20:19 +0000 (12:20 +0100)
committerStefan Roese <sr@denx.de>
Fri, 14 Jan 2022 06:47:57 +0000 (07:47 +0100)
commit94c30f9c8f3cf3032349167be21b837b2d568ea2
treea38a6f3e10880b010ef95a1775ac357fc1b6b81b
parent35e29e89a38662407d773e01ad6344de6ad268f0
arm: mvebu: a38x: serdes: Move non-serdes PCIe code to pci_mvebu.c

As explained in commit 3bedbcc3aa18 ("arm: mvebu: a38x: serdes: Don't
overwrite read-only SAR PCIe registers") it is required to set Maximum Link
Width bits of PCIe Root Port Link Capabilities Register depending of number
of used serdes lanes. As this register is part of PCIe address space and
not serdes address space, move it into pci_mvebu.c driver.

Read number of PCIe lanes from DT property "num-lanes" which is used also
by other PCIe controller drivers in Linux kernel. If this property is
absent then it defaults to 1. This property needs to be set to 4 for every
mvebu board which use PEX_ROOT_COMPLEX_X4 or PEX_BUS_MODE_X4.

Enabling of PCIe port needs to be done afer all registers in PCIe address
space are properly configure. For this purpose use new mvebu-reset driver
(part of system-controller) and remove this code from serdes code.

Because some PCIe ports cannot be enabled individually, it is required to
first setup all PCIe ports and then enable them.

This change contains also all required "num-lanes" and "resets" DTS
properties, to make pci_mvebu.c driver work correctly.

Signed-off-by: Pali Rohár <pali@kernel.org>
15 files changed:
arch/arm/dts/armada-375.dtsi
arch/arm/dts/armada-380.dtsi
arch/arm/dts/armada-385.dtsi
arch/arm/dts/armada-xp-98dx3236.dtsi
arch/arm/dts/armada-xp-mv78230.dtsi
arch/arm/dts/armada-xp-mv78260.dtsi
arch/arm/dts/armada-xp-mv78460.dtsi
arch/arm/dts/armada-xp-synology-ds414.dts
arch/arm/dts/armada-xp-theadorable.dts
arch/arm/mach-mvebu/serdes/a38x/Makefile
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c [deleted file]
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h [deleted file]
arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c
drivers/pci/Kconfig
drivers/pci/pci_mvebu.c