diff mbox series

[v2,3/3] net: phy: Add DP8382x phy registration to TI PHY init

Message ID 20200428192606.1808-4-dmurphy@ti.com
State New
Headers show
Series TI Ethernet PHY changes | expand

Commit Message

Dan Murphy April 28, 2020, 7:26 p.m. UTC
Add the DP8382X generic PHY registration to the TI PHY init file.

Signed-off-by: Dan Murphy <dmurphy at ti.com>
---
 drivers/net/phy/ti_phy_init.c | 91 +++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

Comments

Michal Simek April 30, 2020, 8:04 a.m. UTC | #1
On 28. 04. 20 21:26, Dan Murphy wrote:
> Add the DP8382X generic PHY registration to the TI PHY init file.
> 
> Signed-off-by: Dan Murphy <dmurphy at ti.com>
> ---
>  drivers/net/phy/ti_phy_init.c | 91 +++++++++++++++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
> 
> diff --git a/drivers/net/phy/ti_phy_init.c b/drivers/net/phy/ti_phy_init.c
> index 277b29a26342..47f32a528361 100644
> --- a/drivers/net/phy/ti_phy_init.c
> +++ b/drivers/net/phy/ti_phy_init.c
> @@ -7,12 +7,103 @@
>   * Copyright (C) 2019-20 Texas Instruments Inc.
>   */
>  
> +

Useless change.

> +#include <phy.h>
>  #include "ti_phy_init.h"
>  
> +#define DP83822_PHY_ID	        0x2000a240
> +#define DP83825S_PHY_ID		0x2000a140
> +#define DP83825I_PHY_ID		0x2000a150
> +#define DP83825CM_PHY_ID	0x2000a160
> +#define DP83825CS_PHY_ID	0x2000a170
> +#define DP83826C_PHY_ID		0x2000a130
> +#define DP83826NC_PHY_ID	0x2000a110

nit: Can't see value to have these macros here.

