From patchwork Wed Sep 11 07:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1160707 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="NS5/OP30"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Stnk2pKYz9s00 for ; Wed, 11 Sep 2019 17:29:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 2697FC21D8E; Wed, 11 Sep 2019 07:28:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 65FB7C21DF3; Wed, 11 Sep 2019 07:28:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8F90AC21DF3; Wed, 11 Sep 2019 07:28:34 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 8E0D3C21CB1 for ; Wed, 11 Sep 2019 07:28:32 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id r195so2186037wme.2 for ; Wed, 11 Sep 2019 00:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=k4+yOIyyjR+bLo3RtOUa880T2Szkw6EpL3AurSisB44=; b=NS5/OP30+9vV5lq09efwH3MVi9ChP60tZ6q6Dq4MyQAQEJOYuqm1C0DsxxXj+1/OYp B/n9tO7wkODShL0FcShQUwVXyLqqDj3ON6Bfmq6P3PRo6Ve9fjM9uLh+R5Ew5uyIZ+fx PBe+NLRKDBPGuJ8nzwBe6Z7SuyJTarspe5h5A2JtuGqsMBD+aT4LKUcchYOL+mBUciuB YCFdmqSqFnaXmhTQ9T27KIlrJv17byv263OeZ1P5XqynNnfex33ocEPm7MMj/FgMLLQM SyzRivhOumVlBTCeGvkqsSCE9ANBEIN73BwREdTQoT/Uxdd+wL/dsGh4xSPYGH09Couf cqRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=k4+yOIyyjR+bLo3RtOUa880T2Szkw6EpL3AurSisB44=; b=GOfiNP13WLKLOrYhohMYzXxEtacWx3LhbGF5SULX9riMAUbB2PYHeoKI/+/L6fpo7W aiNqg8SikbHyV1Hx46FMgZZUFbndk+n8e7b2rC1Eo6xubhgn0OKduwF7ZO9Mi9MOHh8O 3q/EWZUltKvUX2dl7vY6ZZtxlGsjP+5Nt9E8xYsj4+F/ClIZQfiiSduqIB0Kt3ipQaD1 zfE12BV7mqGw54UTlbkC0TU2Mk5a4JxX+Byn/Tqd3ZgHHkl/LVnxIF7ZjsXBn4cEOuvy NWa7gYFaRSrDqx2kpcPchqfEklSqapT5ACwi5TafpkLDzrJYub7QPUtIYS2XHCx/6mi/ jQxQ== X-Gm-Message-State: APjAAAXbKe+zS19+bsLl3/1pwOy+MtgQ+6JgaZ3iWwHU5j/fBw3ryOAE RIMRtldwO52JV9rVfH+tTNSJsC3xWe8= X-Google-Smtp-Source: APXvYqy6Tp5HflLg9M3J7eRMGIm70EIOzYd1UwcuMAq+89kDZazOR6qu3cRGSVLoGc0zB/CROw6H4Q== X-Received: by 2002:a7b:c40f:: with SMTP id k15mr2482322wmi.99.1568186911950; Wed, 11 Sep 2019 00:28:31 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id r15sm1770266wmh.42.2019.09.11.00.28.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2019 00:28:31 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Wed, 11 Sep 2019 09:28:27 +0200 Message-Id: <24e1c9d86dbd7ca3a271f8b27abca49e93c40365.1568186905.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [U-Boot] [PATCH 1/2] arm64: versal: Set initrd_high to as high as possible X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Siva Durga Prasad Paladugu This patch is setting up the initrd_high to as high as possible by leaving max stack size for u-boot so that bigger rootfs can also be loaded by u-boot for booting kernel. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- arch/arm/Kconfig | 16 ++++++++++++++++ board/xilinx/versal/board.c | 6 ++++++ include/configs/xilinx_versal.h | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a93138aa0ada..33cb3e065830 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -462,6 +462,22 @@ config TPL_USE_ARCH_MEMSET Such implementation may be faster under some conditions but may increase the binary size. +config SET_STACK_SIZE + bool "Enable an option to set max stack size that can be used" + default y if ARCH_VERSAL + help + This will enable an option to set max stack size that can be + used by u-boot. + +config STACK_SIZE + hex "Define max stack size that can be used by u-boot" + depends on SET_STACK_SIZE + default 0x4000000 if ARCH_VERSAL + help + Defines Max stack size that can be used by u-boot so that the + initrd_high will be calculated as base stack pointer minus this + stack size. + config ARM64_SUPPORT_AARCH32 bool "ARM64 system support AArch32 execution state" depends on ARM64 diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index a2b00aa0b662..2b4edd8738b4 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -12,6 +12,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -88,6 +89,7 @@ int board_late_init(void) const char *mode; char *new_targets; char *env_targets; + ulong initrd_hi; if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { debug("Saved variables - Skipping\n"); @@ -183,6 +185,10 @@ int board_late_init(void) env_set("boot_targets", new_targets); + initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; + initrd_hi = round_down(initrd_hi, SZ_16M); + env_set_addr("initrd_high", (void *)initrd_hi); + return 0; } diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index 296f4502c652..1e0951c1d92d 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -65,7 +65,6 @@ #define ENV_MEM_LAYOUT_SETTINGS \ "fdt_high=10000000\0" \ - "initrd_high=10000000\0" \ "fdt_addr_r=0x40000000\0" \ "pxefile_addr_r=0x10000000\0" \ "kernel_addr_r=0x18000000\0" \