From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by mx.groups.io with SMTP id smtpd.web10.21317.1633409270354980831 for ; Mon, 04 Oct 2021 21:47:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YoJL2FQH; spf=pass (domain: gmail.com, ip: 209.85.167.180, mailfrom: christopher.w.clark@gmail.com) Received: by mail-oi1-f180.google.com with SMTP id a3so24584368oid.6 for ; Mon, 04 Oct 2021 21:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7wxQ8zE7VMntuwBs9ECLafMKdLWGBMVY62nLGq40prE=; b=YoJL2FQHjzXobm1b+HNG7fHK/fbcdMHiA1mp+pq8zQKgLrf2wRmsmSvfWwQEpOJAbv ib4KQmdhA7tb2DBRTJVfSC2J7XTsA5h0jR0GKWEAQcrAOxCFu/aBt9eVK/E56j0cf4L1 pK2Pj2XsNKaSCf23elymMDtIawcHiwfMWQxymzLSQUd8RhbRIP/GMRpyRuOJGec7vYai WYamdTziroQjCGcuFIrebhy754mW+u8T+WX+y5VmL15qbwZtdv+n4j7/gTKDb2uMGeZ/ SyxGOHNpyd44HI60vuCl47rfxLoALA+BUaKx+wM34EtL+Rh8Ur9PM5Fyv6hNK0JJK9HZ iV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7wxQ8zE7VMntuwBs9ECLafMKdLWGBMVY62nLGq40prE=; b=qVhh8dnXYn6B912rWaODrTMo3c1+8xpkMhQcxWLjzybbDmc8M1H/aYur2oqmgMakUG f1s07K6+Snp4YWWxcVnVkAH/B4VDleJ1kmBYgpG/y9o2h2M+DenFOala9QdQUAkvRlkV 57eaDwnMmwzx70DKhIjLv8oQoqb9rbOVINUqX1oPP1DMx0OT6X1BuTsC96XOlH6oa63X bA+hJ/DaBeBobhqv6BmnBwy+rTHlU/0m/pGmPoZ3eFalqV+rwgcANK06xG40Al72aLFW 2NgMAx6i1m7yi3QhGNIETcoHtZIC+0QBCCKTVXzrK/O5UBThqESU0kJdDlfXEwo2jrnn kZLA== X-Gm-Message-State: AOAM533cDe4bnq5/AAvGuVxuZHN2iVyHVsNsf4A542WFLIv2Y+14Tutz a4oHQbn7ciiV6k9T/dOAhCTqzZDobPKyIpyVjbI= X-Google-Smtp-Source: ABdhPJwtq3XbIP6Z3U/uqqLe5f/groDzgAZY+/edFom+BG16m/jX5j9OrEf8aI+8RYsohWk/rHzu675TRpukKD0yyms= X-Received: by 2002:a05:6808:10d5:: with SMTP id s21mr876527ois.152.1633409269614; Mon, 04 Oct 2021 21:47:49 -0700 (PDT) MIME-Version: 1.0 References: <20210930145423.17162-1-luca.fancellu@arm.com> <20210930145423.17162-2-luca.fancellu@arm.com> In-Reply-To: From: "Christopher Clark" Date: Mon, 4 Oct 2021 21:47:38 -0700 Message-ID: Subject: Re: [meta-virtualization] [PATCH 2/2] xen, rpi4: Use PARTUUID for rootfs discovery To: Bertrand Marquis Cc: Luca Fancellu , "meta-virtualization@lists.yoctoproject.org" Content-Type: multipart/alternative; boundary="00000000000049ccb905cd93bb0f" --00000000000049ccb905cd93bb0f Content-Type: text/plain; charset="UTF-8" On Thu, Sep 30, 2021 at 8:03 AM Bertrand Marquis wrote: > Hi Luca, > > > On 30 Sep 2021, at 15:54, Luca Fancellu wrote: > > > > The mmc probing order has become unpredictable > > due to recent linux kernel changes, therefore devices > > like the raspberry pi that have two mmc interface most > > of the time can't boot from the hard-coded root path. > > > > Modify the u-boot script to fetch the PARTUUID of the > > second partition of the sd card and use it to put > > root=PARTUUID= in the command line passed to > > the dom0 kernel. > Thanks for posting a way of handling this. I've encountered the same unpredictable device enumeration and had been looking into whether switching the sdhci_iproc driver to PROBE_FORCE_SYNCHRONOUS instead of PROBE_PREFER_ASYNCHRONOUS would resolve it but I can't report that it does. I would prefer to have a way to get stable enumeration but without it, this is an improvement. > > > > Signed-off-by: Luca Fancellu > > Reviewed-by: Diego Sueiro > > Reviewed-by: Bertrand Marquis > Reviewed-by: Christopher Clark Tested-by: Christopher Clark Christopher > > Cheers > Bertrand > > > --- > > .../xen-rpi-u-boot-scr/files/boot.cmd.xen.in | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git > a/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/ > boot.cmd.xen.in > b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/ > boot.cmd.xen.in > > index 0367e36..9874220 100644 > > --- a/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/ > boot.cmd.xen.in > > +++ b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/ > boot.cmd.xen.in > > @@ -13,10 +13,6 @@ fdt resize 0x1000 > > echo Add boot arguments for Xen > > fdt set /chosen xen,xen-bootargs "console=dtuart > dtuart=/soc/serial@7e215040 dom0_mem='@@RPI_DOM0_MEM@@' > @@RPI_DEBUG_XEN_ARGS@@" > > > > -echo Add boot arguments for dom0 > > -setenv dom0_bootargs "console=hvc0 earlycon=xenboot debug > root=/dev/mmcblk0p2 rootwait" > > -fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\" > > - > > echo Add a dom0 node to chosen to put Linux boot information in > > fdt mknode /chosen dom0 > > > > @@ -32,6 +28,13 @@ fdt rm /scb/pcie@7d500000/pci@1,0/usb@1,0 > > echo Delay to allow the MMC card to be ready > > sleep 1 > > > > +# Retrieve PARTUUID for the rootfs partition of the sdcard > > +part uuid mmc 1:2 rootfs_partuuid > > + > > +echo Add boot arguments for dom0 > > +setenv dom0_bootargs "console=hvc0 earlycon=xenboot debug > root=PARTUUID=${rootfs_partuuid} rootwait" > > +fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\" > > + > > echo Load Xen into memory > > fatload mmc 1:1 ${xen_loadaddr} xen > > echo Xen loaded, size: 0x$filesize > > -- > > 2.17.1 > > > > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy the > information in any medium. Thank you. > > > > --00000000000049ccb905cd93bb0f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Sep 30, 2021 at 8:03 AM Bertr= and Marquis <bertrand.marqui= s@arm.com> wrote:
Hi Luca,

