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 3919FC4338F for ; Sun, 15 Aug 2021 18:19:09 +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 A93226124C for ; Sun, 15 Aug 2021 18:19:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A93226124C 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 8072982EEA; Sun, 15 Aug 2021 20:17:52 +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="cXqgOHVj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 224B882C91; Sun, 15 Aug 2021 20:17:29 +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 D40E182937 for ; Sun, 15 Aug 2021 20:17:18 +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 k4so10195406wms.3 for ; Sun, 15 Aug 2021 11:17:18 -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=7wPl2f3hpXWwYUbjttJoOoVgwryY4T3Axe3mdQ4BJ04=; b=cXqgOHVjoLm74oTdGaq/hZvq/4ibL7IwLbuvx5a1QH0n6ChJ88d9DmmzdjtMmzfbLQ 8Yt+7XejvbgYsCvn1JYEB51A2bJfefc/xN696zderxF5Wmh+cZAAc6bKNat+D0PW5wP9 7WSsCC1soesBbAHi9/+soz5nXmUyVq/x4CHrta1eG17Wn0xFZxxHWpenMfvEFEu1LRl4 Cgnm6XwEaHXtqMiT5y+NEXJwXQCULx6L+8hsJp0oRevqeE/6CDrZJck+/S/jDSkalqdc E0j0ICAm1MrZqebycTGRSvbrstyjctfvYp4EHPqIQ21WcfGuSowUu+He0pdH6P8X4grB +cNw== 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=7wPl2f3hpXWwYUbjttJoOoVgwryY4T3Axe3mdQ4BJ04=; b=EC6IA5TJS6ZIoLbzrPpGFYWa6dXecU64deNl/bJBBdC9lwx7y0+igLWNXzcki+V2ub BsW6kUM8n1FzrTTfdmjLMNrkM5LU4CVXBskWmwvpo+sDtJkgaT/cppCA4Q5TOvCbuAgC XAAVKBjh+o/Z7xqW4wnjnZcdzt+E1yn+dKU4SJEyGzAQNSqMJ0rEW7a/wchlKJAjeRav PlRb8eQLS32mRQXhZg7dvyBFb5BPi4h5xJzAMZ19ZJg0FmPLoj3GRbN76WGDyIW+oMEK Xy4c9Giwlm64ge6TPiiFYwXjSNeO7MY724JeAVKqsehKJmObbY5fFouyEC0lkGiojvOY 33Cg== X-Gm-Message-State: AOAM533hD7WKaSidNT3MiN3JnLoKBN/+2pYyH7Wv9wl3xFN2mozjH5v/ +lDDfU+mjfvS4QQcuf0bYXVAlqPmq03gZw== X-Google-Smtp-Source: ABdhPJzeRnV1YWcRVZnMO4cVS94vRTl9FjTlXcVaOf0y0Gg8Fsl2J2ZQZnsBn4sWP2WGv5CZZHmpOg== X-Received: by 2002:a05:600c:21ce:: with SMTP id x14mr12027924wmj.187.1629051438480; Sun, 15 Aug 2021 11:17:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 11:17:18 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Atish Patra , Leo , Rick Chen , Simon Goldschmidt , Tom Rini Subject: [PATCH 09/14] lmb: riscv: Add arch_lmb_reserve() Date: Sun, 15 Aug 2021 20:13:09 +0200 Message-Id: <20210815181314.132330-9-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: Atish Patra Cc: Leo Cc: Rick Chen Cc: Simon Goldschmidt Cc: Tom Rini --- 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.30.2