linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform
@ 2016-03-08  8:24 Shawn Lin
  2016-04-07 13:00 ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn Lin @ 2016-03-08  8:24 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, Shawn Lin

This patch rename "reg" property to "reg_offset".
We rename it to fix the compile issue on ARM64 platform:
(reg_format): "reg" property in /phy has invalid length (4 bytes)
(#address-cells == 2, #size-cells == 2)

This's because "reg" is very special one which should keep the
*-cells with its parent node and can't be overwrited even if we
do that explicitly. On 32-bit plafform, the default *-cells
fit for what we assign to "reg". But that's not correct for 64-bit
platform. So we can see two possible solutions to fix this problem:
A) make phy-rockchip-emmc as a child phy node and overwrite its
parent's #address-cells and #size-cells.
B) avoid using this special property.

we use it just for passing on a offset for different Socs, and there's
no requirement to change the code to make phy-rockchip-emmc as a child
node. so choose option B) is sane.

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

 Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt | 4 ++--
 drivers/phy/phy-rockchip-emmc.c                             | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
index 61916f1..ed964ef 100644
--- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
+++ b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
@@ -6,7 +6,7 @@ Required properties:
  - rockchip,grf : phandle to the syscon managing the "general
    register files"
  - #phy-cells: must be 0
- - reg: PHY configure reg address offset in "general
+ - reg_offset: PHY configure reg address offset in "general
    register files"
 
 Example:
@@ -14,6 +14,6 @@ Example:
 emmcphy: phy {
 	compatible = "rockchip,rk3399-emmc-phy";
 	rockchip,grf = <&grf>;
-	reg = <0xf780>;
+	reg_offset = <0xf780>;
 	#phy-cells = <0>;
 };
diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c
index 887b4c2..3f55c0d 100644
--- a/drivers/phy/phy-rockchip-emmc.c
+++ b/drivers/phy/phy-rockchip-emmc.c
@@ -186,7 +186,7 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
 	if (!rk_phy)
 		return -ENOMEM;
 
