Skip to content

Commit 8215851

Browse files
jamesequinlankwilczynski
authored andcommitted
PCI: brcmstb: Change field name from 'type' to 'soc_base'
The 'type' field used in the driver to discern SoC differences is confusing; change it to the more apt 'soc_base'. The 'base' is because some SoCs have the same characteristics as previous SoCs so it is convenient to classify them in the same group. Link: https://lore.kernel.org/linux-pci/20240815225731.40276-13-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> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1 parent 6f61062 commit 8215851

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ enum {
218218
PCIE_INTR2_CPU_BASE,
219219
};
220220

221-
enum pcie_type {
221+
enum pcie_soc_base {
222222
GENERIC,
223223
BCM7425,
224224
BCM7435,
@@ -236,7 +236,7 @@ struct inbound_win {
236236

237237
struct pcie_cfg_data {
238238
const int *offsets;
239-
const enum pcie_type type;
239+
const enum pcie_soc_base soc_base;
240240
const bool has_phy;
241241
u8 num_inbound_wins;
242242
int (*perst_set)(struct brcm_pcie *pcie, u32 val);
@@ -277,7 +277,7 @@ struct brcm_pcie {
277277
u64 msi_target_addr;
278278
struct brcm_msi *msi;
279279
const int *reg_offsets;
280-
enum pcie_type type;
280+
enum pcie_soc_base soc_base;
281281
struct reset_control *rescal;
282282
struct reset_control *perst_reset;
283283
struct reset_control *bridge_reset;
@@ -295,7 +295,7 @@ struct brcm_pcie {
295295

296296
static inline bool is_bmips(const struct brcm_pcie *pcie)
297297
{
298-
return pcie->type == BCM7435 || pcie->type == BCM7425;
298+
return pcie->soc_base == BCM7435 || pcie->soc_base == BCM7425;
299299
}
300300

301301
/*
@@ -862,7 +862,7 @@ static int brcm_pcie_get_inbound_wins(struct brcm_pcie *pcie,
862862
* security considerations, and is not implemented in our modern
863863
* SoCs.
864864
*/
865-
if (pcie->type != BCM7712)
865+
if (pcie->soc_base != BCM7712)
866866
add_inbound_win(b++, &n, 0, 0, 0);
867867

868868
resource_list_for_each_entry(entry, &bridge->dma_ranges) {
@@ -879,7 +879,7 @@ static int brcm_pcie_get_inbound_wins(struct brcm_pcie *pcie,
879879
* That being said, each BARs size must still be a power of
880880
* two.
881881
*/
882-
if (pcie->type == BCM7712)
882+
if (pcie->soc_base == BCM7712)
883883
add_inbound_win(b++, &n, size, cpu_start, pcie_start);
884884

885885
if (n > pcie->num_inbound_wins)
@@ -896,7 +896,7 @@ static int brcm_pcie_get_inbound_wins(struct brcm_pcie *pcie,
896896
* that enables multiple memory controllers. As such, it can return
897897
* now w/o doing special configuration.
898898
*/
899-
if (pcie->type == BCM7712)
899+
if (pcie->soc_base == BCM7712)
900900
return n;
901901

902902
ret = of_property_read_variable_u64_array(pcie->np, "brcm,scb-sizes", pcie->memc_size, 1,
@@ -1019,7 +1019,7 @@ static void set_inbound_win_registers(struct brcm_pcie *pcie,
10191019
* 7712:
10201020
* All of their BARs need to be set.
10211021
*/
1022-
if (pcie->type == BCM7712) {
1022+
if (pcie->soc_base == BCM7712) {
10231023
/* BUS remap register settings */
10241024
reg_offset = brcm_ubus_reg_offset(i);
10251025
tmp = lower_32_bits(cpu_addr) & ~0xfff;
@@ -1048,7 +1048,7 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
10481048
return ret;
10491049

10501050
/* Ensure that PERST# is asserted; some bootloaders may deassert it. */
1051-
if (pcie->type == BCM2711) {
1051+
if (pcie->soc_base == BCM2711) {
10521052
ret = pcie->perst_set(pcie, 1);
10531053
if (ret) {
10541054
pcie->bridge_sw_init_set(pcie, 0);
@@ -1079,9 +1079,9 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
10791079
*/
10801080
if (is_bmips(pcie))
10811081
burst = 0x1; /* 256 bytes */
1082-
else if (pcie->type == BCM2711)
1082+
else if (pcie->soc_base == BCM2711)
10831083
burst = 0x0; /* 128 bytes */
1084-
else if (pcie->type == BCM7278)
1084+
else if (pcie->soc_base == BCM7278)
10851085
burst = 0x3; /* 512 bytes */
10861086
else
10871087
burst = 0x2; /* 512 bytes */
@@ -1678,31 +1678,31 @@ static const int pcie_offsets_bmips_7425[] = {
16781678

16791679
static const struct pcie_cfg_data generic_cfg = {
16801680
.offsets = pcie_offsets,
1681-
.type = GENERIC,
1681+
.soc_base = GENERIC,
16821682
.perst_set = brcm_pcie_perst_set_generic,
16831683
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
16841684
.num_inbound_wins = 3,
16851685
};
16861686

16871687
static const struct pcie_cfg_data bcm7425_cfg = {
16881688
.offsets = pcie_offsets_bmips_7425,
1689-
.type = BCM7425,
1689+
.soc_base = BCM7425,
16901690
.perst_set = brcm_pcie_perst_set_generic,
16911691
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
16921692
.num_inbound_wins = 3,
16931693
};
16941694

16951695
static const struct pcie_cfg_data bcm7435_cfg = {
16961696
.offsets = pcie_offsets,
1697-
.type = BCM7435,
1697+
.soc_base = BCM7435,
16981698
.perst_set = brcm_pcie_perst_set_generic,
16991699
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
17001700
.num_inbound_wins = 3,
17011701
};
17021702

17031703
static const struct pcie_cfg_data bcm4908_cfg = {
17041704
.offsets = pcie_offsets,
1705-
.type = BCM4908,
1705+
.soc_base = BCM4908,
17061706
.perst_set = brcm_pcie_perst_set_4908,
17071707
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
17081708
.num_inbound_wins = 3,
@@ -1718,23 +1718,23 @@ static const int pcie_offset_bcm7278[] = {
17181718

17191719
static const struct pcie_cfg_data bcm7278_cfg = {
17201720
.offsets = pcie_offset_bcm7278,
1721-
.type = BCM7278,
1721+
.soc_base = BCM7278,
17221722
.perst_set = brcm_pcie_perst_set_7278,
17231723
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
17241724
.num_inbound_wins = 3,
17251725
};
17261726

17271727
static const struct pcie_cfg_data bcm2711_cfg = {
17281728
.offsets = pcie_offsets,
1729-
.type = BCM2711,
1729+
.soc_base = BCM2711,
17301730
.perst_set = brcm_pcie_perst_set_generic,
17311731
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
17321732
.num_inbound_wins = 3,
17331733
};
17341734

17351735
static const struct pcie_cfg_data bcm7216_cfg = {
17361736
.offsets = pcie_offset_bcm7278,
1737-
.type = BCM7278,
1737+
.soc_base = BCM7278,
17381738
.perst_set = brcm_pcie_perst_set_7278,
17391739
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
17401740
.has_phy = true,
@@ -1791,7 +1791,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
17911791
pcie->dev = &pdev->dev;
17921792
pcie->np = np;
17931793
pcie->reg_offsets = data->offsets;
1794-
pcie->type = data->type;
1794+
pcie->soc_base = data->soc_base;
17951795
pcie->perst_set = data->perst_set;
17961796
pcie->bridge_sw_init_set = data->bridge_sw_init_set;
17971797
pcie->has_phy = data->has_phy;
@@ -1869,7 +1869,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
18691869
goto fail;
18701870

18711871
pcie->hw_rev = readl(pcie->base + PCIE_MISC_REVISION);
1872-
if (pcie->type == BCM4908 && pcie->hw_rev >= BRCM_PCIE_HW_REV_3_20) {
1872+
if (pcie->soc_base == BCM4908 && pcie->hw_rev >= BRCM_PCIE_HW_REV_3_20) {
18731873
dev_err(pcie->dev, "hardware revision with unsupported PERST# setup\n");
18741874
ret = -ENODEV;
18751875
goto fail;
@@ -1884,7 +1884,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
18841884
}
18851885
}
18861886

1887-
bridge->ops = pcie->type == BCM7425 ? &brcm7425_pcie_ops : &brcm_pcie_ops;
1887+
bridge->ops = pcie->soc_base == BCM7425 ? &brcm7425_pcie_ops : &brcm_pcie_ops;
18881888
bridge->sysdata = pcie;
18891889

18901890
platform_set_drvdata(pdev, pcie);

0 commit comments

Comments
 (0)