From: Andreas Schwab <schwab@linux-m68k.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: devicetree@vger.kernel.org, aou@eecs.berkeley.edu,
kernel@esmil.dk, anup@brainfault.org,
linux-kernel@vger.kernel.org, Atish Patra <Atish.Patra@wdc.com>,
yash.shah@sifive.com, robh+dt@kernel.org,
Alistair Francis <Alistair.Francis@wdc.com>,
sagar.kadam@sifive.com, Paul Walmsley <paul.walmsley@sifive.com>,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 0/3] fix macb phy probe failure if phy-reset is not handled
Date: Thu, 04 Feb 2021 11:16:54 +0100 [thread overview]
Message-ID: <87a6skw31l.fsf@igel.home> (raw)
In-Reply-To: <mhng-40b3307c-6849-46f4-83c3-ffa1ab92baef@palmerdabbelt-glaptop> (Palmer Dabbelt's message of "Wed, 13 Jan 2021 21:01:00 -0800 (PST)")
On Jan 13 2021, Palmer Dabbelt wrote:
> On Tue, 10 Nov 2020 07:22:09 PST (-0800), sagar.kadam@sifive.com wrote:
>> HiFive Unleashed is having VSC8541-01 ethernet phy device and requires a
>> specific reset sequence of 0-1-0-1 in order to use it in unmanaged mode.
>> This series addresses a corner case where phy reset is not handled by boot
>> stages prior to linux.
>> Somewhat similar unreliable phy probe failure was reported and discussed
>> here [1].
>> The macb driver fails to detect the ethernet phy device if the bootloader
>> doesn't provide a proper reset sequence to the phy device or the phy itself
>> is in some invalid state. Currently, the FSBL or u-boot-spl is resetting
>> the phy device, and so there is no issue observed in the linux network
>> setup.
>>
>> The series is based on linux-5.10-rc5.
>> Patch 1: Add the OUI to the phy dt node to fix issue of missing mdio device
>> Patch 2 and 3:
>> Resetting phy needs GPIO support so add to dt and defconfig.
>>
>> [1] https://lkml.org/lkml/2018/11/29/154
>>
>> To reproduce the issue:
>> Using FSBL:
>> 1. Comment out VSC8541 reset sequence in fsbl/main.c
>> from within the freedom-u540-c000-bootloader.
>> 2. Build and flash fsbl.bin to micro sdcard.
>>
>> Using u-boot:
>> 1. Comment out VSC8541 reset sequence in board/sifive/fu540/spl.c
>> from mainline u-boot source code.
>> 2. Build and flash u-boot binaries to micro sdcard.
>>
>> Boot the board and bootlog will show network setup failure messages as:
>>
>> [ 1.069474] libphy: MACB_mii_bus: probed
>> [ 1.073092] mdio_bus 10090000.ethernet-ffffffff: MDIO device at address 0
>> is missing
>> .....
>> [ 1.979252] macb 10090000.ethernet eth0: Could not attach PHY (-19)
>>
>> 3. Now apply the series build, and boot kernel.
>> 4. MACB and VSC8541 driver get successfully probed and the network is set
>> without any failure.
>>
>>
>> So irrespective of whether the prior stages handle the phy reset sequence,
>> the probing is successful in both the cases of cold boot and warm boot.
>>
>> Change History:
>> ===============================
>> V2:
>> -Rebased v1 on linux kernel v5.10-rc3.
>>
>> V1:
>> -Ignore 4th patch as suggested and so removed it from the series.
>> -Verified this series on 5.7-rc5.
>>
>> V0: Base RFC patch. Verified on 5.7-rc2
>>
>> Sagar Shrikant Kadam (3):
>> dts: phy: fix missing mdio device and probe failure of vsc8541-01
>> device
>> dts: phy: add GPIO number and active state used for phy reset
>> riscv: defconfig: enable gpio support for HiFive Unleashed
>>
>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 2 ++
>> arch/riscv/configs/defconfig | 2 ++
>> 2 files changed, 4 insertions(+)
>
> David pointed out I missed these, they're on fixes. Thanks!
This is now on 5.10.12, and breaks ethernet on the Hifive Unleashed:
[ 12.777976] macb 10090000.ethernet: Registered clk switch 'sifive-gemgxl-mgmt'
[ 12.784559] macb 10090000.ethernet: GEM doesn't support hardware ptp.
[ 12.791629] libphy: MACB_mii_bus: probed
[ 12.919728] MACsec IEEE 802.1AE
[ 12.984676] macb 10090000.ethernet eth0: Cadence GEM rev 0x10070109 at 0x10090000 irq 16 (70:b3:d5:92:f1:07)
[ 14.030319] Microsemi VSC8541 SyncE 10090000.ethernet-ffffffff:00: phy_poll_reset failed: -110
[ 14.038986] macb 10090000.ethernet eth0: Could not attach PHY (-110)
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Andreas Schwab <schwab@linux-m68k.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: sagar.kadam@sifive.com, devicetree@vger.kernel.org,
aou@eecs.berkeley.edu, kernel@esmil.dk, anup@brainfault.org,
linux-kernel@vger.kernel.org, Atish Patra <Atish.Patra@wdc.com>,
yash.shah@sifive.com, robh+dt@kernel.org,
Alistair Francis <Alistair.Francis@wdc.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 0/3] fix macb phy probe failure if phy-reset is not handled
Date: Thu, 04 Feb 2021 11:16:54 +0100 [thread overview]
Message-ID: <87a6skw31l.fsf@igel.home> (raw)
In-Reply-To: <mhng-40b3307c-6849-46f4-83c3-ffa1ab92baef@palmerdabbelt-glaptop> (Palmer Dabbelt's message of "Wed, 13 Jan 2021 21:01:00 -0800 (PST)")
On Jan 13 2021, Palmer Dabbelt wrote:
> On Tue, 10 Nov 2020 07:22:09 PST (-0800), sagar.kadam@sifive.com wrote:
>> HiFive Unleashed is having VSC8541-01 ethernet phy device and requires a
>> specific reset sequence of 0-1-0-1 in order to use it in unmanaged mode.
>> This series addresses a corner case where phy reset is not handled by boot
>> stages prior to linux.
>> Somewhat similar unreliable phy probe failure was reported and discussed
>> here [1].
>> The macb driver fails to detect the ethernet phy device if the bootloader
>> doesn't provide a proper reset sequence to the phy device or the phy itself
>> is in some invalid state. Currently, the FSBL or u-boot-spl is resetting
>> the phy device, and so there is no issue observed in the linux network
>> setup.
>>
>> The series is based on linux-5.10-rc5.
>> Patch 1: Add the OUI to the phy dt node to fix issue of missing mdio device
>> Patch 2 and 3:
>> Resetting phy needs GPIO support so add to dt and defconfig.
>>
>> [1] https://lkml.org/lkml/2018/11/29/154
>>
>> To reproduce the issue:
>> Using FSBL:
>> 1. Comment out VSC8541 reset sequence in fsbl/main.c
>> from within the freedom-u540-c000-bootloader.
>> 2. Build and flash fsbl.bin to micro sdcard.
>>
>> Using u-boot:
>> 1. Comment out VSC8541 reset sequence in board/sifive/fu540/spl.c
>> from mainline u-boot source code.
>> 2. Build and flash u-boot binaries to micro sdcard.
>>
>> Boot the board and bootlog will show network setup failure messages as:
>>
>> [ 1.069474] libphy: MACB_mii_bus: probed
>> [ 1.073092] mdio_bus 10090000.ethernet-ffffffff: MDIO device at address 0
>> is missing
>> .....
>> [ 1.979252] macb 10090000.ethernet eth0: Could not attach PHY (-19)
>>
>> 3. Now apply the series build, and boot kernel.
>> 4. MACB and VSC8541 driver get successfully probed and the network is set
>> without any failure.
>>
>>
>> So irrespective of whether the prior stages handle the phy reset sequence,
>> the probing is successful in both the cases of cold boot and warm boot.
>>
>> Change History:
>> ===============================
>> V2:
>> -Rebased v1 on linux kernel v5.10-rc3.
>>
>> V1:
>> -Ignore 4th patch as suggested and so removed it from the series.
>> -Verified this series on 5.7-rc5.
>>
>> V0: Base RFC patch. Verified on 5.7-rc2
>>
>> Sagar Shrikant Kadam (3):
>> dts: phy: fix missing mdio device and probe failure of vsc8541-01
>> device
>> dts: phy: add GPIO number and active state used for phy reset
>> riscv: defconfig: enable gpio support for HiFive Unleashed
>>
>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 2 ++
>> arch/riscv/configs/defconfig | 2 ++
>> 2 files changed, 4 insertions(+)
>
> David pointed out I missed these, they're on fixes. Thanks!
This is now on 5.10.12, and breaks ethernet on the Hifive Unleashed:
[ 12.777976] macb 10090000.ethernet: Registered clk switch 'sifive-gemgxl-mgmt'
[ 12.784559] macb 10090000.ethernet: GEM doesn't support hardware ptp.
[ 12.791629] libphy: MACB_mii_bus: probed
[ 12.919728] MACsec IEEE 802.1AE
[ 12.984676] macb 10090000.ethernet eth0: Cadence GEM rev 0x10070109 at 0x10090000 irq 16 (70:b3:d5:92:f1:07)
[ 14.030319] Microsemi VSC8541 SyncE 10090000.ethernet-ffffffff:00: phy_poll_reset failed: -110
[ 14.038986] macb 10090000.ethernet eth0: Could not attach PHY (-110)
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2021-02-04 10:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 15:22 [PATCH v2 0/3] fix macb phy probe failure if phy-reset is not handled Sagar Shrikant Kadam
2020-11-10 15:22 ` Sagar Shrikant Kadam
2020-11-10 15:22 ` [PATCH v2 1/3] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device Sagar Shrikant Kadam
2020-11-10 15:22 ` Sagar Shrikant Kadam
2020-11-10 15:22 ` [PATCH v2 2/3] dts: phy: add GPIO number and active state used for phy reset Sagar Shrikant Kadam
2020-11-10 15:22 ` Sagar Shrikant Kadam
2020-11-10 15:22 ` [PATCH v2 3/3] riscv: defconfig: enable gpio support for HiFive Unleashed Sagar Shrikant Kadam
2020-11-10 15:22 ` Sagar Shrikant Kadam
2021-01-14 5:01 ` [PATCH v2 0/3] fix macb phy probe failure if phy-reset is not handled Palmer Dabbelt
2021-01-14 5:01 ` Palmer Dabbelt
2021-02-04 10:16 ` Andreas Schwab [this message]
2021-02-04 10:16 ` Andreas Schwab
2021-02-05 3:41 ` Palmer Dabbelt
2021-02-05 3:41 ` Palmer Dabbelt
2021-02-06 10:27 ` David Abdurachmanov
2021-02-06 10:27 ` David Abdurachmanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6skw31l.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=Alistair.Francis@wdc.com \
--cc=Atish.Patra@wdc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=devicetree@vger.kernel.org \
--cc=kernel@esmil.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
--cc=sagar.kadam@sifive.com \
--cc=yash.shah@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.