pci: enable designware pci and phy on spacemit k1 SoC
Subsystems (3)
v2 cover pci: enable designware pci and phy on spacemit k1 SoC
---
Changes in v2:
- dts: Rebase on upstream DTS. So drop the changes in overlay DTS.
- pci: Find the phy by index instead.
- maintainer: Add the driver in the Spacemit MAINTAINER entry.
- Link to v1: https://patch.msgid.link/[email protected]
To: [email protected]
To: [email protected]
Cc: Tom Rini <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Julien Stephan <[email protected]>
Cc: Johan Jonker <[email protected]>
Cc: Siu Ming Tong <[email protected]>
Cc: "Lucien.Jheng" <[email protected]>
Cc: Eric Chung <[email protected]>
Cc: Huan Zhou <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Pranav Sanwal <[email protected]>
Cc: Raymond Mao <[email protected]>
Cc: Yixun Lan <[email protected]>
---
Eric Chung (4):
phy: spacemit: add K1 PCIe/USB3 combo PHY driver
pci: spacemit: add DesignWare PCIe host controller driver
configs: k1: enable PCIe and NVMe support
MAINTAINER: add K1 PCIe driver to Spacemit entry
board/spacemit/k1/MAINTAINERS | 1 + configs/spacemit_k1_defconfig | 10 + drivers/pci/Kconfig | 7 + drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_spacemit.c | 391 +++++++++++++++++++++++++++++ drivers/pci/pcie_dw_spacemit.h | 78 ++++++ drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/spacemit/Kconfig | 11 + drivers/phy/spacemit/Makefile | 1 + drivers/phy/spacemit/phy-k1-pcie.c | 492 +++++++++++++++++++++++++++++++++++++ 11 files changed, 994 insertions(+)
---
base-commit: b739fb09a011558396287e077108d2e5379069c1
change-id: 20260705-pci-38358b570d03
Best regards,
Signature · 1 line
Eric Chung <[email protected]>
PATCH v2 1/4 phy: spacemit: add K1 PCIe/USB3 combo PHY driver
Add PHY driver for Spacemit K1 SoC supporting:
- Combo PHY (PCIe/USB3) with auto-calibration of RX/TX termination
- PCIe-only PHY (2 lanes) using combo PHY calibration values
The combo PHY calibrates at probe time, and the result is shared globally so PCIe-only PHYs can apply the same termination settings.
--- drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/spacemit/Kconfig | 11 + drivers/phy/spacemit/Makefile | 1 + drivers/phy/spacemit/phy-k1-pcie.c | 492 +++++++++++++++++++++++++++++++++++++ 5 files changed, 506 insertions(+)
drivers/phy/Kconfig +1 -0
@@ -369,6 +369,7 @@ source "drivers/phy/ti/Kconfig" source "drivers/phy/qcom/Kconfig" source "drivers/phy/renesas/Kconfig" source "drivers/phy/starfive/Kconfig" +source "drivers/phy/spacemit/Kconfig" config PHY_COMMON_PROPS bool "Common PHY properties support"
drivers/phy/Makefile +1 -0
@@ -51,3 +51,4 @@ obj-y += ti/ obj-y += qcom/ obj-y += renesas/ obj-y += starfive/ +obj-y += spacemit/
drivers/phy/spacemit/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config PHY_SPACEMIT_K1_PCIE + bool "Spacemit K1 PCIe PHY driver" + depends on PHY + help + Support for the Spacemit K1 SoC PCIe and Combo (PCIe/USB3) PHYs. + + This driver handles both the combo PHY used for port A (which + calibrates RX/TX termination values) and the PCIe-only PHYs for + ports B and C. The combo PHY must be enabled even if port A + is not used for PCIe, because it provides calibration values + required by the other ports.
drivers/phy/spacemit/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_PHY_SPACEMIT_K1_PCIE) += phy-k1-pcie.o
drivers/phy/spacemit/phy-k1-pcie.c new file +492 -0
492 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH v2 2/4 pci: spacemit: add DesignWare PCIe host controller driver
In reply to Eric ChungAdd PCIe host controller driver for Spacemit K1 SoC using the Synopsys DesignWare PCIe core. Supports up to 3 ports.
---
v2:
- Locate the phy by index instead.
--- drivers/pci/Kconfig | 7 + drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_spacemit.c | 391 +++++++++++++++++++++++++++++++++++++++++ drivers/pci/pcie_dw_spacemit.h | 78 ++++++++ 4 files changed, 477 insertions(+)
drivers/pci/Kconfig +7 -0
@@ -498,4 +498,11 @@ config PCIE_DW_IMX Say Y here if you want to enable DW PCIe controller support on iMX SoCs. +config PCIE_DW_SPACEMIT + bool "Enable Spacemit K1 PCIe" + select PCIE_DW_COMMON + help + Say Y here if you want to enable PCIe controller support on + K1 SoC. + endif
drivers/pci/Makefile +1 -0
@@ -60,3 +60,4 @@ obj-$(CONFIG_PCIE_PLDA_COMMON) += pcie_plda_common.o obj-$(CONFIG_PCIE_STARFIVE_JH7110) += pcie_starfive_jh7110.o obj-$(CONFIG_PCIE_DW_AMD) += pcie_dw_amd.o obj-$(CONFIG_PCIE_DW_IMX) += pcie_dw_imx.o +obj-$(CONFIG_PCIE_DW_SPACEMIT) += pcie_dw_spacemit.o
drivers/pci/pcie_dw_spacemit.c new file +391 -0
391 lines not on this page · raw message
drivers/pci/pcie_dw_spacemit.h new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
2.51.0
Yixun Lan
maintainerRe: [PATCH v2 2/4] pci: spacemit: add DesignWare PCIe host controller driver
Hi Neil,
Quoted 9 lines · Eric Chung
Add PCIe host controller driver for Spacemit K1 SoC using the Synopsys DesignWare PCIe core. Supports up to 3 ports.
Signed-off-by Eric Chung <[email protected]>Reviewed-by Neil Armstrong <[email protected]>---
v2:
- Locate the phy by index instead.
Quoted 7 lines
--- drivers/pci/Kconfig | 7 + drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_spacemit.c | 391 +++++++++++++++++++++++++++++++++++++++++ drivers/pci/pcie_dw_spacemit.h | 78 ++++++++ 4 files changed, 477 insertions(+)
Would you like to merge this patch via pci tree? otherwise, I could take all of this series via spacemit custodian tree, let me know which way you'd prefer?
Thanks
Signature · 1 line
Yixun Lan (dlan)
Neil Armstrong
reviewerRe: [PATCH v2 2/4] pci: spacemit: add DesignWare PCIe host controller driver
Hi,
Quoted 20 lines · Yixun Lan
Hi Neil,
Quoted 9 lines · Eric Chung
Add PCIe host controller driver for Spacemit K1 SoC using the Synopsys DesignWare PCIe core. Supports up to 3 ports.
Signed-off-by Eric Chung <[email protected]>Reviewed-by Neil Armstrong <[email protected]>---
v2:
- Locate the phy by index instead.Quoted 7 lines
--- drivers/pci/Kconfig | 7 + drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_spacemit.c | 391 +++++++++++++++++++++++++++++++++++++++++ drivers/pci/pcie_dw_spacemit.h | 78 ++++++++ 4 files changed, 477 insertions(+)
Quoted 2 lines
Would you like to merge this patch via pci tree? otherwise, I could take all of this series via spacemit custodian tree, let me know which way you'd prefer?
Feel free to pick it via your tree!
Thanks,
Neil
Quoted 3 lines
Thanks
PATCH v2 3/4 configs: k1: enable PCIe and NVMe support
In reply to Eric ChungEnable PCIe and NVMe support on K1 based boards.
--- configs/spacemit_k1_defconfig | 10 ++++++++++ 1 file changed, 10 insertions(+)
configs/spacemit_k1_defconfig +10 -0
@@ -105,6 +105,16 @@ CONFIG_CMD_MMC=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMINFO_MAP=y CONFIG_EFI_PARTITION=y +CONFIG_PCI=y +CONFIG_CMD_PCI=y +CONFIG_NVME=y +CONFIG_NVME_PCI=y +CONFIG_CMD_NVME=y +CONFIG_PCIE_DW_SPACEMIT=y +CONFIG_PHY=y +CONFIG_PHY_SPACEMIT_K1_PCIE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_EXT4=y CONFIG_SPL_SPI=y CONFIG_SPL_DM_SPI=y CONFIG_SPL_DM_SPI_FLASH=y
Signature · 1 line
2.51.0
PATCH v2 4/4 MAINTAINER: add K1 PCIe driver to Spacemit entry
In reply to Eric ChungAdd drivers/pci/pcie_dw_spacemit.c to the list of files maintained for the Spacemit K1 board.
--- board/spacemit/k1/MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
board/spacemit/k1/MAINTAINERS +1 -0
@@ -10,6 +10,7 @@ F: doc/board/spacemit/ F: drivers/gpio/spacemit_gpio.c F: drivers/i2c/k1_i2c.c F: drivers/mmc/spacemit_sdhci.c +F: drivers/pci/pcie_dw_spacemit.c F: drivers/pinctrl/spacemit/ F: drivers/power/pmic/pmic_spacemit_p1.c F: drivers/power/regulator/spacemit_p1_regulator.c
Signature · 1 line
2.51.0
Quoted 43 lines · Eric Chung
Signed-off-by Eric Chung <[email protected]>---
Changes in v2:
- dts: Rebase on upstream DTS. So drop the changes in overlay DTS.
- pci: Find the phy by index instead.
- maintainer: Add the driver in the Spacemit MAINTAINER entry.
- Link to v1: https://patch.msgid.link/[email protected]To: [email protected]
To: [email protected]
Cc: Tom Rini <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Julien Stephan <[email protected]>
Cc: Johan Jonker <[email protected]>
Cc: Siu Ming Tong <[email protected]>
Cc: "Lucien.Jheng" <[email protected]>
Cc: Eric Chung <[email protected]>
Cc: Huan Zhou <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Pranav Sanwal <[email protected]>
Cc: Raymond Mao <[email protected]>
Cc: Yixun Lan <[email protected]>---
Eric Chung (4):
phy: spacemit: add K1 PCIe/USB3 combo PHY driver
pci: spacemit: add DesignWare PCIe host controller driver
configs: k1: enable PCIe and NVMe support
MAINTAINER: add K1 PCIe driver to Spacemit entryboard/spacemit/k1/MAINTAINERS | 1 + configs/spacemit_k1_defconfig | 10 + drivers/pci/Kconfig | 7 + drivers/pci/Makefile | 1 + drivers/pci/pcie_dw_spacemit.c | 391 +++++++++++++++++++++++++++++ drivers/pci/pcie_dw_spacemit.h | 78 ++++++ drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/spacemit/Kconfig | 11 + drivers/phy/spacemit/Makefile | 1 + drivers/phy/spacemit/phy-k1-pcie.c | 492 +++++++++++++++++++++++++++++++++++++ 11 files changed, 994 insertions(+)
Quoted 1 line
---
For the series, tested on Bananapi-f3 board
Signature · 1 line
Yixun Lan (dlan)
Quoted 1 line · Eric Chung
Applied, thanks!
[1/4] phy: spacemit: add K1 PCIe/USB3 combo PHY driver
https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/57eb5723d5feb3226cff9ac1d8379f0b31eb09b1 [2/4] pci: spacemit: add DesignWare PCIe host controller driver https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/c8764b8db670152ff8e3b393c8de52823bef51ec [3/4] configs: k1: enable PCIe and NVMe support https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/d70d033928044754e9ac6ea103bfaea19b300816 [4/4] MAINTAINER: add K1 PCIe driver to Spacemit entry https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/dfa681ec397aed90bd13aa5e0e887ee533d41988
Best regards,
Signature · 1 line
Yixun Lan <[email protected]>