linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] net: ethernet: faraday: To support device tree usage.
@ 2017-01-05 10:23 Greentime Hu
  2017-01-05 21:55 ` Arnd Bergmann
  0 siblings, 1 reply; 9+ messages in thread
From: Greentime Hu @ 2017-01-05 10:23 UTC (permalink / raw)
  To: f.fainelli, netdev, devicetree, andrew, linux-kernel, jiri,
	jonas.jensen, davem, arnd

Signed-off-by: Greentime Hu <green.hu@gmail.com>
---
Changes in v4:
  - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
Changes in v3:
  - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
Changes in v2:
  - Change atmac100_of_ids to ftmac100_of_ids
      
---
 .../net/{moxa,moxart-mac.txt => faraday,ftmac.txt} |    7 +++++--
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/net/ethernet/faraday/ftmac100.c            |    7 +++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 rename Documentation/devicetree/bindings/net/{moxa,moxart-mac.txt => faraday,ftmac.txt} (68%)

diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
similarity index 68%
rename from Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
rename to Documentation/devicetree/bindings/net/faraday,ftmac.txt
index 583418b..be4f55e 100644
--- a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
+++ b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
@@ -1,8 +1,11 @@
-MOXA ART Ethernet Controller
+Faraday Ethernet Controller
 
 Required properties:
 
-- compatible : Must be "moxa,moxart-mac"
+- compatible : Must contain "faraday,ftmac", as well as one of
+		the SoC specific identifiers:
+		"andestech,atmac100"
+		"moxa,moxart-mac"
 - reg : Should contain register location and length
 - interrupts : Should contain the mac interrupt number
 
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 16d3b5e..489c336 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -102,6 +102,7 @@ everest	Everest Semiconductor Co. Ltd.
 everspin	Everspin Technologies, Inc.
 excito	Excito
 ezchip	EZchip Semiconductor
+faraday	Faraday Technology Corporation
 fcs	Fairchild Semiconductor
 firefly	Firefly
 focaltech	FocalTech Systems Co.,Ltd
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index dce5f7b..5d70ee9 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1172,11 +1172,17 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ftmac100_of_ids[] = {
+	{ .compatible = "andestech,atmac100" },
+	{ }
+};
+
 static struct platform_driver ftmac100_driver = {
 	.probe		= ftmac100_probe,
 	.remove		= __exit_p(ftmac100_remove),
 	.driver		= {
 		.name	= DRV_NAME,
+		.of_match_table = ftmac100_of_ids
 	},
 };
 
@@ -1200,3 +1206,4 @@ static void __exit ftmac100_exit(void)
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTMAC100 driver");
 MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(of, ftmac100_of_ids);
-- 
1.7.9.5

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-05 10:23 [PATCH v4] net: ethernet: faraday: To support device tree usage Greentime Hu
@ 2017-01-05 21:55 ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2017-01-05 21:55 UTC (permalink / raw)
  To: Greentime Hu
  Cc: f.fainelli, netdev, devicetree, andrew, linux-kernel, jiri,
	jonas.jensen, davem

On Thursday, January 5, 2017 6:23:53 PM CET Greentime Hu wrote:
> Signed-off-by: Greentime Hu <green.hu@gmail.com>
> ---
> Changes in v4:
>   - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
> Changes in v3:
>   - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
> Changes in v2:
>   - Change atmac100_of_ids to ftmac100_of_ids
> 

The patch looks good to me now, but please add a proper commit log
before your Signed-off-by tag.

	Arnd

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-02-08 11:59       ` Greentime Hu
@ 2017-02-10 15:03         ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2017-02-10 15:03 UTC (permalink / raw)
  To: Greentime Hu
  Cc: Arnd Bergmann, David Miller, Networking, devicetree, Andrew Lunn,
	Jiri Pirko, Linux Kernel Mailing List, Florian Fainelli,
	Mark Rutland

