Skip to content

Commit 6276a40

Browse files
abelvesaLorenzo Pieralisi
authored andcommitted
PCI: qcom: Add SM8550 PCIe support
SM8550 requires two additional clocks for proper working. Add these two clocks as optional clocks (as only required by this platform) and compatible for this platform. While at it, let's also rename the reset variable to "rst" from "pci_reset" to match the existing naming preference. Link: https://lore.kernel.org/r/20230320144658.1794991-2-abel.vesa@linaro.org Signed-off-by: Abel Vesa <abel.vesa@linaro.org> [lpieralisi@kernel.org: commit log rewording] Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
1 parent 1a24edc commit 6276a40

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ struct qcom_pcie_resources_2_4_0 {
193193
int num_resets;
194194
};
195195

196-
#define QCOM_PCIE_2_7_0_MAX_CLOCKS 13
196+
#define QCOM_PCIE_2_7_0_MAX_CLOCKS 15
197197
#define QCOM_PCIE_2_7_0_MAX_SUPPLIES 2
198198
struct qcom_pcie_resources_2_7_0 {
199199
struct clk_bulk_data clks[QCOM_PCIE_2_7_0_MAX_CLOCKS];
200200
int num_clks;
201201
struct regulator_bulk_data supplies[QCOM_PCIE_2_7_0_MAX_SUPPLIES];
202-
struct reset_control *pci_reset;
202+
struct reset_control *rst;
203203
};
204204

205205
#define QCOM_PCIE_2_9_0_MAX_CLOCKS 5
@@ -848,9 +848,9 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie)
848848
unsigned int idx;
849849
int ret;
850850

851-
res->pci_reset = devm_reset_control_get_exclusive(dev, "pci");
852-
if (IS_ERR(res->pci_reset))
853-
return PTR_ERR(res->pci_reset);
851+
res->rst = devm_reset_control_array_get_exclusive(dev);
852+
if (IS_ERR(res->rst))
853+
return PTR_ERR(res->rst);
854854

855855
res->supplies[0].supply = "vdda";
856856
res->supplies[1].supply = "vddpe-3v3";
@@ -876,10 +876,12 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie)
876876
res->clks[idx++].id = "ddrss_sf_tbu";
877877
res->clks[idx++].id = "aggre0";
878878
res->clks[idx++].id = "aggre1";
879+
res->clks[idx++].id = "noc_aggr";
879880
res->clks[idx++].id = "noc_aggr_4";
880881
res->clks[idx++].id = "noc_aggr_south_sf";
881882
res->clks[idx++].id = "cnoc_qx";
882883
res->clks[idx++].id = "sleep";
884+
res->clks[idx++].id = "cnoc_sf_axi";
883885

884886
num_opt_clks = idx - num_clks;
885887
res->num_clks = idx;
@@ -909,17 +911,17 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
909911
if (ret < 0)
910912
goto err_disable_regulators;
911913

912-
ret = reset_control_assert(res->pci_reset);
913-
if (ret < 0) {
914-
dev_err(dev, "cannot assert pci reset\n");
914+
ret = reset_control_assert(res->rst);
915+
if (ret) {
916+
dev_err(dev, "reset assert failed (%d)\n", ret);
915917
goto err_disable_clocks;
916918
}
917919

918920
usleep_range(1000, 1500);
919921

920-
ret = reset_control_deassert(res->pci_reset);
921-
if (ret < 0) {
922-
dev_err(dev, "cannot deassert pci reset\n");
922+
ret = reset_control_deassert(res->rst);
923+
if (ret) {
924+
dev_err(dev, "reset deassert failed (%d)\n", ret);
923925
goto err_disable_clocks;
924926
}
925927

@@ -1618,6 +1620,7 @@ static const struct of_device_id qcom_pcie_match[] = {
16181620
{ .compatible = "qcom,pcie-sm8350", .data = &cfg_1_9_0 },
16191621
{ .compatible = "qcom,pcie-sm8450-pcie0", .data = &cfg_1_9_0 },
16201622
{ .compatible = "qcom,pcie-sm8450-pcie1", .data = &cfg_1_9_0 },
1623+
{ .compatible = "qcom,pcie-sm8550", .data = &cfg_1_9_0 },
16211624
{ }
16221625
};
16231626

0 commit comments

Comments
 (0)