PCI: Make "cdns,max-outbound-regions" optional DT property
Subsystems (4)
cover PCI: Make "cdns,max-outbound-regions" optional DT property
Make "cdns,max-outbound-regions" optional DT property in all the platforms using Cadence PCIe core.
Kishon Vijay Abraham I (2):
dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found
Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml | 3 --- .../devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 2 -- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 +++------ drivers/pci/controller/cadence/pcie-cadence.h | 1 + 4 files changed, 4 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
Make "cdns,max-outbound-regions" optional property with the default being 32.
--- Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml | 3 --- Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 2 -- 2 files changed, 5 deletions(-)
Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml +0 -3
@@ -20,7 +20,4 @@ properties: maximum: 32 default: 32 -required: - - cdns,max-outbound-regions - additionalProperties: true
Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml +0 -2
@@ -57,7 +57,6 @@ required: - power-domains - clocks - clock-names - - cdns,max-outbound-regions - dma-coherent - max-functions - phys
@@ -86,7 +85,6 @@ examples: power-domains = <&k3_pds 239 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 239 1>; clock-names = "fck"; - cdns,max-outbound-regions = <16>; max-functions = /bits/ 8 <6>; dma-coherent; phys = <&serdes0_pcie_link>;
Signature · 1 line
2.17.1
Re: [PATCH 1/2] dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
Quoted 10 lines · Kishon Vijay Abraham I
Make "cdns,max-outbound-regions" optional property with the default being 32.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml | 3 --- Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 2 -- 2 files changed, 5 deletions(-)
PATCH 2/2 PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found
In reply to Kishon Vijay Abraham INow that "cdns,max-outbound-regions" is made an optional property, do not error out if "cdns,max-outbound-regions" device tree property is not found.
--- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 +++------ drivers/pci/controller/cadence/pcie-cadence.h | 1 + 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-ep.c +3 -6
@@ -531,12 +531,9 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) } pcie->mem_res = res; - ret =of_property_read_u32 (np,"cdns,max-outbound-regions" , - &ep->max_regions); -if (ret <0 ) { -dev_err (dev,"missing \"cdns,max-outbound-regions\"\n" ); -return ret; - } + ep->max_regions =CDNS_PCIE_MAX_OB ; +of_property_read_u32 (np,"cdns,max-outbound-regions" , &ep->max_regions); + ep->ob_addr =devm_kcalloc (dev, ep->max_regions,sizeof (*ep->ob_addr),GFP_KERNEL );
drivers/pci/controller/cadence/pcie-cadence.h +1 -0
@@ -197,6 +197,7 @@ enum cdns_pcie_rp_bar { };#define CDNS_PCIE_RP_MAX_IB 0x3 +#define CDNS_PCIE_MAX_OB 32struct cdns_pcie_rp_ib_bar {u64 size;
Signature · 1 line
2.17.1
Re: [PATCH 2/2] PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found
Quoted 10 lines · Kishon Vijay Abraham I
Now that "cdns,max-outbound-regions" is made an optional property, do not error out if "cdns,max-outbound-regions" device tree property is not found.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 +++------ drivers/pci/controller/cadence/pcie-cadence.h | 1 + 2 files changed, 4 insertions(+), 6 deletions(-)
Quoted 36 lines
drivers/pci/controller/cadence/pcie-cadence-ep.c +3
-6@@ -531,12 +531,9 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) } pcie->mem_res = res; - ret =of_property_read_u32 (np,"cdns,max-outbound-regions" , - &ep->max_regions); -if (ret <0 ) { -dev_err (dev,"missing \"cdns,max-outbound-regions\"\n" ); -return ret; - } + ep->max_regions =CDNS_PCIE_MAX_OB ; +of_property_read_u32 (np,"cdns,max-outbound-regions" , &ep->max_regions); + ep->ob_addr =devm_kcalloc (dev, ep->max_regions,sizeof (*ep->ob_addr),GFP_KERNEL );drivers/pci/controller/cadence/pcie-cadence.h +1
-0@@ -197,6 +197,7 @@ enum cdns_pcie_rp_bar { };#define CDNS_PCIE_RP_MAX_IB 0x3 +#define CDNS_PCIE_MAX_OB 32struct cdns_pcie_rp_ib_bar {u64 size;Signature · 1 line
2.17.1
Lorenzo Pieralisi
AppliedQuoted 8 lines · Kishon Vijay Abraham I
Make "cdns,max-outbound-regions" optional DT property in all the platforms using Cadence PCIe core.
Kishon Vijay Abraham I (2):
dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found[...]
Applied to pci/cadence, thanks!
[1/2] dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
https://git.kernel.org/lpieralisi/pci/c/4a2b9125c9 [2/2] PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found https://git.kernel.org/lpieralisi/pci/c/e87d17ca6a
Thanks,
Lorenzo