All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST v4 04/13] Osstest/Debian: Support for loading an FDT from u-boot script
Date: Wed, 21 Jan 2015 11:18:05 +0000	[thread overview]
Message-ID: <1421839094-10857-4-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1421839070.4899.8.camel@citrix.com>

The currently supported platform provides an FDT preloaded at 0x1000.
Replace this with ${fdt_addr} (which the current platform exposes) and
for platforms which do not provide an fdt arrange to load the relevant
file as named in the ${fdtfile} (which is conventionally provided by
u-boot for platforms which need this).

Drop some random memory clearing rune, I've no idea what the intended
purpose was, 0x800000 doesn't correspond to any $foo_addr_r on the
midway systems for example.

Also get rid of the scsi scan which must necessarily have already
happened (since the boot.scr itselfs lives on a scsi drive).

Lastly, add some echos to show progress through the script, as an aid
to debugging.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: Refactor uboot dtb loading scriptlet, which previously appeared
    twice
---
 Osstest/Debian.pm | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 0a69aca..8b70442 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -114,6 +114,15 @@ sub bl_getmenu_open ($$$) {
     return $f;
 }
 
+sub uboot_scr_load_dtb () {
+    return <<'END';
+if test -z "\${fdt_addr}" && test -n "\${fdtfile}" ; then
+    echo Loading dtbs/\${fdtfile}
+    ext2load scsi 0 \${fdt_addr_r} dtbs/\${fdtfile}
+    setenv fdt_addr \${fdt_addr_r}
+fi
+END
+}
 sub setupboot_uboot ($$$) {
     my ($ho,$want_kernver,$xenhopt,$xenkopt) = @_;
     my $bl= { };
@@ -132,6 +141,8 @@ sub setupboot_uboot ($$$) {
 
 	my $early_commands = get_host_property($ho, 'UBootScriptEarlyCommands', '');
 
+	my $load_dtb = uboot_scr_load_dtb();
+
 	target_cmd_root($ho, <<END);
 if test ! -f /boot/$kern ; then
     exit 1
@@ -143,9 +154,7 @@ cp -n /boot/boot.scr /boot/boot.scr.bak
 xen=`readlink /boot/$xen`
 
 cat >/boot/boot <<EOF
-
-mw.l 800000 0 10000
-scsi scan
+${load_dtb}
 
 fdt addr \\\${fdt_addr}
 fdt resize
@@ -692,6 +701,8 @@ END
 
 	my $bootargs = join ' ', @bootargs;
 
+	my $load_dtb = uboot_scr_load_dtb();
+
 	preseed_hook_command($ho, 'late_command', $sfx, <<END);
 #!/bin/sh
 set -ex
@@ -703,11 +714,13 @@ initrd=`readlink \$r/initrd.img | sed -e 's|boot/||'`
 
 cat >\$r/boot/boot <<EOF
 setenv bootargs $bootargs
-mw.l 800000 0 10000
-scsi scan
+${load_dtb}
+echo Loading \$kernel
 ext2load scsi 0 \\\${kernel_addr_r} \$kernel
+echo Loading \$initrd
 ext2load scsi 0 \\\${ramdisk_addr_r} \$initrd
-bootz \\\${kernel_addr_r} \\\${ramdisk_addr_r}:\\\${filesize} 0x1000
+echo Booting
+bootz \\\${kernel_addr_r} \\\${ramdisk_addr_r}:\\\${filesize} \\\${fdt_addr}
 EOF
 
 in-target mkimage -A arm -T script -d /boot/boot /boot/boot.scr
-- 
2.1.4

  parent reply	other threads:[~2015-01-21 11:18 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 ` Ian Campbell [this message]
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
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=1421839094-10857-4-git-send-email-ian.campbell@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.