mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD
@ 2019-01-21 17:53 Vivien Didelot
  2019-01-21 17:53 ` [PATCH 2/2] ARM: zii-vf610-dev: boot initrd " Vivien Didelot
  2019-01-22  7:40 ` [PATCH 1/2] ARM: zii-vf610-dev: fix boot " Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Vivien Didelot @ 2019-01-21 17:53 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov, Vivien Didelot

VF610 Dev Rev B and VF610 Dev Rev C boot from SD card attached to
SDHCI1, and CFU1, SPU3 and SCU4 boot from eMMC attached to SDHCI2.

Since 5f99a8d40305 ("dts: VFxxx: Add aliases for ESDHC controllers"),
these devices were renamed from mci0 and mci1 to mmc1 and mmc2.

To fix this, completely drop the automount-sd script, probe mmcX from
the boot/sd script directly and use the mountpoint /mnt/mmcX.0 from
there. At the same time, make the sd variable non global.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
 .../zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd | 14 ++++++++++++--
 .../defaultenv-zii-vf610-dev/init/automount-sd     | 13 -------------
 2 files changed, 12 insertions(+), 15 deletions(-)
 delete mode 100644 arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd

diff --git a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
index cf8eec363..1a6f9706b 100644
--- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
+++ b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
@@ -1,4 +1,14 @@
 #!/bin/sh
 
