diff mbox series

[U-Boot,v5,07/15] phy: add support for internal phys

Message ID 20180305200546.12744-8-noltari@gmail.com
State Superseded, archived
Delegated to: Daniel Schwierzeck
Headers show
Series bmips: add bcm6348-enet support | expand

Commit Message

Álvaro Fernández Rojas March 5, 2018, 8:05 p.m. UTC
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v5: no changes
 v4: no changes
 v3: no changes
 v2: no changes

 include/phy.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Joe Hershberger March 7, 2018, 8:28 p.m. UTC | #1
On Mon, Mar 5, 2018 at 2:05 PM, Álvaro Fernández Rojas
<noltari@gmail.com> wrote:
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v5: no changes
>  v4: no changes
>  v3: no changes
>  v2: no changes
>
>  include/phy.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/phy.h b/include/phy.h
> index 0543ec10c2..8f3e53db01 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -50,6 +50,7 @@
>
>
>  typedef enum {
> +       PHY_INTERFACE_MODE_INTERNAL,

In Linux this is handled as a flag instead of a different mode. It
seems we should do it the same way.

>         PHY_INTERFACE_MODE_MII,
>         PHY_INTERFACE_MODE_GMII,
>         PHY_INTERFACE_MODE_SGMII,
> @@ -72,6 +73,7 @@ typedef enum {
>  } phy_interface_t;
>
>  static const char *phy_interface_strings[] = {
> +       [PHY_INTERFACE_MODE_INTERNAL]           = "internal",
>         [PHY_INTERFACE_MODE_MII]                = "mii",
>         [PHY_INTERFACE_MODE_GMII]               = "gmii",
>         [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
> --
> 2.11.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Álvaro Fernández Rojas March 8, 2018, 7:38 p.m. UTC | #2
Hi Joe,

El 07/03/2018 a las 21:28, Joe Hershberger escribió:
> On Mon, Mar 5, 2018 at 2:05 PM, Álvaro Fernández Rojas
> <noltari@gmail.com> wrote:
>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>> ---
>>   v5: no changes
>>   v4: no changes
>>   v3: no changes
>>   v2: no changes
>>
>>   include/phy.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/include/phy.h b/include/phy.h
>> index 0543ec10c2..8f3e53db01 100644
>> --- a/include/phy.h
>> +++ b/include/phy.h
>> @@ -50,6 +50,7 @@
>>
>>
>>   typedef enum {
>> +       PHY_INTERFACE_MODE_INTERNAL,
> In Linux this is handled as a flag instead of a different mode. It
> seems we should do it the same way.
Not really, in Linux this is handled as both:
- As a flag (https://elixir.bootlin.com/linux/latest/ident/PHY_IS_INTERNAL):
https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L61
https://github.com/torvalds/linux/blob/master/drivers/net/phy/phy_device.c#L1792
https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L832
- As a mode 
(https://elixir.bootlin.com/linux/latest/ident/PHY_INTERFACE_MODE_INTERNAL):
https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L68
https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L119

>
>>          PHY_INTERFACE_MODE_MII,
>>          PHY_INTERFACE_MODE_GMII,
>>          PHY_INTERFACE_MODE_SGMII,
>> @@ -72,6 +73,7 @@ typedef enum {
>>   } phy_interface_t;
>>
>>   static const char *phy_interface_strings[] = {
>> +       [PHY_INTERFACE_MODE_INTERNAL]           = "internal",
>>          [PHY_INTERFACE_MODE_MII]                = "mii",
>>          [PHY_INTERFACE_MODE_GMII]               = "gmii",
>>          [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
>> --
>> 2.11.0
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
~Álvaro.
Joe Hershberger March 8, 2018, 8:11 p.m. UTC | #3
On Thu, Mar 8, 2018 at 1:38 PM, Álvaro Fernández Rojas
<noltari@gmail.com> wrote:
> Hi Joe,
>
> El 07/03/2018 a las 21:28, Joe Hershberger escribió:
>>
>> On Mon, Mar 5, 2018 at 2:05 PM, Álvaro Fernández Rojas
>> <noltari@gmail.com> wrote:
>>>
>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>> ---
>>>   v5: no changes
>>>   v4: no changes
>>>   v3: no changes
>>>   v2: no changes
>>>
>>>   include/phy.h | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/include/phy.h b/include/phy.h
>>> index 0543ec10c2..8f3e53db01 100644
>>> --- a/include/phy.h
>>> +++ b/include/phy.h
>>> @@ -50,6 +50,7 @@
>>>
>>>
>>>   typedef enum {
>>> +       PHY_INTERFACE_MODE_INTERNAL,
>>
>> In Linux this is handled as a flag instead of a different mode. It
>> seems we should do it the same way.
>
> Not really, in Linux this is handled as both:
> - As a flag (https://elixir.bootlin.com/linux/latest/ident/PHY_IS_INTERNAL):
> https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L61
> https://github.com/torvalds/linux/blob/master/drivers/net/phy/phy_device.c#L1792
> https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L832
> - As a mode
> (https://elixir.bootlin.com/linux/latest/ident/PHY_INTERFACE_MODE_INTERNAL):
> https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L68
> https://github.com/torvalds/linux/blob/master/include/linux/phy.h#L119
>

OK, I was looking at an older kernel where there was only the flag.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

>>
>>>          PHY_INTERFACE_MODE_MII,
>>>          PHY_INTERFACE_MODE_GMII,
>>>          PHY_INTERFACE_MODE_SGMII,
>>> @@ -72,6 +73,7 @@ typedef enum {
>>>   } phy_interface_t;
>>>
>>>   static const char *phy_interface_strings[] = {
>>> +       [PHY_INTERFACE_MODE_INTERNAL]           = "internal",
>>>          [PHY_INTERFACE_MODE_MII]                = "mii",
>>>          [PHY_INTERFACE_MODE_GMII]               = "gmii",
>>>          [PHY_INTERFACE_MODE_SGMII]              = "sgmii",
>>> --
>>> 2.11.0
>>>
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot@lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>
> ~Álvaro.
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
diff mbox series

Patch

diff --git a/include/phy.h b/include/phy.h
index 0543ec10c2..8f3e53db01 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -50,6 +50,7 @@ 
 
 
 typedef enum {
+	PHY_INTERFACE_MODE_INTERNAL,
 	PHY_INTERFACE_MODE_MII,
 	PHY_INTERFACE_MODE_GMII,
 	PHY_INTERFACE_MODE_SGMII,
@@ -72,6 +73,7 @@  typedef enum {
 } phy_interface_t;
 
 static const char *phy_interface_strings[] = {
+	[PHY_INTERFACE_MODE_INTERNAL]		= "internal",
 	[PHY_INTERFACE_MODE_MII]		= "mii",
 	[PHY_INTERFACE_MODE_GMII]		= "gmii",
 	[PHY_INTERFACE_MODE_SGMII]		= "sgmii",