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 84005C4338F for ; Sun, 15 Aug 2021 18:18:35 +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 0F80961214 for ; Sun, 15 Aug 2021 18:18:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F80961214 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 97FF682E9E; Sun, 15 Aug 2021 20:17:43 +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="ApNVMbwP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D1D2B82CDA; Sun, 15 Aug 2021 20:17:26 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 2F91A81BC8 for ; Sun, 15 Aug 2021 20:17:17 +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-x42d.google.com with SMTP id f5so20474875wrm.13 for ; Sun, 15 Aug 2021 11:17:17 -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=gF9wxpWZ6ja+0FVdkbl3XjqW+rBoSCVYjjqZ6NfPCvI=; b=ApNVMbwPJJFFAdiH2xE3eXz4fIcnxEcRHIeOkctKNDac5kWGlED4k+XO53uX7eT/vU G8uIInR0LJojgXV23pkoveQQBXRIritAgeSHRoiOK37AobZlzzm+3/oRSDKWo+a+RhTo IGu0gGynim8HYoh/mErbjDSfjlVemlU9JoWcP5Kd22alkgxBW/KLdBgpMv8CRbtzrzY/ ygfZL7BcvAz/GfaTNI3Ia49esNFSLtGICudqOo5P+uVly44aHh2QuqkiLdfZ2lQrnapp lGOe10FD3I5yeJQw2ybUw6OXaeZoXhpjy++6L/3oCP5xpdVxwYOoQvWXIzKfap2qIMuz /YUA== 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=gF9wxpWZ6ja+0FVdkbl3XjqW+rBoSCVYjjqZ6NfPCvI=; b=gzE4tmaJol852/26VJhYu11SkBTt8WcP1DOIwvf0hzP+NjjDbvxyrPGP2592wrkpcw z/MVtp6hhBWC898LZY+MxYDjqOxRezL/gv01ZiBcvMLhertbrZWSkyIfN7pTp/MgACxx Nf0nR41sgXXZ48EH391AQ8byT/faNcqkuUrE1eL/V7a/OFj6N37n92mHdYFxKBkoXwYn WbP6VsBtApuBDHyQVvX3WxpdvIalUR1DSRsrPUXKP6ILObHLAyB75mkTk85+L+aM+pGk sgMxLmv8HDNZYu2E8Cp1OlmXvvcNUISd8hzRhFqLS0x4DCv47zVx2SNrJr9Kn4aBngY+ 8xRw== X-Gm-Message-State: AOAM531cbDsRonTKaA1jjL9MS5v+aLN+ASCsC4v3Ar+YZ2dyBB6oTgcQ bY1o6ZeQjD+70inOqO65w8WK1StNguJvbw== X-Google-Smtp-Source: ABdhPJyAO/mBp4Lfcj2nibKsKX2Zk6dzrpphfXV4OFwiEX/NQ6MUPP9c9Pup7LTIOGkDv60B+n5Wmw== X-Received: by 2002:a5d:6e12:: with SMTP id h18mr14500428wrz.236.1629051436740; Sun, 15 Aug 2021 11:17:16 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 11:17:16 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Simon Goldschmidt , Thomas Chou , Tom Rini Subject: [PATCH 07/14] lmb: nios2: Add arch_lmb_reserve() Date: Sun, 15 Aug 2021 20:13:07 +0200 Message-Id: <20210815181314.132330-7-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 Add arch_lmb_reserve() implemented using arch_lmb_reserve_generic(). It is rather likely this architecture also needs to cover U-Boot with LMB before booting Linux. Signed-off-by: Marek Vasut Cc: Simon Goldschmidt Cc: Thomas Chou Cc: Tom Rini --- arch/nios2/lib/bootm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index 5037467151..3cb59bd977 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -10,6 +10,9 @@ #include #include #include +#include + +DECLARE_GLOBAL_DATA_PTR; #define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */ @@ -60,3 +63,16 @@ int do_bootm_linux(int flag, int argc, char *const argv[], return 1; } + +static ulong get_sp(void) +{ + ulong ret; + + asm("mov %0, sp" : "=r"(ret) : ); + return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ + arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096); +} -- 2.30.2