Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions arch/riscv/boot/dts/spacemit/k3-com260.dts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@
drive-strength = <25>;
power-source = <1800>;
};
pcie0-1-cfg {
pcie0-0-pins {
pinmux = <K3_PADCONF(79, 5)>, /* pcie0 perst */
<K3_PADCONF(81, 5)>; /* pcie0 clkreq */
bias-pull-up;
drive-strength = <38>;
power-source = <3300>;
};
};
};
};

Expand Down Expand Up @@ -346,3 +355,13 @@
};
};

&combphy {
status = "okay";
};

&pcie0_rc {
pinctrl-names = "default";
pinctrl-0 = <&pcie0_1_cfg>;
status = "okay";
};

50 changes: 50 additions & 0 deletions arch/riscv/boot/dts/spacemit/k3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <dt-bindings/clock/spacemit,k3-syscon.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/phy/phy.h>

/ {
compatible = "spacemit,k3";
Expand Down Expand Up @@ -910,6 +911,55 @@
reset-names = "sdh_axi", "sdh2";
status = "disabled";
};

combphy: phy@81d00000 {
compatible = "spacemit,k3-comb-phy";
reg = <0x0 0x81d00000 0x0 0x600000>;
#phy-cells = <2>;
spacemit,apb-spare = <&pll>;
spacemit,apmu = <&syscon_apmu 0x0>;
status = "disabled";
};

pcie0_rc: pcie@80000000 {
compatible = "spacemit,k3-pcie";
reg = <0x0 0x80000000 0x0 0x00001000>,
<0x0 0x80100000 0x0 0x00001000>,
<0x0 0x80300000 0x0 0x00003f20>,
<0x11 0x00000000 0x0 0x00010000>,
<0x0 0x82900000 0x0 0x00001000>;
reg-names = "dbi", "dbi2", "atu", "config", "link";
device_type = "pci";
#address-cells = <3>;
#size-cells = <2>;
bus-range = <0x00 0xff>;
max-link-speed = <3>;
num-lanes = <8>;
ranges = <0x01000000 0x00 0x00010000 0x11 0x00010000 0x0 0x00100000>,
<0x02000000 0x0 0x00110000 0x11 0x00110000 0x0 0x7fef0000>,
<0x43000000 0x18 0x00000000 0x18 0x00000000 0x1 0x00000000>;
clocks = <&syscon_apmu CLK_APMU_PCIE_PORTA_SLV>,
<&syscon_apmu CLK_APMU_PCIE_PORTA_MSTE>,
<&syscon_apmu CLK_APMU_PCIE_PORTA_SLV>;
clock-names = "dbi", "mstr", "slv";
resets = <&syscon_apmu RESET_APMU_PCIE_PORTA>,
<&syscon_apmu RESET_APMU_PCIE_PORTA>,
<&syscon_apmu RESET_APMU_PCIE_PORTA>;
reset-names = "dbi", "mstr", "slv";
phys = <&combphy 0 PHY_TYPE_PCIE>,
<&combphy 1 PHY_TYPE_PCIE>,
<&combphy 2 PHY_TYPE_PCIE>,
<&combphy 3 PHY_TYPE_PCIE>,
<&combphy 4 PHY_TYPE_PCIE>,
<&combphy 5 PHY_TYPE_PCIE>;
phy-names = "pcie0", "pcie1", "pcie2", "pcie3", "pcie4", "pcie5";
linux,pci-domain = <0>;
msi-parent = <&simsic>;
spacemit,apmu = <&syscon_apmu 0x1f0>;
interrupt-parent = <&saplic>;
interrupts = <141 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
};
};

2 changes: 2 additions & 0 deletions arch/riscv/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ CONFIG_PCIE_XILINX=y
CONFIG_PCIE_CADENCE_PLAT_HOST=y
CONFIG_PCIE_CADENCE_SOPHGO=y
CONFIG_PCIE_DW_PLAT_HOST=y
CONFIG_PCIE_SPACEMIT_K1=y
CONFIG_PCIE_FU740=y
CONFIG_CXL_BUS=y
CONFIG_CXL_PCI=m
Expand Down Expand Up @@ -2466,6 +2467,7 @@ CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
CONFIG_PHY_STARFIVE_JH7110_PCIE=m
CONFIG_PHY_STARFIVE_JH7110_USB=m
CONFIG_PHY_DW_DPHY=y
CONFIG_PHY_SPACEMIT_K3_COMBO_PHY=y
CONFIG_LRW_DDR_PMU=m
CONFIG_LRW_PCIE_PMU=m
CONFIG_DEV_DAX=m
Expand Down
10 changes: 10 additions & 0 deletions drivers/pci/controller/dwc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,14 @@ config PCIE_ULTRARISC
requiring no further configuration on that platform.


config PCIE_SPACEMIT_K1
tristate "SpacemiT K1/K3 PCIe controller (host mode)"
depends on ARCH_SPACEMIT || COMPILE_TEST
depends on HAS_IOMEM
select PCIE_DW_HOST
default ARCH_SPACEMIT
help
Enables support for the DesignWare based PCIe controller in
the SpacemiT K1/K3 SoC operating in host mode.

endmenu
1 change: 1 addition & 0 deletions drivers/pci/controller/dwc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o
obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o
obj-$(CONFIG_PCIE_VISCONTI_HOST) += pcie-visconti.o
obj-$(CONFIG_PCIE_ULTRARISC) += pcie-ultrarisc.o
obj-$(CONFIG_PCIE_SPACEMIT_K1) += pcie-spacemit-k1.o

# The following drivers are for devices that use the generic ACPI
# pci_root.c driver but don't support standard ECAM config access.
Expand Down
Loading