arm: mvebu: a38x: serdes: Don't overwrite read-only SAR PCIe registers
authorPali Rohár <pali@kernel.org>
Fri, 24 Sep 2021 20:59:17 +0000 (22:59 +0200)
committerStefan Roese <sr@denx.de>
Fri, 8 Oct 2021 06:33:52 +0000 (08:33 +0200)
commit3bedbcc3aa1865de3de55ca1abfa8d06d33df3b9
treebf77b1a4c365d7657857fa5075bbb34c2ae92a31
parent2d5f51f680be9461f87f0c99b55c68ad68633078
arm: mvebu: a38x: serdes: Don't overwrite read-only SAR PCIe registers

Device/Port Type bits of PCIe Root Port PCI Express Capabilities Register
are read-only SAR registers and are initialized according to current mode
configured by PCIe controller. Changing PCIe controller mode (from Root
Complex mode to Endpoint mode or the other way) is possible via PCI
Express Control Register (offset 0x41A00), bit 1 (ConfRoot Complex). This
has to be done in PCIe controller driver (in our case pci_mvebu.c). Note
that default mode is Root Complex.

Maximum Link Speed bits of PCIe Root Port Link Capabilities Register are
platform specific and overwriting them does not make sense. They are set by
PCIe controller according to current SerDes configuration. For A38x it is
5.0 GT/s if SerDes supports appropriate speed.

Maximum Link Width bits of PCIe Root Port Link Capabilities Register are
read-only SAR registers, but unfortunately if this is not set correctly
here, then access PCI config space of the endpoint card behind this Root
Port does not work.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h
arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c