> +
> +#ifdef CONFIG_PHY_TI_GENERIC
> +static struct phy_driver dp83822_driver = {
> +	.name = "TI DP83822",
> +	.uid = DP83822_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +
> +static struct phy_driver dp83825s_driver = {
> +	.name = "TI DP83825S",
> +	.uid = DP83825S_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +
> +static struct phy_driver dp83825i_driver = {
> +	.name = "TI DP83825I",
> +	.uid = DP83825I_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +
> +static struct phy_driver dp83825m_driver = {
> +	.name = "TI DP83825M",
> +	.uid = DP83825CM_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +
> +static struct phy_driver dp83825cs_driver = {
> +	.name = "TI DP83825CS",
> +	.uid = DP83825CS_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +
> +static struct phy_driver dp83826c_driver = {
> +	.name = "TI DP83826C",
> +	.uid = DP83826C_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +static struct phy_driver dp83826nc_driver = {
> +	.name = "TI DP83826NC",
> +	.uid = DP83826NC_PHY_ID,
> +	.mask = 0xfffffff0,
> +	.features = PHY_BASIC_FEATURES,
> +	.config = &genphy_config_aneg,
> +	.startup = &genphy_startup,
> +	.shutdown = &genphy_shutdown,
> +};
> +#endif /* CONFIG_PHY_TI_GENERIC */
> +
>  int phy_ti_init(void)
>  {
>  #ifdef CONFIG_PHY_TI_DP83867
>  	phy_dp83867_init();
>  #endif
> +
> +#ifdef CONFIG_PHY_TI_GENERIC
> +	phy_register(&dp83822_driver);
> +	phy_register(&dp83825s_driver);
> +	phy_register(&dp83825i_driver);
> +	phy_register(&dp83825m_driver);
> +	phy_register(&dp83825cs_driver);
> +	phy_register(&dp83826c_driver);
> +	phy_register(&dp83826nc_driver);
> +#endif
>  	return 0;
>  }
> 

When you remove that additional empty line feel free to add my
Acked-by: Michal Simek <michal.simek at xilinx.com>

Thanks,
Michal
Dan Murphy April 30, 2020, 11:47 a.m. UTC | #2
Michal

On 4/30/20 3:04 AM, Michal Simek wrote:
> On 28. 04. 20 21:26, Dan Murphy wrote:
>> Add the DP8382X generic PHY registration to the TI PHY init file.
>>
>> Signed-off-by: Dan Murphy <dmurphy at ti.com>
>> ---
>>   drivers/net/phy/ti_phy_init.c | 91 +++++++++++++++++++++++++++++++++++
>>   1 file changed, 91 insertions(+)
>>
>> diff --git a/drivers/net/phy/ti_phy_init.c b/drivers/net/phy/ti_phy_init.c
>> index 277b29a26342..47f32a528361 100644
>> --- a/drivers/net/phy/ti_phy_init.c
>> +++ b/drivers/net/phy/ti_phy_init.c
>> @@ -7,12 +7,103 @@
>>    * Copyright (C) 2019-20 Texas Instruments Inc.
>>    */
>>   
>> +
> Useless change.
Ack
>> +#include <phy.h>
>>   #include "ti_phy_init.h"
>>   
>> +#define DP83822_PHY_ID	        0x2000a240
>> +#define DP83825S_PHY_ID		0x2000a140
>> +#define DP83825I_PHY_ID		0x2000a150
>> +#define DP83825CM_PHY_ID	0x2000a160
>> +#define DP83825CS_PHY_ID	0x2000a170
>> +#define DP83826C_PHY_ID		0x2000a130
>> +#define DP83826NC_PHY_ID	0x2000a110
> nit: Can't see value to have these macros here.

Are you saying to just add the PHY IDs directly below?

I will make that change as well.

>
>> +
>> +#ifdef CONFIG_PHY_TI_GENERIC
>> +static struct phy_driver dp83822_driver = {
>> +	.name = "TI DP83822",
>> +	.uid = DP83822_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +
>> +static struct phy_driver dp83825s_driver = {
>> +	.name = "TI DP83825S",
>> +	.uid = DP83825S_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +
>> +static struct phy_driver dp83825i_driver = {
>> +	.name = "TI DP83825I",
>> +	.uid = DP83825I_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +
>> +static struct phy_driver dp83825m_driver = {
>> +	.name = "TI DP83825M",
>> +	.uid = DP83825CM_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +
>> +static struct phy_driver dp83825cs_driver = {
>> +	.name = "TI DP83825CS",
>> +	.uid = DP83825CS_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +
>> +static struct phy_driver dp83826c_driver = {
>> +	.name = "TI DP83826C",
>> +	.uid = DP83826C_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +static struct phy_driver dp83826nc_driver = {
>> +	.name = "TI DP83826NC",
>> +	.uid = DP83826NC_PHY_ID,
>> +	.mask = 0xfffffff0,
>> +	.features = PHY_BASIC_FEATURES,
>> +	.config = &genphy_config_aneg,
>> +	.startup = &genphy_startup,
>> +	.shutdown = &genphy_shutdown,
>> +};
>> +#endif /* CONFIG_PHY_TI_GENERIC */
>> +
>>   int phy_ti_init(void)
>>   {
>>   #ifdef CONFIG_PHY_TI_DP83867
>>   	phy_dp83867_init();
>>   #endif
>> +
>> +#ifdef CONFIG_PHY_TI_GENERIC
>> +	phy_register(&dp83822_driver);
>> +	phy_register(&dp83825s_driver);
>> +	phy_register(&dp83825i_driver);
>> +	phy_register(&dp83825m_driver);
>> +	phy_register(&dp83825cs_driver);
>> +	phy_register(&dp83826c_driver);
>> +	phy_register(&dp83826nc_driver);
>> +#endif
>>   	return 0;
>>   }
>>
> When you remove that additional empty line feel free to add my
> Acked-by: Michal Simek <michal.simek at xilinx.com>

Ack

Dan

> Thanks,
> Michal
Michal Simek April 30, 2020, 12:14 p.m. UTC | #3
On 30. 04. 20 13:47, Dan Murphy wrote:
> Michal
> 
> On 4/30/20 3:04 AM, Michal Simek wrote:
>> On 28. 04. 20 21:26, Dan Murphy wrote:
>>> Add the DP8382X generic PHY registration to the TI PHY init file.
>>>
>>> Signed-off-by: Dan Murphy <dmurphy at ti.com>
>>> ---
>>> ? drivers/net/phy/ti_phy_init.c | 91 +++++++++++++++++++++++++++++++++++
>>> ? 1 file changed, 91 insertions(+)
>>>
>>> diff --git a/drivers/net/phy/ti_phy_init.c
>>> b/drivers/net/phy/ti_phy_init.c
>>> index 277b29a26342..47f32a528361 100644
>>> --- a/drivers/net/phy/ti_phy_init.c
>>> +++ b/drivers/net/phy/ti_phy_init.c
>>> @@ -7,12 +7,103 @@
>>> ?? * Copyright (C) 2019-20 Texas Instruments Inc.
>>> ?? */
>>> ? +
>> Useless change.
> Ack
>>> +#include <phy.h>
>>> ? #include "ti_phy_init.h"
>>> ? +#define DP83822_PHY_ID??????????? 0x2000a240
>>> +#define DP83825S_PHY_ID??????? 0x2000a140
>>> +#define DP83825I_PHY_ID??????? 0x2000a150
>>> +#define DP83825CM_PHY_ID??? 0x2000a160
>>> +#define DP83825CS_PHY_ID??? 0x2000a170
>>> +#define DP83826C_PHY_ID??????? 0x2000a130
>>> +#define DP83826NC_PHY_ID??? 0x2000a110
>> nit: Can't see value to have these macros here.
> 
> Are you saying to just add the PHY IDs directly below?

others are doing that that's why I can't see the reason to do it
differently. Also normally when you look for phy id you likely want to
know what functions are called.

M
diff mbox series

Patch

diff --git a/drivers/net/phy/ti_phy_init.c b/drivers/net/phy/ti_phy_init.c
index 277b29a26342..47f32a528361 100644
--- a/drivers/net/phy/ti_phy_init.c
+++ b/drivers/net/phy/ti_phy_init.c
@@ -7,12 +7,103 @@ 
  * Copyright (C) 2019-20 Texas Instruments Inc.
  */
 
+
+#include <phy.h>
 #include "ti_phy_init.h"
 
+#define DP83822_PHY_ID	        0x2000a240
+#define DP83825S_PHY_ID		0x2000a140
+#define DP83825I_PHY_ID		0x2000a150
+#define DP83825CM_PHY_ID	0x2000a160
+#define DP83825CS_PHY_ID	0x2000a170
+#define DP83826C_PHY_ID		0x2000a130
+#define DP83826NC_PHY_ID	0x2000a110
+
+#ifdef CONFIG_PHY_TI_GENERIC
+static struct phy_driver dp83822_driver = {
+	.name = "TI DP83822",
+	.uid = DP83822_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver dp83825s_driver = {
+	.name = "TI DP83825S",
+	.uid = DP83825S_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver dp83825i_driver = {
+	.name = "TI DP83825I",
+	.uid = DP83825I_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver dp83825m_driver = {
+	.name = "TI DP83825M",
+	.uid = DP83825CM_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver dp83825cs_driver = {
+	.name = "TI DP83825CS",
+	.uid = DP83825CS_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+
+static struct phy_driver dp83826c_driver = {
+	.name = "TI DP83826C",
+	.uid = DP83826C_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+static struct phy_driver dp83826nc_driver = {
+	.name = "TI DP83826NC",
+	.uid = DP83826NC_PHY_ID,
+	.mask = 0xfffffff0,
+	.features = PHY_BASIC_FEATURES,
+	.config = &genphy_config_aneg,
+	.startup = &genphy_startup,
+	.shutdown = &genphy_shutdown,
+};
+#endif /* CONFIG_PHY_TI_GENERIC */
+
 int phy_ti_init(void)
 {
 #ifdef CONFIG_PHY_TI_DP83867
 	phy_dp83867_init();
 #endif
+
+#ifdef CONFIG_PHY_TI_GENERIC
+	phy_register(&dp83822_driver);
+	phy_register(&dp83825s_driver);
+	phy_register(&dp83825i_driver);
+	phy_register(&dp83825m_driver);
+	phy_register(&dp83825cs_driver);
+	phy_register(&dp83826c_driver);
+	phy_register(&dp83826nc_driver);
+#endif
 	return 0;
 }