From patchwork Mon Apr 13 20:54:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 460932 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 71BC1140281 for ; Tue, 14 Apr 2015 06:54:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C5F6A747E; Mon, 13 Apr 2015 22:54:49 +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 CNoUFbMP2tVi; Mon, 13 Apr 2015 22:54:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CEDDEA7472; Mon, 13 Apr 2015 22:54:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 753F5A744E for ; Mon, 13 Apr 2015 22:54:40 +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 ZIdvflVvgAFn for ; Mon, 13 Apr 2015 22:54:40 +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 3A568A744C for ; Mon, 13 Apr 2015 22:54:36 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id BF037600759 Received: by dusk.luon.net (Postfix, from userid 1000) id 7E2AD25587; Mon, 13 Apr 2015 22:54:27 +0200 (CEST) From: Sjoerd Simons To: Simon Glass Date: Mon, 13 Apr 2015 22:54:20 +0200 Message-Id: <1428958467-1589-3-git-send-email-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428958467-1589-1-git-send-email-sjoerd.simons@collabora.co.uk> References: <1428958467-1589-1-git-send-email-sjoerd.simons@collabora.co.uk> Cc: Masahiro Yamada , Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 2/9] 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 v4: None Changes in v3: None 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 007ae86..f0dafed 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -49,18 +49,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 75b135c..96761e2 100644 --- a/arch/sandbox/lib/Makefile +++ b/arch/sandbox/lib/Makefile @@ -9,3 +9,4 @@ obj-y += interrupts.o obj-$(CONFIG_PCI) += pci_io.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; +}