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 2D7F8C433F5 for ; Fri, 10 Sep 2021 20:49:28 +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 A7EFF61208 for ; Fri, 10 Sep 2021 20:49:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A7EFF61208 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 531538373B; Fri, 10 Sep 2021 22:49:08 +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="l/pwCGBx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B81A783701; Fri, 10 Sep 2021 22:48:42 +0200 (CEST) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 730FD83715 for ; Fri, 10 Sep 2021 22:47:50 +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-x430.google.com with SMTP id v10so4361108wrd.4 for ; Fri, 10 Sep 2021 13:47:50 -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=nmyk2dBayEh7QBnH8phgwGp9J8W/RFqNfRRhbTw5E1o=; b=l/pwCGBxgRJbMo1JQRRKr470rUY4wSioc8OLK0C1NUWr/ycbdkpUcjYvLZs9oiFrfB faJTbTuiWFW57Dnbe8ILoBQy5W2W1/FdqW7DlZTcP+JtRgQWZLPpGJeqHMoNhn54ZmEd tcUiFPDPs3G6gyQT0c70+iWBi5Y18MoV63WGxdx/3iICnADQ9djVECIe/FQAWhtopgcH gVeQYoRjT04OgEgYgOMlGn9HoyTtNyue4EwsyNKvcqEIbNv9ZeZ6h8m+UhwIz9IW0Kyp F8lmtOgm6t0qdb2XijcRoYO4dXV7cGgNz8KLlcnBmaMit+a2Q5AIvO+01Q9zazlJaxnl tskA== 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=nmyk2dBayEh7QBnH8phgwGp9J8W/RFqNfRRhbTw5E1o=; b=SnVrBf4jkAM3JGo3vuIOjJy9OZ54VJfFTL0FWjppWpR5EDx5776lIbkl9wzmPkmI1W Zztg2XKftZkW/YaF4KJHO0rZ4MpZtKHmLvWoi9GMQwDS06vCB2Tv5SzTDUUg1RTjyYr6 9dH2ZeZAIgV3/ZXYOjYbnU8lVj9giDD8xEtA+LCX66zJ/fT2Jo/fSCOERlyPQkYd04MF cc6B8JNvvBoK3zi9bZhEvI4hS8fTuEEcTDJu4OAzxU6ctqxuv0o2Syadxcofc61zmVVL AIL2AmaZfAtFy2EwndvCF7/YtOj7Xk344DiKxyMXU8OokvjMyfciGJXBFeo127XKExu/ R+4w== X-Gm-Message-State: AOAM533/r6lZpcU3Fd8+2OyD6jHgGBe3RENACQpDrkoNmfOa5TXfdouJ NyTIgfn7/a9QyVeQLqmaNqMPkfeQPP0xVQ== X-Google-Smtp-Source: ABdhPJywK33oDoOBTpzOpkqRZSf9qva98DcBy7sSI6IpOA4jXlvG49mcYouuXYq18EqTYYv5tpEofg== X-Received: by 2002:a5d:43c8:: with SMTP id v8mr223083wrr.68.1631306870092; Fri, 10 Sep 2021 13:47:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 13:47:49 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Rick Chen , Atish Patra , Leo , Simon Goldschmidt , Tom Rini Subject: [PATCH 09/12] lmb: riscv: Add arch_lmb_reserve() Date: Fri, 10 Sep 2021 22:47:15 +0200 Message-Id: <20210910204718.17765-9-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 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. Reviewed-by: Rick Chen Signed-off-by: Marek Vasut Cc: Atish Patra Cc: Leo Cc: Rick Chen Cc: Simon Goldschmidt Cc: Tom Rini --- V2: Add RB from Rick --- arch/riscv/lib/bootm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 8dd1820540..ff1bdf7131 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -135,3 +135,16 @@ int do_bootm_vxworks(int flag, int argc, char *const argv[], { return do_bootm_linux(flag, argc, argv, images); } + +static ulong get_sp(void) +{ + ulong ret; + + asm("mv %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.33.0