From patchwork Wed Oct 13 19:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 1540591 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=FR7cXqLe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HV2fS4P0nz9sP7 for ; Thu, 14 Oct 2021 06:29:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86A7E8374F; Wed, 13 Oct 2021 21:29:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io 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=foundries.io header.i=@foundries.io header.b="FR7cXqLe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EDEE835F5; Wed, 13 Oct 2021 21:29:15 +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=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (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 9AAAA83769 for ; Wed, 13 Oct 2021 21:29:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=oleksandr.suvorov@foundries.io Received: by mail-lf1-x12c.google.com with SMTP id t9so16326179lfd.1 for ; Wed, 13 Oct 2021 12:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KfnFXuiZlZZYOSPmDFN/4Am20PN2COBLfiepHMziq2A=; b=FR7cXqLeDLk+zN3igIqTyllekE/N5WY0bIxO1JLhg3KdpuJBKRpqtZgmWBbu6h66IX w90Plbjsm91Hj44UIDqtZRv5Jca1v1/3kqvxlR5vQOjVeHo4VW1ho/rT91sg/EwtQQpv e/ZmYl+m/vAP2/3cKdtjhDyJKh28/6QGmeByvtziMbLp7WdzLGT16QCD7Lixi5/lXOie mU1qbvjaDwTUs9B8f57qPj0+jDDRHM5EV+rk0hsqG6t2m/tsdK/1AiLtfMZ4mPBxd9pt S85jCnI+oX5WZX0Cnldx9+FhL/KrJKu8j352aJxrRpGEbnXVt59h03B2fYou3jVFZ9z2 Gf4w== 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:mime-version :content-transfer-encoding; bh=KfnFXuiZlZZYOSPmDFN/4Am20PN2COBLfiepHMziq2A=; b=YnY9nAcUN47kOt2yRLVdYZL2EXLgbbYAvRBgMECoH+dHVbymlhWtc7noVFtC43yeTN bvSuSNqNJOx+nCn5usEfiIQql21Vxz5ewaYnbraB1JJ3GHZtWOUW8tDjMkOirSMlPRYB cDrWDS6qdIAaxRUu5SC69l5c1CydxXFzwtS5ynB1tJzXmDLNFatKpd3E0+M/MmKn5yqr hmkWC3WhurxHB9G5ph0wxfYsl4YJmOE66ImSNDTq9u6bB+RBd771yTAREPgi2TxtCIXf bKAl5tDxh5LTmWyenG76fchZ6+0jx+NEMOe/P87Lb/uYUBrZcY/+lqZOpnD6vTovHL4z eKXA== X-Gm-Message-State: AOAM5336ng7YFuAdDpWHBXVjMKKJApbVzgW+Yg5cVg9T3rZNuyQkQMnF Y6c64pnl0W9CeWt3tOQSgyBUvcVDUARhGw== X-Google-Smtp-Source: ABdhPJyfvG5FOSWgcSjnZt/Ji+QPjUb/Tu9bjJOkwZH0GTE0yzOAA5LlL3ZSJARk5TBpG7q3cIuzAA== X-Received: by 2002:a05:651c:24b:: with SMTP id x11mr1327855ljn.272.1634153347424; Wed, 13 Oct 2021 12:29:07 -0700 (PDT) Received: from cryobook.bearlog ([82.193.109.226]) by smtp.gmail.com with ESMTPSA id x10sm33041lff.44.2021.10.13.12.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 12:29:06 -0700 (PDT) From: Oleksandr Suvorov To: u-boot@lists.denx.de Cc: Michael Scott , Oleksandr Suvorov , Bryan O'Donoghue , Fabio Estevam , "NXP i.MX U-Boot Team" , Peng Fan , Rui Miguel Silva , Stefano Babic Subject: [PATCH v2] imx: syscounter: allow timer_init for SPL build Date: Wed, 13 Oct 2021 22:29:03 +0300 Message-Id: <20211013192903.370968-1-oleksandr.suvorov@foundries.io> X-Mailer: git-send-email 2.31.1 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 From: Michael Scott If we enable SPL and SKIP_LOWLEVEL_INIT, this results in the weak function timer_init() being used in the SPL build. This is not desirable as on iMX6 SoC, MMC will then fail once u-boot proper is booted due to timing issue. Fixes: be277c3a89 ("imx: mx7: avoid some initialization if low level is skipped") Signed-off-by: Michael Scott Signed-off-by: Oleksandr Suvorov --- Changes in v2: - rebased on top of a2ac2b964b ("Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig") arch/arm/mach-imx/syscounter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/syscounter.c b/arch/arm/mach-imx/syscounter.c index 7c02e199a3..058369d5ea 100644 --- a/arch/arm/mach-imx/syscounter.c +++ b/arch/arm/mach-imx/syscounter.c @@ -59,7 +59,7 @@ static inline unsigned long long us_to_tick(unsigned long long usec) return usec; } -#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) +#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) || IS_ENABLED(CONFIG_SPL_BUILD) int timer_init(void) { struct sctr_regs *sctr = (struct sctr_regs *)SCTR_BASE_ADDR;