All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH OSSTEST v4 00/13] support for ARM32 arndale and cubietruck platforms
Date: Thu, 29 Jan 2015 11:44:39 +0000	[thread overview]
Message-ID: <1422531879.30641.60.camel@citrix.com> (raw)
In-Reply-To: <21706.6325.44789.673819@mariner.uk.xensource.com>

On Thu, 2015-01-29 at 11:25 +0000, Ian Jackson wrote:
> Nnng.
[...]
> Oh god oh god the horror.

Quite...

> > In theory I could try upgrading the u-boot firmware on these systems
> > (it's still supported by mainline u-boot), but to be honest with Calxeda
> > no longer existing I'm reluctant to do anything which might have any
> > chance of bricking the systems.
> > 
> > I'm not sure how specific to make this quirk and whether it is worth
> > doing via the hostdb or just directly in Debian.pm. Options:
> > 
> >       * Make the addition of the 0x prefix conditional on !
> >         platform-midway
> 
> I think this would be an abuse of platform-*.  You've already done
> this kind of thing once with equiv-marilith in Osstest/CXFabric.pm and
> I think I should have put my foot down then...

I thought you'd say that ;-)

> 
> >       * A similar host flag to control the addition (or, more likely, 
> >         the omission of) of the 0x
> 
> That would be fine, although AFAICT we don't really have any quirks in
> the hostflags already.  It should probably be quirk-something.
> 
> >       * Add a new host prop e.g. UBootLoadFilesizePrefix, defaulting to
> >         0x and set to '' on midway machines
> 
> That would be fine too (although do you expect any values other than
> '' and 0x?)

It seems pretty unlikely, at least I can't think of anything plausible.
Which suggests a hostflag is the right answer...

I propose to append the following to the pretest branch (rather than
trying to fold it into some existing patch, although I can if you want)

Feel free to bikeshed the name, of course ;-)...

8<------

