From patchwork Mon Apr 6 21:02:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 458431 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DCC51140213 for ; Tue, 7 Apr 2015 07:03:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB05BB37D7; Mon, 6 Apr 2015 23:03:08 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fHuTSh3DII0S; Mon, 6 Apr 2015 23:03:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E627B37F6; Mon, 6 Apr 2015 23:02:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E2A9B37CC for ; Mon, 6 Apr 2015 23:02:43 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9BZSz6D8qLwz for ; Mon, 6 Apr 2015 23:02:43 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by theia.denx.de (Postfix) with ESMTPS id 12406B37BD for ; Mon, 6 Apr 2015 23:02:42 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id C055C60060D Received: by dusk.luon.net (Postfix, from userid 1000) id 98CEF25464; Mon, 6 Apr 2015 23:02:28 +0200 (CEST) From: Sjoerd Simons To: Simon Glass Date: Mon, 6 Apr 2015 23:02:22 +0200 Message-Id: <1428354148-1511-3-git-send-email-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428354148-1511-1-git-send-email-sjoerd.simons@collabora.co.uk> References: <1428354148-1511-1-git-send-email-sjoerd.simons@collabora.co.uk> Cc: Masahiro Yamada , Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 2/8] sandbox: Split bootm code out into lib/bootm X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Follow the convention of other architectures and move the platform specific linux bootm code into sandbox/lib/bootm.c. Signed-off-by: Sjoerd Simons Acked-by: Simon Glass --- Changes in v2: None arch/sandbox/cpu/cpu.c | 12 ------------ arch/sandbox/lib/Makefile | 1 + arch/sandbox/lib/bootm.c | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 arch/sandbox/lib/bootm.c diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 1aa397c..a0c8106 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -40,18 +40,6 @@ unsigned long __attribute__((no_instrument_function)) timer_get_us(void) return os_get_nsec() / 1000; } -int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) -{ - if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) { - bootstage_mark(BOOTSTAGE_ID_RUN_OS); - printf("## Transferring control to Linux (at address %08lx)...\n", - images->ep); - reset_cpu(0); - } - - return 0; -} - int cleanup_before_linux(void) { return 0; diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile index 4c1a38d..3c86cc2 100644 --- a/arch/sandbox/lib/Makefile +++ b/arch/sandbox/lib/Makefile @@ -9,3 +9,4 @@ obj-y += interrupts.o +obj-$(CONFIG_CMD_BOOTM) += bootm.o diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c new file mode 100644 index 0000000..8ddf4ef --- /dev/null +++ b/arch/sandbox/lib/bootm.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) +{ + if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) { + bootstage_mark(BOOTSTAGE_ID_RUN_OS); + printf("## Transferring control to Linux (at address %08lx)...\n", + images->ep); + reset_cpu(0); + } + + return 0; +}