From mboxrd@z Thu Jan 1 00:00:00 1970 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.7 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 6EE21C433F5 for ; Fri, 10 Sep 2021 20:48:07 +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 722B261205 for ; Fri, 10 Sep 2021 20:48:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 722B261205 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 02B4E83724; Fri, 10 Sep 2021 22:47:55 +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="Wd9pB30t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E4FF783713; Fri, 10 Sep 2021 22:47:48 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 10FE1836FF for ; Fri, 10 Sep 2021 22:47:44 +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-wm1-x32b.google.com with SMTP id k5-20020a05600c1c8500b002f76c42214bso2325728wms.3 for ; Fri, 10 Sep 2021 13:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DF+wttRrP/3sZcl38s1/OJHu8D+Y3wn8vS08EvpOwiA=; b=Wd9pB30t+bMH5wkqfHs5BNA/nlNj6o76MqVk8AdfdN0Qk/CgiY3HLkXHPRbPYfs1Zr sCSWp71J81eammBaiIgTlBwAXYUEUm9wIhoi9FjOVlyezvPtwFhAJ7I/A6Vp+UK9X/xO V7edJsizZWmrCsd+ijYPw5vnXauUL4sWd0xnE1KaKXqSs5GUpCvGI+TKAE4jABwO8zXD 6N9zRre0glPi156+JwszmpDTdik7PWQgiZzE1je2anWzz/G9UrYHdVF/bWTxjhaYOV2Q 5rJEWzoiXFsdUNJonfn9QaGrx4Um7WJ91MOo5vGOvtBQVOcZtWj4n5BZGrRUF7PZRCIt Wc1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DF+wttRrP/3sZcl38s1/OJHu8D+Y3wn8vS08EvpOwiA=; b=tj4XS4Q7wz8fcdLTEYG1Z/dThQiNMrLp76TbJWz9I/GZtgXZr5W4ZQx1ByREnuBWP1 RrSwbErKD1X3qTcQNP/d+DYinv+WpwBXpzacDVI/v3YRKtKPvKkb38e6hF6I4Yv35Afr zDbBDzQiFeeTDaA6YUR6EYfH29hyiRS1xemX9PfEGvFhzsWupLug+LaR3RGwkkYmqcsN OZrWpWs9Eyn+OUQBYXuHXk5z2zUhnC/nXhCPRrZ8b8W0d0QrOQwZcJfXNTnvOrLPN+ks ddD0ZoqIDM3BwLxzttqDpRMHhbJfNLt83A1nGW/ZlM0zbPSonqn1xlrN+X4AhFX+Y0mX 8IVw== X-Gm-Message-State: AOAM532XAmT7tkZtZ6sf8QH+t3nlo8D6ZV8I3lFaocBwxxJ3QuIe13Cm pyvufdudSqTZyC58NwUQTvojXnMhf8/T2Q== X-Google-Smtp-Source: ABdhPJwXvDRIn+nvuHy5slr+1l1ePV2vjoYGLbVozk2P7z99TwL1BJ4MwSgOMAA7D+D2aoHimkFL2g== X-Received: by 2002:a1c:2905:: with SMTP id p5mr10100896wmp.93.1631306863592; Fri, 10 Sep 2021 13:47:43 -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 p11sm5195948wma.16.2021.09.10.13.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 13:47:43 -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 02/12] lmb: Always compile arch_lmb_reserve() into U-Boot on arc Date: Fri, 10 Sep 2021 22:47:08 +0200 Message-Id: <20210910204718.17765-2-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910204718.17765-1-marek.vasut+renesas@gmail.com> References: <20210910204718.17765-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 arc. 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 --- V2: No change --- 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.33.0