Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-11 Thread Yuiko.Oshino
>-Original Message-
>From: Joe Hershberger [mailto:joe.hershber...@gmail.com]
>Sent: Thursday, August 10, 2017 5:12 PM
>To: Yuiko Oshino - C18177
>Cc: Marek Vasut; u-boot
>Subject: Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip
>LAN75xx and LAN78xx
>
>On Thu, Aug 10, 2017 at 2:32 PM,  <yuiko.osh...@microchip.com> wrote:
>>>-Original Message-
>>>From: Joe Hershberger [mailto:joe.hershber...@ni.com]
>>>Sent: Thursday, August 10, 2017 2:45 PM
>>>To: Yuiko Oshino - C18177
>>>Cc: Marek Vasut; u-boot; Joe Hershberger
>>>Subject: Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for
>>>Microchip LAN75xx and LAN78xx
>>>
>>>On Thu, Aug 10, 2017 at 1:13 PM,  <yuiko.osh...@microchip.com> wrote:
>>>> Hi Marek,
>>>>
>>>>>-Original Message-
>>>>>From: Marek Vasut [mailto:ma...@denx.de]
>>>>>Sent: Wednesday, August 9, 2017 1:12 PM
>>>>>To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>>>>>Cc: Joe Hershberger
>>>>>Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip
>>>>>LAN75xx and LAN78xx
>>>>>
>>>>>On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>>>>> From: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>>>>
>>>>>> Series-Changes: 3
>>>>>
>>>>>FYI, this will end in the commit message when applied, remove it or
>>>>>move it below the --- . Also commit message is missing.
>>>>
>>>> I did my best to follow the patman instructions and I added
>>>> "commit-notes:" tag,
>>>but I guess it wasn't good enough.
>>>
>>>You need to not use commit notes here. That's for things that you want
>>>to be a note in the email, but not end up in the commit log.
>>
>> Understood. So what is the "commit message" that Marek meant that I missed?
>
>This:
>Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>10/100/1000 Ethernet Controllers.
>
>>
>>>
>>>> Should I always manually edit the patch before sending email in the patman?
>>>
>>>No, you shouldn't have to. The reason this failed to be removed is
>>>that you capitalized the 'C' in changes, and it didn't see it.
>>
>> I see...
>>
>>>
>>>Also, these tags are parsed and included as notes. You don't want to
>>>put these in a commit notes tag. That's only needed for other random commit
>notes.
>>>
>> What are "threse"?
>
>The tags I was referring to the Series-*: tags. It seemed like you were putting
>those tags into the Commit-notes: since that's there they should ultimately end
>up, but I'm saying that it happens for you.
>There should not be any nested tags.

Series-*: tags were placed after Commit-notes: and END, so I did not think it 
was nested.
In any case, I can delete the Commit-notes: and just add the non-tagged commit 
message.
And I fixed the C to c and they look much better.
Thank you so much.

>
>>>> Also, when I am ready to update this patch again, should I do a
>>>> series or just this
>>>patch?
>>>
>>>Do the series. Also, you should have the dependency patch first, and
>>>the dependent patch second (swap them around).
>>>
>>>> How can I update the [PATCH v] number? If just his patch, then will
>>>> it be [PATCH
>>>v4]?
>>>
>>>Go ahead and use v4. So use:
>>>
>>>Series-version: 4
>>>
>>
>> Got it.
>>
>>>>>
>>>>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>>>>- The lan7x_eth_recv() is modifed to correctly support the Driver 
>>>>>> Model
>>>>>>  and returns packet_en.
>>>>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>>>>
>>>>>> Series-Changes: 2
>>>>>>- The wait_for_bit functions copy the real one.
>>>>>>- Uses phylib
>>>>>>- Unnecessary variables are removed
>>>>>>- All return values are checked
>>>>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>>>>
>>>>>> Signed-off-by: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>>>> ---
>>>>>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>>>>>> 10/100/1000 Ethernet Con

Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Joe Hershberger
On Thu, Aug 10, 2017 at 2:32 PM,  <yuiko.osh...@microchip.com> wrote:
>>-Original Message-
>>From: Joe Hershberger [mailto:joe.hershber...@ni.com]
>>Sent: Thursday, August 10, 2017 2:45 PM
>>To: Yuiko Oshino - C18177
>>Cc: Marek Vasut; u-boot; Joe Hershberger
>>Subject: Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip
>>LAN75xx and LAN78xx
>>
>>On Thu, Aug 10, 2017 at 1:13 PM,  <yuiko.osh...@microchip.com> wrote:
>>> Hi Marek,
>>>
>>>>-Original Message-
>>>>From: Marek Vasut [mailto:ma...@denx.de]
>>>>Sent: Wednesday, August 9, 2017 1:12 PM
>>>>To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>>>>Cc: Joe Hershberger
>>>>Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip
>>>>LAN75xx and LAN78xx
>>>>
>>>>On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>>>> From: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>>>
>>>>> Series-Changes: 3
>>>>
>>>>FYI, this will end in the commit message when applied, remove it or
>>>>move it below the --- . Also commit message is missing.
>>>
>>> I did my best to follow the patman instructions and I added "commit-notes:" 
>>> tag,
>>but I guess it wasn't good enough.
>>
>>You need to not use commit notes here. That's for things that you want to be a
>>note in the email, but not end up in the commit log.
>
> Understood. So what is the "commit message" that Marek meant that I missed?