On Wed, Feb 8, 2017 at 5:59 AM, Greentime Hu <green.hu@gmail.com> wrote:
> On Sat, Jan 28, 2017 at 6:17 AM, Rob Herring <robh@kernel.org> wrote:
>>
>> On Wed, Jan 25, 2017 at 10:09:20PM +0100, Arnd Bergmann wrote:
>> > On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
>> > > From: Greentime Hu <green.hu@gmail.com>
>> > > Date: Tue, 24 Jan 2017 16:46:14 +0800
>> > >> We also use the same binding document to describe the same faraday ethernet
>> > >> controller and add faraday to vendor-prefixes.txt.
>> > >
>> > > Why are you renaming the MOXA binding file instead of adding a completely new one
>> > > for faraday?  The MOXA one should stick around, I don't see a justification for
>> > > removing it.
>> >
>> > This was my suggestion, basically fixing the name of the existing
>> > binding, which was
>> > accidentally named after one of the users rather than the company that did the
>> > hardware.
>> >
>> > We can't change the compatible string, but I'd much prefer having only
>> > one binding
>> > file for this device rather than two separate ones that could possibly become
>> > incompatible in case we add new properties to them. If there is only
>> > one of them,
>> > naming it according to the hardware design is the general policy.
>> >
>> > Note that we currently have two separate device drivers, but that is more a
>> > historic artifact, and if we ever get around to merging them into one driver,
>> > that should not impact the binding.
>>
>> The change is fine with me, but the subject and commit message need some
>> work.
>
> Hi, Rob:
>
> Would you please advise me of the proper subject and commit messages?

Split the binding to a separate commit and summarize the email
discussion here. For a subject, something like this:

"dt-bindings: net: generalize moxart-mac to support all faraday based ftmac IP"

Rob

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-27 22:17     ` Rob Herring
  2017-02-01 15:47       ` Arnd Bergmann
@ 2017-02-08 11:59       ` Greentime Hu
  2017-02-10 15:03         ` Rob Herring
  1 sibling, 1 reply; 9+ messages in thread
From: Greentime Hu @ 2017-02-08 11:59 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, David Miller, Networking, devicetree, Andrew Lunn,
	Jiri Pirko, Linux Kernel Mailing List, Florian Fainelli,
	Mark Rutland

On Sat, Jan 28, 2017 at 6:17 AM, Rob Herring <robh@kernel.org> wrote:
>
> On Wed, Jan 25, 2017 at 10:09:20PM +0100, Arnd Bergmann wrote:
> > On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> > > From: Greentime Hu <green.hu@gmail.com>
> > > Date: Tue, 24 Jan 2017 16:46:14 +0800
> > >> We also use the same binding document to describe the same faraday ethernet
> > >> controller and add faraday to vendor-prefixes.txt.
> > >
> > > Why are you renaming the MOXA binding file instead of adding a completely new one
> > > for faraday?  The MOXA one should stick around, I don't see a justification for
> > > removing it.
> >
> > This was my suggestion, basically fixing the name of the existing
> > binding, which was
> > accidentally named after one of the users rather than the company that did the
> > hardware.
> >
> > We can't change the compatible string, but I'd much prefer having only
> > one binding
> > file for this device rather than two separate ones that could possibly become
> > incompatible in case we add new properties to them. If there is only
> > one of them,
> > naming it according to the hardware design is the general policy.
> >
> > Note that we currently have two separate device drivers, but that is more a
> > historic artifact, and if we ever get around to merging them into one driver,
> > that should not impact the binding.
>
> The change is fine with me, but the subject and commit message need some
> work.

Hi, Rob:

Would you please advise me of the proper subject and commit messages?
Thanks~

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-27 22:17     ` Rob Herring
@ 2017-02-01 15:47       ` Arnd Bergmann
  2017-02-08 11:59       ` Greentime Hu
  1 sibling, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2017-02-01 15:47 UTC (permalink / raw)
  To: Rob Herring
  Cc: green.hu, David Miller, Networking, devicetree, andrew, jiri,
	Linux Kernel Mailing List, f.fainelli, Mark Rutland

On Friday, January 27, 2017 4:17:33 PM CET Rob Herring wrote:
> On Wed, Jan 25, 2017 at 10:09:20PM +0100, Arnd Bergmann wrote:
> > On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> > > From: Greentime Hu <green.hu@gmail.com>
> > > Date: Tue, 24 Jan 2017 16:46:14 +0800
> > >> We also use the same binding document to describe the same faraday ethernet
> > >> controller and add faraday to vendor-prefixes.txt.
> > >
> > > Why are you renaming the MOXA binding file instead of adding a completely new one
> > > for faraday?  The MOXA one should stick around, I don't see a justification for
> > > removing it.
> > 
> > This was my suggestion, basically fixing the name of the existing
> > binding, which was
> > accidentally named after one of the users rather than the company that did the
> > hardware.
> > 
> > We can't change the compatible string, but I'd much prefer having only
> > one binding
> > file for this device rather than two separate ones that could possibly become
> > incompatible in case we add new properties to them. If there is only
> > one of them,
> > naming it according to the hardware design is the general policy.
> > 
> > Note that we currently have two separate device drivers, but that is more a
> > historic artifact, and if we ever get around to merging them into one driver,
> > that should not impact the binding.
> 
> The change is fine with me, but the subject and commit message need some 
> work. I'm guessing faraday licensed this to MOXA or something?

Correct, Faraday just produces IP blocks.

> Why is the new name preferred or better?

The situation is similar to the designware "dwmac", which for historic
reasons is called "stmmac" in Linux, both for the binding and the driver
name. I think this should have been dwmac from the start, but changing
it earlier is much easier than changing it later.

	Arnd

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-25 21:09   ` Arnd Bergmann
@ 2017-01-27 22:17     ` Rob Herring
  2017-02-01 15:47       ` Arnd Bergmann
  2017-02-08 11:59       ` Greentime Hu
  0 siblings, 2 replies; 9+ messages in thread
From: Rob Herring @ 2017-01-27 22:17 UTC (permalink / raw)
  To: Arnd Bergmann, green.hu
  Cc: David Miller, Networking, devicetree, andrew, jiri,
	Linux Kernel Mailing List, f.fainelli, Mark Rutland

On Wed, Jan 25, 2017 at 10:09:20PM +0100, Arnd Bergmann wrote:
> On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> > From: Greentime Hu <green.hu@gmail.com>
> > Date: Tue, 24 Jan 2017 16:46:14 +0800
> >> We also use the same binding document to describe the same faraday ethernet
> >> controller and add faraday to vendor-prefixes.txt.
> >
> > Why are you renaming the MOXA binding file instead of adding a completely new one
> > for faraday?  The MOXA one should stick around, I don't see a justification for
> > removing it.
> 
> This was my suggestion, basically fixing the name of the existing
> binding, which was
> accidentally named after one of the users rather than the company that did the
> hardware.
> 
> We can't change the compatible string, but I'd much prefer having only
> one binding
> file for this device rather than two separate ones that could possibly become
> incompatible in case we add new properties to them. If there is only
> one of them,
> naming it according to the hardware design is the general policy.
> 
> Note that we currently have two separate device drivers, but that is more a
> historic artifact, and if we ever get around to merging them into one driver,
> that should not impact the binding.

The change is fine with me, but the subject and commit message need some 
work. I'm guessing faraday licensed this to MOXA or something? Why is 
the new name preferred or better?

Rob

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-25 17:34 ` David Miller
@ 2017-01-25 21:09   ` Arnd Bergmann
  2017-01-27 22:17     ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2017-01-25 21:09 UTC (permalink / raw)
  To: David Miller
  Cc: green.hu, Networking, devicetree, andrew, jiri,
	Linux Kernel Mailing List, f.fainelli, Rob Herring, Mark Rutland

On Wed, Jan 25, 2017 at 6:34 PM, David Miller <davem@davemloft.net> wrote:
> From: Greentime Hu <green.hu@gmail.com>
> Date: Tue, 24 Jan 2017 16:46:14 +0800
>> We also use the same binding document to describe the same faraday ethernet
>> controller and add faraday to vendor-prefixes.txt.
>
> Why are you renaming the MOXA binding file instead of adding a completely new one
> for faraday?  The MOXA one should stick around, I don't see a justification for
> removing it.

This was my suggestion, basically fixing the name of the existing
binding, which was
accidentally named after one of the users rather than the company that did the
hardware.

We can't change the compatible string, but I'd much prefer having only
one binding
file for this device rather than two separate ones that could possibly become
incompatible in case we add new properties to them. If there is only
one of them,
naming it according to the hardware design is the general policy.

Note that we currently have two separate device drivers, but that is more a
historic artifact, and if we ever get around to merging them into one driver,
that should not impact the binding.

    Arnd

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

* Re: [PATCH v4] net: ethernet: faraday: To support device tree usage.
  2017-01-24  8:46 Greentime Hu
@ 2017-01-25 17:34 ` David Miller
  2017-01-25 21:09   ` Arnd Bergmann
  0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2017-01-25 17:34 UTC (permalink / raw)
  To: green.hu
  Cc: netdev, devicetree, andrew, arnd, jiri, linux-kernel, f.fainelli,
	robh+dt, mark.rutland

From: Greentime Hu <green.hu@gmail.com>
Date: Tue, 24 Jan 2017 16:46:14 +0800

> We also use the same binding document to describe the same faraday ethernet
> controller and add faraday to vendor-prefixes.txt.
> 
> Signed-off-by: Greentime Hu <green.hu@gmail.com>
> ---
> Changes in v4:
>   - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
> Changes in v3:
>   - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
> Changes in v2:
>   - Change atmac100_of_ids to ftmac100_of_ids
> 
> ---
>  .../net/{moxa,moxart-mac.txt => faraday,ftmac.txt} |    7 +++++--
>  .../devicetree/bindings/vendor-prefixes.txt        |    1 +
>  drivers/net/ethernet/faraday/ftmac100.c            |    7 +++++++
>  3 files changed, 13 insertions(+), 2 deletions(-)
>  rename Documentation/devicetree/bindings/net/{moxa,moxart-mac.txt => faraday,ftmac.txt} (68%)
> 
> diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
> similarity index 68%
> rename from Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
> rename to Documentation/devicetree/bindings/net/faraday,ftmac.txt

Why are you renaming the MOXA binding file instead of adding a completely new one
for faraday?  The MOXA one should stick around, I don't see a justification for
removing it.

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

* [PATCH v4] net: ethernet: faraday: To support device tree usage.
@ 2017-01-24  8:46 Greentime Hu
  2017-01-25 17:34 ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Greentime Hu @ 2017-01-24  8:46 UTC (permalink / raw)
  To: netdev, devicetree, andrew, arnd, jiri, linux-kernel, f.fainelli,
	robh+dt, mark.rutland

We also use the same binding document to describe the same faraday ethernet
controller and add faraday to vendor-prefixes.txt.

Signed-off-by: Greentime Hu <green.hu@gmail.com>
---
Changes in v4:
  - Use the same binding document to describe the same faraday ethernet controller and add faraday to vendor-prefixes.txt.
Changes in v3:
  - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.
Changes in v2:
  - Change atmac100_of_ids to ftmac100_of_ids

---
 .../net/{moxa,moxart-mac.txt => faraday,ftmac.txt} |    7 +++++--
 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 drivers/net/ethernet/faraday/ftmac100.c            |    7 +++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 rename Documentation/devicetree/bindings/net/{moxa,moxart-mac.txt => faraday,ftmac.txt} (68%)

diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
similarity index 68%
rename from Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
rename to Documentation/devicetree/bindings/net/faraday,ftmac.txt
index 583418b..be4f55e 100644
--- a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
+++ b/Documentation/devicetree/bindings/net/faraday,ftmac.txt
@@ -1,8 +1,11 @@
-MOXA ART Ethernet Controller
+Faraday Ethernet Controller
 
 Required properties:
 
-- compatible : Must be "moxa,moxart-mac"
+- compatible : Must contain "faraday,ftmac", as well as one of
+		the SoC specific identifiers:
+		"andestech,atmac100"
+		"moxa,moxart-mac"
 - reg : Should contain register location and length
 - interrupts : Should contain the mac interrupt number
 
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 16d3b5e..489c336 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -102,6 +102,7 @@ everest	Everest Semiconductor Co. Ltd.
 everspin	Everspin Technologies, Inc.
 excito	Excito
 ezchip	EZchip Semiconductor
+faraday	Faraday Technology Corporation
 fcs	Fairchild Semiconductor
 firefly	Firefly
 focaltech	FocalTech Systems Co.,Ltd
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index dce5f7b..5d70ee9 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1172,11 +1172,17 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ftmac100_of_ids[] = {
+	{ .compatible = "andestech,atmac100" },
+	{ }
+};
+
 static struct platform_driver ftmac100_driver = {
 	.probe		= ftmac100_probe,
 	.remove		= __exit_p(ftmac100_remove),
 	.driver		= {
 		.name	= DRV_NAME,
+		.of_match_table = ftmac100_of_ids
 	},
 };
 
@@ -1200,3 +1206,4 @@ static void __exit ftmac100_exit(void)
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTMAC100 driver");
 MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(of, ftmac100_of_ids);
-- 
1.7.9.5

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

end of thread, other threads:[~2017-02-10 15:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-05 10:23 [PATCH v4] net: ethernet: faraday: To support device tree usage Greentime Hu
2017-01-05 21:55 ` Arnd Bergmann
2017-01-24  8:46 Greentime Hu
2017-01-25 17:34 ` David Miller
2017-01-25 21:09   ` Arnd Bergmann
2017-01-27 22:17     ` Rob Herring
2017-02-01 15:47       ` Arnd Bergmann
2017-02-08 11:59       ` Greentime Hu
2017-02-10 15:03         ` Rob Herring

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).