>From caee3d8167b107b02293b1e72dae2d76db08437c Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Thu, 29 Jan 2015 11:37:39 +0000
Subject: [PATCH] Debian: Handle systems where u-boot includes 0x on $filesize

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/Debian.pm | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 3c4ac5e..9b54e5e 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -180,6 +180,22 @@ sub setupboot_uboot ($$$) {
 	my $set_xen_addr_r =
 	    $xen_addr_r ? "setenv xen_addr_r $xen_addr_r" : "";
 
+	# According to u-boot policy $filesize is an unprefixed hex
+	# number, but fdt set requires numbers to be prefixed
+	# (e.g. with 0x for a hex number). See:
+	#
+	# http://lists.denx.de/pipermail/u-boot/2014-October/193622.html,
+	# http://lists.denx.de/pipermail/u-boot/2014-November/194150.html and
+	# http://lists.denx.de/pipermail/u-boot/2014-November/194150.html.
+	#
+	# However some older u-boot versions (e.g. on midway) erroneously
+	# include the 0x prefix when setting $filesize from ext*load
+	# commands, meaning we cannot simply unconditionally prepend
+	# the 0x. Base it on a host flag quirk.
+	my $size_hex_prefix =
+	    $ho->{Flags}{'quirk-load-filesize-has-0x-prefix'} ?
+	    '' : '0x';
+
 	target_cmd_root($ho, <<END);
 if test ! -f /boot/$kern ; then
     exit 1
@@ -210,7 +226,7 @@ echo command line: \\\${bootargs}
 ext2load scsi 0 \\\${kernel_addr_r} $kern
 fdt mknod /chosen module\@0
 fdt set /chosen/module\@0 compatible "xen,linux-zimage" "xen,multiboot-module"
-fdt set /chosen/module\@0 reg <\\\${kernel_addr_r} 0x\\\${filesize}>
+fdt set /chosen/module\@0 reg <\\\${kernel_addr_r} ${size_hex_prefix}\\\${filesize}>
 fdt set /chosen/module\@0 bootargs "$xenkopt"
 echo Loaded $kern to \\\${kernel_addr_r} (\\\${filesize})
 echo command line: $xenkopt
@@ -218,7 +234,7 @@ echo command line: $xenkopt
 ext2load scsi 0 \\\${ramdisk_addr_r} $initrd
 fdt mknod /chosen module\@1
 fdt set /chosen/module\@1 compatible "xen,linux-initrd" "xen,multiboot-module"
-fdt set /chosen/module\@1 reg <\\\${ramdisk_addr_r} 0x\\\${filesize}>
+fdt set /chosen/module\@1 reg <\\\${ramdisk_addr_r} ${size_hex_prefix}\\\${filesize}>
 echo Loaded $initrd to \\\${ramdisk_addr_r} (\\\${filesize})
 
 fdt print /chosen
-- 
2.1.4

  reply	other threads:[~2015-01-29 11:44 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 11:17 [PATCH OSSTEST v4 00/13] support for ARM32 arndale and cubietruck platforms Ian Campbell
2015-01-21 11:18 ` [PATCH OSSTEST v4 01/13] make-flight: Run a basic test on each arm platform Ian Campbell
2015-01-21 11:18 ` [PATCH OSSTEST v4 02/13] Osstest/PDU: Add eth008.pm method to control the ARM rack PDU Ian Campbell
2015-01-21 11:43   ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 03/13] Osstest/Debian: Install dtbs into target filesystem in /boot/dtbs Ian Campbell
2015-01-21 11:44   ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 04/13] Osstest/Debian: Support for loading an FDT from u-boot script Ian Campbell
2015-01-21 11:18 ` [PATCH OSSTEST v4 05/13] Osstest/Debian: Refactor setting of dom0 kernel command line Ian Campbell
2015-01-21 11:47   ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 06/13] Osstest/Debian: support adding a rootdelay property to bootargs Ian Campbell
2015-01-21 11:58   ` Ian Jackson
2015-01-21 13:07     ` Ian Campbell
2015-01-21 16:18       ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 07/13] Osstest/Debian: Remove hardcoded addresses from boot.scr Ian Campbell
2015-01-21 12:00   ` Ian Jackson
2015-01-21 12:25     ` Ian Campbell
2015-01-21 11:18 ` [PATCH OSSTEST v4 08/13] Osstest/Debian: Add "clk_ignore_unused" to default command line Ian Campbell
2015-01-21 12:01   ` Ian Jackson
2015-01-21 12:02   ` Ian Jackson
2015-01-21 13:12     ` Ian Campbell
2015-01-21 16:18       ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 09/13] Osstest/Debian: Add 0x prefix to $filesize Ian Campbell
2015-01-21 12:04   ` Ian Jackson
2015-01-21 12:22     ` Ian Campbell
2015-01-21 15:08       ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 10/13] ts-kernel-build: Adjust kernel .config to work on the arndale boards Ian Campbell
2015-01-21 12:05   ` Ian Jackson
2015-01-21 13:20     ` Ian Campbell
2015-01-21 14:04       ` Ian Campbell
2015-01-21 16:20       ` Ian Jackson
2015-01-21 16:31         ` Ian Campbell
2015-01-21 16:36           ` Ian Jackson
2015-01-21 16:50             ` Ian Campbell
2015-01-21 17:01               ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 11/13] Debian: Create boot.scr with a suffix and copy to boot.scr Ian Campbell
2015-01-21 12:08   ` Ian Jackson
2015-01-21 12:27     ` Ian Campbell
2015-01-21 11:18 ` [PATCH OSSTEST v4 12/13] TestSupport: replace power_cycle_timeout with power_cycle_sleep Ian Campbell
2015-01-21 12:09   ` Ian Jackson
2015-01-21 11:18 ` [PATCH OSSTEST v4 13/13] Debian: create boot.scr.nat when installing Xen on u-boot Ian Campbell
2015-01-21 12:12   ` Ian Jackson
2015-01-29  9:54 ` [PATCH OSSTEST v4 00/13] support for ARM32 arndale and cubietruck platforms Ian Campbell
2015-01-29 11:25   ` Ian Jackson
2015-01-29 11:44     ` Ian Campbell [this message]
2015-01-29 11:54       ` Ian Campbell

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=1422531879.30641.60.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.