Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9e95d86
Revert "FROMLIST: riscv: sophgo: dts: enable PCIe for SG2042_EVB_V2.0"
RevySR Sep 12, 2025
ae4fc9b
Revert "FROMLIST: riscv: sophgo: dts: enable PCIe for SG2042_EVB_V1.X"
RevySR Sep 12, 2025
207bb21
Revert "FROMLIST: riscv: sophgo: dts: enable PCIe for PioneerBox"
RevySR Sep 12, 2025
7ad6d81
Revert "FROMLIST: riscv: sophgo: dts: add PCIe controllers for SG2042"
RevySR Sep 12, 2025
219a53b
Revert "FROMLIST: PCI: sg2042: Add Sophgo SG2042 PCIe driver"
RevySR Sep 12, 2025
7fb6b40
Revert "FROMLIST: PCI: cadence: Check pcie-ops before using it."
RevySR Sep 12, 2025
47c3440
Revert "FROMLIST: dt-bindings: pci: Add Sophgo SG2042 PCIe host"
RevySR Sep 12, 2025
2a7ec95
FROMLIST: dt-bindings: pci: Add Sophgo SG2042 PCIe host
unicornx Sep 12, 2025
6a24583
FROMLIST: PCI: cadence: Check pcie-ops before using it
unicornx Sep 12, 2025
dbc8e41
FROMLIST: PCI: sg2042: Add Sophgo SG2042 PCIe driver
unicornx Sep 12, 2025
1096f46
FROMLIST: riscv: sophgo: dts: add PCIe controllers for SG2042
unicornx Sep 12, 2025
881ea07
FROMLIST: riscv: sophgo: dts: enable PCIe for PioneerBox
unicornx Sep 12, 2025
468c497
FROMLIST: riscv: sophgo: dts: enable PCIe for SG2042_EVB_V1.X
unicornx Sep 12, 2025
607f95c
FROMLIST: riscv: sophgo: dts: enable PCIe for SG2042_EVB_V2.0
unicornx Sep 12, 2025
9548302
Revert "FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_…
RevySR Sep 20, 2025
b5274e7
Revert "FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_…
RevySR Sep 20, 2025
f318fea
Revert "FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for Pioneer…
RevySR Sep 20, 2025
c55e1f4
Revert "FROMLIST: riscv: dts: sophgo: Add SPI NOR node for SG2042"
RevySR Sep 20, 2025
b210267
FROMLIST: riscv: dts: sophgo: Add SPI NOR node for SG2042
sycamoremoon Sep 16, 2025
d34ea9e
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for PioneerBox
sycamoremoon Sep 16, 2025
f056399
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_EVB_V1
sycamoremoon Sep 16, 2025
3ba0b81
FROMLIST: riscv: dts: sophgo: Enable SPI NOR node for SG2042_EVB_V2
sycamoremoon Sep 16, 2025
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
12 changes: 6 additions & 6 deletions arch/riscv/boot/dts/sophgo/sg2042-evb-v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
};
};

Expand All @@ -268,9 +268,9 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
};
};

Expand Down
6 changes: 3 additions & 3 deletions arch/riscv/boot/dts/sophgo/sg2042-evb-v2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
};
};

Expand Down
12 changes: 6 additions & 6 deletions arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
};
};

Expand All @@ -168,9 +168,9 @@
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
spi-max-frequency = <50000000>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
};
};

Expand Down
36 changes: 35 additions & 1 deletion drivers/pci/controller/cadence/pcie-sg2042.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,44 @@ static int sg2042_pcie_probe(struct platform_device *pdev)
static void sg2042_pcie_remove(struct platform_device *pdev)
{
struct cdns_pcie *pcie = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
struct cdns_pcie_rc *rc;

rc = container_of(pcie, struct cdns_pcie_rc, pcie);
cdns_pcie_host_disable(rc);

cdns_pcie_disable_phy(pcie);

pm_runtime_disable(dev);
}

static int sg2042_pcie_suspend_noirq(struct device *dev)
{
struct cdns_pcie *pcie = dev_get_drvdata(dev);

cdns_pcie_disable_phy(pcie);

return 0;
}

static int sg2042_pcie_resume_noirq(struct device *dev)
{
struct cdns_pcie *pcie = dev_get_drvdata(dev);
int ret;

ret = cdns_pcie_enable_phy(pcie);
if (ret) {
dev_err(dev, "failed to enable PHY\n");
return ret;
}

return 0;
}

static DEFINE_NOIRQ_DEV_PM_OPS(sg2042_pcie_pm_ops,
sg2042_pcie_suspend_noirq,
sg2042_pcie_resume_noirq);

static const struct of_device_id sg2042_pcie_of_match[] = {
{ .compatible = "sophgo,sg2042-pcie-host" },
{},
Expand All @@ -92,7 +126,7 @@ static struct platform_driver sg2042_pcie_driver = {
.driver = {
.name = "sg2042-pcie",
.of_match_table = sg2042_pcie_of_match,
.pm = &cdns_pcie_pm_ops,
.pm = pm_sleep_ptr(&sg2042_pcie_pm_ops),
},
.probe = sg2042_pcie_probe,
.remove = sg2042_pcie_remove,
Expand Down