-	if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
+	if (of_property_read_u32(dev->of_node, "reg_offset", &reg_offset)) {
 		dev_err(dev, "missing reg property in node %s\n",
 			dev->of_node->name);
 		return -EINVAL;
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform
  2016-03-08  8:24 [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform Shawn Lin
@ 2016-04-07 13:00 ` Kishon Vijay Abraham I
  2016-04-07 13:31   ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 4+ messages in thread
From: Kishon Vijay Abraham I @ 2016-04-07 13:00 UTC (permalink / raw)
  To: Shawn Lin; +Cc: linux-kernel

Hi,

On Tuesday 08 March 2016 01:54 PM, Shawn Lin wrote:
> This patch rename "reg" property to "reg_offset".
> We rename it to fix the compile issue on ARM64 platform:
> (reg_format): "reg" property in /phy has invalid length (4 bytes)
> (#address-cells == 2, #size-cells == 2)

Is the same node used for both ARM32 and ARM64 platforms?

Thanks
Kishon
> 
> This's because "reg" is very special one which should keep the
> *-cells with its parent node and can't be overwrited even if we
> do that explicitly. On 32-bit plafform, the default *-cells
> fit for what we assign to "reg". But that's not correct for 64-bit
> platform. So we can see two possible solutions to fix this problem:
> A) make phy-rockchip-emmc as a child phy node and overwrite its
> parent's #address-cells and #size-cells.
> B) avoid using this special property.
> 
> we use it just for passing on a offset for different Socs, and there's
> no requirement to change the code to make phy-rockchip-emmc as a child
> node. so choose option B) is sane.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
> 
>  Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt | 4 ++--
>  drivers/phy/phy-rockchip-emmc.c                             | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> index 61916f1..ed964ef 100644
> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
> @@ -6,7 +6,7 @@ Required properties:
>   - rockchip,grf : phandle to the syscon managing the "general
>     register files"
>   - #phy-cells: must be 0
> - - reg: PHY configure reg address offset in "general
> + - reg_offset: PHY configure reg address offset in "general
>     register files"
>  
>  Example:
> @@ -14,6 +14,6 @@ Example:
>  emmcphy: phy {
>  	compatible = "rockchip,rk3399-emmc-phy";
>  	rockchip,grf = <&grf>;
> -	reg = <0xf780>;
> +	reg_offset = <0xf780>;
>  	#phy-cells = <0>;
>  };
> diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c
> index 887b4c2..3f55c0d 100644
> --- a/drivers/phy/phy-rockchip-emmc.c
> +++ b/drivers/phy/phy-rockchip-emmc.c
> @@ -186,7 +186,7 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
>  	if (!rk_phy)
>  		return -ENOMEM;
>  
> -	if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
> +	if (of_property_read_u32(dev->of_node, "reg_offset", &reg_offset)) {
>  		dev_err(dev, "missing reg property in node %s\n",
>  			dev->of_node->name);
>  		return -EINVAL;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform
  2016-04-07 13:00 ` Kishon Vijay Abraham I
@ 2016-04-07 13:31   ` Kishon Vijay Abraham I
  2016-04-08  1:14     ` Shawn Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Kishon Vijay Abraham I @ 2016-04-07 13:31 UTC (permalink / raw)
  To: Shawn Lin; +Cc: linux-kernel, Heiko Stuebner, linux-rockchip

Hi,

On Thursday 07 April 2016 06:30 PM, Kishon Vijay Abraham I wrote:
> Hi,
> 
> On Tuesday 08 March 2016 01:54 PM, Shawn Lin wrote:
>> This patch rename "reg" property to "reg_offset".
>> We rename it to fix the compile issue on ARM64 platform:
>> (reg_format): "reg" property in /phy has invalid length (4 bytes)
>> (#address-cells == 2, #size-cells == 2)
> 
> Is the same node used for both ARM32 and ARM64 platforms?
> 
> Thanks
> Kishon
>>
>> This's because "reg" is very special one which should keep the
>> *-cells with its parent node and can't be overwrited even if we
>> do that explicitly. On 32-bit plafform, the default *-cells
>> fit for what we assign to "reg". But that's not correct for 64-bit
>> platform. So we can see two possible solutions to fix this problem:
>> A) make phy-rockchip-emmc as a child phy node and overwrite its
>> parent's #address-cells and #size-cells.
>> B) avoid using this special property.
>>
>> we use it just for passing on a offset for different Socs, and there's
>> no requirement to change the code to make phy-rockchip-emmc as a child
>> node. so choose option B) is sane.

I just looked at the Heiko's patch and it makes more sense to have the binding
that he described in his patch [1]. Can you fix it accordingly?

I seem to have only this patch and Heiko's patch for this -rc cycle. Once you
send your patch, I can send a pull request to Greg.

Thanks
Kishon

