From patchwork Mon Mar 18 06:12:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Stallion X-Patchwork-Id: 228378 X-Patchwork-Delegate: wd@denx.de 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 94C4F2C00BE for ; Mon, 18 Mar 2013 17:59:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC5454A037; Mon, 18 Mar 2013 07:59:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 7f7temNoX9aA; Mon, 18 Mar 2013 07:59:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F33CB4A03C; Mon, 18 Mar 2013 07:58:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA4D04A02E for ; Mon, 18 Mar 2013 07:19:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 lMKc58lMunH4 for ; Mon, 18 Mar 2013 07:19:24 +0100 (CET) X-Greylist: delayed 391 seconds by postgrey-1.27 at theia; Mon, 18 Mar 2013 07:19:21 CET 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 mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by theia.denx.de (Postfix) with ESMTPS id 9B06A4A02A for ; Mon, 18 Mar 2013 07:19:21 +0100 (CET) Received: by mail-pd0-f175.google.com with SMTP id r11so728778pdi.20 for ; Sun, 17 Mar 2013 23:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=yXppzbDHHgRaVS57UHhh+AVKkLJzYhe18t+mpK80DtU=; b=0HvCGUL56L33V7OT6GkmEcLrONiBtbetRz2/mPgSEWcmewXobwM26LIu0o8YGOPQ59 4c8LRwZ2Bq0Kd8cRV5ygWMjv7efOcEpbikMEmvGWDTZNuAUcjsU4t916vmu7Gl7pSykd 8IDAQu00nd9JZpEAQ1ukNcgivE1X1h+5+2Rs2NYQB/1utXmGBDw0e9KjsId4mqYeTcGw 8t93YjU19RDdrL+MXBvlNSJr2xLwJ1FyXiywpi7wivPAOpC9zfiegrCmevseF71pHsaF U4X0jWwVDtgSG/MXbv6dwKwzvfGEiH1KwflYbND3aK7JZbla6G/9XRsymyE8mNHqrUdt RHQg== MIME-Version: 1.0 X-Received: by 10.68.178.1 with SMTP id cu1mr11264902pbc.45.1363587166072; Sun, 17 Mar 2013 23:12:46 -0700 (PDT) Received: by 10.68.223.202 with HTTP; Sun, 17 Mar 2013 23:12:45 -0700 (PDT) Date: Sun, 17 Mar 2013 23:12:45 -0700 Message-ID: From: Steven Stallion To: u-boot@lists.denx.de X-Mailman-Approved-At: Mon, 18 Mar 2013 07:58:56 +0100 X-Content-Filtered-By: Mailman/MimeDel 2.1.11 Subject: [U-Boot] [PATCH] bootm: Add support for Plan 9 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From 902b728b8bcacecf9e2ea7854cc1e3777c2fd4e3 Mon Sep 17 00:00:00 2001 Apologies for the second patch; I did not realize at the time that modifications were needed for bootm to function correctly. --- common/cmd_bootm.c | 39 +++++++++++++++++++++++++++++++++++++++ include/config_defaults.h | 1 + 2 files changed, 40 insertions(+) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 5d2ce00..7438469 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -128,6 +128,9 @@ static boot_os_fn do_bootm_rtems; #if defined(CONFIG_BOOTM_OSE) static boot_os_fn do_bootm_ose; #endif +#if defined(CONFIG_BOOTM_PLAN9) +static boot_os_fn do_bootm_plan9; +#endif #if defined(CONFIG_CMD_ELF) static boot_os_fn do_bootm_vxworks; static boot_os_fn do_bootm_qnxelf; @@ -154,6 +157,9 @@ static boot_os_fn *boot_os[] = { #if defined(CONFIG_BOOTM_OSE) [IH_OS_OSE] = do_bootm_ose, #endif +#if defined(CONFIG_BOOTM_PLAN9) + [IH_OS_PLAN9] = do_bootm_plan9, +#endif #if defined(CONFIG_CMD_ELF) [IH_OS_VXWORKS] = do_bootm_vxworks, [IH_OS_QNX] = do_bootm_qnxelf, @@ -1628,6 +1634,39 @@ static int do_bootm_ose(int flag, int argc, char * const argv[], } #endif /* CONFIG_BOOTM_OSE */ +#if defined(CONFIG_BOOTM_PLAN9) +static int do_bootm_plan9(int flag, int argc, char * const argv[], + bootm_headers_t *images) +{ + void (*entry_point)(void); + + if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) + return 1; + +#if defined(CONFIG_FIT) + if (!images->legacy_hdr_valid) { + fit_unsupported_reset("Plan 9"); + return 1; + } +#endif + + entry_point = (void (*)(void))images->ep; + + printf("## Transferring control to Plan 9 (at address %08lx) ...\n", + (ulong)entry_point); + + bootstage_mark(BOOTSTAGE_ID_RUN_OS); + + /* + * Plan 9 Parameters: + * None + */ + (*entry_point)(); + + return 1; +} +#endif /* CONFIG_BOOTM_PLAN9 */ + #if defined(CONFIG_CMD_ELF) static int do_bootm_vxworks(int flag, int argc, char * const argv[], bootm_headers_t *images) diff --git a/include/config_defaults.h b/include/config_defaults.h index d023c63..567b46c 100644 --- a/include/config_defaults.h +++ b/include/config_defaults.h @@ -12,6 +12,7 @@ /* Support bootm-ing different OSes */ #define CONFIG_BOOTM_LINUX 1 #define CONFIG_BOOTM_NETBSD 1 +#define CONFIG_BOOTM_PLAN9 1 #define CONFIG_BOOTM_RTEMS 1 #define CONFIG_GZIP 1