This:
Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
10/100/1000 Ethernet Controllers.

>
>>
>>> Should I always manually edit the patch before sending email in the patman?
>>
>>No, you shouldn't have to. The reason this failed to be removed is that you
>>capitalized the 'C' in changes, and it didn't see it.
>
> I see...
>
>>
>>Also, these tags are parsed and included as notes. You don't want to put 
>>these in
>>a commit notes tag. That's only needed for other random commit notes.
>>
> What are "threse"?

The tags I was referring to the Series-*: tags. It seemed like you
were putting those tags into the Commit-notes: since that's there they
should ultimately end up, but I'm saying that it happens for you.
There should not be any nested tags.

>>> Also, when I am ready to update this patch again, should I do a series or 
>>> just this
>>patch?
>>
>>Do the series. Also, you should have the dependency patch first, and the
>>dependent patch second (swap them around).
>>
>>> How can I update the [PATCH v] number? If just his patch, then will it be 
>>> [PATCH
>>v4]?
>>
>>Go ahead and use v4. So use:
>>
>>Series-version: 4
>>
>
> Got it.
>
>>>>
>>>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>>>>  and returns packet_en.
>>>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>>>
>>>>> Series-Changes: 2
>>>>>- The wait_for_bit functions copy the real one.
>>>>>- Uses phylib
>>>>>- Unnecessary variables are removed
>>>>>- All return values are checked
>>>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>>>
>>>>> Signed-off-by: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>>> ---
>>>>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>>>>> 10/100/1000 Ethernet Controllers.
>>
>>The fact that this is in the notes means that you put it under 
>>"Commit-notes:" ...
>>"END"
>>
> Yes, I did. Is the Commit-notes: == Commit message?

That's not correct. Commit-notes: is for the random other notes that
you want not to be in git.

Just like not using patman, the standard un-tagged text is the Commit message.

> Do I still need this tag?

No, unless you have something to say in the notes beyond the change comments.

> Following tags are all I need?
> Series-to: u-boot
> Series-version: 4
> Series-changes: 4
> Series-changes: 3
> Series-changes: 2
> Series-changes: 1

Presumably there is no change for the initial version.

> Signed-off-by: Yuiko Oshino <yuiko.osh...@microchip.com>
>
> Should I add Acked-by:?

Yes, you should add any Acked-by that you got on a previous version to
the commit so it is already included in all following versions.

>>>>>
>>>>>
>>>>>  drivers/usb/Kconfig   |   2 +
>>>>>  drivers/usb/eth/Kconfig   |  17 ++
>>>>>  drivers/usb/eth/Makefile  |   2 +
>>>>>  drivers/usb/eth/lan75xx.c | 318 +
>>>>> drivers/usb/eth/lan78xx.c | 477
>>>>
>>>>>  drivers/usb/eth/lan7x.c   | 495
>>>>++
>>>>>  drivers/usb/eth/lan7x.h   | 230 +
>>>>>  7 files changed, 1541 insertions(+)
>>
>>-Joe
>
> Thank you, Joe.
> Yuiko
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Yuiko.Oshino
>-Original Message-
>From: Joe Hershberger [mailto:joe.hershber...@ni.com]
>Sent: Thursday, August 10, 2017 2:45 PM
>To: Yuiko Oshino - C18177
>Cc: Marek Vasut; u-boot; Joe Hershberger
>Subject: Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip
>LAN75xx and LAN78xx
>
>On Thu, Aug 10, 2017 at 1:13 PM,  <yuiko.osh...@microchip.com> wrote:
>> Hi Marek,
>>
>>>-Original Message-
>>>From: Marek Vasut [mailto:ma...@denx.de]
>>>Sent: Wednesday, August 9, 2017 1:12 PM
>>>To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>>>Cc: Joe Hershberger
>>>Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip
>>>LAN75xx and LAN78xx
>>>
>>>On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>>> From: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>>
>>>> Series-Changes: 3
>>>
>>>FYI, this will end in the commit message when applied, remove it or
>>>move it below the --- . Also commit message is missing.
>>
>> I did my best to follow the patman instructions and I added "commit-notes:" 
>> tag,
>but I guess it wasn't good enough.
>
>You need to not use commit notes here. That's for things that you want to be a
>note in the email, but not end up in the commit log.

Understood. So what is the "commit message" that Marek meant that I missed?

>
>> Should I always manually edit the patch before sending email in the patman?
>
>No, you shouldn't have to. The reason this failed to be removed is that you
>capitalized the 'C' in changes, and it didn't see it.

I see...

>
>Also, these tags are parsed and included as notes. You don't want to put these 
>in
>a commit notes tag. That's only needed for other random commit notes.
>
What are "threse"?

>> Also, when I am ready to update this patch again, should I do a series or 
>> just this
>patch?
>
>Do the series. Also, you should have the dependency patch first, and the
>dependent patch second (swap them around).
>
>> How can I update the [PATCH v] number? If just his patch, then will it be 
>> [PATCH
>v4]?
>
>Go ahead and use v4. So use:
>
>Series-version: 4
>

