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 B9C85C433F5 for ; Sun, 3 Apr 2022 23:07:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3709583BE4; Mon, 4 Apr 2022 01:07:29 +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="mk+EmFcL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B065803F5; Mon, 4 Apr 2022 01:07:15 +0200 (CEST) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 2B08183B47 for ; Mon, 4 Apr 2022 01:07:08 +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-x635.google.com with SMTP id bh17so16468445ejb.8 for ; Sun, 03 Apr 2022 16:07:08 -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=2DODojkKqci2gHWaFqhON3dU+UjmBFqPQRv8wshnj2o=; b=mk+EmFcLnLJJeyJn7n8sr1mElZqIfOCuek6D8jCh+0JttlX3tngPZnFStahRvHLfsQ gHlcd9wqxuo6t2jVxhHeQ6lbg27+HA01qbzvX4YFrNCh4uP+0hk6h47hVDyibh3qAZKd 6eC1SlVuKiCUpWwYoAR7YvzNBT+ruvfRAFHCc7LjbuGn6cXn5a4CBiZ8hutIiBUdY49S iFDK9NwbUD0WZxV4yQA0Lwoarp4RLjHUutuDIyCj2bMHoTzB4fJUeUf0oaTy3nd7Rdlf UZSdjPPHPTbINUYjbyGFH3kXwEl3nPkAdkxxDQrR+eO731FH6nzc1j9/d8WHjxAEeXZm ZFbA== 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=2DODojkKqci2gHWaFqhON3dU+UjmBFqPQRv8wshnj2o=; b=MbUlLTibOCCL/iwZWlpztrI3gnAHPhwXXtkGBQvtSJXKQpZWD1JGy6rIsY7W7WkGbL ILcXWfwI2qMNkC7Emr5upt4EkiWeWtHkdcQ6owyASnt/TMwUqutngbojWV3e3/1A1w1z FPUe3MQe7FeqCvr9rOz2Il5bsrnab9voKJ/bIfyn2PUfwjVcIMHN1l+G9RRGOF5aVUi1 AMaZ401DHxllcPHFh2wzygCwLkzjBny/lIhJJVe6GiA5JJ0HlJnMLqnV//j9N56Vwp37 A0UWTXgjkalFEb+HTg8FMfMHMx7PVk3JHUbaHAPppvvMfxAqwVa2hLL1cMoom5aF4uD7 zSKg== X-Gm-Message-State: AOAM531wCzzd3XnaMgF3EkbUF7CFmVS4+fJUxD+ZLrDhZH+Q2sd3NPzI Pq43/zyz1bFmV81Ou5EIwQA= X-Google-Smtp-Source: ABdhPJwv1Cf4NOQvfyshoEOstYbHn5Ep+Q73xEpklccuw5a97W+8EYFOJ+1J0S/efKfXNkAdb5FHUA== X-Received: by 2002:a17:906:a2c2:b0:6e7:efc2:17f2 with SMTP id by2-20020a170906a2c200b006e7efc217f2mr1973746ejb.542.1649027227636; Sun, 03 Apr 2022 16:07:07 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id c14-20020a170906340e00b006ce98f2581asm3645597ejb.205.2022.04.03.16.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 16:07:07 -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 v4 03/12] rockchip: tpl: change call condition rockchip_stimer_init() Date: Mon, 4 Apr 2022 01:06:50 +0200 Message-Id: <20220403230659.12039-4-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220403230659.12039-1-jbx6244@gmail.com> References: <20220403230659.12039-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 The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception. Make this more generic and call the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available. Signed-off-by: Johan Jonker Reviewed-by: Simon Glass --- Changed V3: use CONFIG_ROCKCHIP_STIMER Changed V2: use IS_ENABLED add include kconfig.h move define location so that rockchip_stimer_init() is always visible to the compiler --- arch/arm/mach-rockchip/tpl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 3c007bb450..2b561264a5 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 @@ -29,6 +30,7 @@ __weak void rockchip_stimer_init(void) { +#if defined(CONFIG_ROCKCHIP_STIMER_BASE) /* If Timer already enabled, don't re-init it */ u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); @@ -45,6 +47,7 @@ __weak void rockchip_stimer_init(void) writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); +#endif } void board_init_f(ulong dummy) @@ -74,7 +77,9 @@ void board_init_f(ulong dummy) } /* Init secure timer */ - rockchip_stimer_init(); + if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER)) + rockchip_stimer_init(); + /* Init ARM arch timer in arch/arm/cpu/ */ timer_init(); -- 2.20.1