Skip to content

Commit fb3d102

Browse files
committed
Merge branch 'pci/controller/xilinx-ecam'
- Drop xilinx-nwl updates of bridge bus number fields, since PCI core already does that (Thippeswamy Havalige) - Update xilinx-nwl driver and ECAM size in devicetree example to allow up to 256 buses (Thippeswamy Havalige) * pci/controller/xilinx-ecam: PCI: xilinx-nwl: Modify ECAM size to enable support for 256 buses PCI: xilinx-nwl: Rename the NWL_ECAM_VALUE_DEFAULT macro dt-bindings: PCI: xilinx-nwl: Modify ECAM size in the DT example PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields
2 parents a4179c6 + 2fccd11 commit fb3d102

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

Documentation/devicetree/bindings/pci/xlnx,nwl-pcie.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ examples:
118118
compatible = "xlnx,nwl-pcie-2.11";
119119
reg = <0x0 0xfd0e0000 0x0 0x1000>,
120120
<0x0 0xfd480000 0x0 0x1000>,
121-
<0x80 0x00000000 0x0 0x1000000>;
121+
<0x80 0x00000000 0x0 0x10000000>;
122122
reg-names = "breg", "pcireg", "cfg";
123123
ranges = <0x02000000 0x0 0xe0000000 0x0 0xe0000000 0x0 0x10000000>,
124124
<0x43000000 0x00000006 0x0 0x00000006 0x0 0x00000002 0x0>;

drivers/pci/controller/pcie-xilinx-nwl.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
#define E_ECAM_CR_ENABLE BIT(0)
127127
#define E_ECAM_SIZE_LOC GENMASK(20, 16)
128128
#define E_ECAM_SIZE_SHIFT 16
129-
#define NWL_ECAM_VALUE_DEFAULT 12
129+
#define NWL_ECAM_MAX_SIZE 16
130130

131131
#define CFG_DMA_REG_BAR GENMASK(2, 0)
132132
#define CFG_PCIE_CACHE GENMASK(7, 0)
@@ -165,8 +165,6 @@ struct nwl_pcie {
165165
u32 ecam_size;
166166
int irq_intx;
167167
int irq_misc;
168-
u32 ecam_value;
169-
u8 last_busno;
170168
struct nwl_msi msi;
171169
struct irq_domain *legacy_irq_domain;
172170
struct clk *clk;
@@ -625,7 +623,7 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie)
625623
{
626624
struct device *dev = pcie->dev;
627625
struct platform_device *pdev = to_platform_device(dev);
628-
u32 breg_val, ecam_val, first_busno = 0;
626+
u32 breg_val, ecam_val;
629627
int err;
630628

631629
breg_val = nwl_bridge_readl(pcie, E_BREG_CAPABILITIES) & BREG_PRESENT;
@@ -675,23 +673,14 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie)
675673
E_ECAM_CR_ENABLE, E_ECAM_CONTROL);
676674

677675
nwl_bridge_writel(pcie, nwl_bridge_readl(pcie, E_ECAM_CONTROL) |
678-
(pcie->ecam_value << E_ECAM_SIZE_SHIFT),
676+
(NWL_ECAM_MAX_SIZE << E_ECAM_SIZE_SHIFT),
679677
E_ECAM_CONTROL);
680678

681679
nwl_bridge_writel(pcie, lower_32_bits(pcie->phys_ecam_base),
682680
E_ECAM_BASE_LO);
683681
nwl_bridge_writel(pcie, upper_32_bits(pcie->phys_ecam_base),
684682
E_ECAM_BASE_HI);
685683

686-
/* Get bus range */
687-
ecam_val = nwl_bridge_readl(pcie, E_ECAM_CONTROL);
688-
pcie->last_busno = (ecam_val & E_ECAM_SIZE_LOC) >> E_ECAM_SIZE_SHIFT;
689-
/* Write primary, secondary and subordinate bus numbers */
690-
ecam_val = first_busno;
691-
ecam_val |= (first_busno + 1) << 8;
692-
ecam_val |= (pcie->last_busno << E_ECAM_SIZE_SHIFT);
693-
writel(ecam_val, (pcie->ecam_base + PCI_PRIMARY_BUS));
694-
695684
if (nwl_pcie_link_up(pcie))
696685
dev_info(dev, "Link is UP\n");
697686
else
@@ -792,7 +781,6 @@ static int nwl_pcie_probe(struct platform_device *pdev)
792781
pcie = pci_host_bridge_priv(bridge);
793782

794783
pcie->dev = dev;
795-
pcie->ecam_value = NWL_ECAM_VALUE_DEFAULT;
796784

797785
err = nwl_pcie_parse_dt(pcie, pdev);
798786
if (err) {

0 commit comments

Comments
 (0)