From patchwork Sat Jun 8 22:42:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 249991 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com 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 1CAEA2C008A for ; Sun, 9 Jun 2013 08:51:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DCEF4A135; Sun, 9 Jun 2013 00:51:13 +0200 (CEST) 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 7BHMU6GKgyOH; Sun, 9 Jun 2013 00:51:13 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 53C2D4A140; Sun, 9 Jun 2013 00:50:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 929364A134 for ; Sun, 9 Jun 2013 00:50:38 +0200 (CEST) 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 aiGTfMHi3U4T for ; Sun, 9 Jun 2013 00:50:32 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by theia.denx.de (Postfix) with ESMTPS id C58B74A11E for ; Sun, 9 Jun 2013 00:50:12 +0200 (CEST) Received: by mail-ea0-f179.google.com with SMTP id b15so3288001eae.24 for ; Sat, 08 Jun 2013 15:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=/I9o1NuM9JuKqJxjDSb29kRn6hKzpr9Q2Ofy+suNSsE=; b=u3VeZNHMmSaPxQ1nKNyOSrf3OmN832YFVXbrfBov6eKR/+RMF4wFyVT5VN2JoHo9EZ 8FP4JG4kFZ9744aEI7PnL6KB2Iw2FQlZTZRYT/SiKItvqPXhqAHAJGWLIcf3z9jiYva/ S82ZzncV35IQh18wZdECGIJqNsUhifn680+zeCnRP1h9j0GS0S6tsWVqjXr5Wuycnhgv JRmtzD319DebrpuvPUTE5/zdkJFpo2BcomAILx04OJkECs1WeDCsAJ2kDgLC2pxKqrM3 8Ow8MafpXPZZsq1G6+TI45GiNQRrT+eYkd7ri8RPmIK2Ie84oforjoShXyDOzXvcm9cK TEog== X-Received: by 10.15.41.196 with SMTP id s44mr4448532eev.138.1370731383645; Sat, 08 Jun 2013 15:43:03 -0700 (PDT) Received: from workstation.zombienet.local (p5DDCAFD5.dip0.t-ipconnect.de. [93.220.175.213]) by mx.google.com with ESMTPSA id u7sm10052133eef.14.2013.06.08.15.43.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 15:43:03 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 9 Jun 2013 00:42:49 +0200 Message-Id: <1370731370-32767-11-git-send-email-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370731370-32767-1-git-send-email-daniel.schwierzeck@gmail.com> References: <1370731370-32767-1-git-send-email-daniel.schwierzeck@gmail.com> Subject: [U-Boot] [PATCH 10/11] MIPS: bootm: add YAMON style Linux preparation/jump code for Qemu Malta 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Gabor Juhos Signed-off-by: Daniel Schwierzeck --- arch/mips/lib/bootm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 68b57d7..1dc4e73 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -39,6 +39,12 @@ DECLARE_GLOBAL_DATA_PTR; #define need_linux_env 1 #endif +#if defined(CONFIG_QEMU_MALTA) +#define board_is_qemu_malta 1 +#else +#define board_is_qemu_malta 0 +#endif + static int linux_argc; static char **linux_argv; static char *linux_argp; @@ -174,7 +180,12 @@ static void linux_env_set(const char *env_name, const char *env_val) strcpy(linux_env_p, env_name); linux_env_p += strlen(env_name); - *linux_env_p++ = '='; + if (board_is_qemu_malta) { + linux_env_p++; + linux_env[++linux_env_idx] = linux_env_p; + } else { + *linux_env_p++ = '='; + } strcpy(linux_env_p, env_val); linux_env_p += strlen(env_val); @@ -225,6 +236,9 @@ static void boot_prep_linux_legacy(bootm_headers_t *images) cp = getenv("eth1addr"); if (cp) linux_env_set("eth1addr", cp); + + if (board_is_qemu_malta) + linux_env_set("modetty0", "38400n8r"); } static void boot_prep_linux(bootm_headers_t *images) @@ -237,15 +251,19 @@ static void boot_jump_linux(bootm_headers_t *images) { typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong); kernel_entry_t kernel = (kernel_entry_t) images->ep; + ulong linux_extra = 0; debug("## Transferring control to Linux (at address %p) ...\n", kernel); bootstage_mark(BOOTSTAGE_ID_RUN_OS); + if (board_is_qemu_malta) + linux_extra = gd->ram_size; + /* we assume that the kernel is in place */ printf("\nStarting kernel ...\n\n"); - kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, 0); + kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, linux_extra); } int do_bootm_linux(int flag, int argc, char * const argv[],