From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 19 Apr 2016 14:59:07 -0600 Subject: [U-Boot] [PATCH 27/60] ARM: tegra: move emc.h In-Reply-To: <1461099580-3866-1-git-send-email-swarren@wwwdotorg.org> References: <1461099580-3866-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <1461099580-3866-28-git-send-email-swarren@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Stephen Warren This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path. tegra_set_emc() is moved between two emc.h so that mach-tegra/emc.h defines fairly public interfaces to the EMC functionality, and emc_priv.h contains internal register details. Signed-off-by: Stephen Warren --- arch/arm/mach-tegra/board2.c | 3 --- arch/arm/mach-tegra/emc.c | 1 - arch/arm/mach-tegra/emc.h | 14 ++++++++++++++ arch/arm/mach-tegra/tegra20/emc.c | 3 ++- .../emc.h => mach-tegra/tegra20/emc_priv.h} | 17 +++-------------- arch/arm/mach-tegra/tegra20/warmboot.c | 3 ++- 6 files changed, 21 insertions(+), 20 deletions(-) rename arch/arm/{include/asm/arch-tegra20/emc.h => mach-tegra/tegra20/emc_priv.h} (83%) diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index ce865be250e0..269afdf7a6e5 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -18,9 +18,6 @@ #include #include #include -#ifdef CONFIG_TEGRA_CLOCK_SCALING -#include -#endif #include "../../../drivers/usb/host/ehci-tegra-priv.h" #ifdef CONFIG_USB_EHCI_TEGRA #include diff --git a/arch/arm/mach-tegra/emc.c b/arch/arm/mach-tegra/emc.c index 25150bcc3e80..945bdedaf82d 100644 --- a/arch/arm/mach-tegra/emc.c +++ b/arch/arm/mach-tegra/emc.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/arm/mach-tegra/emc.h b/arch/arm/mach-tegra/emc.h index 46e1260585a1..19527b67031e 100644 --- a/arch/arm/mach-tegra/emc.h +++ b/arch/arm/mach-tegra/emc.h @@ -8,6 +8,20 @@ #ifndef _TEGRA_EMC_H #define _TEGRA_EMC_H +/* Implemented in SoC-agnostic EMC code, called by core board code */ int board_emc_init(void); +/** + * Set up the EMC for the given rate. The timing parameters are retrieved + * from the device tree "nvidia,tegra20-emc" node and its + * "nvidia,tegra20-emc-table" sub-nodes. + * + * @param blob Device tree blob + * @param rate Clock speed of memory controller in Hz (=2x memory bus rate) + * @return 0 if ok, else -ve error code (look in emc.c to decode it) + * + * Implemented by SoC-specific code. + */ +int tegra_set_emc(const void *blob, unsigned rate); + #endif diff --git a/arch/arm/mach-tegra/tegra20/emc.c b/arch/arm/mach-tegra/tegra20/emc.c index ace5fb5aa758..c2569418ba9f 100644 --- a/arch/arm/mach-tegra/tegra20/emc.c +++ b/arch/arm/mach-tegra/tegra20/emc.c @@ -9,9 +9,10 @@ #include #include #include -#include #include #include "../apb_misc.h" +#include "../emc.h" +#include "emc_priv.h" /* * The EMC registers have shadow registers. When the EMC clock is updated diff --git a/arch/arm/include/asm/arch-tegra20/emc.h b/arch/arm/mach-tegra/tegra20/emc_priv.h similarity index 83% rename from arch/arm/include/asm/arch-tegra20/emc.h rename to arch/arm/mach-tegra/tegra20/emc_priv.h index a85f4c3d823d..108e8aa62576 100644 --- a/arch/arm/include/asm/arch-tegra20/emc.h +++ b/arch/arm/mach-tegra/tegra20/emc_priv.h @@ -1,12 +1,12 @@ /* * Copyright (c) 2011 The Chromium OS Authors. - * (C) Copyright 2010,2011 NVIDIA Corporation + * (C) Copyright 2010-2016 NVIDIA Corporation * * SPDX-License-Identifier: GPL-2.0+ */ -#ifndef _ARCH_EMC_H_ -#define _ARCH_EMC_H_ +#ifndef _TEGRA20_EMC_PRIV_H +#define _TEGRA20_EMC_PRIV_H #include @@ -76,17 +76,6 @@ struct emc_ctlr { }; /** - * Set up the EMC for the given rate. The timing parameters are retrieved - * from the device tree "nvidia,tegra20-emc" node and its - * "nvidia,tegra20-emc-table" sub-nodes. - * - * @param blob Device tree blob - * @param rate Clock speed of memory controller in Hz (=2x memory bus rate) - * @return 0 if ok, else -ve error code (look in emc.c to decode it) - */ -int tegra_set_emc(const void *blob, unsigned rate); - -/** * Get a pointer to the EMC controller from the device tree. * * @param blob Device tree blob diff --git a/arch/arm/mach-tegra/tegra20/warmboot.c b/arch/arm/mach-tegra/tegra20/warmboot.c index 956eb96f027f..94298907c084 100644 --- a/arch/arm/mach-tegra/tegra20/warmboot.c +++ b/arch/arm/mach-tegra/tegra20/warmboot.c @@ -9,16 +9,17 @@ #include #include #include -#include #include #include #include #include #include #include "../apb_misc.h" +#include "../emc.h" #include "../fuse.h" #include "../pmc.h" #include "crypto.h" +#include "emc_priv.h" #include "warmboot.h" DECLARE_GLOBAL_DATA_PTR; -- 2.8.1