[1]- > https://patchwork.ozlabs.org/patch/601580/
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>> ---
>>
>>  Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt | 4 ++--
>>  drivers/phy/phy-rockchip-emmc.c                             | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>> index 61916f1..ed964ef 100644
>> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>> +++ b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>> @@ -6,7 +6,7 @@ Required properties:
>>   - rockchip,grf : phandle to the syscon managing the "general
>>     register files"
>>   - #phy-cells: must be 0
>> - - reg: PHY configure reg address offset in "general
>> + - reg_offset: PHY configure reg address offset in "general
>>     register files"
>>  
>>  Example:
>> @@ -14,6 +14,6 @@ Example:
>>  emmcphy: phy {
>>  	compatible = "rockchip,rk3399-emmc-phy";
>>  	rockchip,grf = <&grf>;
>> -	reg = <0xf780>;
>> +	reg_offset = <0xf780>;
>>  	#phy-cells = <0>;
>>  };
>> diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c
>> index 887b4c2..3f55c0d 100644
>> --- a/drivers/phy/phy-rockchip-emmc.c
>> +++ b/drivers/phy/phy-rockchip-emmc.c
>> @@ -186,7 +186,7 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
>>  	if (!rk_phy)
>>  		return -ENOMEM;
>>  
>> -	if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
>> +	if (of_property_read_u32(dev->of_node, "reg_offset", &reg_offset)) {
>>  		dev_err(dev, "missing reg property in node %s\n",
>>  			dev->of_node->name);
>>  		return -EINVAL;
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform
  2016-04-07 13:31   ` Kishon Vijay Abraham I
@ 2016-04-08  1:14     ` Shawn Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Lin @ 2016-04-08  1:14 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: shawn.lin, linux-kernel, Heiko Stuebner, linux-rockchip

在 2016/4/7 21:31, Kishon Vijay Abraham I 写道:
> Hi,
>
> On Thursday 07 April 2016 06:30 PM, Kishon Vijay Abraham I wrote:
>> Hi,
>>
>> On Tuesday 08 March 2016 01:54 PM, Shawn Lin wrote:
>>> This patch rename "reg" property to "reg_offset".
>>> We rename it to fix the compile issue on ARM64 platform:
>>> (reg_format): "reg" property in /phy has invalid length (4 bytes)
>>> (#address-cells == 2, #size-cells == 2)
>>
>> Is the same node used for both ARM32 and ARM64 platforms?
>>
>> Thanks
>> Kishon
>>>
>>> This's because "reg" is very special one which should keep the
>>> *-cells with its parent node and can't be overwrited even if we
>>> do that explicitly. On 32-bit plafform, the default *-cells
>>> fit for what we assign to "reg". But that's not correct for 64-bit
>>> platform. So we can see two possible solutions to fix this problem:
>>> A) make phy-rockchip-emmc as a child phy node and overwrite its
>>> parent's #address-cells and #size-cells.
>>> B) avoid using this special property.
>>>
>>> we use it just for passing on a offset for different Socs, and there's
>>> no requirement to change the code to make phy-rockchip-emmc as a child
>>> node. so choose option B) is sane.
>
> I just looked at the Heiko's patch and it makes more sense to have the binding
> that he described in his patch [1]. Can you fix it accordingly?

yes, Heiko's patch is more reasonable to me. With his patch applied,
this issue is gone if assigning address-cells in dt for grf.

So we can drop this patch.

>
> I seem to have only this patch and Heiko's patch for this -rc cycle. Once you
> send your patch, I can send a pull request to Greg.
>
> Thanks
> Kishon
>
> [1]- > https://patchwork.ozlabs.org/patch/601580/
>>>
>>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>>> ---
>>>
>>>   Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt | 4 ++--
>>>   drivers/phy/phy-rockchip-emmc.c                             | 2 +-
>>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>>> index 61916f1..ed964ef 100644
>>> --- a/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>>> +++ b/Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
>>> @@ -6,7 +6,7 @@ Required properties:
>>>    - rockchip,grf : phandle to the syscon managing the "general
>>>      register files"
>>>    - #phy-cells: must be 0
>>> - - reg: PHY configure reg address offset in "general
>>> + - reg_offset: PHY configure reg address offset in "general
>>>      register files"
>>>
>>>   Example:
>>> @@ -14,6 +14,6 @@ Example:
>>>   emmcphy: phy {
>>>   	compatible = "rockchip,rk3399-emmc-phy";
>>>   	rockchip,grf = <&grf>;
>>> -	reg = <0xf780>;
>>> +	reg_offset = <0xf780>;
>>>   	#phy-cells = <0>;
>>>   };
>>> diff --git a/drivers/phy/phy-rockchip-emmc.c b/drivers/phy/phy-rockchip-emmc.c
>>> index 887b4c2..3f55c0d 100644
>>> --- a/drivers/phy/phy-rockchip-emmc.c
>>> +++ b/drivers/phy/phy-rockchip-emmc.c
>>> @@ -186,7 +186,7 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
>>>   	if (!rk_phy)
>>>   		return -ENOMEM;
>>>
>>> -	if (of_property_read_u32(dev->of_node, "reg", &reg_offset)) {
>>> +	if (of_property_read_u32(dev->of_node, "reg_offset", &reg_offset)) {
>>>   		dev_err(dev, "missing reg property in node %s\n",
>>>   			dev->of_node->name);
>>>   		return -EINVAL;
>>>
>
>
>


-- 
Best Regards
Shawn Lin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-08  1:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08  8:24 [PATCH] phy: rockchip-emmc: fix compile issue on arm64 platform Shawn Lin
2016-04-07 13:00 ` Kishon Vijay Abraham I
2016-04-07 13:31   ` Kishon Vijay Abraham I
2016-04-08  1:14     ` Shawn Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).