PCI: mediatek-gen3: Add support for restricting link width
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 4 Nov 2024 11:49:35 +0000 (12:49 +0100)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Wed, 6 Nov 2024 19:57:26 +0000 (19:57 +0000)
commitb609a15e7969d6a50d65067ee783b5d9365b04dd
tree6df49c9216e2d00f192315d69761faa3a876a59e
parentade7da14954a5d1003ceb316a230189c445ba357
PCI: mediatek-gen3: Add support for restricting link width

Add support for restricting the port's link width by specifying
the num-lanes devicetree property in the PCIe node.

The setting is done in the GEN_SETTINGS register (in the driver
named as PCIE_SETTING_REG), where each set bit in [11:8] activates
a set of lanes (from bits 11 to 8 respectively, x16/x8/x4/x2).

Link: https://lore.kernel.org/r/20241104114935.172908-3-angelogioacchino.delregno@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/pcie-mediatek-gen3.c