* [BUG] USB boot issue on ROCKPro64 with UEFI
@ 2021-09-03 15:24 Vincent Stehlé
2021-09-03 15:24 ` [PATCH WORKAROUND] clk: rk3399: do not disable the USB2PHY clk Vincent Stehlé
2021-09-03 17:02 ` [BUG] USB boot issue on ROCKPro64 with UEFI Arnaud Patard
0 siblings, 2 replies; 4+ messages in thread
From: Vincent Stehlé @ 2021-09-03 15:24 UTC (permalink / raw)
To: u-boot
Cc: Vincent Stehlé,
Simon Glass, Philipp Tomsich, Kever Yang, Lukasz Majewski
Hi U-Boot folks,
Hopefully this is the right way to report bugs. If not, please do not hesitate
to let me know.
I am hitting an issue with U-Boot v2021.07 on the ROCKPro64, when booting Linux
with UEFI from USB. The kernel EFI stub will hang:
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...
After tracking it down, it appears efi_exit_boot_services() is ultimately
calling OHCI hc_reset(), which hangs at this line:
1804 if (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) {
This seems to indicate reading the OHCI hardware control register cannot
complete, which hints at a clocking issue.
Looking in more details at the clocks changes performed on the
efi_exit_boot_services() path, a workaround is indeed to prevent the USB2PHY
clocks from being disabled (see the patch following this e-mail).
I don't know enough about the RK3399 clock tree to fully understand what is
going on here, and what would be a proper fix. Hopefully others will be able to
continue from there.
Best regards,
Vincent Stehlé
System Architect - Arm
Vincent Stehlé (1):
clk: rk3399: do not disable the USB2PHY clk
drivers/clk/rockchip/clk_rk3399.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH WORKAROUND] clk: rk3399: do not disable the USB2PHY clk
2021-09-03 15:24 [BUG] USB boot issue on ROCKPro64 with UEFI Vincent Stehlé
@ 2021-09-03 15:24 ` Vincent Stehlé
2021-09-03 17:02 ` [BUG] USB boot issue on ROCKPro64 with UEFI Arnaud Patard
1 sibling, 0 replies; 4+ messages in thread
From: Vincent Stehlé @ 2021-09-03 15:24 UTC (permalink / raw)
To: u-boot
Cc: Vincent Stehlé,
Simon Glass, Philipp Tomsich, Kever Yang, Lukasz Majewski
When booting from USB with UEFI on the ROCKPro64, the Linux kernel EFI stub
will hang in efi_exit_boot_services due to OHCI hc_reset accessing the
hardware registers after the USB2PHY clocks have been disabled.
As a workaround, prevent the USB2PHY clocks from being disabled to repair
the boot.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
---
THIS IS A WORKAROUND
PLEASE DO NOT APPLY!
drivers/clk/rockchip/clk_rk3399.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index f8cbda44551..9cf7d26a026 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -1213,10 +1213,10 @@ static int rk3399_clk_disable(struct clk *clk)
rk_setreg(&priv->cru->clkgate_con[5], BIT(6));
break;
case SCLK_USB2PHY0_REF:
- rk_setreg(&priv->cru->clkgate_con[6], BIT(5));
+ /* WORKAROUND: leave enabled */
break;
case SCLK_USB2PHY1_REF:
- rk_setreg(&priv->cru->clkgate_con[6], BIT(6));
+ /* WORKAROUND: leave enabled */
break;
case ACLK_GMAC:
rk_setreg(&priv->cru->clkgate_con[32], BIT(0));
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [BUG] USB boot issue on ROCKPro64 with UEFI
2021-09-03 15:24 [BUG] USB boot issue on ROCKPro64 with UEFI Vincent Stehlé
2021-09-03 15:24 ` [PATCH WORKAROUND] clk: rk3399: do not disable the USB2PHY clk Vincent Stehlé
@ 2021-09-03 17:02 ` Arnaud Patard
2021-09-03 17:30 ` Vincent Stehlé
1 sibling, 1 reply; 4+ messages in thread
From: Arnaud Patard @ 2021-09-03 17:02 UTC (permalink / raw)
To: Vincent Stehlé
Cc: u-boot, Simon Glass, Philipp Tomsich, Kever Yang, Lukasz Majewski
Vincent Stehlé <vincent.stehle@arm.com> writes:
Hi,
> Hi U-Boot folks,
>
> Hopefully this is the right way to report bugs. If not, please do not hesitate
> to let me know.
>
> I am hitting an issue with U-Boot v2021.07 on the ROCKPro64, when booting Linux
> with UEFI from USB. The kernel EFI stub will hang:
>
> EFI stub: Booting Linux Kernel...
> EFI stub: Using DTB from configuration table
> EFI stub: Exiting boot services and installing virtual address map...
>
> After tracking it down, it appears efi_exit_boot_services() is ultimately
> calling OHCI hc_reset(), which hangs at this line:
>
> 1804 if (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) {
>
> This seems to indicate reading the OHCI hardware control register cannot
> complete, which hints at a clocking issue.
>
> Looking in more details at the clocks changes performed on the
> efi_exit_boot_services() path, a workaround is indeed to prevent the USB2PHY
> clocks from being disabled (see the patch following this e-mail).
>
> I don't know enough about the RK3399 clock tree to fully understand what is
> going on here, and what would be a proper fix. Hopefully others will be able to
> continue from there.
I may be wrong but seems like the issue solved by
https://patchwork.ozlabs.org/project/uboot/patch/20210406151059.1187379-1-icenowy@aosc.io/
Unfortunately, I think that there has been no progress since the
submission of this patch.
Arnaud
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] USB boot issue on ROCKPro64 with UEFI
2021-09-03 17:02 ` [BUG] USB boot issue on ROCKPro64 with UEFI Arnaud Patard
@ 2021-09-03 17:30 ` Vincent Stehlé
0 siblings, 0 replies; 4+ messages in thread
From: Vincent Stehlé @ 2021-09-03 17:30 UTC (permalink / raw)
To: Arnaud Patard
Cc: u-boot, Simon Glass, Philipp Tomsich, Kever Yang, Lukasz Majewski
On Fri, Sep 03, 2021 at 07:02:13PM +0200, Arnaud Patard wrote:
..
> I may be wrong but seems like the issue solved by
> https://patchwork.ozlabs.org/project/uboot/patch/20210406151059.1187379-1-icenowy@aosc.io/
> Unfortunately, I think that there has been no progress since the
> submission of this patch.
Hi Arnaud,
You are right, this patch solves the issue I am seeing on the ROCKPro64.
Thanks for the pointer.
Best regards,
Vincent Stehlé
System Architect - Arm
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-03 17:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03 15:24 [BUG] USB boot issue on ROCKPro64 with UEFI Vincent Stehlé
2021-09-03 15:24 ` [PATCH WORKAROUND] clk: rk3399: do not disable the USB2PHY clk Vincent Stehlé
2021-09-03 17:02 ` [BUG] USB boot issue on ROCKPro64 with UEFI Arnaud Patard
2021-09-03 17:30 ` Vincent Stehlé
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.