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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CA542C433F5 for ; Sat, 9 Apr 2022 16:56:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1985B83DA2; Sat, 9 Apr 2022 18:55: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=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="D/tQNIxL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D60BC83CF3; Sat, 9 Apr 2022 18:55:31 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 CED40811D8 for ; Sat, 9 Apr 2022 18:55:28 +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=jbx6244@gmail.com Received: by mail-ej1-x629.google.com with SMTP id l7so17550316ejn.2 for ; Sat, 09 Apr 2022 09:55:28 -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=5r4pdQEIr6zF/C9nm2o2wyLJF6RmJN4Pbm4PfrYT0jI=; b=D/tQNIxLhgPlhhn3BSucje5+DolDH04I6wCNqNFbX18LoA755YWaX6T4pnDf8ukZG+ ON22cG/KySdPacenK7n0TiQ9JjnV1llvFbcNvBJoe8kUtRpzfed4q3SG9DahGY393pFi UqV4QRehIxFgBVZMbs83jNfzbHyRfL2TujEjwizMkc0BolnvOJhsIFpMsKEgTmlgF6c2 8pirSrctT3AwVoTzfLKOO1xIgLJfB7OiJhsIV9Yj56pN37ap34LnJvVTwB5DU8kqwtZC SYtphJrQrLlBOE8lyOVeVtP/qVjxm6dAFSBzclXEPzJxuN+24YhpwkEbnMhb69xVcfY2 MlKA== 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=5r4pdQEIr6zF/C9nm2o2wyLJF6RmJN4Pbm4PfrYT0jI=; b=E/0FE4Qa50v/TTieek/yU4Kf+EDAccJWWk1vX4ob+37ggVyeA4eagNkk7xUDjCH7+Y mIHXwW/o5r6s+90bXtilELqWLoWgBRK+RCWt2Dm/bCOqWRMsHmNz59NpEv8I9Wm56ED8 R72zzFRtDx0P0j4Qm+0GC25c7/JTIB8e/J7a26RRjA5hiz4y5EnsAlUfOQ9hfVv5Ujqd oLw1MbRQ4uQfjgXlKjkMM9lvl7cwToKNC5tba4BWDfWcw/JhFsWUyWUp4+8MLDl9qC8g 4OQUYdQ9QM026eqohbMaCloaKG7IBQM1KLhS2U1ci1GVjTkrevSdQ7BSW6ytesCmfoF+ j/iQ== X-Gm-Message-State: AOAM530D/yzv7l1Gw0k3Bsi4JoTcNPx8c5/3YJtzjCvhib8nNQiOSt8G 5CFiNVfPCKxmlS6l4lB58hg= X-Google-Smtp-Source: ABdhPJwtc96SyM0sBxfydgCYEK7gRUE0qXIBhETF6d00z/ZOV0qhQX8Eb5xPF696SzYW9AEKf9XOFg== X-Received: by 2002:a17:906:d1c8:b0:6e4:8244:4c5a with SMTP id bs8-20020a170906d1c800b006e482444c5amr1856912ejb.315.1649523328516; Sat, 09 Apr 2022 09:55:28 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id t14-20020a170906608e00b006d1455acc62sm10004538ejj.74.2022.04.09.09.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 09:55:28 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, peng.fan@nxp.com, jh80.chung@samsung.com, u-boot@lists.denx.de Subject: [PATCH v5 04/13] rockchip: tpl: use IS_ENABLED for timer_init() call condition Date: Sat, 9 Apr 2022 18:55:05 +0200 Message-Id: <20220409165514.19220-5-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220409165514.19220-1-jbx6244@gmail.com> References: <20220409165514.19220-1-jbx6244@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available. Use the call condition IS_ENABLED to increase build coverage and make the code easier to read. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- Changed V5: rebase add include kconfig.h --- arch/arm/mach-rockchip/tpl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 7f43f58406..8126587060 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -15,6 +15,7 @@ #include #include #include +#include #if CONFIG_IS_ENABLED(BANNER_PRINT) #include @@ -77,8 +78,10 @@ void board_init_f(ulong dummy) /* Init secure timer */ rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/ */ - timer_init(); + + /* Init ARM arch timer */ + if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER)) + timer_init(); ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { -- 2.20.1