All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 02/19] ARM: tegra: Guard clock code with a Kconfig symbol
Date: Thu, 21 Mar 2019 19:01:01 +0100	[thread overview]
Message-ID: <20190321180118.26475-3-thierry.reding@gmail.com> (raw)
In-Reply-To: <20190321180118.26475-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
 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 <ns16550.h>
 #include <spl.h>
 #include <asm/io.h>
+#if IS_ENABLED(CONFIG_TEGRA_CLKRST)
 #include <asm/arch/clock.h>
+#endif
 #include <asm/arch/funcmux.h>
 #include <asm/arch/mc.h>
 #include <asm/arch/tegra.h>
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 <asm/arch-tegra/gpu.h>
 #include <asm/arch-tegra/usb.h>
 #include <asm/arch-tegra/xusb-padctl.h>
+#if IS_ENABLED(CONFIG_TEGRA_CLKRST)
 #include <asm/arch/clock.h>
+#endif
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
@@ -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();
-- 
2.21.0

  parent reply	other threads:[~2019-03-21 18:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 18:00 [U-Boot] [PATCH v3 00/19] ARM: tegra: Miscellaneous improvements Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 01/19] ARM: tegra: Use common header for PMU declarations Thierry Reding
2019-03-21 18:01 ` Thierry Reding [this message]
2019-03-21 18:01 ` [U-Boot] [PATCH v3 03/19] ARM: tegra: Guard GP pad control code with a Kconfig symbol Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 04/19] ARM: tegra: Guard memory controller " Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 05/19] ARM: tegra: Guard pin " Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 06/19] ARM: tegra: Guard powergate " Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 07/19] ARM: tegra: Fix save_boot_params() prototype Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 08/19] ARM: tegra: Allow boards to override boot target devices Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 09/19] ARM: tegra: Support TZ-only access to PMC Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 10/19] ARM: tegra: Workaround UDC boot issues only if necessary Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 11/19] ARM: tegra: Restore DRAM bank count Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 12/19] ARM: tegra: Unify Tegra186 builds Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 13/19] ARM: tegra: Implement cboot_save_boot_params() in C Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 14/19] ARM: tegra: Implement cboot_get_ethaddr() Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 15/19] ARM: tegra: Enable position independent build for 64-bit Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 16/19] p2371-2180: Pass Ethernet MAC to the kernel Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 17/19] p2771-0000: " Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 18/19] lib: Implement strndup() Thierry Reding
2019-03-21 18:01 ` [U-Boot] [PATCH v3 19/19] ARM: tegra: Import cbootargs value from cboot DTB Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190321180118.26475-3-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.