[PATCH u-boot 0/2] eth/r8152: fix issues

2020-12-16 Thread Hayes Wang
The two patch are used to fix known issues. Hayes Wang (2): eth/r8152: free previous memory if r8152_eth_probe fail eth/r8152: fix the aggregation issue drivers/usb/eth/r8152.c | 26 ++ drivers/usb/eth/r8152.h | 5 + 2 files changed, 27 insertions(+), 4

[PATCH u-boot 2/2] eth/r8152: fix the aggregation issue

2020-12-16 Thread Hayes Wang
Remove the redundant setting for USB_RX_EARLY_SIZE. Besides, for RTL8153B, it is necessary to notify the hardware of the changes of the aggregation settings. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 17 +++-- drivers/usb/eth/r8152.h | 5 + 2 files changed, 20

[PATCH u-boot 1/2] eth/r8152: free previous memory if r8152_eth_probe fail

2020-12-16 Thread Hayes Wang
The r8152_eth_probe() may allocate a memory for ss->dev_priv. It has to be freed if r8152_eth_probe() fails finally. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8

[PATCH u-boot v2 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-16 Thread Hayes Wang
This is used to support RTL8153B and RTL8154B. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c| 207 - drivers/usb/eth/r8152.h| 41 +++- drivers/usb/eth/r8152_fw.c | 170 ++ 3 files changed, 414 insertions(+), 4

[PATCH u-boot v2 1/4] eth/r8152: reset bmu after disabling Tx/Rx

2020-06-16 Thread Hayes Wang
Reset bmu after disabling Tx/Rx. This is used to clear the FIFO of Tx/Rx. The remained data may be transferred after Tx/Rx is re-enabled. And it results in garbage data. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 14 ++ drivers/usb/eth/r8152.h | 7 ++- 2 files

[PATCH u-boot v2 3/4] eth/r8152: modify rtl_clear_bp function

2020-06-16 Thread Hayes Wang
. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.h| 13 ++--- drivers/usb/eth/r8152_fw.c | 58 ++ 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/usb/eth/r8152.h b/drivers/usb/eth/r8152.h index 4daf4ee87d..710637d7a2 100644 --- a

[PATCH u-boot v2 2/4] eth/r8152: reset PHY after setting it

2020-06-16 Thread Hayes Wang
Some settings of PHY have to work after resetting PHY. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c index 041cb22dd3..7f988543a1 100644 --- a/drivers/usb/eth/r8152.c

[PATCH u-boot v2 0/4] r8152: support more chips

2020-06-16 Thread Hayes Wang
. v1: The first two patched are some improvements. And the last two patches are used to support RTL8153B and RTL8154B. Hayes Wang (4): eth/r8152: reset bmu after disabling Tx/Rx eth/r8152: reset PHY after setting it eth/r8152: modify rtl_clear_bp function eth/r8152: support RTL8153B/RTL8154B

RE: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-14 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Friday, June 12, 2020 7:53 PM [...] > Try this: > > ocp_data = r8152_efuse_read(tp, 0x7d); > ocp_data = (ocp_data & 0x1fff0) >> 1) | (ocp_data & 0x7); > if (data != 0x) > ocp_reg_write(tp, OCP_ADC_IOFFSET, data); I thi

RE: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-11 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Friday, June 12, 2020 8:05 AM [...] > > The real data (16-bit) would be inserted a dummy bit, > > and store the 17-bit to efuse offset 0x7d. Therefore, when > > reading the 17-bit data from efuse, we have to remove the > > dummy to get the real data. > >

