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 0CA02C433F5 for ; Fri, 10 Sep 2021 20:50:03 +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 5B308610C9 for ; Fri, 10 Sep 2021 20:50:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B308610C9 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 7217783741; Fri, 10 Sep 2021 22:49:21 +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="lrGOZNd9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96F6E83703; Fri, 10 Sep 2021 22:48:49 +0200 (CEST) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 CCE938371B for ; Fri, 10 Sep 2021 22:47: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=marek.vasut@gmail.com Received: by mail-wr1-x42f.google.com with SMTP id n5so4344748wro.12 for ; Fri, 10 Sep 2021 13:47:52 -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=sv1pqRhBediFuk+L0BBmKy/xckoMZOgCtV1bLcQfFrs=; b=lrGOZNd9eZOknXaQHYELkZVLck3q5YsSt6zcBi533XfZAdn/2Iv244BBJb5gdLVZhb Qa2qBdv3qJSz8RMT2VNoqBUCl8Cy/P6XoPPEzwGKnyeZMkU5FoNBBLsZGpGbVLdQLkUV i7LTJi3thOocQpjPWBz3ATTCvdfEMEhDbY+AQiRIJs35BJziVwmElb4ils8uME8zrwM1 z0dP7FVp8XCyVaups8Apds94zPko45w4teGcwi5wkOW2pHPNoTtrsW3eQNyrEkdeVlyr WkNnMi02mMK8kOwb2W8Jtw53K9DiGWIEekNTO+IWKHHzwT/SQX8/sYpMhzSwsqz0MbS0 cmdg== 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=sv1pqRhBediFuk+L0BBmKy/xckoMZOgCtV1bLcQfFrs=; b=DZU64iD7bfvllE3+LxUKS3sRdXYud2tYTMtj91BINbp7DyMkRQITbBd2ptxwtFI9tM Gk+8hkHWwHrHSje/qIO3firV217pCc21k1IJcVV4SOq4xX0APpoE2I4anrdYRrJcs0rg V5LfzCP58tEmnZt/wKydWgfNjjdjuZLRZiwAlCO3NnfxECFqAdbXH0M/IxW6udiyCoMw PNoop4RMJzSl09ODZIqs7pWYD/dkMdnJnx2GT4Ylxdw0hpAAUyq4F7o3Vos75yfdBatc CV7FDE5wbanV2EPqkpKnps5ahr4f+y4tOBDWWELC3ilvEGR9aigO5enXQ/UurpdggG6U z0cA== X-Gm-Message-State: AOAM531wmQy8NabupGop1a4SYhJwrD7q+Oj1NhIz2lFb+HKBPtJsBKfD IJB6sIgMcTP7xV0MegxkvScMo1aweJpBCw== X-Google-Smtp-Source: ABdhPJytg3ovPExzyKSNCqtBEA7g9T88/wIiPHww9NLSZjO33V9zX+GYi0AL+vLjSOa38bNclg1qnA== X-Received: by 2002:a5d:4e51:: with SMTP id r17mr11765411wrt.308.1631306872409; Fri, 10 Sep 2021 13:47:52 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 13:47:51 -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 12/12] lmb: x86: Add arch_lmb_reserve() Date: Fri, 10 Sep 2021 22:47:18 +0200 Message-Id: <20210910204718.17765-12-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. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Simon Goldschmidt Cc: Tom Rini --- V2: No change --- arch/x86/lib/bootm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 733dd71257..667e5e689e 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -223,3 +223,21 @@ int do_bootm_linux(int flag, int argc, char *const argv[], return boot_jump_linux(images); } + +static ulong get_sp(void) +{ + ulong ret; + +#if CONFIG_IS_ENABLED(X86_64) + ret = gd->start_addr_sp; +#else + asm("mov %%esp, %0" : "=r"(ret) : ); +#endif + + return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ + arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096); +} -- 2.33.0