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,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 1A532C4338F for ; Sun, 15 Aug 2021 18:19:30 +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 5D9D66124F for ; Sun, 15 Aug 2021 18:19:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5D9D66124F 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 9210282F12; Sun, 15 Aug 2021 20:18:00 +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="rC+JAIbH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B44C882CDA; Sun, 15 Aug 2021 20:17:33 +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 2529582E4A for ; Sun, 15 Aug 2021 20:17: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=marek.vasut@gmail.com Received: by mail-wm1-x32b.google.com with SMTP id u15so10203313wmj.1 for ; Sun, 15 Aug 2021 11:17:21 -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=CJuuFM3bAhp1+62wliN3mVAjwpYo0ZgVJivPNioLhpU=; b=rC+JAIbH6nMjh1rG3IG6uq4hl+jSyOTe4M3pmfxbPs0GP5uD1gMXwY6B+LSR8J6OH+ vpl3bnTRU9GHsEz7rGrvG14Sfm+SkUl4UOqDug+ObDJkJ/3r6rzZv+lt+MH+CoOZ5vm2 u17a/YChf3IW8JPPB02m178uuU8ehzzRpA5H/2On1Vac3R3IFIXMm939rJqQJ+76xnhx ul7rtkU8MsCfsIjGl938yY3AFun9F5uCcng5rtaV2+s98Cn736P5FTO++vcrQdDgley3 vMXBaltMMHxzh7KBORZ1s/ntoNgRhPVfPexMOyNGqJTx+AlTT2fh+cxNdToynoL5PvOz fUcw== 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=CJuuFM3bAhp1+62wliN3mVAjwpYo0ZgVJivPNioLhpU=; b=RPlBMkjO6SZIh3lmFAKa60vHl0R7vuTrtqDh+RMlEw4nXa8pQJJtORz2mEFFFpmo5s mulzSoNRWiTY9cZgQpXar52oTNSrT06R+9myUZr0J/LZiJ90APaNhAwDW89gcxW7nUP0 LSfuiXsbXSWSeEBZT61ItYwKZ6ffF4/rqIY2nJvePyynGEWks0DO0wwXpdq4lpPVkn1R kQ7Ey91yMBiXIbLJwdygLHexKECcPHEee/gEgF0BR7hm5NkRalwSCDU4CNs/G0Tm4kuT KUT7vr06IgRvMeTunWIMyjfD6ClKyG4l1igUPngsAdhkTzw4a7B04lw6xaI7bFTIvOpM f4Jg== X-Gm-Message-State: AOAM531+2YpTaH1NMqcY/Dqk7giMDBtd61zMRte3tFgjeRrn/cQ+RUsp DrHWKSf6VBYAeeyw+bhOM4a7xxhgucDrTQ== X-Google-Smtp-Source: ABdhPJz+fUlnhLQHdDXj6UYC7K6tjThD1VeM+nwlSo26j/MKI9vLKp7Rb5nvTV7NBd1S+TU4Ds4RKA== X-Received: by 2002:a7b:cb09:: with SMTP id u9mr11800592wmj.63.1629051440784; Sun, 15 Aug 2021 11:17:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 11:17:20 -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/14] lmb: x86: Add arch_lmb_reserve() Date: Sun, 15 Aug 2021 20:13:12 +0200 Message-Id: <20210815181314.132330-12-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 Glass Cc: Simon Goldschmidt Cc: Tom Rini --- 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.30.2