[U-Boot] [PATCH] arm: Tegra: Use arch-specific pmc.h where needed, else use common pmc.h

Tom Warren twarren.nvidia at gmail.com
Tue Oct 8 22:28:24 CEST 2013


PMC block for T20/T30 is able to use a common header, but T1x4 has
added registers and/or moved registers around, so these SoCs need
a arch-specific pmc.h.

Built all Tegra AOK, tested on T114 Dalmore and T124 Venice OK.

Signed-off-by: Tom Warren <twarren at nvidia.com>
---
 arch/arm/cpu/arm720t/tegra-common/cpu.c        |  2 +-
 arch/arm/cpu/arm720t/tegra114/cpu.c            |  4 ++--
 arch/arm/cpu/arm720t/tegra20/cpu.c             |  2 +-
 arch/arm/cpu/arm720t/tegra30/cpu.c             |  2 +-
 arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c |  2 +-
 arch/arm/cpu/tegra-common/ap.c                 |  2 +-
 arch/arm/cpu/tegra-common/board.c              |  2 +-
 arch/arm/cpu/tegra20-common/warmboot.c         |  2 +-
 arch/arm/cpu/tegra20-common/warmboot_avp.c     |  2 +-
 arch/arm/include/asm/arch-tegra124/pmc.h       |  4 ++--
 arch/arm/include/asm/arch-tegra20/pmc.h        | 14 ++++++++++++++
 arch/arm/include/asm/arch-tegra30/pmc.h        | 15 +++++++++++++++
 board/nvidia/common/board.c                    |  2 +-
 13 files changed, 42 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra20/pmc.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pmc.h

diff --git a/arch/arm/cpu/arm720t/tegra-common/cpu.c b/arch/arm/cpu/arm720t/tegra-common/cpu.c
index fbe553a..aea5c2b 100644
--- a/arch/arm/cpu/arm720t/tegra-common/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra-common/cpu.c
@@ -10,9 +10,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include "cpu.h"
 
diff --git a/arch/arm/cpu/arm720t/tegra114/cpu.c b/arch/arm/cpu/arm720t/tegra114/cpu.c
index 844299b..e55847e 100644
--- a/arch/arm/cpu/arm720t/tegra114/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra114/cpu.c
@@ -19,9 +19,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../tegra-common/cpu.h"
 
 /* Tegra114-specific CPU init code */
@@ -211,7 +211,7 @@ static int is_clamp_enabled(u32 mask)
 	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
 	u32 reg;
 
-	/* Get clamp status. TODO: Add pmc_clamp_status alias to pmc.h */
+	/* Get clamp status */
 	reg = readl(&pmc->pmc_clamp_status);
 	return (reg & mask) == mask;
 }
diff --git a/arch/arm/cpu/arm720t/tegra20/cpu.c b/arch/arm/cpu/arm720t/tegra20/cpu.c
index 2533899..ebd6fbe 100644
--- a/arch/arm/cpu/arm720t/tegra20/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra20/cpu.c
@@ -16,8 +16,8 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../tegra-common/cpu.h"
 
 static void enable_cpu_power_rail(void)
diff --git a/arch/arm/cpu/arm720t/tegra30/cpu.c b/arch/arm/cpu/arm720t/tegra30/cpu.c
index e162357..2e7423f 100644
--- a/arch/arm/cpu/arm720t/tegra30/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra30/cpu.c
@@ -18,9 +18,9 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/flow.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/tegra_i2c.h>
 #include "../tegra-common/cpu.h"
 
diff --git a/arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c b/arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c
index a94ec93..45f0f4d 100644
--- a/arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c
+++ b/arch/arm/cpu/armv7/tegra-common/cmd_enterrcm.c
@@ -26,8 +26,8 @@
  */
 
 #include <common.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/pmc.h>
 
 static int do_enterrcm(cmd_tbl_t *cmdtp, int flag, int argc,
 		       char * const argv[])
diff --git a/arch/arm/cpu/tegra-common/ap.c b/arch/arm/cpu/tegra-common/ap.c
index c2c4a0b..6233305 100644
--- a/arch/arm/cpu/tegra-common/ap.c
+++ b/arch/arm/cpu/tegra-common/ap.c
@@ -10,10 +10,10 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/gp_padctrl.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clock.h>
 #include <asm/arch-tegra/fuse.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/arch-tegra/warmboot.h>
diff --git a/arch/arm/cpu/tegra-common/board.c b/arch/arm/cpu/tegra-common/board.c
index 2c9613e..b4675c7 100644
--- a/arch/arm/cpu/tegra-common/board.c
+++ b/arch/arm/cpu/tegra-common/board.c
@@ -9,9 +9,9 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/warmboot.h>
 
diff --git a/arch/arm/cpu/tegra20-common/warmboot.c b/arch/arm/cpu/tegra20-common/warmboot.c
index 8beba53..0969753 100644
--- a/arch/arm/cpu/tegra20-common/warmboot.c
+++ b/arch/arm/cpu/tegra20-common/warmboot.c
@@ -11,12 +11,12 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/gp_padctrl.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/warmboot.h>
 
diff --git a/arch/arm/cpu/tegra20-common/warmboot_avp.c b/arch/arm/cpu/tegra20-common/warmboot_avp.c
index b910f78..224d10d 100644
--- a/arch/arm/cpu/tegra20-common/warmboot_avp.c
+++ b/arch/arm/cpu/tegra20-common/warmboot_avp.c
@@ -10,10 +10,10 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "warmboot_avp.h"
 
diff --git a/arch/arm/include/asm/arch-tegra124/pmc.h b/arch/arm/include/asm/arch-tegra124/pmc.h
index fa6ef10..08080e2 100644
--- a/arch/arm/include/asm/arch-tegra124/pmc.h
+++ b/arch/arm/include/asm/arch-tegra124/pmc.h
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2013
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
diff --git a/arch/arm/include/asm/arch-tegra20/pmc.h b/arch/arm/include/asm/arch-tegra20/pmc.h
new file mode 100644
index 0000000..6a39848
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra20/pmc.h
@@ -0,0 +1,14 @@
+/*
+ *  (C) Copyright 2010-2013
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _TEGRA20_PMC_H_
+#define _TEGRA20_PMC_H_
+
+/* Use common include */
+#include <asm/arch-tegra/pmc.h>
+
+#endif	/* _TEGRA20_PMC_H_ */
diff --git a/arch/arm/include/asm/arch-tegra30/pmc.h b/arch/arm/include/asm/arch-tegra30/pmc.h
new file mode 100644
index 0000000..fc155d7
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra30/pmc.h
@@ -0,0 +1,15 @@
+/*
+ *  (C) Copyright 2010-2013
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _TEGRA30_PMC_H_
+#define _TEGRA30_PMC_H_
+
+/* Use common include */
+#include <asm/arch-tegra/pmc.h>
+
+#endif  /* _TEGRA30_PMC_H_ */
+
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 3f78787..007fdec 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -19,10 +19,10 @@
 #ifdef CONFIG_PWM_TEGRA
 #include <asm/arch/pwm.h>
 #endif
+#include <asm/arch/pmc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/uart.h>
 #include <asm/arch-tegra/warmboot.h>
-- 
1.8.1.5



More information about the U-Boot mailing list