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: 137043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DB758B6F13 for ; Sat, 21 Jan 2012 04:06:27 +1100 (EST) Received: from localhost ([::1]:58985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHux-0006D5-2X for incoming@patchwork.ozlabs.org; Fri, 20 Jan 2012 12:06:23 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHun-0006Ch-BV for qemu-devel@nongnu.org; Fri, 20 Jan 2012 12:06:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoHuh-0002fv-Di for qemu-devel@nongnu.org; Fri, 20 Jan 2012 12:06:13 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:59980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoHuh-0002fC-4k for qemu-devel@nongnu.org; Fri, 20 Jan 2012 12:06:07 -0500 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 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: qemu-devel@nongnu.org, patches@linaro.org Subject: [Qemu-devel] [PATCH] arm_boot: support board IDs more than 16 bits wide X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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++) {