From patchwork Sat Jun 8 22:42:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 249986 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 8055C2C008A for ; Sun, 9 Jun 2013 08:49:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8373D4A0AD; Sun, 9 Jun 2013 00:49:05 +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 mtEfdymigzcO; Sun, 9 Jun 2013 00:49:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 718714A096; Sun, 9 Jun 2013 00:48:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 805E34A058 for ; Sun, 9 Jun 2013 00:48:43 +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 Ddr6rx66qr6U for ; Sun, 9 Jun 2013 00:48:38 +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 mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by theia.denx.de (Postfix) with ESMTPS id 87F094A08F for ; Sun, 9 Jun 2013 00:48:25 +0200 (CEST) Received: by mail-ea0-f180.google.com with SMTP id k10so4462750eaj.39 for ; Sat, 08 Jun 2013 15:48:24 -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=Q6f0jDp7pI7w+2wHg2ZKOOQLAo9bPcNl/KZgg3P89pM=; b=uYJTNttWbOX2diFW9otElZJpOKpBSRD/cCekXJoE4IHIsf0eR3Az3OFmTQH/Iwuyu6 XX08ieRFDcQxyVaUeT7u2qlR6oJ1dTtFNDKJtIYtK6OwLrHY0IHLUaMcrgNgZmI9wbyU W0ICRN4pcmxxj9z/nlB9OPmCNXRTk2NYjTWVj+DKllDXDyb2J7obvRrbWztDANnw1bGh //SZ3fZvrb0yyoiw8CHYsIxM4zP9ZZZpBRsVLXP8WHHiCPm0KRoOCCm9Vl8BEhgLRSOb aaZRxqQPENWRB9arvvHPBPurZOh8bdyoiE3tFMZbH4lPvlnF9/fRiZsXeim60Ii8QweB J7Vw== X-Received: by 10.14.98.194 with SMTP id v42mr4561104eef.61.1370731382165; Sat, 08 Jun 2013 15:43:02 -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.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 15:43:01 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 9 Jun 2013 00:42:47 +0200 Message-Id: <1370731370-32767-9-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 08/11] MIPS: bootm: automatically initialise kernel cmdline variable 'mem' 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 This replaces the passing of memory size via the traditional Linux environment. This is required for recent Linux kernels. Signed-off-by: Daniel Schwierzeck --- arch/mips/lib/bootm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 741e088..796d405 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -102,9 +102,15 @@ static void linux_cmdline_dump(void) static void boot_cmdline_linux(bootm_headers_t *images) { const char *bootargs, *next, *quote; + char buf[12]; + unsigned int mem = gd->ram_size >> 20; linux_cmdline_init(); + /* append mem */ + sprintf(buf, "mem=%uM", mem); + linux_cmdline_set(buf, strlen(buf)); + bootargs = getenv("bootargs"); if (!bootargs) return;