Got it.

>>>
>>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>>>  and returns packet_en.
>>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>>
>>>> Series-Changes: 2
>>>>- The wait_for_bit functions copy the real one.
>>>>- Uses phylib
>>>>- Unnecessary variables are removed
>>>>- All return values are checked
>>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>>
>>>> Signed-off-by: Yuiko Oshino <yuiko.osh...@microchip.com>
>>>> ---
>>>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>>>> 10/100/1000 Ethernet Controllers.
>
>The fact that this is in the notes means that you put it under "Commit-notes:" 
>...
>"END"
>
Yes, I did. Is the Commit-notes: == Commit message?
Do I still need this tag?

Following tags are all I need?
Series-to: u-boot
Series-version: 4
Series-changes: 4
Series-changes: 3
Series-changes: 2
Series-changes: 1
Signed-off-by: Yuiko Oshino <yuiko.osh...@microchip.com>

Should I add Acked-by:?

>>>>
>>>>
>>>>  drivers/usb/Kconfig   |   2 +
>>>>  drivers/usb/eth/Kconfig   |  17 ++
>>>>  drivers/usb/eth/Makefile  |   2 +
>>>>  drivers/usb/eth/lan75xx.c | 318 +
>>>> drivers/usb/eth/lan78xx.c | 477
>>>
>>>>  drivers/usb/eth/lan7x.c   | 495
>>>++
>>>>  drivers/usb/eth/lan7x.h   | 230 +
>>>>  7 files changed, 1541 insertions(+)
>
>-Joe

Thank you, Joe.
Yuiko
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Joe Hershberger
On Thu, Aug 10, 2017 at 1:13 PM,   wrote:
> Hi Marek,
>
>>-Original Message-
>>From: Marek Vasut [mailto:ma...@denx.de]
>>Sent: Wednesday, August 9, 2017 1:12 PM
>>To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>>Cc: Joe Hershberger
>>Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and
>>LAN78xx
>>
>>On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>> From: Yuiko Oshino 
>>>
>>> Series-Changes: 3
>>
>>FYI, this will end in the commit message when applied, remove it or move it
>>below the --- . Also commit message is missing.
>
> I did my best to follow the patman instructions and I added "commit-notes:" 
> tag, but I guess it wasn't good enough.

You need to not use commit notes here. That's for things that you want
to be a note in the email, but not end up in the commit log.

> Should I always manually edit the patch before sending email in the patman?

No, you shouldn't have to. The reason this failed to be removed is
that you capitalized the 'C' in changes, and it didn't see it.

Also, these tags are parsed and included as notes. You don't want to
put these in a commit notes tag. That's only needed for other random
commit notes.

> Also, when I am ready to update this patch again, should I do a series or 
> just this patch?

Do the series. Also, you should have the dependency patch first, and
the dependent patch second (swap them around).

> How can I update the [PATCH v] number? If just his patch, then will it be 
> [PATCH v4]?

Go ahead and use v4. So use:

Series-version: 4

>>
>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>>  and returns packet_en.
>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>
>>> Series-Changes: 2
>>>- The wait_for_bit functions copy the real one.
>>>- Uses phylib
>>>- Unnecessary variables are removed
>>>- All return values are checked
>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>
>>> Signed-off-by: Yuiko Oshino 
>>> ---
>>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>>> 10/100/1000 Ethernet Controllers.

The fact that this is in the notes means that you put it under
"Commit-notes:" ... "END"

>>>
>>>
>>>  drivers/usb/Kconfig   |   2 +
>>>  drivers/usb/eth/Kconfig   |  17 ++
>>>  drivers/usb/eth/Makefile  |   2 +
>>>  drivers/usb/eth/lan75xx.c | 318 +
>>> drivers/usb/eth/lan78xx.c | 477
>>
>>>  drivers/usb/eth/lan7x.c   | 495
>>++
>>>  drivers/usb/eth/lan7x.h   | 230 +
>>>  7 files changed, 1541 insertions(+)

-Joe
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Marek Vasut
On 08/10/2017 08:13 PM, yuiko.osh...@microchip.com wrote:
> Hi Marek,

Hi,

>> -Original Message-
>> From: Marek Vasut [mailto:ma...@denx.de]
>> Sent: Wednesday, August 9, 2017 1:12 PM
>> To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>> Cc: Joe Hershberger
>> Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and
>> LAN78xx
>>
>> On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>> From: Yuiko Oshino 
>>>
>>> Series-Changes: 3
>>
>> FYI, this will end in the commit message when applied, remove it or move it
>> below the --- . Also commit message is missing.
> 
> I did my best to follow the patman instructions and I added "commit-notes:" 
> tag, but I guess it wasn't good enough.
> Should I always manually edit the patch before sending email in the patman?
> Also, when I am ready to update this patch again, should I do a series or 
> just this patch?
> How can I update the [PATCH v] number? If just his patch, then will it be 
> [PATCH v4]?

TBH, I dunno, I don't use patman :)

