[PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188

Jianguo Zhang posted 2 patches 2 years ago
[PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Jianguo Zhang 2 years ago
Add ethernet support for MediaTek SoCs from mt8188 family.
As mt8188 and mt8195 have same ethernet design, so private data
"mt8195_gmac_variant" can be reused for mt8188.

Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index d42e1afb6521..f45be440b6d0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -720,6 +720,8 @@ static const struct of_device_id mediatek_dwmac_match[] = {
 	  .data = &mt2712_gmac_variant },
 	{ .compatible = "mediatek,mt8195-gmac",
 	  .data = &mt8195_gmac_variant },
+	{ .compatible = "mediatek,mt8188-gmac",
+	  .data = &mt8195_gmac_variant },
 	{ }
 };
 
-- 
2.25.1
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Krzysztof Kozlowski 2 years ago
On 19/09/2022 10:04, Jianguo Zhang wrote:
> Add ethernet support for MediaTek SoCs from mt8188 family.
> As mt8188 and mt8195 have same ethernet design, so private data
> "mt8195_gmac_variant" can be reused for mt8188.
> 
> Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> index d42e1afb6521..f45be440b6d0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> @@ -720,6 +720,8 @@ static const struct of_device_id mediatek_dwmac_match[] = {
>  	  .data = &mt2712_gmac_variant },
>  	{ .compatible = "mediatek,mt8195-gmac",
>  	  .data = &mt8195_gmac_variant },
> +	{ .compatible = "mediatek,mt8188-gmac",
> +	  .data = &mt8195_gmac_variant },

It's the same. No need for new entry.


Best regards,
Krzysztof
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Jianguo Zhang 2 years ago
Dear Krzysztof,

	Thanks for your comments.


On Mon, 2022-09-19 at 10:19 +0200, Krzysztof Kozlowski wrote:
> On 19/09/2022 10:04, Jianguo Zhang wrote:
> > Add ethernet support for MediaTek SoCs from mt8188 family.
> > As mt8188 and mt8195 have same ethernet design, so private data
> > "mt8195_gmac_variant" can be reused for mt8188.
> > 
> > Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > index d42e1afb6521..f45be440b6d0 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > @@ -720,6 +720,8 @@ static const struct of_device_id
> > mediatek_dwmac_match[] = {
> >  	  .data = &mt2712_gmac_variant },
> >  	{ .compatible = "mediatek,mt8195-gmac",
> >  	  .data = &mt8195_gmac_variant },
> > +	{ .compatible = "mediatek,mt8188-gmac",
> > +	  .data = &mt8195_gmac_variant },
> 
> It's the same. No need for new entry.
> 
mt8188 and mt8195 are different SoCs and we need to distinguish mt8188
from mt8195, so I think a new entry is needed for mt8188 with the
specific "compatiable".
On the other hand, mt8188 and mt8195 have same ethernet design, so the
private data "mt8195_gmac_variant" can be resued to reduce redundant
info in driver.

> 
> Best regards,
> Krzysztof
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Krzysztof Kozlowski 2 years ago
On 19/09/2022 10:37, Jianguo Zhang wrote:
> Dear Krzysztof,
> 
> 	Thanks for your comments.
> 
> 
> On Mon, 2022-09-19 at 10:19 +0200, Krzysztof Kozlowski wrote:
>> On 19/09/2022 10:04, Jianguo Zhang wrote:
>>> Add ethernet support for MediaTek SoCs from mt8188 family.
>>> As mt8188 and mt8195 have same ethernet design, so private data
>>> "mt8195_gmac_variant" can be reused for mt8188.
>>>
>>> Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
>>> ---
>>>  drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
>>> b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
>>> index d42e1afb6521..f45be440b6d0 100644
>>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
>>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
>>> @@ -720,6 +720,8 @@ static const struct of_device_id
>>> mediatek_dwmac_match[] = {
>>>  	  .data = &mt2712_gmac_variant },
>>>  	{ .compatible = "mediatek,mt8195-gmac",
>>>  	  .data = &mt8195_gmac_variant },
>>> +	{ .compatible = "mediatek,mt8188-gmac",
>>> +	  .data = &mt8195_gmac_variant },
>>
>> It's the same. No need for new entry.
>>
> mt8188 and mt8195 are different SoCs and we need to distinguish mt8188
> from mt8195, so I think a new entry is needed for mt8188 with the
> specific "compatiable".

No, this does not justify new entry. You need specific compatible, but
not new entry.

> On the other hand, mt8188 and mt8195 have same ethernet design, so the
> private data "mt8195_gmac_variant" can be resued to reduce redundant
> info in driver.

And you do not need new entry in the driver.

Best regards,
Krzysztof
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Jianguo Zhang 2 years ago
Dear Krzysztof,

On Mon, 2022-09-19 at 11:27 +0200, Krzysztof Kozlowski wrote:
> On 19/09/2022 10:37, Jianguo Zhang wrote:
> > Dear Krzysztof,
> > 
> > 	Thanks for your comments.
> > 
> > 
> > On Mon, 2022-09-19 at 10:19 +0200, Krzysztof Kozlowski wrote:
> > > On 19/09/2022 10:04, Jianguo Zhang wrote:
> > > > Add ethernet support for MediaTek SoCs from mt8188 family.
> > > > As mt8188 and mt8195 have same ethernet design, so private data
> > > > "mt8195_gmac_variant" can be reused for mt8188.
> > > > 
> > > > Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
> > > > ---
> > > >  drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-
> > > > mediatek.c
> > > > b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > > > index d42e1afb6521..f45be440b6d0 100644
> > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > > > @@ -720,6 +720,8 @@ static const struct of_device_id
> > > > mediatek_dwmac_match[] = {
> > > >  	  .data = &mt2712_gmac_variant },
> > > >  	{ .compatible = "mediatek,mt8195-gmac",
> > > >  	  .data = &mt8195_gmac_variant },
> > > > +	{ .compatible = "mediatek,mt8188-gmac",
> > > > +	  .data = &mt8195_gmac_variant },
> > > 
> > > It's the same. No need for new entry.
> > > 
> > 
> > mt8188 and mt8195 are different SoCs and we need to distinguish
> > mt8188
> > from mt8195, so I think a new entry is needed for mt8188 with the
> > specific "compatiable".
> 
> No, this does not justify new entry. You need specific compatible,
> but
> not new entry.
> 
> > On the other hand, mt8188 and mt8195 have same ethernet design, so
> > the
> > private data "mt8195_gmac_variant" can be resued to reduce
> > redundant
> > info in driver.
> 
> And you do not need new entry in the driver.
Do you mean that I can use "mediatek,mt8195-gmac" as compatible for
ethernet in mt8188 DTS file?
> 
> Best regards,
> Krzysztof

BRS
Jianguo
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Krzysztof Kozlowski 2 years ago
On 19/09/2022 11:56, Jianguo Zhang wrote:
>> No, this does not justify new entry. You need specific compatible,
>> but
>> not new entry.
>>
>>> On the other hand, mt8188 and mt8195 have same ethernet design, so
>>> the
>>> private data "mt8195_gmac_variant" can be resued to reduce
>>> redundant
>>> info in driver.
>>
>> And you do not need new entry in the driver.
> Do you mean that I can use "mediatek,mt8195-gmac" as compatible for
> ethernet in mt8188 DTS file?

Yes, as a fallback. Example schema describes such case.

Best regards,
Krzysztof
Re: [PATCH 1/2] stmmac: dwmac-mediatek: add support for mt8188
Posted by Jianguo Zhang 2 years ago
Dear Krzysztof,

	Thanks for your comment.

On Mon, 2022-09-19 at 12:06 +0200, Krzysztof Kozlowski wrote:
> On 19/09/2022 11:56, Jianguo Zhang wrote:
> > > No, this does not justify new entry. You need specific
> > > compatible,
> > > but
> > > not new entry.
> > > 
> > > > On the other hand, mt8188 and mt8195 have same ethernet design,
> > > > so
> > > > the
> > > > private data "mt8195_gmac_variant" can be resued to reduce
> > > > redundant
> > > > info in driver.
> > > 
> > > And you do not need new entry in the driver.
> > 
> > Do you mean that I can use "mediatek,mt8195-gmac" as compatible for
> > ethernet in mt8188 DTS file?
> 
> Yes, as a fallback. Example schema describes such case.
> 
OK, we will drop the changes in patch #1 and add MT8188 related info in
binding document in next version patches.
> Best regards,
> Krzysztof
> 
BRS
Jianguo