Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D160EC4338F for ; Sun, 15 Aug 2021 18:18:23 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27E4561214 for ; Sun, 15 Aug 2021 18:18:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 27E4561214 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF9D082E67; Sun, 15 Aug 2021 20:17:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TPkKkMLI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB1D782CDA; Sun, 15 Aug 2021 20:17:24 +0200 (CEST) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C6E182959 for ; Sun, 15 Aug 2021 20:17:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@gmail.com Received: by mail-wr1-x42a.google.com with SMTP id r6so20556742wrt.4 for ; Sun, 15 Aug 2021 11:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vZ86bzbeji1g7l3uvSluUJ8C33BAysxFcSSZ3QQnAlE=; b=TPkKkMLIU5luC5hGPmqtLQ7dN7qBGspUEAkRCabldF1PreUPTU0MpEKkuBmQ4CuxCL cAHIRhg/vVoVXa2qMY/6r5N1E7hscGkyzILyJpR13MjX8WJwoMAh05640Bus8ZKiSlH0 k2HE/kiGUxiRHwNRt9HnFukI6/MqV0CXm17KL2EBCvlGckVT8sTLmog64IzdzJIxm08S S+S7wb95U4mQTycRaJfpu8h6ewvIaBUSr9ZW23m/QGhcEUYNbsmTUY9pm5IkuwzHm2yf 0jwX4woi0ijSycWxyGD0iD1Jxq+4oH7MaZ8ZiTbRhFHMqf/vgpsz1u5RORSQmE673g9j MddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vZ86bzbeji1g7l3uvSluUJ8C33BAysxFcSSZ3QQnAlE=; b=IQ7JqyZjwiD5ht5hxcrdTpSH9H9+4RGgobQWeEmZWUzbI4nSWAWizmVvTB5xl3wt/D eyjBJ3SpA0vFEtUmSBWcKWtL/uE7Jylgw5DTTfreDsF9hXyifOV5AxWTGatFsRIx+zYu 3rRParyDXp9rvjCLHLGgapTpBQOhOXihUKe+OxbpXcZOTFmjC/f+YmVfRFIxpFnplltj S6u1vAn1rl8lzLlNhsz1dumdxHJtjE0vpOySdj1XshCftBgcmQoJvtHONNqthjrS6pjt 5LKajmrL5X9JJH0x5jvnHtUl+IN1tWZD2c9w2NghuMjX07ewsuMLRfBBPoa7DzpUqpl5 Rgdg== X-Gm-Message-State: AOAM530ZJqhm+WcsACKjhMHw2qqew7hE8rxx+RjCmhypydMFZU9sHkbN HLaJwXHUuPSugCsBdwuicHOpSTHIP0wUvQ== X-Google-Smtp-Source: ABdhPJxgSXRogjLUOlMYdx+H0gqsrh1xmGWHhLP4HcR5bu0KwNmzt4qOin5xePRe2aiX3jNVh8FZrQ== X-Received: by 2002:adf:e6cc:: with SMTP id y12mr15033405wrm.200.1629051434064; Sun, 15 Aug 2021 11:17:14 -0700 (PDT) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz. [89.176.112.137]) by smtp.gmail.com with ESMTPSA id i8sm5920343wrv.70.2021.08.15.11.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 11:17:13 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Glass , Simon Goldschmidt , Tom Rini Subject: [PATCH 04/14] lmb: Always compile arch_lmb_reserve() into U-Boot on arc Date: Sun, 15 Aug 2021 20:13:04 +0200 Message-Id: <20210815181314.132330-4-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210815181314.132330-1-marek.vasut+renesas@gmail.com> References: <20210815181314.132330-1-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The arch_lmb_reserve() is called by lib/lmb.c lmb_reserve_common() even if CMD_BOOTM is not enabled. However, the arc variant of arch_lmb_reserve() is only compiled in if CMD_BOOTM is enabled. This currently does not trigger build error, because there is an empty weak implementation of arch_lmb_reserve(), however that is not the function that should be used on ar. Fix this by moving the arch_lmb_reserve() implementation into common code and always compile it in. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Simon Goldschmidt Cc: Tom Rini --- arch/arc/lib/bootm.c | 30 ------------------------------ arch/arc/lib/cache.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/arch/arc/lib/bootm.c b/arch/arc/lib/bootm.c index 8a8d394a5f..41408c2b46 100644 --- a/arch/arc/lib/bootm.c +++ b/arch/arc/lib/bootm.c @@ -8,42 +8,12 @@ #include #include #include -#include #include #include #include DECLARE_GLOBAL_DATA_PTR; -static ulong get_sp(void) -{ - ulong ret; - - asm("mov %0, sp" : "=r"(ret) : ); - return ret; -} - -void arch_lmb_reserve(struct lmb *lmb) -{ - ulong sp; - - /* - * Booting a (Linux) kernel image - * - * Allocate space for command line and board info - the - * address should be as high as possible within the reach of - * the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused - * memory, which means far enough below the current stack - * pointer. - */ - sp = get_sp(); - debug("## Current stack ends at 0x%08lx ", sp); - - /* adjust sp by 4K to be safe */ - sp -= 4096; - lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp)); -} - static int cleanup_before_linux(void) { disable_interrupts(); diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c index f807cd83d6..4ba180482c 100644 --- a/arch/arc/lib/cache.c +++ b/arch/arc/lib/cache.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -820,3 +821,32 @@ void sync_n_cleanup_cache_all(void) __ic_entire_invalidate(); } + +static ulong get_sp(void) +{ + ulong ret; + + asm("mov %0, sp" : "=r"(ret) : ); + return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ + ulong sp; + + /* + * Booting a (Linux) kernel image + * + * Allocate space for command line and board info - the + * address should be as high as possible within the reach of + * the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused + * memory, which means far enough below the current stack + * pointer. + */ + sp = get_sp(); + debug("## Current stack ends at 0x%08lx ", sp); + + /* adjust sp by 4K to be safe */ + sp -= 4096; + lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp)); +} -- 2.30.2