>>
>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>>  and returns packet_en.
>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>
>>> Series-Changes: 2
>>>- The wait_for_bit functions copy the real one.
>>>- Uses phylib
>>>- Unnecessary variables are removed
>>>- All return values are checked
>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>
>>> Signed-off-by: Yuiko Oshino 
>>> ---
>>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>>> 10/100/1000 Ethernet Controllers.
>>>
>>>
>>>  drivers/usb/Kconfig   |   2 +
>>>  drivers/usb/eth/Kconfig   |  17 ++
>>>  drivers/usb/eth/Makefile  |   2 +
>>>  drivers/usb/eth/lan75xx.c | 318 +
>>> drivers/usb/eth/lan78xx.c | 477
>> 
>>>  drivers/usb/eth/lan7x.c   | 495
>> ++
>>>  drivers/usb/eth/lan7x.h   | 230 +
>>>  7 files changed, 1541 insertions(+)
>>>  create mode 100644 drivers/usb/eth/Kconfig  create mode 100644
>>> drivers/usb/eth/lan75xx.c  create mode 100644
>>> drivers/usb/eth/lan78xx.c  create mode 100644 drivers/usb/eth/lan7x.c
>>> create mode 100644 drivers/usb/eth/lan7x.h
>>>
>>> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index
>>> da3ec2f..62126aa 100644
>>> --- a/drivers/usb/Kconfig
>>> +++ b/drivers/usb/Kconfig
>>> @@ -94,4 +94,6 @@ endif
>>>
>>>  source "drivers/usb/gadget/Kconfig"
>>>
>>> +source "drivers/usb/eth/Kconfig"
>>> +
>>>  endif
>>> diff --git a/drivers/usb/eth/Kconfig b/drivers/usb/eth/Kconfig new
>>> file mode 100644 index 000..14cfa26
>>> --- /dev/null
>>> +++ b/drivers/usb/eth/Kconfig
>>> @@ -0,0 +1,17 @@
>>> +comment "USB to Ethernet Controller Drivers"
>>> +
>>> +config USB_ETHER_LAN75XX
>>> +   bool "Microchip LAN75XX support"
>>> +   ---help---
>>> + Say Y here if you would like to support Microchip LAN75XX Hi-Speed
>>> + USB 2.0 to 10/100/1000 Gigabit Ethernet controller.
>>> + Supports 10Base-T/ 100Base-TX/1000Base-T.
>>> + This driver supports the internal PHY.
>>> +
>>> +config USB_ETHER_LAN78XX
>>> +   bool "Microchip LAN78XX support"
>>> +   ---help---
>>> + Say Y here if you would like to support Microchip LAN78XX USB 3.1
>>> + Gen 1 to 10/100/1000 Gigabit Ethernet controller.
>>> + Supports 10Base-T/ 100Base-TX/1000Base-T.
>>> + This driver supports the internal PHY.
>>> diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile index
>>> 4c44efc..4b935a3 100644
>>> --- a/drivers/usb/eth/Makefile
>>> +++ b/drivers/usb/eth/Makefile
>>> @@ -9,4 +9,6 @@ obj-$(CONFIG_USB_ETHER_ASIX) += asix.o
>>>  obj-$(CONFIG_USB_ETHER_ASIX88179) += asix88179.o
>>>  obj-$(CONFIG_USB_ETHER_MCS7830) += mcs7830.o
>>>  obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
>>> +obj-$(CONFIG_USB_ETHER_LAN75XX) += lan7x.o lan75xx.o
>>> +obj-$(CONFIG_USB_ETHER_LAN78XX) += lan7x.o lan78xx.o
>>>  obj-$(CONFIG_USB_ETHER_RTL8152) += r8152.o r8152_fw.o diff --git
>>> a/drivers/usb/eth/lan75xx.c b/drivers/usb/eth/lan75xx.c new file mode
>>> 100644 index 000..a3c1411
>>> --- /dev/null
>>> +++ b/drivers/usb/eth/lan75xx.c
>>> @@ -0,0 +1,318 @@
>>> +/*
>>> + * Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
>>> + *
>>> + * SPDX-License-Identifier:GPL-2.0+
>>> + */
>>> +
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include "usb_ether.h"
>>> +#include "lan7x.h"
>>> +
>>> +/* LAN75xx specific register/bit defines */
>>> +#define LAN75XX_HW_CFG_BIR BIT(7)
>>> +
>>> +#define LAN75XX_BURST_CAP  0x034
>>> +
>>> +#define LAN75XX_BULK_IN_DLY0x03C
>>> +
>>> +#define LAN75XX_RFE_CTL0x060
>>> +
>>> +#define LAN75XX_FCT_RX_CTL 0x090
>>> +
>>> +#define LAN75XX_FCT_TX_CTL 0x094

Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Yuiko.Oshino
Hi Marek,

