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 D66BEC433F5 for ; Wed, 29 Dec 2021 18:50:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0ADC78305F; Wed, 29 Dec 2021 19:50:18 +0100 (CET) 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="YgvMmyKf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B002F811BA; Wed, 29 Dec 2021 17:59:03 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 646C98128B for ; Wed, 29 Dec 2021 17:59:00 +0100 (CET) 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-ed1-x536.google.com with SMTP id w16so88515287edc.11 for ; Wed, 29 Dec 2021 08:59:00 -0800 (PST) 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=tEo1ddqsp8vX10uZtrZv/+5UzqtiGBWmZUNFiuqoIW0=; b=YgvMmyKfelVFSmAom3BbrYm4EBBNP/7wzWSWLor7VYN3ntk3c1CUUvZIy9LTSc8x2N 5BDTk6Mi/mjnXjDxayg9gbfwK0RvxBmHltgMXsgv+sk53jsaHkq/5gmOkQuTYaJYdJGa U1f+gdg6tcf0ux00hdl8oROtRPWQFC7tjCKRDknLGdoJNAdiwfLX6QpYPEl3iLJBICLX WnE5f1/gQjRXkn/hSfg64au6ZRUOb37sjQhg4M+E1fG1bPX27pdw8Z5Jf7vQC06zhE8n yQp3hTLhOjD7dD9chhiB6TvBOMjJxg5XiQco1c1EXxOx/5c1lFTeKb8JWRrV2jkqcKC+ J9BQ== 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=tEo1ddqsp8vX10uZtrZv/+5UzqtiGBWmZUNFiuqoIW0=; b=jJ8wri6N/UR8EfjtXnhtDwUeGEVo8Q+e3VWn1PEkxQjQQUQAjLZyNAPHA81QHN97Ru V0O8dVXbCu3bIfOmsVsJ3K+o8HCuEmaPY/0DJhAGevzfhGomG1nLWwP8CBexWnju9Q2o AD/g27m9Fca0nCis+XISfQxVOsMqRzKbNY8OnWdQ2UefnLQ4HYctf60ZqzmUWm0W0e16 1Fyl/UJ+qFcgjK6x18SajCxvbEC0MlNjIqMhiVHKrSfw+n3zPIOR0+pBLsH3c/Z7ThJ8 5E42VtgbRVplGXJW3WI6OPRHtJSQz9BlqKjZLOl1H70gBiFCeJcgmh9lTPSdF8zRygrN xIng== X-Gm-Message-State: AOAM530PHaVIt0VUX2ZZ3MC13LDdD593q+v4nQaYNo4jBdUhtwSflmOM Sz1CHUwktGx/we2LgxbVGyo= X-Google-Smtp-Source: ABdhPJyunAYmK6sgAszAZWChZnMugZpP7DSr7aczrx42mGERNMlyelH3rVuAkaaTfS9EYyv19zQFyQ== X-Received: by 2002:a17:907:3d8e:: with SMTP id he14mr21538147ejc.167.1640797140087; Wed, 29 Dec 2021 08:59:00 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id g19sm8695051edr.6.2021.12.29.08.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 08:58:59 -0800 (PST) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, u-boot@lists.denx.de Subject: [PATCH v2 2/4] rockchip: tpl: change call condition rockchip_stimer_init() Date: Wed, 29 Dec 2021 17:58:48 +0100 Message-Id: <20211229165850.6911-2-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211229165850.6911-1-jbx6244@gmail.com> References: <20211229165850.6911-1-jbx6244@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 29 Dec 2021 19:50:14 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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 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 --- 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 3c007bb4..5ce6e57c 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_BASE)) + rockchip_stimer_init(); + /* Init ARM arch timer in arch/arm/cpu/ */ timer_init(); -- 2.20.1