From patchwork Thu Mar 21 18:01:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 1060347 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pibRnk2L"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44QFBM2Cf3z9sPP for ; Fri, 22 Mar 2019 05:07:39 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id F0D13C220C9; Thu, 21 Mar 2019 18:02:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8F27AC2208B; Thu, 21 Mar 2019 18:01:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 56470C22036; Thu, 21 Mar 2019 18:01:31 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id BBDA7C2209F for ; Thu, 21 Mar 2019 18:01:27 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id y197so3706643wmd.0 for ; Thu, 21 Mar 2019 11:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VCExboGpnJBwA5UKrrwS2EGHmVJ2i4D8u9whTt+qAow=; b=pibRnk2Lx5x2QZ7mInBpGG/t1rCI3+vsJstx4vW6fN6SAp+N6cx+GAATijOyTz0VCy hklxHb4Qfd8ye2HUgWATIdil98lIyEWWH5/YISwp4Ij6LlmfDMiy4Bz5CBNozKE+Bnac lg4P1A8OSFFDmUTdhJQGdEDuJqkPRssQLwufRI5Re1kzc1MdPe3ZndbVivCvyl1s/i4L lvdhmQMqZZi1uiX/B7+/TsNXwXWPcrbDqlRQXU0+pNgVrJtFQ9JLrbP8gyb4sVbAb25L WKpT86niGqupb1VIDuIFQQYDUIgs99X/5HbgQutnXEH+C9C3jv6T0CQbDmXwGxqeOAMN 4gUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VCExboGpnJBwA5UKrrwS2EGHmVJ2i4D8u9whTt+qAow=; b=hnfUaYwjdsitxIV0D3z/yYhfV1Z7k3MSgdEXn1UryqMJHUeAp0BHqff7wPCv3P25DD PItZYlEu68R+T7JGZMObxE2hPsEThFJYBPnD4uNzu+CRZ5JZvSXlDUADNoUY3abQ9rmv Czdx25g2lgOb0HXUNae5KKtCoolfcZn93vI5lEpgJZa2K6L2NGoKZwl21kAIhk2oGPIB 4aZsxJJvlgzce5txAL8iXTRL+0JX57BoX7R2IVUw0EiaeUzyr+4wcRNatkfgIl+Ai7FY ZqtzCMIL8qPq2j0ibczOd3bjMfXocY1kprEnMznWb0mU0OKAqSgBqRiXif10DctKek6H Jq2w== X-Gm-Message-State: APjAAAW6VyH6nQ8OtRaZryLxDXG1lJXjHUyrb6Q1Jt+vyXyXDFxyuksP xDD1/h8thYa2kgcFD4yk1QQ= X-Google-Smtp-Source: APXvYqwBWkaI3l3itbXloR+EvxOaO4B7/PV1TMtc2HhU8OAGzMSGIIs70kWGnmqpTQMX38YZmNS/9A== X-Received: by 2002:a1c:cc0a:: with SMTP id h10mr346203wmb.20.1553191284639; Thu, 21 Mar 2019 11:01:24 -0700 (PDT) Received: from localhost (pD9E51D2D.dip0.t-ipconnect.de. [217.229.29.45]) by smtp.gmail.com with ESMTPSA id a17sm2002961wmg.40.2019.03.21.11.01.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2019 11:01:23 -0700 (PDT) From: Thierry Reding To: Tom Warren Date: Thu, 21 Mar 2019 19:01:01 +0100 Message-Id: <20190321180118.26475-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321180118.26475-1-thierry.reding@gmail.com> References: <20190321180118.26475-1-thierry.reding@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 02/19] ARM: tegra: Guard clock code with a Kconfig symbol X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Thierry Reding Clock code is not relevant on all Tegra SoC generations, so guard it with a Kconfig symbol that can be selected by the generations that need it. This is in preparation for unifying Tegra186 code with the code used on older generations. Signed-off-by: Thierry Reding --- arch/arm/mach-tegra/Kconfig | 5 +++++ arch/arm/mach-tegra/Makefile | 2 +- arch/arm/mach-tegra/board.c | 2 ++ arch/arm/mach-tegra/board2.c | 12 ++++++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 86b1cd11f752..ee078fec9adc 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -12,6 +12,9 @@ config SPL_LIBGENERIC_SUPPORT config SPL_SERIAL_SUPPORT default y +config TEGRA_CLKRST + bool + config TEGRA_IVC bool "Tegra IVC protocol" help @@ -55,6 +58,7 @@ config TEGRA_ARMV7_COMMON select SPL select SPL_BOARD_INIT if SPL select SUPPORT_SPL + select TEGRA_CLKRST select TEGRA_COMMON select TEGRA_GPIO select TEGRA_NO_BPMP @@ -100,6 +104,7 @@ config TEGRA124 config TEGRA210 bool "Tegra210 family" select TEGRA_ARMV8_COMMON + select TEGRA_CLKRST select TEGRA_GPIO select TEGRA_NO_BPMP diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index d4b4666fb1e2..0e812818d7a2 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -16,7 +16,7 @@ endif obj-y += ap.o obj-y += board.o board2.o obj-y += cache.o -obj-y += clock.o +obj-$(CONFIG_TEGRA_CLKRST) += clock.o obj-y += pinmux-common.o obj-y += powergate.o obj-y += xusb-padctl-dummy.o diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c index f8fc042a1dcc..ecd5001de4c5 100644 --- a/arch/arm/mach-tegra/board.c +++ b/arch/arm/mach-tegra/board.c @@ -9,7 +9,9 @@ #include #include #include +#if IS_ENABLED(CONFIG_TEGRA_CLKRST) #include +#endif #include #include #include diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index b8d5ef0322cb..b94077221f77 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -22,7 +22,9 @@ #include #include #include +#if IS_ENABLED(CONFIG_TEGRA_CLKRST) #include +#endif #include #include #include @@ -109,8 +111,10 @@ int board_init(void) __maybe_unused int board_id; /* Do clocks and UART first so that printf() works */ +#if IS_ENABLED(CONFIG_TEGRA_CLKRST) clock_init(); clock_verify(); +#endif tegra_gpu_config(); @@ -181,8 +185,10 @@ void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init"))); int board_early_init_f(void) { +#if IS_ENABLED(CONFIG_TEGRA_CLKRST) if (!clock_early_init_done()) clock_early_init(); +#endif #if defined(CONFIG_TEGRA_DISCONNECT_UDC_ON_BOOT) #define USBCMD_FS2 (1 << 15) @@ -193,10 +199,12 @@ int board_early_init_f(void) #endif /* Do any special system timer/TSC setup */ -#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) +#if IS_ENABLED(CONFIG_TEGRA_CLKRST) +# if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) if (!tegra_cpu_is_non_secure()) -#endif +# endif arch_timer_init(); +#endif pinmux_init(); board_init_uart_f();