>-Original Message-
>From: Marek Vasut [mailto:ma...@denx.de]
>Sent: Wednesday, August 9, 2017 1:12 PM
>To: Yuiko Oshino - C18177; u-boot@lists.denx.de
>Cc: Joe Hershberger
>Subject: Re: [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and
>LAN78xx
>
>On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>> From: Yuiko Oshino 
>>
>> Series-Changes: 3
>
>FYI, this will end in the commit message when applied, remove it or move it
>below the --- . Also commit message is missing.

I did my best to follow the patman instructions and I added "commit-notes:" 
tag, but I guess it wasn't good enough.
Should I always manually edit the patch before sending email in the patman?
Also, when I am ready to update this patch again, should I do a series or just 
this patch?
How can I update the [PATCH v] number? If just his patch, then will it be 
[PATCH v4]?

>
>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>  and returns packet_en.
>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>
>> Series-Changes: 2
>>- The wait_for_bit functions copy the real one.
>>- Uses phylib
>>- Unnecessary variables are removed
>>- All return values are checked
>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>
>> Signed-off-by: Yuiko Oshino 
>> ---
>> Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to
>> 10/100/1000 Ethernet Controllers.
>>
>>
>>  drivers/usb/Kconfig   |   2 +
>>  drivers/usb/eth/Kconfig   |  17 ++
>>  drivers/usb/eth/Makefile  |   2 +
>>  drivers/usb/eth/lan75xx.c | 318 +
>> drivers/usb/eth/lan78xx.c | 477
>
>>  drivers/usb/eth/lan7x.c   | 495
>++
>>  drivers/usb/eth/lan7x.h   | 230 +
>>  7 files changed, 1541 insertions(+)
>>  create mode 100644 drivers/usb/eth/Kconfig  create mode 100644
>> drivers/usb/eth/lan75xx.c  create mode 100644
>> drivers/usb/eth/lan78xx.c  create mode 100644 drivers/usb/eth/lan7x.c
>> create mode 100644 drivers/usb/eth/lan7x.h
>>
>> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index
>> da3ec2f..62126aa 100644
>> --- a/drivers/usb/Kconfig
>> +++ b/drivers/usb/Kconfig
>> @@ -94,4 +94,6 @@ endif
>>
>>  source "drivers/usb/gadget/Kconfig"
>>
>> +source "drivers/usb/eth/Kconfig"
>> +
>>  endif
>> diff --git a/drivers/usb/eth/Kconfig b/drivers/usb/eth/Kconfig new
>> file mode 100644 index 000..14cfa26
>> --- /dev/null
>> +++ b/drivers/usb/eth/Kconfig
>> @@ -0,0 +1,17 @@
>> +comment "USB to Ethernet Controller Drivers"
>> +
>> +config USB_ETHER_LAN75XX
>> +bool "Microchip LAN75XX support"
>> +---help---
>> +  Say Y here if you would like to support Microchip LAN75XX Hi-Speed
>> +  USB 2.0 to 10/100/1000 Gigabit Ethernet controller.
>> +  Supports 10Base-T/ 100Base-TX/1000Base-T.
>> +  This driver supports the internal PHY.
>> +
>> +config USB_ETHER_LAN78XX
>> +bool "Microchip LAN78XX support"
>> +---help---
>> +  Say Y here if you would like to support Microchip LAN78XX USB 3.1
>> +  Gen 1 to 10/100/1000 Gigabit Ethernet controller.
>> +  Supports 10Base-T/ 100Base-TX/1000Base-T.
>> +  This driver supports the internal PHY.
>> diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile index
>> 4c44efc..4b935a3 100644
>> --- a/drivers/usb/eth/Makefile
>> +++ b/drivers/usb/eth/Makefile
>> @@ -9,4 +9,6 @@ obj-$(CONFIG_USB_ETHER_ASIX) += asix.o
>>  obj-$(CONFIG_USB_ETHER_ASIX88179) += asix88179.o
>>  obj-$(CONFIG_USB_ETHER_MCS7830) += mcs7830.o
>>  obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
>> +obj-$(CONFIG_USB_ETHER_LAN75XX) += lan7x.o lan75xx.o
>> +obj-$(CONFIG_USB_ETHER_LAN78XX) += lan7x.o lan78xx.o
>>  obj-$(CONFIG_USB_ETHER_RTL8152) += r8152.o r8152_fw.o diff --git
>> a/drivers/usb/eth/lan75xx.c b/drivers/usb/eth/lan75xx.c new file mode
>> 100644 index 000..a3c1411
>> --- /dev/null
>> +++ b/drivers/usb/eth/lan75xx.c
>> @@ -0,0 +1,318 @@
>> +/*
>> + * Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
>> + *
>> + * SPDX-License-Identifier: GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include "usb_ether.h"
>> +#include "lan7x.h"
>> +
>> +/* LAN75xx specific register/bit defines */
>> +#define LAN75XX_HW_CFG_BIR  BIT(7)
>> +
>> +#define LAN75XX_BURST_CAP   0x034
>> +
>> +#define LAN75XX_BULK_IN_DLY 0x03C
>> +
>> +#define LAN75XX_RFE_CTL 0x060
>> +
>> +#define LAN75XX_FCT_RX_CTL  0x090
>> +
>> +#define LAN75XX_FCT_TX_CTL  0x094
>> +
>> +#define LAN75XX_FCT_RX_FIFO_END 0x098
>> +
>> +#define LAN75XX_FCT_TX_FIFO_END 0x09C
>> +
>> +#define LAN75XX_FCT_FLOW0x0A0
>> +
>> +/* MAC ADDRESS PERFECT FILTER For LAN75xx */
>> +#define 

Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Joe Hershberger
On Thu, Aug 10, 2017 at 2:15 AM, Marek Vasut  wrote:
> On 08/09/2017 07:47 PM, Joe Hershberger wrote:
>> On Wed, Aug 9, 2017 at 12:12 PM, Marek Vasut  wrote:
>>> On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
 From: Yuiko Oshino 

 Series-Changes: 3
>>>
>>> FYI, this will end in the commit message when applied, remove it or move
>>> it below the --- . Also commit message is missing.
>>
>> This is what I was talking about when I said I would fix the commit
>> log as I apply it.
>
> I have a few more comments though, but feel free to fix them up too.

I'll let you guys work through the rest of your comments and apply
them when you're done.

Cheers,
-Joe
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-10 Thread Marek Vasut
On 08/09/2017 07:47 PM, Joe Hershberger wrote:
> On Wed, Aug 9, 2017 at 12:12 PM, Marek Vasut  wrote:
>> On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>>> From: Yuiko Oshino 
>>>
>>> Series-Changes: 3
>>
>> FYI, this will end in the commit message when applied, remove it or move
>> it below the --- . Also commit message is missing.
> 
> This is what I was talking about when I said I would fix the commit
> log as I apply it.

I have a few more comments though, but feel free to fix them up too.

>>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>>  and returns packet_en.
>>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>>
>>> Series-Changes: 2
>>>- The wait_for_bit functions copy the real one.
>>>- Uses phylib
>>>- Unnecessary variables are removed
>>>- All return values are checked
>>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>>
>>> Signed-off-by: Yuiko Oshino 
>>> ---
>>> Add support for Microchip LAN7500, LAN7800 and LAN7850,
>>> USB to 10/100/1000 Ethernet Controllers.
>>>


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-09 Thread Joe Hershberger
On Wed, Aug 9, 2017 at 12:12 PM, Marek Vasut  wrote:
> On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
>> From: Yuiko Oshino 
>>
>> Series-Changes: 3
>
> FYI, this will end in the commit message when applied, remove it or move
> it below the --- . Also commit message is missing.

This is what I was talking about when I said I would fix the commit
log as I apply it.

>>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>>  and returns packet_en.
>>- Add mii_resolve_flowctrl_fdx() patch in the series.
>>
>> Series-Changes: 2
>>- The wait_for_bit functions copy the real one.
>>- Uses phylib
>>- Unnecessary variables are removed
>>- All return values are checked
>>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>>
>> Signed-off-by: Yuiko Oshino 
>> ---
>> Add support for Microchip LAN7500, LAN7800 and LAN7850,
>> USB to 10/100/1000 Ethernet Controllers.
>>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-09 Thread Marek Vasut
On 08/09/2017 06:25 PM, yuiko.osh...@microchip.com wrote:
> From: Yuiko Oshino 
> 
> Series-Changes: 3

FYI, this will end in the commit message when applied, remove it or move
it below the --- . Also commit message is missing.

>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>  and returns packet_en.
>- Add mii_resolve_flowctrl_fdx() patch in the series.
> 
> Series-Changes: 2
>- The wait_for_bit functions copy the real one.
>- Uses phylib
>- Unnecessary variables are removed
>- All return values are checked
>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
> 
> Signed-off-by: Yuiko Oshino 
> ---
> Add support for Microchip LAN7500, LAN7800 and LAN7850,
> USB to 10/100/1000 Ethernet Controllers.
> 
> 
>  drivers/usb/Kconfig   |   2 +
>  drivers/usb/eth/Kconfig   |  17 ++
>  drivers/usb/eth/Makefile  |   2 +
>  drivers/usb/eth/lan75xx.c | 318 +
>  drivers/usb/eth/lan78xx.c | 477 
>  drivers/usb/eth/lan7x.c   | 495 
> ++
>  drivers/usb/eth/lan7x.h   | 230 +
>  7 files changed, 1541 insertions(+)
>  create mode 100644 drivers/usb/eth/Kconfig
>  create mode 100644 drivers/usb/eth/lan75xx.c
>  create mode 100644 drivers/usb/eth/lan78xx.c
>  create mode 100644 drivers/usb/eth/lan7x.c
>  create mode 100644 drivers/usb/eth/lan7x.h
> 
> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> index da3ec2f..62126aa 100644
> --- a/drivers/usb/Kconfig
> +++ b/drivers/usb/Kconfig
> @@ -94,4 +94,6 @@ endif
>  
>  source "drivers/usb/gadget/Kconfig"
>  
> +source "drivers/usb/eth/Kconfig"
> +
>  endif
> diff --git a/drivers/usb/eth/Kconfig b/drivers/usb/eth/Kconfig
> new file mode 100644
> index 000..14cfa26
> --- /dev/null
> +++ b/drivers/usb/eth/Kconfig
> @@ -0,0 +1,17 @@
> +comment "USB to Ethernet Controller Drivers"
> +
> +config USB_ETHER_LAN75XX
> + bool "Microchip LAN75XX support"
> + ---help---
> +   Say Y here if you would like to support Microchip LAN75XX Hi-Speed
> +   USB 2.0 to 10/100/1000 Gigabit Ethernet controller.
> +   Supports 10Base-T/ 100Base-TX/1000Base-T.
> +   This driver supports the internal PHY.
> +
> +config USB_ETHER_LAN78XX
> + bool "Microchip LAN78XX support"
> + ---help---
> +   Say Y here if you would like to support Microchip LAN78XX USB 3.1
> +   Gen 1 to 10/100/1000 Gigabit Ethernet controller.
> +   Supports 10Base-T/ 100Base-TX/1000Base-T.
> +   This driver supports the internal PHY.
> diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile
> index 4c44efc..4b935a3 100644
> --- a/drivers/usb/eth/Makefile
> +++ b/drivers/usb/eth/Makefile
> @@ -9,4 +9,6 @@ obj-$(CONFIG_USB_ETHER_ASIX) += asix.o
>  obj-$(CONFIG_USB_ETHER_ASIX88179) += asix88179.o
>  obj-$(CONFIG_USB_ETHER_MCS7830) += mcs7830.o
>  obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
> +obj-$(CONFIG_USB_ETHER_LAN75XX) += lan7x.o lan75xx.o
> +obj-$(CONFIG_USB_ETHER_LAN78XX) += lan7x.o lan78xx.o
>  obj-$(CONFIG_USB_ETHER_RTL8152) += r8152.o r8152_fw.o
> diff --git a/drivers/usb/eth/lan75xx.c b/drivers/usb/eth/lan75xx.c
> new file mode 100644
> index 000..a3c1411
> --- /dev/null
> +++ b/drivers/usb/eth/lan75xx.c
> @@ -0,0 +1,318 @@
> +/*
> + * Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include "usb_ether.h"
> +#include "lan7x.h"
> +
> +/* LAN75xx specific register/bit defines */
> +#define LAN75XX_HW_CFG_BIR   BIT(7)
> +
> +#define LAN75XX_BURST_CAP0x034
> +
> +#define LAN75XX_BULK_IN_DLY  0x03C
> +
> +#define LAN75XX_RFE_CTL  0x060
> +
> +#define LAN75XX_FCT_RX_CTL   0x090
> +
> +#define LAN75XX_FCT_TX_CTL   0x094
> +
> +#define LAN75XX_FCT_RX_FIFO_END  0x098
> +
> +#define LAN75XX_FCT_TX_FIFO_END  0x09C
> +
> +#define LAN75XX_FCT_FLOW 0x0A0
> +
> +/* MAC ADDRESS PERFECT FILTER For LAN75xx */
> +#define LAN75XX_ADDR_FILTX   0x300
> +#define LAN75XX_ADDR_FILTX_FB_VALID  BIT(31)
> +
> +/*
> + * Lan75xx infrastructure commands
> + */
> +static int lan75xx_phy_gig_workaround(struct usb_device *udev,
> +   struct ueth_data *dev)
> +{
> + int ret = 0;
> +
> + /* Only internal phy */
> + /* Set the phy in Gig loopback */
> + lan7x_mdio_write(udev, dev->phy_id, MII_BMCR,
> +  (BMCR_LOOPBACK | BMCR_SPEED1000));
> +
> + /* Wait for the link up */
> + ret = lan7x_mdio_wait_for_bit(udev, "BMSR_LSTATUS",
> +   dev->phy_id, MII_BMSR, BMSR_LSTATUS,
> +   true, PHY_CONNECT_TIMEOUT_MS, 1);
> + if (ret)
> 

Re: [U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-09 Thread Joe Hershberger
On Wed, Aug 9, 2017 at 11:25 AM,   wrote:
> From: Yuiko Oshino 
>
> Series-Changes: 3
>- All #ifdef CONFIG_DM_ETH and #endif are removed.
>- The lan7x_eth_recv() is modifed to correctly support the Driver Model
>  and returns packet_en.
>- Add mii_resolve_flowctrl_fdx() patch in the series.
>
> Series-Changes: 2
>- The wait_for_bit functions copy the real one.
>- Uses phylib
>- Unnecessary variables are removed
>- All return values are checked
>- Uses mii_resolve_flowctrl_fdx() from linux/mii.h
>
> Signed-off-by: Yuiko Oshino 
> ---
> Add support for Microchip LAN7500, LAN7800 and LAN7850,
> USB to 10/100/1000 Ethernet Controllers.

I'll fix up this commit log as I pull it.

Acked-by: Joe Hershberger 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/2] usb: net: Add support for Microchip LAN75xx and LAN78xx

2017-08-09 Thread yuiko.oshino
From: Yuiko Oshino 

Series-Changes: 3
   - All #ifdef CONFIG_DM_ETH and #endif are removed.
   - The lan7x_eth_recv() is modifed to correctly support the Driver Model
 and returns packet_en.
   - Add mii_resolve_flowctrl_fdx() patch in the series.

Series-Changes: 2
   - The wait_for_bit functions copy the real one.
   - Uses phylib
   - Unnecessary variables are removed
   - All return values are checked
   - Uses mii_resolve_flowctrl_fdx() from linux/mii.h

Signed-off-by: Yuiko Oshino 
---
Add support for Microchip LAN7500, LAN7800 and LAN7850,
USB to 10/100/1000 Ethernet Controllers.


 drivers/usb/Kconfig   |   2 +
 drivers/usb/eth/Kconfig   |  17 ++
 drivers/usb/eth/Makefile  |   2 +
 drivers/usb/eth/lan75xx.c | 318 +
 drivers/usb/eth/lan78xx.c | 477 
 drivers/usb/eth/lan7x.c   | 495 ++
 drivers/usb/eth/lan7x.h   | 230 +
 7 files changed, 1541 insertions(+)
 create mode 100644 drivers/usb/eth/Kconfig
 create mode 100644 drivers/usb/eth/lan75xx.c
 create mode 100644 drivers/usb/eth/lan78xx.c
 create mode 100644 drivers/usb/eth/lan7x.c
 create mode 100644 drivers/usb/eth/lan7x.h

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index da3ec2f..62126aa 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -94,4 +94,6 @@ endif
 
 source "drivers/usb/gadget/Kconfig"
 
+source "drivers/usb/eth/Kconfig"
+
 endif
diff --git a/drivers/usb/eth/Kconfig b/drivers/usb/eth/Kconfig
new file mode 100644
index 000..14cfa26
--- /dev/null
+++ b/drivers/usb/eth/Kconfig
@@ -0,0 +1,17 @@
+comment "USB to Ethernet Controller Drivers"
+
+config USB_ETHER_LAN75XX
+   bool "Microchip LAN75XX support"
+   ---help---
+ Say Y here if you would like to support Microchip LAN75XX Hi-Speed
+ USB 2.0 to 10/100/1000 Gigabit Ethernet controller.
+ Supports 10Base-T/ 100Base-TX/1000Base-T.
+ This driver supports the internal PHY.
+
+config USB_ETHER_LAN78XX
+   bool "Microchip LAN78XX support"
+   ---help---
+ Say Y here if you would like to support Microchip LAN78XX USB 3.1
+ Gen 1 to 10/100/1000 Gigabit Ethernet controller.
+ Supports 10Base-T/ 100Base-TX/1000Base-T.
+ This driver supports the internal PHY.
diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile
index 4c44efc..4b935a3 100644
--- a/drivers/usb/eth/Makefile
+++ b/drivers/usb/eth/Makefile
@@ -9,4 +9,6 @@ obj-$(CONFIG_USB_ETHER_ASIX) += asix.o
 obj-$(CONFIG_USB_ETHER_ASIX88179) += asix88179.o
 obj-$(CONFIG_USB_ETHER_MCS7830) += mcs7830.o
 obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
+obj-$(CONFIG_USB_ETHER_LAN75XX) += lan7x.o lan75xx.o
+obj-$(CONFIG_USB_ETHER_LAN78XX) += lan7x.o lan78xx.o
 obj-$(CONFIG_USB_ETHER_RTL8152) += r8152.o r8152_fw.o
diff --git a/drivers/usb/eth/lan75xx.c b/drivers/usb/eth/lan75xx.c
new file mode 100644
index 000..a3c1411
--- /dev/null
+++ b/drivers/usb/eth/lan75xx.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include "usb_ether.h"
+#include "lan7x.h"
+
+/* LAN75xx specific register/bit defines */
+#define LAN75XX_HW_CFG_BIR BIT(7)
+
+#define LAN75XX_BURST_CAP  0x034
+
+#define LAN75XX_BULK_IN_DLY0x03C
+
+#define LAN75XX_RFE_CTL0x060
+
+#define LAN75XX_FCT_RX_CTL 0x090
+
+#define LAN75XX_FCT_TX_CTL 0x094
+
+#define LAN75XX_FCT_RX_FIFO_END0x098
+
+#define LAN75XX_FCT_TX_FIFO_END0x09C
+
+#define LAN75XX_FCT_FLOW   0x0A0
+
+/* MAC ADDRESS PERFECT FILTER For LAN75xx */
+#define LAN75XX_ADDR_FILTX 0x300
+#define LAN75XX_ADDR_FILTX_FB_VALIDBIT(31)
+
+/*
+ * Lan75xx infrastructure commands
+ */
+static int lan75xx_phy_gig_workaround(struct usb_device *udev,
+ struct ueth_data *dev)
+{
+   int ret = 0;
+
+   /* Only internal phy */
+   /* Set the phy in Gig loopback */
+   lan7x_mdio_write(udev, dev->phy_id, MII_BMCR,
+(BMCR_LOOPBACK | BMCR_SPEED1000));
+
+   /* Wait for the link up */
+   ret = lan7x_mdio_wait_for_bit(udev, "BMSR_LSTATUS",
+ dev->phy_id, MII_BMSR, BMSR_LSTATUS,
+ true, PHY_CONNECT_TIMEOUT_MS, 1);
+   if (ret)
+   return ret;
+
+   /* phy reset */
+   return lan7x_pmt_phy_reset(udev, dev);
+}
+
+static int lan75xx_update_flowcontrol(struct usb_device *udev,
+ struct ueth_data *dev)
+{
+   uint32_t flow = 0, fct_flow = 0;
+   int ret;
+
+   ret = lan7x_update_flowcontrol(udev, dev, , _flow);
+   if (ret)
+   return