> On 30 Sep 2021, at 15:54, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
>
> The mmc probing order has become unpredictable
> due to recent linux kernel changes, therefore devices
> like the raspberry pi that have two mmc interface most
> of the time can't boot from the hard-coded root path.
>
> Modify the u-boot script to fetch the PARTUUID of the
> second partition of the sd card and use it to put
> root=3DPARTUUID=3D<xxx> in the command line passed to
> the dom0 kernel.

Thanks for postin= g a way of handling this. I've encountered the same unpredictable devic= e enumeration and had been looking into whether switching the sdhci_iproc d= river to PROBE_FORCE_SYNCHRONOUS instead of PROBE_PREFER_ASYNCHRONOUS would= resolve it but I can't report that it does. I would prefer to have a w= ay to get stable enumeration but without it, this is an improvement.
<= div>=C2=A0
>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Re= viewed-by: Diego Sueiro <diego.sueiro@arm.com>=C2=A0
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
=
Reviewed-by: Christopher Clark <christopher.w.clark@gmail.com>
Tested-by: Christopher Clark <christopher.w.clark@gmail.com>

Christopher

=C2=A0

Cheers
Bertrand

> ---
> .../xen-rpi-u-boot-scr/files/boot.cmd.xen.in=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr= /files/boot.cmd.xen.in b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-= boot-scr/files/boot.cmd.xen.in
> index 0367e36..9874220 100644
> --- a/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/= boo= t.cmd.xen.in
> +++ b/dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/= boo= t.cmd.xen.in
> @@ -13,10 +13,6 @@ fdt resize 0x1000
> echo Add boot arguments for Xen
> fdt set /chosen xen,xen-bootargs "console=3Ddtuart dtuart=3D/soc/= serial@7e215040 dom0_mem=3D'@@RPI_DOM0_MEM@@' @@RPI_DEBUG_XEN_ARGS@= @"
>
> -echo Add boot arguments for dom0
> -setenv dom0_bootargs "console=3Dhvc0 earlycon=3Dxenboot debug ro= ot=3D/dev/mmcblk0p2 rootwait"
> -fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\"
> -
> echo Add a dom0 node to chosen to put Linux boot information in
> fdt mknode /chosen dom0
>
> @@ -32,6 +28,13 @@ fdt rm /scb/pcie@7d500000/pci@1,0/usb@1,0
> echo Delay to allow the MMC card to be ready
> sleep 1
>
> +# Retrieve PARTUUID for the rootfs partition of the sdcard
> +part uuid mmc 1:2 rootfs_partuuid
> +
> +echo Add boot arguments for dom0
> +setenv dom0_bootargs "console=3Dhvc0 earlycon=3Dxenboot debug ro= ot=3DPARTUUID=3D${rootfs_partuuid} rootwait"
> +fdt set /chosen xen,dom0-bootargs \"${dom0_bootargs}\"
> +
> echo Load Xen into memory
> fatload mmc 1:1 ${xen_loadaddr} xen
> echo Xen loaded, size: 0x$filesize
> --
> 2.17.1
>

IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.



--00000000000049ccb905cd93bb0f--