-global.bootm.image=/mnt/sd/zImage
-global.bootm.oftree=/mnt/sd/${global.bootm.oftree}
+if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ]; then
+    sd=1
+else
+    sd=2
+fi
+
+mmc${sd}.probe=1
+
+path="/mnt/mmc${sd}.0"
+
+global.bootm.image="${path}/zImage"
+global.bootm.oftree="${path}/${global.bootm.oftree}"
diff --git a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
deleted file mode 100644
index f44dab34e..000000000
--- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
-then
-    global sd=0
-else
-    global sd=1
-fi
-
-mkdir -p /mnt/sd
-automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'
-
-exit 0
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ARM: zii-vf610-dev: boot initrd from SD
  2019-01-21 17:53 [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD Vivien Didelot
@ 2019-01-21 17:53 ` Vivien Didelot
  2019-01-22  7:40 ` [PATCH 1/2] ARM: zii-vf610-dev: fix boot " Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Vivien Didelot @ 2019-01-21 17:53 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov, Vivien Didelot

As for tftp, make use of the initramfs if one is present on the SD card.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
---
 .../boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
index 1a6f9706b..48476bd14 100644
--- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
+++ b/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/boot/sd
@@ -12,3 +12,8 @@ path="/mnt/mmc${sd}.0"
 
 global.bootm.image="${path}/zImage"
 global.bootm.oftree="${path}/${global.bootm.oftree}"
+
+initramfs="${path}/initramfs"
+if [ -f "${initramfs}" ]; then
+	global.bootm.initrd="$initramfs"
+fi
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD
  2019-01-21 17:53 [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD Vivien Didelot
  2019-01-21 17:53 ` [PATCH 2/2] ARM: zii-vf610-dev: boot initrd " Vivien Didelot
@ 2019-01-22  7:40 ` Sascha Hauer
  2019-01-22 17:07   ` Vivien Didelot
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2019-01-22  7:40 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: Andrey Smirnov, barebox

Hi Vivien,

On Mon, Jan 21, 2019 at 12:53:04PM -0500, Vivien Didelot wrote:
> VF610 Dev Rev B and VF610 Dev Rev C boot from SD card attached to
> SDHCI1, and CFU1, SPU3 and SCU4 boot from eMMC attached to SDHCI2.
> 
> Since 5f99a8d40305 ("dts: VFxxx: Add aliases for ESDHC controllers"),
> these devices were renamed from mci0 and mci1 to mmc1 and mmc2.
> 
> To fix this, completely drop the automount-sd script, probe mmcX from
> the boot/sd script directly and use the mountpoint /mnt/mmcX.0 from
> there. At the same time, make the sd variable non global.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> ---
> --- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -#!/bin/sh
> -
> -if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
> -then
> -    global sd=0
> -else
> -    global sd=1
> -fi
> -
> -mkdir -p /mnt/sd
> -automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'

Any special reason you evaluate $global.sd at the time the automount is
executed? I would expect a local variable here and the command put in
"" rather than ''

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD
  2019-01-22  7:40 ` [PATCH 1/2] ARM: zii-vf610-dev: fix boot " Sascha Hauer
@ 2019-01-22 17:07   ` Vivien Didelot
  2019-01-22 17:20     ` Sascha Hauer
  2019-01-23  0:48     ` Andrey Smirnov
  0 siblings, 2 replies; 6+ messages in thread
From: Vivien Didelot @ 2019-01-22 17:07 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Andrey Smirnov, barebox

Hi Sascha,

On Tue, 22 Jan 2019 08:40:03 +0100, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Mon, Jan 21, 2019 at 12:53:04PM -0500, Vivien Didelot wrote:
> > VF610 Dev Rev B and VF610 Dev Rev C boot from SD card attached to
> > SDHCI1, and CFU1, SPU3 and SCU4 boot from eMMC attached to SDHCI2.
> > 
> > Since 5f99a8d40305 ("dts: VFxxx: Add aliases for ESDHC controllers"),
> > these devices were renamed from mci0 and mci1 to mmc1 and mmc2.
> > 
> > To fix this, completely drop the automount-sd script, probe mmcX from
> > the boot/sd script directly and use the mountpoint /mnt/mmcX.0 from
> > there. At the same time, make the sd variable non global.
> > 
> > Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> > ---
> > --- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
> > +++ /dev/null
> > @@ -1,13 +0,0 @@
> > -#!/bin/sh
> > -
> > -if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
> > -then
> > -    global sd=0
> > -else
> > -    global sd=1
> > -fi
> > -
> > -mkdir -p /mnt/sd
> > -automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'
> 
> Any special reason you evaluate $global.sd at the time the automount is
> executed? I would expect a local variable here and the command put in
> "" rather than ''

I'm not sure to understand your question. As stated in the commit
message, this patch gets rid of this automount script and use a local
variable 'sd' in the boot/sd script instead.

That said, please wait for Andrey to review and confirm that the SD
card slot on CFU and other boards is mmc2, because I only have ZII
Dev boards with me (which use mmc1).


Thanks,

	Vivien

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD
  2019-01-22 17:07   ` Vivien Didelot
@ 2019-01-22 17:20     ` Sascha Hauer
  2019-01-23  0:48     ` Andrey Smirnov
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2019-01-22 17:20 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: Andrey Smirnov, barebox

On Tue, Jan 22, 2019 at 12:07:02PM -0500, Vivien Didelot wrote:
> Hi Sascha,
> 
> On Tue, 22 Jan 2019 08:40:03 +0100, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > On Mon, Jan 21, 2019 at 12:53:04PM -0500, Vivien Didelot wrote:
> > > VF610 Dev Rev B and VF610 Dev Rev C boot from SD card attached to
> > > SDHCI1, and CFU1, SPU3 and SCU4 boot from eMMC attached to SDHCI2.
> > > 
> > > Since 5f99a8d40305 ("dts: VFxxx: Add aliases for ESDHC controllers"),
> > > these devices were renamed from mci0 and mci1 to mmc1 and mmc2.
> > > 
> > > To fix this, completely drop the automount-sd script, probe mmcX from
> > > the boot/sd script directly and use the mountpoint /mnt/mmcX.0 from
> > > there. At the same time, make the sd variable non global.
> > > 
> > > Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> > > ---
> > > --- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
> > > +++ /dev/null
> > > @@ -1,13 +0,0 @@
> > > -#!/bin/sh
> > > -
> > > -if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
> > > -then
> > > -    global sd=0
> > > -else
> > > -    global sd=1
> > > -fi
> > > -
> > > -mkdir -p /mnt/sd
> > > -automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'
> > 
> > Any special reason you evaluate $global.sd at the time the automount is
> > executed? I would expect a local variable here and the command put in
> > "" rather than ''
> 
> I'm not sure to understand your question. As stated in the commit
> message, this patch gets rid of this automount script and use a local
> variable 'sd' in the boot/sd script instead.

D'oh. You're removing this file, not adding it. Forget my comment.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD
  2019-01-22 17:07   ` Vivien Didelot
  2019-01-22 17:20     ` Sascha Hauer
@ 2019-01-23  0:48     ` Andrey Smirnov
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2019-01-23  0:48 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: Barebox List

On Tue, Jan 22, 2019 at 9:07 AM Vivien Didelot <vivien.didelot@gmail.com> wrote:
>
> Hi Sascha,
>
> On Tue, 22 Jan 2019 08:40:03 +0100, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > On Mon, Jan 21, 2019 at 12:53:04PM -0500, Vivien Didelot wrote:
> > > VF610 Dev Rev B and VF610 Dev Rev C boot from SD card attached to
> > > SDHCI1, and CFU1, SPU3 and SCU4 boot from eMMC attached to SDHCI2.
> > >
> > > Since 5f99a8d40305 ("dts: VFxxx: Add aliases for ESDHC controllers"),
> > > these devices were renamed from mci0 and mci1 to mmc1 and mmc2.
> > >
> > > To fix this, completely drop the automount-sd script, probe mmcX from
> > > the boot/sd script directly and use the mountpoint /mnt/mmcX.0 from
> > > there. At the same time, make the sd variable non global.
> > >
> > > Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> > > ---
> > > --- a/arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd
> > > +++ /dev/null
> > > @@ -1,13 +0,0 @@
> > > -#!/bin/sh
> > > -
> > > -if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
> > > -then
> > > -    global sd=0
> > > -else
> > > -    global sd=1
> > > -fi
> > > -
> > > -mkdir -p /mnt/sd
> > > -automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'
> >
> > Any special reason you evaluate $global.sd at the time the automount is
> > executed? I would expect a local variable here and the command put in
> > "" rather than ''
>
> I'm not sure to understand your question. As stated in the commit
> message, this patch gets rid of this automount script and use a local
> variable 'sd' in the boot/sd script instead.
>
> That said, please wait for Andrey to review and confirm that the SD
> card slot on CFU and other boards is mmc2, because I only have ZII
> Dev boards with me (which use mmc1).
>

Just checked on CFU1 and, with aliases in place, SD slot has a
consistent name across all platforms, so

detect mmc1
path="/mnt/mmc1.0"

global.bootm.image="${path}/zImage"
global.bootm.oftree="${path}/vf610-zii-${global.hostname}.dtb"

is probably all that's needed in "boot/sd". I also don't think that
"init/choose-dtb" is necessary anymore and can be probably be dropped.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-23  0:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 17:53 [PATCH 1/2] ARM: zii-vf610-dev: fix boot from SD Vivien Didelot
2019-01-21 17:53 ` [PATCH 2/2] ARM: zii-vf610-dev: boot initrd " Vivien Didelot
2019-01-22  7:40 ` [PATCH 1/2] ARM: zii-vf610-dev: fix boot " Sascha Hauer
2019-01-22 17:07   ` Vivien Didelot
2019-01-22 17:20     ` Sascha Hauer
2019-01-23  0:48     ` Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox