From patchwork Sat Jun 8 22:42:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 249990 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 8E99F2C008C for ; Sun, 9 Jun 2013 08:51:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0773A4A173; Sun, 9 Jun 2013 00:51:02 +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 xwQyAPjb11eE; Sun, 9 Jun 2013 00:51:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EBF6E4A13B; Sun, 9 Jun 2013 00:50:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 864814A12E for ; Sun, 9 Jun 2013 00:50:33 +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 a03KtNqgf+CL for ; Sun, 9 Jun 2013 00:50:14 +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-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by theia.denx.de (Postfix) with ESMTPS id 76A044A113 for ; Sun, 9 Jun 2013 00:50:08 +0200 (CEST) Received: by mail-ea0-f169.google.com with SMTP id h15so4512097eak.14 for ; Sat, 08 Jun 2013 15:50:08 -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=XUCbapqQ4vOFP1JWUk6kOQECDxZL4tWmpyKTM+6yvNI=; b=nyGZe+TTvu6A9h3V5lUWfH0sAErRwVi7ob17SoYmz05JXJ8Ays/LzMVkKCKbGchH92 f9pgx62/rB87DgibPL17ZbpXYRhxNVjv9FuaLLw5AYld5XobazTCrjExVzZyBl1u9Cqk K4+oKvdryKBqyzHX1CKcQztM2twazV9+KwwbSEFeyjTxRjJVrEiX96M0fTy15ovlXP4X h0OevrG4w4HIbIcmQ5AgI2iVhPbW+QeIiFWeLJsTNb8MfHtWXdvCiOolhQ1biUDuqHIx yxvqRW7o006WY24h3Onz7NDGP73BzptgteQa/E4/0yDjyJeIhVG9SBeyQlvUwMrHTYZL jdQA== X-Received: by 10.15.54.4 with SMTP id s4mr4599131eew.49.1370731380666; Sat, 08 Jun 2013 15:43:00 -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.42.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 15:43:00 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 9 Jun 2013 00:42:45 +0200 Message-Id: <1370731370-32767-7-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 06/11] MIPS: bootm: make initialisation of Linux environment optional 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 Recent linux kernels do not use that special environment variables anymore. Add an option to disable compilation of that code but keep it for compatibilty with older kernels. Signed-off-by: Daniel Schwierzeck --- README | 6 ++++++ arch/mips/lib/bootm.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README b/README index 33bda8c..1623616 100644 --- a/README +++ b/README @@ -522,6 +522,12 @@ The following options need to be configured: expect it to be in bytes, others in MB. Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes. + CONFIG_DISABLE_ENV_INIT [relevant for MIPS only] + + Disable initialization of traditional environment variables + passed to Linux. Modern kernels only use variables from command + line. + CONFIG_OF_LIBFDT New kernel versions are expecting firmware settings to be diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 304ee53..e13e0d5 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -33,6 +33,12 @@ DECLARE_GLOBAL_DATA_PTR; #define LINUX_MAX_ENVS 256 #define LINUX_MAX_ARGS 256 +#if defined(CONFIG_DISABLE_ENV_INIT) +#define need_linux_env 0 +#else +#define need_linux_env 1 +#endif + static int linux_argc; static char **linux_argv; static char *linux_argp; @@ -201,7 +207,8 @@ static void boot_prep_linux_legacy(bootm_headers_t *images) static void boot_prep_linux(bootm_headers_t *images) { - boot_prep_linux_legacy(images); + if (need_linux_env) + boot_prep_linux_legacy(images); } static void boot_jump_linux(bootm_headers_t *images)