From patchwork Fri Jan 20 17:05:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6323 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 358AF23E29 for ; Fri, 20 Jan 2012 17:06:06 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 1BE74A181E3 for ; Fri, 20 Jan 2012 17:06:06 +0000 (UTC) Received: by bkar19 with SMTP id r19so689810bka.11 for ; Fri, 20 Jan 2012 09:06:05 -0800 (PST) Received: by 10.204.10.73 with SMTP id o9mr6588158bko.99.1327079165570; Fri, 20 Jan 2012 09:06:05 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs11476bkc; Fri, 20 Jan 2012 09:06:05 -0800 (PST) Received: by 10.216.144.160 with SMTP id n32mr71476wej.5.1327079163777; Fri, 20 Jan 2012 09:06:03 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id y19si2986186weq.139.2012.01.20.09.06.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 09:06:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RoHuY-0007d4-89; Fri, 20 Jan 2012 17:05:58 +0000 From: Peter Maydell To: Mark Langsdorf Cc: qemu-devel@nongnu.org, patches@linaro.org Subject: [PATCH] arm_boot: support board IDs more than 16 bits wide Date: Fri, 20 Jan 2012 17:05:58 +0000 Message-Id: <1327079158-29303-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Support passing a board ID value to the kernel in r1 that is more than 16 bits wide. This is needed to pass the '-1 == invalid' value for boards which only support device tree booting. Signed-off-by: Peter Maydell --- This applies after the Calxeda patchset. Mark, I suggest you put it in your patchset in the appropriate place. hw/arm_boot.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/arm_boot.c b/hw/arm_boot.c index 8f73a29..01ca997 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -20,10 +20,10 @@ /* The worlds second smallest bootloader. Set r0-r2, then jump to kernel. */ static uint32_t bootloader[] = { 0xe3a00000, /* mov r0, #0 */ - 0xe3a01000, /* mov r1, #0x?? */ - 0xe3811c00, /* orr r1, r1, #0x??00 */ - 0xe59f2000, /* ldr r2, [pc, #0] */ - 0xe59ff000, /* ldr pc, [pc, #0] */ + 0xe59f1004, /* ldr r1, [pc, #4] */ + 0xe59f2004, /* ldr r2, [pc, #4] */ + 0xe59ff004, /* ldr pc, [pc, #4] */ + 0, /* Board ID */ 0, /* Address of kernel args. Set by integratorcp_init. */ 0 /* Kernel entry point. Set by integratorcp_init. */ }; @@ -289,8 +289,7 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info) } else { initrd_size = 0; } - bootloader[1] |= info->board_id & 0xff; - bootloader[2] |= (info->board_id >> 8) & 0xff; + bootloader[4] = info->board_id; bootloader[5] = info->loader_start + KERNEL_ARGS_ADDR; bootloader[6] = entry; for (n = 0; n < sizeof(bootloader) / 4; n++) {