RE: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Wednesday, June 10, 2020 9:21 PM [...] > > + /* ADC Bias Calibration: > > +* read efuse offset 0x7d to get a 17-bit data. Remove the > >> dummy/fake > > +* bit (bit3) to rebuild the real 16-bit data. Write the data >

RE: [PATCH u-boot 1/4] eth/r8152: reset bmu after disabling Tx/Rx

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Wednesday, June 10, 2020 7:05 PM [...] > >>> +static void rtl_reset_bmu(struct r8152 *tp) > >>> +{ > >>> + u32 ocp_data; > >> > >> You're writing a byte, shouldn't that be u8 ? > > > > The minimum length which is used to read or write > > the register of t

RE: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Wednesday, June 10, 2020 8:54 PM [...] > >>> + /* ADC Bias Calibration: > >>> + * read efuse offset 0x7d to get a 17-bit data. Remove the > dummy/fake > >>> + * bit (bit3) to rebuild the real 16-bit data. Write the data to the > >>> + * ADC ioffset. > >

RE: [PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 09, 2020 10:27 PM [...] > > + /* ADC Bias Calibration: > > +* read efuse offset 0x7d to get a 17-bit data. Remove the dummy/fake > > +* bit (bit3) to rebuild the real 16-bit data. Write the data to the > > +* ADC ioffset. > > +

RE: [PATCH u-boot 2/4] eth/r8152: reset PHY after setting it

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 09, 2020 10:22 PM [...] > > - bmcr = BMCR_ANENABLE | BMCR_ANRESTART; > > + bmcr = BMCR_ANENABLE | BMCR_ANRESTART | BMCR_RESET; > > Do you really need to reset a PHY while resetting the autonegotiation ? > I think if you r

RE: [PATCH u-boot 1/4] eth/r8152: reset bmu after disabling Tx/Rx

2020-06-10 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 09, 2020 10:21 PM [...] > > +static void rtl_reset_bmu(struct r8152 *tp) > > +{ > > + u32 ocp_data; > > You're writing a byte, shouldn't that be u8 ? The minimum length which is used to read or write the register of the device through con

[PATCH u-boot 3/4] eth/r8152: modify rtl_clear_bp function

2020-06-09 Thread Hayes Wang
The original rtl_clear_bp() is used to clear the firmware of both PLA and USB MCU. The new one could clear the firmware of PLA or USB independently. It is unnecessary to clear firmware, if there is no one to be updated. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.h| 20

[PATCH u-boot 4/4] eth/r8152: support RTL8153B/RTL8154B

2020-06-09 Thread Hayes Wang
This is used to support RTL8153B and RTL8154B. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c| 207 - drivers/usb/eth/r8152.h| 46 - drivers/usb/eth/r8152_fw.c | 176 +++ 3 files changed, 425 insertions

[PATCH u-boot 0/4] r8152: support more chips

2020-06-09 Thread Hayes Wang
The first two patched are some improvements. And the last two patches are used to support RTL8153B and RTL8154B. Hayes Wang (4): eth/r8152: reset bmu after disabling Tx/Rx eth/r8152: reset PHY after setting it eth/r8152: modify rtl_clear_bp function eth/r8152: support RTL8153B/RTL8154B

[PATCH u-boot 1/4] eth/r8152: reset bmu after disabling Tx/Rx

2020-06-09 Thread Hayes Wang
Reset bmu after disabling Tx/Rx. This is used to clear the FIFO of Tx/Rx. The remained data may be transferred after Tx/Rx is re-enabled. And it results in garbage data. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 14 ++ drivers/usb/eth/r8152.h | 7 ++- 2 files

[PATCH u-boot 2/4] eth/r8152: reset PHY after setting it

2020-06-09 Thread Hayes Wang
Some settings of PHY have to work after resetting PHY. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c index dbb1721882..d774a0fa63 100644 --- a/drivers/usb/eth/r8152.c

[PATCH u-boot v2] eth/r8152: update the firmware

2020-06-05 Thread Hayes Wang
: Hayes Wang --- drivers/usb/eth/r8152.h| 8 + drivers/usb/eth/r8152_fw.c | 481 - 2 files changed, 265 insertions(+), 224 deletions(-) diff --git a/drivers/usb/eth/r8152.h b/drivers/usb/eth/r8152.h index c7f62b8b3e..10e0da8eb1 100644 --- a/drivers/usb/eth

RE: [PATCH u-boot] eth/r8152: update the firmware

2020-06-03 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 02, 2020 7:59 PM [...] > Can you be more specific about the problem you are fixing here ? > What is the problem ? > >>> > >>> There is low probability that the device may be lost when rebooting. > >>> Should I submit v2 to reword th

RE: [PATCH u-boot] eth/r8152: update the firmware

2020-06-02 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 02, 2020 7:02 PM [...] > >> Can you be more specific about the problem you are fixing here ? > >> What is the problem ? > > > > There is low probability that the device may be lost when rebooting. > > Should I submit v2 to reword the commit m

RE: [PATCH u-boot] eth/r8152: update the firmware

2020-06-01 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Tuesday, June 02, 2020 12:46 AM > > Update the firmware to improve compatibility for none-intel USB > > host controller. > > Can you be more specific about the problem you are fixing here ? > What is the problem ? There is low probability that the device

[PATCH u-boot] eth/r8152: update the firmware

2020-06-01 Thread Hayes Wang
Update the firmware to improve compatibility for none-intel USB host controller. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.h| 8 + drivers/usb/eth/r8152_fw.c | 481 - 2 files changed, 265 insertions(+), 224 deletions(-) diff --git a/drivers

RE: [PATCH u-boot v2 1/2] eth/r8152: fix assigning the wrong endpoint

2020-05-25 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Monday, May 25, 2020 9:01 PM [...] > > Excuse me. I test v1 only. > > Do I have to resend v1 for patch #1? > > I'll pick V1, no worries. Thanks. Best Regards, Hayes

RE: [PATCH u-boot v2 1/2] eth/r8152: fix assigning the wrong endpoint

2020-05-25 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Monday, May 25, 2020 8:03 PM [...] ep_out_found = 1; > > - } > > + } else if ((ep_addr & USB_DIR_OUT) && !ep_out_found) { > > > Sorry, I was wrong in my previous suggestion, the

[PATCH u-boot v2 0/2] eth/r8152: minor corrections

2020-05-25 Thread Hayes Wang
v2: Reword the patch #1 to make it easier to understand. v1: These are minor corrections for r8152 driver. Hayes Wang (2): eth/r8152: fix assigning the wrong endpoint eth/r8152: fix typo in register name drivers/usb/eth/r8152.c | 22 -- drivers/usb/eth/r8152.h | 4

[PATCH u-boot v2 2/2] eth/r8152: fix typo in register name

2020-05-25 Thread Hayes Wang
The PAL_BDC_CR should be PLA_BDC_CR. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 8 drivers/usb/eth/r8152.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c index 9f7bc7986d..cef79cab49 100644 --- a

[PATCH u-boot v2 1/2] eth/r8152: fix assigning the wrong endpoint

2020-05-25 Thread Hayes Wang
Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/eth/r8152.c b

RE: [PATCH u-boot 1/2] eth/r8152: fix assigning the wrong endpoint

2020-05-25 Thread Hayes Wang
Marek Vasut [mailto:ma...@denx.de] > Sent: Friday, May 22, 2020 9:22 PM [...] > > - if ((ep_addr & USB_DIR_IN) && !ep_in_found) { > > - ss->ep_in = ep_addr & > > - USB_ENDPOINT_NUMBER_MASK; > > -

[PATCH u-boot 2/2] eth/r8152: fix typo in register name

2020-05-22 Thread Hayes Wang
The PAL_BDC_CR should be PLA_BDC_CR. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 8 drivers/usb/eth/r8152.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c index 7c48663370..f201a1789b 100644 --- a

[PATCH u-boot 0/2] eth/r8152: minor corrections

2020-05-22 Thread Hayes Wang
These are minor corrections for r8152 driver. Hayes Wang (2): eth/r8152: fix assigning the wrong endpoint eth/r8152: fix typo in register name drivers/usb/eth/r8152.c | 22 -- drivers/usb/eth/r8152.h | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions

[PATCH u-boot 1/2] eth/r8152: fix assigning the wrong endpoint

2020-05-22 Thread Hayes Wang
Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out. Signed-off-by: Hayes Wang --- drivers/usb/eth/r8152.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/eth/r8152.c b