From patchwork Fri Sep 10 20:47:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1526642 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bhwgrU0V; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H5nzQ3mPSz9sX3 for ; Sat, 11 Sep 2021 06:49:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7356983705; Fri, 10 Sep 2021 22:48:54 +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="bhwgrU0V"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E7B1836FD; Fri, 10 Sep 2021 22:48:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 E7B0B8370D for ; Fri, 10 Sep 2021 22:47:47 +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-x332.google.com with SMTP id u19-20020a7bc053000000b002f8d045b2caso2207341wmc.1 for ; Fri, 10 Sep 2021 13:47:47 -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=yTkeMC6Kvjo2fbQDEVy6qU5t7wjcp/TNh6LqDVrpu4Y=; b=bhwgrU0VTUsrts7whkxjI8f0ZIB5oprzEeIUfgglzjjGyzue3BtHwevYWCk8MZ90EW S3gSZMO3C96MnJUbAdadAt4Mj1k3hnNl84GuixNT1JBSNTOdJLxq7Qx5i4E/aU6HWZq2 jfQHGkk+Pa4P4lTDQfz+SFW6nAqq5zVk05sO+ZV6/5z6UGEK7/+tY23ktOkCGw7sVbXY pb1S5AUDVy1C+Qujt1CYxS2kVIu9Myds6abk95m2gOUhZ9EE6i4p6sqjbvi0sXI/OxoX G9KRsszriy61Bj0HVyl+k041NXE3DB8AgIhRR2S2Z32IsoS5Uy9du7/KgM0ySa3gTMqb 2tdA== 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=yTkeMC6Kvjo2fbQDEVy6qU5t7wjcp/TNh6LqDVrpu4Y=; b=4R8yWRdLwtDzQag9T8QXiSUuOHcMcFGNbLY/hyBuP4zYi/Nyt/C8n4SIp/0XU5mM0K BNyEkwEeDQFue/FkkYdfMF/+XpNqZP5Bh57XpaRJ6WPzTbRWBUS53hMYldS9bpZSCWCG AhyXuGtBv8b2wREGvXvvFIBwBCTxY//7T+AdCgMkhVvov3Gm3olKN6IlXT9YHntO2MyA CdPs72e12QmaZfSfVljON4ziqrFNItJH52uz1pjzCJp0+x04IFd1BADYnsGgn6IWepiV Iu7Zwc0Prcb5r7WmkAt6CZiKlreZlUwX13GW6NG6pP9m0omjkrBoJrSDlVImw0GPMlWp CnWg== X-Gm-Message-State: AOAM531Wn6KriSUEADHBexQKYcQrUPN57ocHp9EqCvc5Fr2Cnw5ZdQew T8QhsPmdhIWAyVzpkc5tF1lX6q9qKAebkQ== X-Google-Smtp-Source: ABdhPJzC4MO8817Hr8M9XQ/X616+mYvRtxiF79MwkdrZcFm7bY+p0uVRgak0XuR8de4qQM03rU1nfQ== X-Received: by 2002:a7b:c8da:: with SMTP id f26mr10034308wml.109.1631306867512; Fri, 10 Sep 2021 13:47:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 13:47:47 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Alexey Brodkin , Angelo Dureghello , Daniel Schwierzeck , Eugeniy Paltsev , Hai Pham , Michal Simek , Simon Goldschmidt , Tom Rini , Wolfgang Denk , Ye Li Subject: [PATCH 06/12] lmb: Remove imx board_lmb_reserve() Date: Fri, 10 Sep 2021 22:47:12 +0200 Message-Id: <20210910204718.17765-6-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 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 This function is clearly architecture specific code, not board specific code. The only difference from the previous arm arch_lmb_reserve() is the extra reservation of 16k of memory below the stack bottom, rather than the 4k. The common code now also uses 16k alignment. Remove this custom implementation, as it now behaves exactly as the common code. Signed-off-by: Marek Vasut Cc: Alexey Brodkin Cc: Angelo Dureghello Cc: Daniel Schwierzeck Cc: Eugeniy Paltsev Cc: Hai Pham Cc: Michal Simek Cc: Simon Goldschmidt Cc: Tom Rini Cc: Wolfgang Denk Cc: Ye Li --- V2: Drop the custom implementation altogether --- arch/arm/mach-imx/misc.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/arch/arm/mach-imx/misc.c b/arch/arm/mach-imx/misc.c index d82efa7f8f..09a758ff6e 100644 --- a/arch/arm/mach-imx/misc.c +++ b/arch/arm/mach-imx/misc.c @@ -77,33 +77,3 @@ int mxs_reset_block(struct mxs_register_32 *reg) return 0; } - -static ulong get_sp(void) -{ - ulong ret; - - asm("mov %0, sp" : "=r"(ret) : ); - return ret; -} - -void board_lmb_reserve(struct lmb *lmb) -{ - ulong sp, bank_end; - int bank; - - sp = get_sp(); - debug("## Current stack ends at 0x%08lx ", sp); - - /* adjust sp by 16K to be safe */ - sp -= 4096 << 2; - for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) { - if (sp < gd->bd->bi_dram[bank].start) - continue; - bank_end = gd->bd->bi_dram[bank].start + - gd->bd->bi_dram[bank].size; - if (sp >= bank_end) - continue; - lmb_reserve(lmb, sp, bank_end - sp); - break; - } -}