diff mbox

[4/6] PCI: rockchip: Add rockchip,rk3399-pcie-host compatible

Message ID 1517971650-61555-5-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Shawn Lin Feb. 7, 2018, 2:47 a.m. UTC
To avoid confusion when folks use this controller as endponint
mode, we add rockchip,rk3399-pcie-host to clearly state that
it's driver for host here. And rename/update the document to
reflect this fact.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 .../bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt}         | 3 ++-
 drivers/pci/rockchip/pcie-rockchip-host.c                              | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
 rename Documentation/devicetree/bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt} (98%)

Comments

Rob Herring (Arm) Feb. 9, 2018, 11:38 p.m. UTC | #1
On Wed, Feb 07, 2018 at 10:47:28AM +0800, Shawn Lin wrote:
> To avoid confusion when folks use this controller as endponint

s/endponint/endpoint/

> mode, we add rockchip,rk3399-pcie-host to clearly state that
> it's driver for host here. And rename/update the document to
> reflect this fact.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
> 
>  .../bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt}         | 3 ++-
>  drivers/pci/rockchip/pcie-rockchip-host.c                              | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
>  rename Documentation/devicetree/bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt} (98%)
> 
> diff --git a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
> similarity index 98%
> rename from Documentation/devicetree/bindings/pci/rockchip-pcie.txt
> rename to Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
> index af34c65..f2f3091 100644
> --- a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt
> +++ b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
> @@ -5,7 +5,8 @@ Required properties:
>  - #size-cells: Size representation for root ports, set to <2>
>  - #interrupt-cells: specifies the number of cells needed to encode an
>  		interrupt source. The value must be 1.
> -- compatible: Should contain "rockchip,rk3399-pcie"
> +- compatible: Should contain "rockchip,rk3399-pcie" or
> +	"rockchip,rk3399-pcie-host"

I don't think this is necessary. Endpoint is generally the exception and 
having "endpoint" or "ep" in the endpoint compatible should be enough.

>  - reg: Two register ranges as listed in the reg-names property
>  - reg-names: Must include the following names
>  	- "axi-base"
> diff --git a/drivers/pci/rockchip/pcie-rockchip-host.c b/drivers/pci/rockchip/pcie-rockchip-host.c
> index f5b0492..efb740d 100644
> --- a/drivers/pci/rockchip/pcie-rockchip-host.c
> +++ b/drivers/pci/rockchip/pcie-rockchip-host.c
> @@ -1120,6 +1120,7 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
>  
>  static const struct of_device_id rockchip_pcie_of_match[] = {
>  	{ .compatible = "rockchip,rk3399-pcie", },
> +	{ .compatible = "rockchip,rk3399-pcie-host", },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, rockchip_pcie_of_match);
> -- 
> 1.9.1
> 
>
Shawn Lin Feb. 10, 2018, 8:10 a.m. UTC | #2
Hi Rob,

On 2018/2/10 7:38, Rob Herring wrote:
> On Wed, Feb 07, 2018 at 10:47:28AM +0800, Shawn Lin wrote:
>> To avoid confusion when folks use this controller as endponint
> 
> s/endponint/endpoint/
> 
>> mode, we add rockchip,rk3399-pcie-host to clearly state that
>> it's driver for host here. And rename/update the document to
>> reflect this fact.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>> ---
>>
>>   .../bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt}         | 3 ++-
>>   drivers/pci/rockchip/pcie-rockchip-host.c                              | 1 +
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>   rename Documentation/devicetree/bindings/pci/{rockchip-pcie.txt => rockchip-pcie-host.txt} (98%)
>>
>> diff --git a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
>> similarity index 98%
>> rename from Documentation/devicetree/bindings/pci/rockchip-pcie.txt
>> rename to Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
>> index af34c65..f2f3091 100644
>> --- a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt
>> +++ b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
>> @@ -5,7 +5,8 @@ Required properties:
>>   - #size-cells: Size representation for root ports, set to <2>
>>   - #interrupt-cells: specifies the number of cells needed to encode an
>>   		interrupt source. The value must be 1.
>> -- compatible: Should contain "rockchip,rk3399-pcie"
>> +- compatible: Should contain "rockchip,rk3399-pcie" or
>> +	"rockchip,rk3399-pcie-host"
> 
> I don't think this is necessary. Endpoint is generally the exception and
> having "endpoint" or "ep" in the endpoint compatible should be enough.
> 

I was following the convention of other controllers that support
both of RC mode and EP mode, for instance, pcie-cadence-{host, ep}.txt

Sure, I agree that endpoint is generally the exception, so will drop
this in v2.

>>   - reg: Two register ranges as listed in the reg-names property
>>   - reg-names: Must include the following names
>>   	- "axi-base"
>> diff --git a/drivers/pci/rockchip/pcie-rockchip-host.c b/drivers/pci/rockchip/pcie-rockchip-host.c
>> index f5b0492..efb740d 100644
>> --- a/drivers/pci/rockchip/pcie-rockchip-host.c
>> +++ b/drivers/pci/rockchip/pcie-rockchip-host.c
>> @@ -1120,6 +1120,7 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
>>   
>>   static const struct of_device_id rockchip_pcie_of_match[] = {
>>   	{ .compatible = "rockchip,rk3399-pcie", },
>> +	{ .compatible = "rockchip,rk3399-pcie-host", },
>>   	{}
>>   };
>>   MODULE_DEVICE_TABLE(of, rockchip_pcie_of_match);
>> -- 
>> 1.9.1
>>
>>
> 
> 
>
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
similarity index 98%
rename from Documentation/devicetree/bindings/pci/rockchip-pcie.txt
rename to Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
index af34c65..f2f3091 100644
--- a/Documentation/devicetree/bindings/pci/rockchip-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt
@@ -5,7 +5,8 @@  Required properties:
 - #size-cells: Size representation for root ports, set to <2>
 - #interrupt-cells: specifies the number of cells needed to encode an
 		interrupt source. The value must be 1.
-- compatible: Should contain "rockchip,rk3399-pcie"
+- compatible: Should contain "rockchip,rk3399-pcie" or
+	"rockchip,rk3399-pcie-host"
 - reg: Two register ranges as listed in the reg-names property
 - reg-names: Must include the following names
 	- "axi-base"
diff --git a/drivers/pci/rockchip/pcie-rockchip-host.c b/drivers/pci/rockchip/pcie-rockchip-host.c
index f5b0492..efb740d 100644
--- a/drivers/pci/rockchip/pcie-rockchip-host.c
+++ b/drivers/pci/rockchip/pcie-rockchip-host.c
@@ -1120,6 +1120,7 @@  static int rockchip_pcie_remove(struct platform_device *pdev)
 
 static const struct of_device_id rockchip_pcie_of_match[] = {
 	{ .compatible = "rockchip,rk3399-pcie", },
+	{ .compatible = "rockchip,rk3399-pcie-host", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, rockchip_pcie_of_match);