Skip to content

Commit e1c8895

Browse files
jamesequinlankwilczynski
authored andcommitted
PCI: brcmstb: Don't conflate the reset rescal with PHY ctrl
Add a "has_phy" field indicating that the internal PHY has SW control that requires configuration. Some previous chips only required the firing of the "rescal" reset controller. This change requires us to give the 7216 SoC its own cfg_data structure. Link: https://lore.kernel.org/linux-pci/20240815225731.40276-10-james.quinlan@broadcom.com Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Stanimir Varbanov <svarbanov@suse.de>
1 parent 0d80460 commit e1c8895

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ enum pcie_type {
222222
struct pcie_cfg_data {
223223
const int *offsets;
224224
const enum pcie_type type;
225+
const bool has_phy;
225226
void (*perst_set)(struct brcm_pcie *pcie, u32 val);
226227
void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val);
227228
};
@@ -272,6 +273,7 @@ struct brcm_pcie {
272273
void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val);
273274
struct subdev_regulators *sr;
274275
bool ep_wakeup_capable;
276+
bool has_phy;
275277
};
276278

277279
static inline bool is_bmips(const struct brcm_pcie *pcie)
@@ -1313,12 +1315,12 @@ static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start)
13131315

13141316
static inline int brcm_phy_start(struct brcm_pcie *pcie)
13151317
{
1316-
return pcie->rescal ? brcm_phy_cntl(pcie, 1) : 0;
1318+
return pcie->has_phy ? brcm_phy_cntl(pcie, 1) : 0;
13171319
}
13181320

13191321
static inline int brcm_phy_stop(struct brcm_pcie *pcie)
13201322
{
1321-
return pcie->rescal ? brcm_phy_cntl(pcie, 0) : 0;
1323+
return pcie->has_phy ? brcm_phy_cntl(pcie, 0) : 0;
13221324
}
13231325

13241326
static void brcm_pcie_turn_off(struct brcm_pcie *pcie)
@@ -1561,12 +1563,20 @@ static const struct pcie_cfg_data bcm2711_cfg = {
15611563
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
15621564
};
15631565

1566+
static const struct pcie_cfg_data bcm7216_cfg = {
1567+
.offsets = pcie_offset_bcm7278,
1568+
.type = BCM7278,
1569+
.perst_set = brcm_pcie_perst_set_7278,
1570+
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
1571+
.has_phy = true,
1572+
};
1573+
15641574
static const struct of_device_id brcm_pcie_match[] = {
15651575
{ .compatible = "brcm,bcm2711-pcie", .data = &bcm2711_cfg },
15661576
{ .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg },
15671577
{ .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg },
15681578
{ .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg },
1569-
{ .compatible = "brcm,bcm7216-pcie", .data = &bcm7278_cfg },
1579+
{ .compatible = "brcm,bcm7216-pcie", .data = &bcm7216_cfg },
15701580
{ .compatible = "brcm,bcm7445-pcie", .data = &generic_cfg },
15711581
{ .compatible = "brcm,bcm7435-pcie", .data = &bcm7435_cfg },
15721582
{ .compatible = "brcm,bcm7425-pcie", .data = &bcm7425_cfg },
@@ -1614,6 +1624,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
16141624
pcie->type = data->type;
16151625
pcie->perst_set = data->perst_set;
16161626
pcie->bridge_sw_init_set = data->bridge_sw_init_set;
1627+
pcie->has_phy = data->has_phy;
16171628

16181629
pcie->base = devm_platform_ioremap_resource(pdev, 0);
16191630
if (IS_ERR(pcie->base))

0 commit comments

Comments
 (0)