Skip to contentSkip to conversation

Add support for NVIDIA Tegra30 SoC

PATCH Superseded Tom Warren 4 participants 35 messages Dec 3, 2012 – Dec 10, 2012

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tom Warren

author
#0 lore raw

v2 cover Add support for NVIDIA Tegra30 SoC

This patch series adds basic (boot to cmd prompt) support for Tegra30. This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI) boot proc) first, then control is transferred to the CPU (A9 quad cluster). It is based on current u-boot-tegra/next. Some Tegra20 files were changed or moved to enable use of common code/headers.

Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND and other peripherals. The Cardhu T30 boards is supported initially.

V2: Rework patchset as per feedback from Stephen and Simon.

Tom Warren (7):
Tegra30: Add arch-tegra30 include files
Tegra30: Add AVP (arm720t) files
Tegra30: Add CPU (armv7) files
Tegra30: Add common CPU (shared) files
Tegra30: Cardhu: Add DT files
Tegra30: Add generic Tegra30 build support
Tegra30: Add/enable Cardhu build (T30 reference board)

 Makefile                                         |    6 +-
 arch/arm/cpu/arm720t/tegra-common/Makefile       |    1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c          |  342 +++++++
 arch/arm/cpu/arm720t/tegra-common/cpu.h          |   64 +-
 arch/arm/cpu/arm720t/tegra-common/spl.c          |    3 +-
 arch/arm/cpu/arm720t/tegra20/cpu.c               |  216 +----
 arch/arm/cpu/arm720t/tegra30/Makefile            |   41 +
 arch/arm/cpu/arm720t/tegra30/config.mk           |   19 +
 arch/arm/cpu/arm720t/tegra30/cpu.c               |  176 ++++
 arch/arm/cpu/armv7/Makefile                      |    2 +-
 arch/arm/cpu/armv7/start.S                       |    4 +-
 arch/arm/cpu/armv7/tegra30/Makefile              |   40 +
 arch/arm/cpu/armv7/tegra30/config.mk             |   19 +
 arch/arm/cpu/tegra-common/ap.c                   |   22 +-
 arch/arm/cpu/tegra-common/board.c                |   41 +-
 arch/arm/cpu/tegra-common/sys_info.c             |    5 +-
 arch/arm/cpu/tegra20-common/warmboot.c           |    2 +-
 arch/arm/cpu/tegra30-common/Makefile             |   44 +
 arch/arm/cpu/tegra30-common/clock.c              | 1092 ++++++++++++++++++++++
 arch/arm/cpu/tegra30-common/funcmux.c            |   57 ++
 arch/arm/cpu/tegra30-common/pinmux.c             |  506 ++++++++++
 arch/arm/dts/tegra30.dtsi                        |    6 +
 arch/arm/include/asm/arch-tegra/ap.h             |   50 +-
 arch/arm/include/asm/arch-tegra/clk_rst.h        |  148 +++-
 arch/arm/include/asm/arch-tegra/clock.h          |    8 +-
 arch/arm/include/asm/arch-tegra/funcmux.h        |   39 +
 arch/arm/include/asm/arch-tegra/gp_padctrl.h     |   39 +
 arch/arm/include/asm/arch-tegra/tegra.h          |   13 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h      |   26 +-
 arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
 arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 ++++++++
 arch/arm/include/asm/arch-tegra30/clock.h        |   24 +
 arch/arm/include/asm/arch-tegra30/flow.h         |   35 +
 arch/arm/include/asm/arch-tegra30/funcmux.h      |   31 +
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 ++
 arch/arm/include/asm/arch-tegra30/gpio.h         |  304 ++++++
 arch/arm/include/asm/arch-tegra30/hardware.h     |   22 +
 arch/arm/include/asm/arch-tegra30/pinmux.h       |  604 ++++++++++++
 arch/arm/include/asm/arch-tegra30/pmu.h          |   23 +
 arch/arm/include/asm/arch-tegra30/spl.h          |   28 +
 arch/arm/include/asm/arch-tegra30/tegra.h        |   26 +
 board/nvidia/cardhu/Makefile                     |   44 +
 board/nvidia/cardhu/cardhu.c                     |   39 +
 board/nvidia/cardhu/pinmux-config-cardhu.h       |  339 +++++++
 board/nvidia/common/board.c                      |   17 +-
 board/nvidia/dts/tegra30-cardhu.dts              |   14 +
 boards.cfg                                       |    1 +
 include/configs/cardhu.h                         |   52 +
 include/configs/tegra-common.h                   |  163 ++++
 include/configs/tegra20-common.h                 |  171 +---
 include/configs/tegra30-common.h                 |   54 ++
 include/serial.h                                 |    2 +-
 spl/Makefile                                     |    2 +-
 53 files changed, 4973 insertions(+), 507 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra-common/cpu.c
 create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c
 create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
 create mode 100644 arch/arm/cpu/tegra30-common/Makefile
 create mode 100644 arch/arm/cpu/tegra30-common/clock.c
 create mode 100644 arch/arm/cpu/tegra30-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra30-common/pinmux.c
 create mode 100644 arch/arm/dts/tegra30.dtsi
 create mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/hardware.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/spl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/tegra.h
 create mode 100644 board/nvidia/cardhu/Makefile
 create mode 100644 board/nvidia/cardhu/cardhu.c
 create mode 100644 board/nvidia/cardhu/pinmux-config-cardhu.h
 create mode 100644 board/nvidia/dts/tegra30-cardhu.dts
 create mode 100644 include/configs/cardhu.h
 create mode 100644 include/configs/tegra-common.h
 create mode 100644 include/configs/tegra30-common.h
author
#1 lore raw

PATCH v2 1/7 Tegra30: Add arch-tegra30 include files

Common Tegra files are in arch-tegra, shared between T20 and T30. Tegra30-specific headers are in arch-tegra30. Note that some of these will be filled in as more T30 support is added (drivers, WB/LP0 support, etc.). A couple of Tegra20 files were changed to support common headers in arch-tegra, also.

---
V2:
* Created common header files in arch-tegra.
* Reworked pmux func name enums, RSVDx values to end of list.
* Added spl.h for T30, removed emc.h.

 arch/arm/include/asm/arch-tegra/clk_rst.h        |  148 +++++-
 arch/arm/include/asm/arch-tegra/clock.h          |    8 +-
 arch/arm/include/asm/arch-tegra/funcmux.h        |   39 ++
 arch/arm/include/asm/arch-tegra/gp_padctrl.h     |   39 ++
 arch/arm/include/asm/arch-tegra/tegra.h          |   13 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h      |   26 +-
 arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
 arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 ++++++++++++++
 arch/arm/include/asm/arch-tegra30/clock.h        |   24 +
 arch/arm/include/asm/arch-tegra30/flow.h         |   35 ++
 arch/arm/include/asm/arch-tegra30/funcmux.h      |   31 ++
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 +++
 arch/arm/include/asm/arch-tegra30/gpio.h         |  304 +++++++++++
 arch/arm/include/asm/arch-tegra30/hardware.h     |   22 +
 arch/arm/include/asm/arch-tegra30/pinmux.h       |  604 ++++++++++++++++++++++
 arch/arm/include/asm/arch-tegra30/pmu.h          |   23 +
 arch/arm/include/asm/arch-tegra30/spl.h          |   28 +
 arch/arm/include/asm/arch-tegra30/tegra.h        |   26 +
 18 files changed, 1776 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/hardware.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/spl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/tegra.h
arch/arm/include/asm/arch-tegra/clk_rst.h +139 -9
index 7b548c2..6a6e507 100644
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef _CLK_RST_H_
-#define _CLK_RST_H_
+#ifndef _TEGRA_CLK_RST_H_
+#define _TEGRA_CLK_RST_H_
 
 /* PLL registers - there are several PLLs in the clock controller */
 struct clk_pll {
@@ -37,6 +37,12 @@ struct clk_pll_simple {
 	uint pll_misc;		/* other misc things */
 };
 
+/* RST_DEV_(L,H,U,V,W)_(SET,CLR) and CLK_ENB_(L,H,U,V,W)_(SET,CLR) */
+struct clk_set_clr {
+	uint set;
+	uint clr;
+};
+
 /*
  * Most PLLs use the clk_pll structure, but some have a simpler two-member
  * structure for which we use clk_pll_simple. The reason for this non-
@@ -45,8 +51,10 @@ struct clk_pll_simple {
 enum {
 	TEGRA_CLK_PLLS		= 6,	/* Number of normal PLLs */
 	TEGRA_CLK_SIMPLE_PLLS	= 3,	/* Number of simple PLLs */
-	TEGRA_CLK_REGS		= 3,	/* Number of clock enable registers */
-	TEGRA_CLK_SOURCES	= 64,	/* Number of peripheral clock sources */
+	TEGRA_CLK_REGS		= 3,	/* Number of clock enable regs L/H/U */
+	TEGRA_CLK_SOURCES	= 64,	/* Number of ppl clock sources L/H/U */
+	TEGRA_CLK_REGS_VW	= 2,	/* Number of clock enable regs V/W */
+	TEGRA_CLK_SOURCES_VW	= 32,	/* Number of ppl clock sources V/W*/
 };
 
 /* Clock/Reset Controller (CLK_RST_CONTROLLER_) regs */
@@ -82,14 +90,53 @@ struct clk_rst_ctlr {
 	uint crc_reserved11;		/* _reserved_11,	0xFC */
 
 	uint crc_clk_src[TEGRA_CLK_SOURCES]; /*_I2S1_0...	0x100-1fc */
-	uint crc_reserved20[80];	/*			0x200-33C */
-	uint crc_cpu_cmplx_set;		/* _CPU_CMPLX_SET_0,	0x340	  */
-	uint crc_cpu_cmplx_clr;		/* _CPU_CMPLX_CLR_0,	0x344     */
+
+	uint crc_reserved20[64];	/* _reserved_20,	0x200-2fc */
+
+	/* _RST_DEV_L/H/U_SET_0 0x300 ~ 0x314 */
+	struct clk_set_clr crc_rst_dev_ex[TEGRA_CLK_REGS];
+
+	uint crc_reserved30[2];		/* _reserved_30,	0x318, 0x31c */
+
+	/* _CLK_ENB_L/H/U_CLR_0 0x320 ~ 0x334 */
+	struct clk_set_clr crc_clk_enb_ex[TEGRA_CLK_REGS];
+
+	uint crc_reserved31[2];		/* _reserved_31,	0x338, 0x33c */
+
+	uint crc_cpu_cmplx_set;		/* _RST_CPU_CMPLX_SET_0,    0x340 */
+	uint crc_cpu_cmplx_clr;		/* _RST_CPU_CMPLX_CLR_0,    0x344 */
+
+	/* Additional (T30) registers */
+	uint crc_clk_cpu_cmplx_set;	/* _CLK_CPU_CMPLX_SET_0,    0x348 */
+	uint crc_clk_cpu_cmplx_clr;	/* _CLK_CPU_CMPLX_SET_0,    0x34c */
+
+	uint crc_reserved32[2];		/* _reserved_32,      0x350,0x354 */
+
+	uint crc_rst_dev_vw[TEGRA_CLK_REGS_VW]; /* _RST_DEVICES_V/W_0 */
+	uint crc_clk_out_enb_vw[TEGRA_CLK_REGS_VW]; /* _CLK_OUT_ENB_V/W_0 */
+	uint crc_cclkg_brst_pol;	/* _CCLKG_BURST_POLICY_0,   0x368 */
+	uint crc_super_cclkg_div;	/* _SUPER_CCLKG_DIVIDER_0,  0x36C */
+	uint crc_cclklp_brst_pol;	/* _CCLKLP_BURST_POLICY_0,  0x370 */
+	uint crc_super_cclkp_div;	/* _SUPER_CCLKLP_DIVIDER_0, 0x374 */
+	uint crc_clk_cpug_cmplx;	/* _CLK_CPUG_CMPLX_0,       0x378 */
+	uint crc_clk_cpulp_cmplx;	/* _CLK_CPULP_CMPLX_0,      0x37C */
+	uint crc_cpu_softrst_ctrl;	/* _CPU_SOFTRST_CTRL_0,     0x380 */
+	uint crc_reserved33[11];	/* _reserved_33,        0x384-3ac */
+	uint crc_clk_src_vw[TEGRA_CLK_SOURCES_VW]; /* _G3D2_0..., 0x3b0-0x42c */
+	/* _RST_DEV_V/W_SET_0 0x430 ~ 0x43c */
+	struct clk_set_clr crc_rst_dev_ex_vw[TEGRA_CLK_REGS_VW];
+	/* _CLK_ENB_V/W_CLR_0 0x440 ~ 0x44c */
+	struct clk_set_clr crc_clk_enb_ex_vw[TEGRA_CLK_REGS_VW];
+	uint crc_reserved40[12];	/* _reserved_40,	0x450-47C */
+	uint crc_pll_cfg0;		/* _PLL_CFG0_0,		0x480 */
+	uint crc_pll_cfg1;		/* _PLL_CFG1_0,		0x484 */
+	uint crc_pll_cfg2;		/* _PLL_CFG2_0,		0x488 */
 };
 
 /* CLK_RST_CONTROLLER_CLK_CPU_CMPLX_0 */
+#define CPU3_CLK_STP_SHIFT	11
+#define CPU2_CLK_STP_SHIFT	10
 #define CPU1_CLK_STP_SHIFT	9
-
 #define CPU0_CLK_STP_SHIFT	8
 #define CPU0_CLK_STP_MASK	(1U << CPU0_CLK_STP_SHIFT)
 
@@ -120,6 +167,12 @@ struct clk_rst_ctlr {
 #define PLL_OUT_RATIO_MASK	(0xffU << PLL_OUT_RATIO_SHIFT)
 
 /* CLK_RST_CONTROLLER_PLLx_MISC_0 */
+#define PLL_DCCON_SHIFT		20
+#define PLL_DCCON_MASK		(1U << PLL_DCCON_SHIFT)
+
+#define PLL_LOCK_ENABLE_SHIFT	18
+#define PLL_LOCK_ENABLE_MASK	(1U << PLL_LOCK_ENABLE_SHIFT)
+
 #define PLL_CPCON_SHIFT		8
 #define PLL_CPCON_MASK		(15U << PLL_CPCON_SHIFT)
 
@@ -129,6 +182,22 @@ struct clk_rst_ctlr {
 #define PLLU_VCO_FREQ_SHIFT	20
 #define PLLU_VCO_FREQ_MASK	(1U << PLLU_VCO_FREQ_SHIFT)
 
+#define PLLP_OUT1_OVR		(1 << 2)
+#define PLLP_OUT2_OVR		(1 << 18)
+#define PLLP_OUT3_OVR		(1 << 2)
+#define PLLP_OUT4_OVR		(1 << 18)
+#define PLLP_OUT1_RATIO		8
+#define PLLP_OUT2_RATIO		24
+#define PLLP_OUT3_RATIO		8
+#define PLLP_OUT4_RATIO		24
+
+enum {
+	IN_408_OUT_204_DIVISOR = 2,
+	IN_408_OUT_102_DIVISOR = 6,
+	IN_408_OUT_48_DIVISOR = 15,
+	IN_408_OUT_9_6_DIVISOR = 83,
+};
+
 /* CLK_RST_CONTROLLER_OSC_CTRL_0 */
 #define OSC_FREQ_SHIFT		30
 #define OSC_FREQ_MASK		(3U << OSC_FREQ_SHIFT)
@@ -151,4 +220,65 @@ struct clk_rst_ctlr {
 #define OUT_CLK_SOURCE4_SHIFT	28
 #define OUT_CLK_SOURCE4_MASK	(15U << OUT_CLK_SOURCE4_SHIFT)
 
-#endif	/* CLK_RST_H */
+/* CLK_RST_CONTROLLER_SCLK_BURST_POLICY */
+#define SCLK_SYS_STATE_SHIFT    28U
+#define SCLK_SYS_STATE_MASK     (15U << SCLK_SYS_STATE_SHIFT)
+enum {
+	SCLK_SYS_STATE_STDBY,
+	SCLK_SYS_STATE_IDLE,
+	SCLK_SYS_STATE_RUN,
+	SCLK_SYS_STATE_IRQ = 4U,
+	SCLK_SYS_STATE_FIQ = 8U,
+};
+#define SCLK_COP_FIQ_MASK       (1 << 27)
+#define SCLK_CPU_FIQ_MASK       (1 << 26)
+#define SCLK_COP_IRQ_MASK       (1 << 25)
+#define SCLK_CPU_IRQ_MASK       (1 << 24)
+
+#define SCLK_SWAKEUP_FIQ_SOURCE_SHIFT		12
+#define SCLK_SWAKEUP_FIQ_SOURCE_MASK		\
+		(7 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT)
+#define SCLK_SWAKEUP_IRQ_SOURCE_SHIFT		8
+#define SCLK_SWAKEUP_IRQ_SOURCE_MASK		\
+		(7 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT)
+#define SCLK_SWAKEUP_RUN_SOURCE_SHIFT		4
+#define SCLK_SWAKEUP_RUN_SOURCE_MASK		\
+		(7 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT)
+#define SCLK_SWAKEUP_IDLE_SOURCE_SHIFT		0
+
+#define SCLK_SWAKEUP_IDLE_SOURCE_MASK		\
+		(7 << SCLK_SWAKEUP_FIQ_SOURCE_SHIFT)
+enum {
+	SCLK_SOURCE_CLKM,
+	SCLK_SOURCE_PLLC_OUT1,
+	SCLK_SOURCE_PLLP_OUT4,
+	SCLK_SOURCE_PLLP_OUT3,
+	SCLK_SOURCE_PLLP_OUT2,
+	SCLK_SOURCE_CLKD,
+	SCLK_SOURCE_CLKS,
+	SCLK_SOURCE_PLLM_OUT1,
+};
+#define SCLK_SWAKE_FIQ_SRC_PLLM_OUT1    (7 << 12)
+#define SCLK_SWAKE_IRQ_SRC_PLLM_OUT1    (7 << 8)
+#define SCLK_SWAKE_RUN_SRC_PLLM_OUT1    (7 << 4)
+#define SCLK_SWAKE_IDLE_SRC_PLLM_OUT1   (7 << 0)
+
+/* CLK_RST_CONTROLLER_SUPER_SCLK_DIVIDER */
+#define SUPER_SCLK_ENB_SHIFT		31U
+#define SUPER_SCLK_ENB_MASK		(1U << 31)
+#define SUPER_SCLK_DIVIDEND_SHIFT	8
+#define SUPER_SCLK_DIVIDEND_MASK	(0xff << SUPER_SCLK_DIVIDEND_SHIFT)
+#define SUPER_SCLK_DIVISOR_SHIFT	0
+#define SUPER_SCLK_DIVISOR_MASK		(0xff << SUPER_SCLK_DIVISOR_SHIFT)
+
+/* CLK_RST_CONTROLLER_CLK_SYSTEM_RATE */
+#define CLK_SYS_RATE_HCLK_DISABLE_SHIFT 7
+#define CLK_SYS_RATE_HCLK_DISABLE_MASK  (1 << CLK_SYS_RATE_HCLK_DISABLE_SHIFT)
+#define CLK_SYS_RATE_AHB_RATE_SHIFT     4
+#define CLK_SYS_RATE_AHB_RATE_MASK      (3 << CLK_SYS_RATE_AHB_RATE_SHIFT)
+#define CLK_SYS_RATE_PCLK_DISABLE_SHIFT 3
+#define CLK_SYS_RATE_PCLK_DISABLE_MASK  (1 << CLK_SYS_RATE_PCLK_DISABLE_SHIFT)
+#define CLK_SYS_RATE_APB_RATE_SHIFT     0
+#define CLK_SYS_RATE_APB_RATE_MASK      (3 << CLK_SYS_RATE_AHB_RATE_SHIFT)
+
+#endif	/* _TEGRA_CLK_RST_H_ */
arch/arm/include/asm/arch-tegra/clock.h +4 -4
index eac1dc2..01f86ab 100644
@@ -21,8 +21,8 @@
 
 /* Tegra clock control functions */
 
-#ifndef _CLOCK_H
-#define _CLOCK_H
+#ifndef _TEGRA_CLOCK_H_
+#define _TEGRA_CLOCK_H_
 
 /* Set of oscillator frequencies supported in the internal API. */
 enum clock_osc_freq {
@@ -136,7 +136,7 @@ enum crc_reset_id {
 /**
  * Put parts of the CPU complex into or out of reset.\
  *
- * @param cpu		cpu number (0 or 1 on Tegra2)
+ * @param cpu		cpu number (0 or 1 on Tegra2, 0-3 on Tegra3)
  * @param which		which parts of the complex to affect (OR of crc_reset_id)
  * @param reset		1 to assert reset, 0 to de-assert
  */
@@ -262,4 +262,4 @@ void clock_init(void);
 /* Initialize the PLLs */
 void clock_early_init(void);
 
-#endif	/* _CLOCK_H_ */
+#endif	/* _TEGRA_CLOCK_H_ */
arch/arm/include/asm/arch-tegra/funcmux.h new file +39 -0
new file mode 100644
index 0000000..f101e5e
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Tegra high-level function multiplexing */
+
+#ifndef _TEGRA_FUNCMUX_H_
+#define _TEGRA_FUNCMUX_H_
+
+/**
+ * Select a config for a particular peripheral.
+ *
+ * Each peripheral can operate through a number of configurations,
+ * which are sets of pins that it uses to bring out its signals.
+ * The basic config is 0, and higher numbers indicate different
+ * pinmux settings to bring the peripheral out on other pins,
+ *
+ * This function also disables tristate for the function's pins,
+ * so that they operate in normal mode.
+ *
+ * @param id		Peripheral id
+ * @param config	Configuration to use (FUNCMUX_...), 0 for default
+ * @return 0 if ok, -1 on error (e.g. incorrect id or config)
+ */
+int funcmux_select(enum periph_id id, int config);
+
+#endif	/* _TEGRA_FUNCMUX_H_ */
arch/arm/include/asm/arch-tegra/gp_padctrl.h new file +39 -0
new file mode 100644
index 0000000..e6085a0
@@ -0,0 +1,39 @@
+/*
+ *  (C) Copyright 2010-2012
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _TEGRA_GP_PADCTRL_H_
+#define _TEGRA_GP_PADCTRL_H_
+
+#define GP_HIDREV			0x804
+
+/* bit fields definitions for APB_MISC_GP_HIDREV register */
+#define HIDREV_CHIPID_SHIFT		8
+#define HIDREV_CHIPID_MASK		(0xff << HIDREV_CHIPID_SHIFT)
+#define HIDREV_MAJORPREV_SHIFT		4
+#define HIDREV_MAJORPREV_MASK		(0xf << HIDREV_MAJORPREV_SHIFT)
+
+/* CHIPID field returned from APB_MISC_GP_HIDREV register */
+#define CHIPID_TEGRA20			0x20
+#define CHIPID_TEGRA30			0x30
+
+#endif	/* _TEGRA_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra/tegra.h +11 -2
index 6d2e62f..b14faf6 100644
@@ -72,14 +72,23 @@ enum {
 	SKU_ID_T25		= 0x18,
 	SKU_ID_AP25E		= 0x1b,
 	SKU_ID_T25E		= 0x1c,
+	SKU_ID_T30		= 0x81, /* Cardhu value */
 };
 
-/* These are the SOC categories that affect clocking */
+/*
+ * These are used to distinguish SOC types for setting up clocks. Mostly
+ * we can tell the clocking required by looking at the SOC sku_id, but
+ * for T30 it is a user option as to whether to run PLLP in fast or slow
+ * mode, so we have two options there.
+ */
 enum {
 	TEGRA_SOC_T20,
 	TEGRA_SOC_T25,
+	TEGRA_SOC_T30,
+	TEGRA_SOC_T30_408MHZ,   /* A T30 with faster PLLP */
+	TEGRA_SOC2_SLOW,	/* T2x needs to run@slow clock initially */
 
-	TEGRA_SOC_COUNT,
+	TEGRA_SOC_CNT,
 	TEGRA_SOC_UNKNOWN	= -1,
 };
 
arch/arm/include/asm/arch-tegra20/funcmux.h +5 -21
index c986b93..1bac25e 100644
@@ -21,8 +21,10 @@
 
 /* Tegra20 high-level function multiplexing */
 
-#ifndef __FUNCMUX_H
-#define __FUNCMUX_H
+#ifndef _TEGRA20_FUNCMUX_H_
+#define _TEGRA20_FUNCMUX_H_
+
+#include <asm/arch-tegra/funcmux.h>
 
 /* Configs supported by the func mux */
 enum {
@@ -62,22 +64,4 @@ enum {
 	FUNCMUX_NDFLASH_ATC = 0,
 	FUNCMUX_NDFLASH_KBC_8_BIT,
 };
-
-/**
- * Select a config for a particular peripheral.
- *
- * Each peripheral can operate through a number of configurations,
- * which are sets of pins that it uses to bring out its signals.
- * The basic config is 0, and higher numbers indicate different
- * pinmux settings to bring the peripheral out on other pins,
- *
- * This function also disables tristate for the function's pins,
- * so that they operate in normal mode.
- *
- * @param id		Peripheral id
- * @param config	Configuration to use (FUNCMUX_...), 0 for default
- * @return 0 if ok, -1 on error (e.g. incorrect id or config)
- */
-int funcmux_select(enum periph_id id, int config);
-
-#endif
+#endif	/* _TEGRA20_FUNCMUX_H_ */
arch/arm/include/asm/arch-tegra20/gp_padctrl.h +5 -12
index 865af5b..eaaf903 100644
@@ -21,8 +21,10 @@
  * MA 02111-1307 USA
  */
 
-#ifndef _GP_PADCTRL_H_
-#define _GP_PADCTRL_H_
+#ifndef _TEGRA20_GP_PADCTRL_H_
+#define _TEGRA20_GP_PADCTRL_H_
+
+#include <asm/arch-tegra/gp_padctrl.h>
 
 /* APB_MISC_GP and padctrl registers */
 struct apb_misc_gp_ctlr {
@@ -61,13 +63,4 @@ struct apb_misc_gp_ctlr {
 	u32	memcomp;	/* 0xD4: APB_MISC_GP_MEMCOMPPADCTRL */
 };
 
-/* bit fields definitions for APB_MISC_GP_HIDREV register */
-#define HIDREV_CHIPID_SHIFT		8
-#define HIDREV_CHIPID_MASK		(0xff << HIDREV_CHIPID_SHIFT)
-#define HIDREV_MAJORPREV_SHIFT		4
-#define HIDREV_MAJORPREV_MASK		(0xf << HIDREV_MAJORPREV_SHIFT)
-
-/* CHIPID field returned from APB_MISC_GP_HIDREV register */
-#define CHIPID_TEGRA20				0x20
-
-#endif
+#endif	/* _TEGRA20_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra30/clock-tables.h new file +378 -0

378 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/clock.h new file +24 -0
new file mode 100644
index 0000000..61fc4c8
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Tegra30 clock control functions */
+
+#ifndef _TEGRA30_CLOCK_H_
+#define _TEGRA30_CLOCK_H_
+
+#include <asm/arch-tegra/clock.h>
+
+#endif	/* _TEGRA30_CLOCK_H_ */
arch/arm/include/asm/arch-tegra30/flow.h new file +35 -0
new file mode 100644
index 0000000..f5966a8
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TEGRA30_FLOW_H_
+#define _TEGRA30_FLOW_H_
+
+struct flow_ctlr {
+	u32 halt_cpu_events;
+	u32 halt_cop_events;
+	u32 cpu_csr;
+	u32 cop_csr;
+	u32 xrq_events;
+	u32 halt_cpu1_events;
+	u32 cpu1_csr;
+	u32 halt_cpu2_events;
+	u32 cpu2_csr;
+	u32 halt_cpu3_events;
+	u32 cpu3_csr;
+	u32 cluster_control;
+};
+
+#endif	/* _TEGRA30_FLOW_H_ */
arch/arm/include/asm/arch-tegra30/funcmux.h new file +31 -0
new file mode 100644
index 0000000..24b2bca
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Tegra30 high-level function multiplexing */
+
+#ifndef _TEGRA30_FUNCMUX_H_
+#define _TEGRA30_FUNCMUX_H_
+
+#include <asm/arch-tegra/funcmux.h>
+
+/* Configs supported by the func mux */
+enum {
+	FUNCMUX_DEFAULT = 0,	/* default config */
+
+	/* UART configs */
+	FUNCMUX_UART1_ULPI = 0,
+};
+#endif	/* _TEGRA30_FUNCMUX_H_ */
arch/arm/include/asm/arch-tegra30/gp_padctrl.h new file +59 -0

59 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/gpio.h new file +304 -0

304 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/hardware.h new file +22 -0
new file mode 100644
index 0000000..b1a5aa9
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TEGRA30_HARDWARE_H_
+#define _TEGRA30_HARDWARE_H_
+
+/* include tegra specific hardware definitions */
+
+#endif /* _TEGRA30-HARDWARE_H_ */
arch/arm/include/asm/arch-tegra30/pinmux.h new file +604 -0

604 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/pmu.h new file +23 -0
new file mode 100644
index 0000000..52bea29
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TEGRA30_PMU_H_
+#define _TEGRA30_PMU_H_
+
+/* Set core and CPU voltages to nominal levels */
+int pmu_set_nominal(void);
+
+#endif	/* _TEGRA30_PMU_H_ */
arch/arm/include/asm/arch-tegra30/spl.h new file +28 -0
new file mode 100644
index 0000000..5e453c5
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright 2012
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#ifndef	_ASM_ARCH_SPL_H_
+#define	_ASM_ARCH_SPL_H_
+
+#define BOOT_DEVICE_RAM         1
+
+#endif
arch/arm/include/asm/arch-tegra30/tegra.h new file +26 -0
new file mode 100644
index 0000000..46a7474
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _TEGRA30_H_
+#define _TEGRA30_H_
+
+#define NV_PA_SDRAM_BASE	0x80000000	/* 0x80000000 for real T30 */
+
+#include <asm/arch-tegra/tegra.h>
+
+#define BCT_ODMDATA_OFFSET	6116	/* 12 bytes from end of BCT */
+
+#endif	/* TEGRA30_H */
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 1/7 Tegra30: Add arch-tegra30 include files

Quoted 15 lines · Tom Warren

Common Tegra files are in arch-tegra, shared between T20 and T30. Tegra30-specific headers are in arch-tegra30. Note that some of these will be filled in as more T30 support is added (drivers, WB/LP0 support, etc.). A couple of Tegra20 files were changed to support common headers in arch-tegra, also.

arch/arm/include/asm/arch-tegra/tegra.h +6 -0
 
+/*
+ * These are used to distinguish SOC types for setting up clocks. Mostly
+ * we can tell the clocking required by looking at the SOC sku_id, but
+ * for T30 it is a user option as to whether to run PLLP in fast or slow
+ * mode, so we have two options there.
+ */
 enum {

arch/arm/include/asm/arch-tegra/tegra.h enum { · line 93

Quoted 10 lines
arch/arm/include/asm/arch-tegra/tegra.h +4 -1
 	TEGRA_SOC_T20,
 	TEGRA_SOC_T25,
+	TEGRA_SOC_T30,
+	TEGRA_SOC_T30_408MHZ,   /* A T30 with faster PLLP */
+	TEGRA_SOC2_SLOW,	/* T2x needs to run at slow clock initially */
 
-	TEGRA_SOC_COUNT,
+	TEGRA_SOC_CNT,
 	TEGRA_SOC_UNKNOWN	= -1,
 };

Can you remind me why TEGRA_SOC_T30_408MHZ exists; isn't it a SW thing whereas this enum is meant to be identifying the HW?

arch/arm/include/asm/arch-tegra30/funcmux.h line 29

Quoted 8 lines
arch/arm/include/asm/arch-tegra30/funcmux.h +6 -0
 
+/* Configs supported by the func mux */
+enum {
+	FUNCMUX_DEFAULT = 0,	/* default config */
+
+	/* UART configs */
+	FUNCMUX_UART1_ULPI = 0,

funcmux isn't going to be remotely useful for Tegra30. There are something like 460 possible ways of muxing out (IIRC) just a 4-pin UART A on Tegra30. That's why when I was defining the proposed ODMDATA2 representation of UART pinmux for the Tegra30 BCT, I didn't have a single enum covering the entire UART configuration, but rather a 4-bit field per signal (RXD, TXD, RTS, CTS) that indicated which of the possible pins to route it to.

Still, I guess having the initial port use funcmux is fine since we only need to support 1 option for now. We'll hopefully just convert it to use the BCT ODMDATA2 format rather quickly.

A similar comment will probably apply to any other peripheral on Tegra30.

author
#3 lore raw

PATCH v2 1/7 Tegra30: Add arch-tegra30 include files

Stephen,

Quoted 22 lines · Stephen Warren
Quoted 21 lines · Tom Warren

Common Tegra files are in arch-tegra, shared between T20 and T30. Tegra30-specific headers are in arch-tegra30. Note that some of these will be filled in as more T30 support is added (drivers, WB/LP0 support, etc.). A couple of Tegra20 files were changed to support common headers in arch-tegra, also.

arch/arm/include/asm/arch-tegra/tegra.h +9 -0
 
+/*
+ * These are used to distinguish SOC types for setting up clocks. Mostly
+ * we can tell the clocking required by looking at the SOC sku_id, but
+ * for T30 it is a user option as to whether to run PLLP in fast or slow
+ * mode, so we have two options there.
+ */
 enum {
      TEGRA_SOC_T20,
      TEGRA_SOC_T25,
+     TEGRA_SOC_T30,
+     TEGRA_SOC_T30_408MHZ,   /* A T30 with faster PLLP */
+     TEGRA_SOC2_SLOW,        /* T2x needs to run at slow clock initially */
Quoted 7 lines

arch/arm/include/asm/arch-tegra/tegra.h enum { · line 93

Quoted 4 lines
arch/arm/include/asm/arch-tegra/tegra.h +1 -1
-     TEGRA_SOC_COUNT,
+     TEGRA_SOC_CNT,
      TEGRA_SOC_UNKNOWN       = -1,
 };

Can you remind me why TEGRA_SOC_T30_408MHZ exists; isn't it a SW thing whereas this enum is meant to be identifying the HW?

It exists in our internal repo, and I don't want to remove it until I've brought our upstream version fully up-to-speed @ 408MHz. This initial patchset runs T30 PLLP @ 216MHz, with an option to upgrade to 408MHz at runtime. Once this baseline T30 support is in, I'll look into making PLLP 408MHz from the get-go.

Quoted 18 lines

arch/arm/include/asm/arch-tegra30/funcmux.h line 29

Quoted 9 lines
arch/arm/include/asm/arch-tegra30/funcmux.h +6 -0
 
+/* Configs supported by the func mux */
+enum {
+     FUNCMUX_DEFAULT = 0,    /* default config */
+
+     /* UART configs */
+     FUNCMUX_UART1_ULPI = 0,

funcmux isn't going to be remotely useful for Tegra30. There are something like 460 possible ways of muxing out (IIRC) just a 4-pin UART A on Tegra30. That's why when I was defining the proposed ODMDATA2 representation of UART pinmux for the Tegra30 BCT, I didn't have a single enum covering the entire UART configuration, but rather a 4-bit field per signal (RXD, TXD, RTS, CTS) that indicated which of the possible pins to route it to.

Quoted 3 lines

Still, I guess having the initial port use funcmux is fine since we only need to support 1 option for now. We'll hopefully just convert it to use the BCT ODMDATA2 format rather quickly.

Yeah, I wanted to get this in, then let your ODMDATA2 change migrate in, and then convert over to using that for UART init for T30 too.

Quoted 2 lines

A similar comment will probably apply to any other peripheral on Tegra30.

author
#4 lore raw

PATCH v2 2/7 Tegra30: Add AVP (arm720t) files

In reply to Tom Warren

This provides SPL support for T30 boards - AVP early init, plus CPU (A9) init/jump to main U-Boot.

Some changes were made to Tegra20 cpu.c to move common routines into tegra-common/cpu.c and reduce code duplication.

---
V2: Move common CPU init code to tegra-common/cpu.c

 arch/arm/cpu/arm720t/tegra-common/Makefile |    1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c    |  342 ++++++++++++++++++++++++++++
 arch/arm/cpu/arm720t/tegra-common/cpu.h    |   64 ++----
 arch/arm/cpu/arm720t/tegra-common/spl.c    |    3 +-
 arch/arm/cpu/arm720t/tegra20/cpu.c         |  216 ++----------------
 arch/arm/cpu/arm720t/tegra30/Makefile      |   41 ++++
 arch/arm/cpu/arm720t/tegra30/config.mk     |   19 ++
 arch/arm/cpu/arm720t/tegra30/cpu.c         |  176 ++++++++++++++
 8 files changed, 615 insertions(+), 247 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra-common/cpu.c
 create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c
arch/arm/cpu/arm720t/tegra-common/Makefile +1 -0
index febd2e3..6cbc6ad 100644
@@ -28,6 +28,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libtegra-common.o
 
 COBJS-$(CONFIG_SPL_BUILD) += spl.o
+COBJS-y	+= cpu.o
 
 SRCS	:= $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
arch/arm/cpu/arm720t/tegra-common/cpu.c new file +342 -0

342 lines not on this page · raw message

arch/arm/cpu/arm720t/tegra-common/cpu.h +21 -43

77 lines not on this page · raw message

arch/arm/cpu/arm720t/tegra-common/spl.c +1 -2
index c280ab7..a9a1c39 100644
@@ -23,7 +23,6 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
-#include "cpu.h"
 #include <spl.h>
 
 #include <asm/io.h>
@@ -32,7 +31,7 @@
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch/spl.h>
-
+#include "cpu.h"
 
 void spl_board_init(void)
 {
arch/arm/cpu/arm720t/tegra20/cpu.c +14 -202

236 lines not on this page · raw message

arch/arm/cpu/arm720t/tegra30/Makefile new file +41 -0

41 lines not on this page · raw message

arch/arm/cpu/arm720t/tegra30/config.mk new file +19 -0
new file mode 100644
index 0000000..2388c56
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+USE_PRIVATE_LIBGCC = yes
arch/arm/cpu/arm720t/tegra30/cpu.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#5 lore raw

PATCH v2 2/7 Tegra30: Add AVP (arm720t) files

Quoted 8 lines · Tom Warren

This provides SPL support for T30 boards - AVP early init, plus CPU (A9) init/jump to main U-Boot.

Some changes were made to Tegra20 cpu.c to move common routines into tegra-common/cpu.c and reduce code duplication.

 arch/arm/cpu/arm720t/tegra-common/cpu.c    |  342 ++++++++++++++++++++++++++++
 arch/arm/cpu/arm720t/tegra20/cpu.c         |  216 ++----------------

Just a minor note here; this patch both moves a bunch of code from cpu.c to the new cpu.c, and adds Tegra30 support. It would have been a little easier to review if the code move were a separate patch (with git format-patch -C) so that it was obvious what code in the new cpu.c was changes due to Tegra30 and what was just copied.

author
#6 lore raw

PATCH v2 2/7 Tegra30: Add AVP (arm720t) files

Stephen,

Quoted 7 lines · Stephen Warren
Quoted 5 lines · Tom Warren

This provides SPL support for T30 boards - AVP early init, plus CPU (A9) init/jump to main U-Boot.

Some changes were made to Tegra20 cpu.c to move common routines into tegra-common/cpu.c and reduce code duplication.

Quoted 8 lines
Quoted 2 lines
 arch/arm/cpu/arm720t/tegra-common/cpu.c    |  342 ++++++++++++++++++++++++++++
 arch/arm/cpu/arm720t/tegra20/cpu.c         |  216 ++----------------

Just a minor note here; this patch both moves a bunch of code from cpu.c to the new cpu.c, and adds Tegra30 support. It would have been a little easier to review if the code move were a separate patch (with git format-patch -C) so that it was obvious what code in the new cpu.c was changes due to Tegra30 and what was just copied.

Perhaps. But I didn't want to delay the T30 patches any longer while waiting for a 'commonize cpu.c' patchset for T20 to trickle through.

I had also tried creating this particular patch with 'git-format -M -C', and it created confusing 'copy foo->bar' lines for some of the other files that were potentially more confusing to the reviewer than the larger cpu.c diff. So I went with a the broader patch.

Tom

author
#7 lore raw

PATCH v2 3/7 Tegra30: Add CPU (armv7) files

In reply to Tom Warren

These files are for code that runs on the CPU (A9) on T30 boards. At this time, it's only the RCM (Recovery Mode) cmd file, which is in tegra-common. As T30-specific run-time code is added, it'll go here.

---
V2: Cleanup whitespace issues

 arch/arm/cpu/armv7/tegra30/Makefile  |   40 ++++++++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/tegra30/config.mk |   19 ++++++++++++++++
 2 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
arch/arm/cpu/armv7/tegra30/Makefile new file +40 -0
new file mode 100644
index 0000000..04adb52
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+COBJS	:= $(COBJS-y)
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/armv7/tegra30/config.mk new file +19 -0
new file mode 100644
index 0000000..719ca81
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+CONFIG_ARCH_DEVICE_TREE := tegra30
Signature · 1 line
1.7.0.4
#8 lore raw

PATCH v2 3/7 Tegra30: Add CPU (armv7) files

Quoted 4 lines · Tom Warren

These files are for code that runs on the CPU (A9) on T30 boards. At this time, it's only the RCM (Recovery Mode) cmd file, which is in tegra-common. As T30-specific run-time code is added, it'll go here.

I don't think this patch adds any code any more; certainly not cmd_rcm.c.

author
#9 lore raw

PATCH v2 4/7 Tegra30: Add common CPU (shared) files

In reply to Tom Warren

These files are used by both SPL and main U-Boot. Also made minor changes to shared Tegra code to support T30 differences.

---
V2:
* Differentiate between T20 and T30 in ODMDATA and query_sdram_size.
* Fix numerous func entries in pingroup table as per Stephen.
* Added warning about LOCK bit in pinmux_set_lock.

 arch/arm/cpu/tegra-common/ap.c                     |   22 +-
 arch/arm/cpu/tegra-common/board.c                  |   41 ++-
 arch/arm/cpu/tegra-common/sys_info.c               |    5 +-
 arch/arm/cpu/tegra20-common/warmboot.c             |    2 +-
 .../{arm720t/tegra30 => tegra30-common}/Makefile   |   11 +-
 .../cpu/{tegra20-common => tegra30-common}/clock.c |  508 +++++++++-----------
 arch/arm/cpu/tegra30-common/funcmux.c              |   57 +++
 arch/arm/cpu/tegra30-common/pinmux.c               |  506 +++++++++++++++++++
 arch/arm/include/asm/arch-tegra/ap.h               |   50 +--
 9 files changed, 873 insertions(+), 329 deletions(-)
 copy arch/arm/cpu/{arm720t/tegra30 => tegra30-common}/Makefile (80%)
 copy arch/arm/cpu/{tegra20-common => tegra30-common}/clock.c (75%)
 create mode 100644 arch/arm/cpu/tegra30-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra30-common/pinmux.c
arch/arm/cpu/tegra-common/ap.c +20 -2
index c4eb137..e1a400c 100644
@@ -20,10 +20,14 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
+
+/* Tegra AP (Application Processor) code */
+
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/gp_padctrl.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>
@@ -58,6 +62,20 @@ int tegra_get_chip_type(void)
 			return TEGRA_SOC_T25;
 		}
 		break;
+	case CHIPID_TEGRA30:
+		switch (tegra_sku_id) {
+		case SKU_ID_T30:
+			/*
+			 * T30 has two options. We will return TEGRA_SOC_T30
+			 * until we have the fdt set up when it may change to
+			 * TEGRA_SOC_T30_408MHZ depending on the PLLP freq.
+			 */
+			if (clock_get_rate(CLOCK_ID_PERIPH) == 408000000)
+				return TEGRA_SOC_T30_408MHZ;
+			else
+				return TEGRA_SOC_T30;
+		}
+		break;
 	}
 	/* unknown sku id */
 	return TEGRA_SOC_UNKNOWN;
@@ -93,7 +111,7 @@ static u32 get_odmdata(void)
 
 	u32 bct_start, odmdata;
 
-	bct_start = readl(AP20_BASE_PA_SRAM + NVBOOTINFOTABLE_BCTPTR);
+	bct_start = readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BCTPTR);
 	odmdata = readl(bct_start + BCT_ODMDATA_OFFSET);
 
 	return odmdata;
@@ -127,5 +145,5 @@ void s_init(void)
 		"orr	r0, r0, #0x41\n"
 		"mcr	p15, 0, r0, c1, c0, 1\n");
 
-	/* FIXME: should have ap20's L2 disabled too? */
+	/* FIXME: should have SoC's L2 disabled too? */
 }
arch/arm/cpu/tegra-common/board.c +35 -6

70 lines not on this page · raw message

arch/arm/cpu/tegra-common/sys_info.c +4 -1
index 1a0bb56..60d1de5 100644
@@ -27,8 +27,11 @@
 /* Print CPU information */
 int print_cpuinfo(void)
 {
+#if defined(CONFIG_TEGRA20)
 	puts("TEGRA20\n");
-
+#else	/* Tegra30 */
+	puts("TEGRA30\n");
+#endif
 	/* TBD: Add printf of major/minor rev info, stepping, etc. */
 	return 0;
 }
arch/arm/cpu/tegra20-common/warmboot.c +1 -1
index 157b9ab..0d472cf 100644
@@ -46,7 +46,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * This is the place in SRAM where the SDRAM parameters are stored. There
  * are 4 blocks, one for each RAM code
  */
-#define SDRAM_PARAMS_BASE	(AP20_BASE_PA_SRAM + 0x188)
+#define SDRAM_PARAMS_BASE	(NV_PA_BASE_SRAM + 0x188)
 
 /* TODO: If we later add support for the Misc GP controller, refactor this */
 union xm2cfga_reg {
arch/arm/cpu/tegra30-common/Makefile renamed from arch/arm/cpu/arm720t/tegra30/Makefile +7 -4
similarity index 80%
copy from arch/arm/cpu/arm720t/tegra30/Makefile
copy to arch/arm/cpu/tegra30-common/Makefile
index bd96997..75fef32 100644
@@ -19,12 +19,15 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	= $(obj)lib$(SOC).o
+# The AVP is ARMv4T architecture so we must use special compiler
+# flags for any startup files it might use.
 
-COBJS-y	+= cpu.o
+LIB	= $(obj)lib$(SOC)-common.o
 
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
+COBJS-y	+= clock.o funcmux.o pinmux.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
 all:	$(obj).depend $(LIB)
 
arch/arm/cpu/tegra30-common/clock.c renamed from arch/arm/cpu/tegra20-common/clock.c +237 -271

729 lines not on this page · raw message

arch/arm/cpu/tegra30-common/funcmux.c new file +57 -0

57 lines not on this page · raw message

arch/arm/cpu/tegra30-common/pinmux.c new file +506 -0

506 lines not on this page · raw message

arch/arm/include/asm/arch-tegra/ap.h +6 -44

70 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#10 lore raw

PATCH v2 4/7 Tegra30: Add common CPU (shared) files

Quoted 8 lines · Tom Warren

These files are used by both SPL and main U-Boot. Also made minor changes to shared Tegra code to support T30 differences.

arch/arm/cpu/tegra-common/ap.c +2 -0
 
+	case CHIPID_TEGRA30:
+		switch (tegra_sku_id) {

arch/arm/cpu/tegra-common/ap.c int tegra_get_chip_type(void) · line 76

Quoted 10 lines
arch/arm/cpu/tegra-common/ap.c +10 -0
+		case SKU_ID_T30:
+			/*
+			 * T30 has two options. We will return TEGRA_SOC_T30
+			 * until we have the fdt set up when it may change to
+			 * TEGRA_SOC_T30_408MHZ depending on the PLLP freq.
+			 */
+			if (clock_get_rate(CLOCK_ID_PERIPH) == 408000000)
+				return TEGRA_SOC_T30_408MHZ;
+			else
+				return TEGRA_SOC_T30;

Just for completeness, I'm going to mention again that I think this should just return TEGRA_SOC_T30 all the time. Sorry if that's belaboring the point!

I just noticed your recent email saying you got 408MHz working, so I guess my comment is moot anyway:-)

arch/arm/cpu/tegra-common/sys_info.c line 34

Quoted 11 lines
arch/arm/cpu/tegra-common/sys_info.c +4 -1
 
 /* Print CPU information */
 int print_cpuinfo(void)
 {
+#if defined(CONFIG_TEGRA20)
 	puts("TEGRA20\n");
-
+#else	/* Tegra30 */
+	puts("TEGRA30\n");
+#endif

This is fine, but the following wouldn't require editing again for future chips:

puts(CONFIG_SYS_SOC);
puts("\n");

(although it ends up being all lower-case; perhaps there's some other variable that is upper-case?)

author
#11 lore raw

PATCH v2 4/7 Tegra30: Add common CPU (shared) files

Stephen,

Quoted 20 lines · Stephen Warren
Quoted 8 lines · Tom Warren

These files are used by both SPL and main U-Boot. Also made minor changes to shared Tegra code to support T30 differences.

arch/arm/cpu/tegra-common/ap.c +2 -0
 
+     case CHIPID_TEGRA30:
+             switch (tegra_sku_id) {

arch/arm/cpu/tegra-common/ap.c int tegra_get_chip_type(void) · line 76

Quoted 10 lines
arch/arm/cpu/tegra-common/ap.c +10 -0
+             case SKU_ID_T30:
+                     /*
+                      * T30 has two options. We will return TEGRA_SOC_T30
+                      * until we have the fdt set up when it may change to
+                      * TEGRA_SOC_T30_408MHZ depending on the PLLP freq.
+                      */
+                     if (clock_get_rate(CLOCK_ID_PERIPH) == 408000000)
+                             return TEGRA_SOC_T30_408MHZ;
+                     else
+                             return TEGRA_SOC_T30;
Quoted 6 lines

Just for completeness, I'm going to mention again that I think this should just return TEGRA_SOC_T30 all the time. Sorry if that's belaboring the point!

I just noticed your recent email saying you got 408MHz working, so I guess my comment is moot anyway:-)

Yep. TEGRA_SOC_T30_408MHZ is gone; TEGRA_SOC_T30 is returned for Tegra30.

Quoted 16 lines

arch/arm/cpu/tegra-common/sys_info.c line 34

Quoted 12 lines
arch/arm/cpu/tegra-common/sys_info.c +4 -1
 
 /* Print CPU information */
 int print_cpuinfo(void)
 {
+#if defined(CONFIG_TEGRA20)
      puts("TEGRA20\n");
-
+#else        /* Tegra30 */
+     puts("TEGRA30\n");
+#endif

This is fine, but the following wouldn't require editing again for future chips:

Quoted 5 lines

puts(CONFIG_SYS_SOC);
puts("\n");

(although it ends up being all lower-case; perhaps there's some other variable that is upper-case?)

How about this:

#include <common.h>
#include <linux/ctype.h>

#ifdef CONFIG_DISPLAY_CPUINFO
void upstring(char *s)

{
        while(*s) {
                *s = toupper(*s);
                s++;
        }
}

/* Print CPU information */
int print_cpuinfo(void)

{
        upstring(CONFIG_SYS_SOC);
        puts(CONFIG_SYS_SOC);
        puts("\n");

    return 0;

)
#endif

What do you think?

Tom

#12 lore raw

PATCH v2 4/7 Tegra30: Add common CPU (shared) files

Quoted 5 lines · Tom Warren
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Tom Warren

These files are used by both SPL and main U-Boot. Also made minor changes to shared Tegra code to support T30 differences.

...

Quoted 1 line
Quoted 1 line
Quoted 1 line
arch/arm/cpu/tegra-common/sys_info.c +0 -0

...

Quoted 41 lines
Quoted 13 lines

arch/arm/cpu/tegra-common/sys_info.c line 34

Quoted 9 lines

/* Print CPU information */
int print_cpuinfo(void)
{

arch/arm/cpu/tegra-common/sys_info.c +4 -1
+#if defined(CONFIG_TEGRA20)
      puts("TEGRA20\n");
-
+#else        /* Tegra30 */
+     puts("TEGRA30\n");
+#endif

This is fine, but the following wouldn't require editing again for future chips:

Quoted 5 lines

puts(CONFIG_SYS_SOC);
puts("\n");

(although it ends up being all lower-case; perhaps there's some other variable that is upper-case?)

How about this:

#include <common.h>
#include <linux/ctype.h>

#ifdef CONFIG_DISPLAY_CPUINFO
void upstring(char *s)

{
        while(*s) {
                *s = toupper(*s);
                s++;
        }
}

/* Print CPU information */
int print_cpuinfo(void)

{
        upstring(CONFIG_SYS_SOC);
        puts(CONFIG_SYS_SOC);
        puts("\n");

    return 0;
Quoted 4 lines

)
#endif

What do you think?

CONFIG_SYS_SOC is presumably stored in a read-only segment, so that might not even work, although I dare say memory protection isn't enabled to prevent this. That would also end up modifying the string itself, which is probably used elsewhere, where such modification might not be desirable.

If you called upstring() on a copy of the string e.g. on the stack, that seems reasonable.

author
#13 lore raw

PATCH v2 4/7 Tegra30: Add common CPU (shared) files

Quoted 53 lines · Stephen Warren
Quoted 5 lines · Tom Warren
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Tom Warren

These files are used by both SPL and main U-Boot. Also made minor changes to shared Tegra code to support T30 differences.

...

Quoted 1 line
Quoted 1 line
Quoted 1 line
arch/arm/cpu/tegra-common/sys_info.c +0 -0

...

Quoted 44 lines
Quoted 13 lines

arch/arm/cpu/tegra-common/sys_info.c line 34

Quoted 9 lines

/* Print CPU information */
int print_cpuinfo(void)
{

arch/arm/cpu/tegra-common/sys_info.c +4 -1
+#if defined(CONFIG_TEGRA20)
      puts("TEGRA20\n");
-
+#else        /* Tegra30 */
+     puts("TEGRA30\n");
+#endif

This is fine, but the following wouldn't require editing again for future chips:

Quoted 5 lines

puts(CONFIG_SYS_SOC);
puts("\n");

(although it ends up being all lower-case; perhaps there's some other variable that is upper-case?)

How about this:

#include <common.h>
#include <linux/ctype.h>

#ifdef CONFIG_DISPLAY_CPUINFO
void upstring(char *s)

{
        while(*s) {
                *s = toupper(*s);
                s++;
        }
}

/* Print CPU information */
int print_cpuinfo(void)

{
        upstring(CONFIG_SYS_SOC);
        puts(CONFIG_SYS_SOC);
        puts("\n");

    return 0;

)
#endif

Quoted 7 lines
Quoted 1 line

What do you think?

CONFIG_SYS_SOC is presumably stored in a read-only segment, so that might not even work, although I dare say memory protection isn't enabled to prevent this. That would also end up modifying the string itself, which is probably used elsewhere, where such modification might not be desirable.

It does work - I wouldn't present code w/o testing it :)
But the side-effect of modifying CONFIG_SYS_SOC is probably a bad thing.

Quoted 3 lines

If you called upstring() on a copy of the string e.g. on the stack, that seems reasonable.

I'll copy the string first. I was trying to minimize the amount of extra code added.

Thanks

author
#14 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

In reply to Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

---
V2: Reduce to the minimum needed to build/boot to cmd prompt

 arch/arm/dts/tegra30.dtsi           |    6 ++++++
 board/nvidia/dts/tegra30-cardhu.dts |   14 ++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/tegra30.dtsi
 create mode 100644 board/nvidia/dts/tegra30-cardhu.dts
arch/arm/dts/tegra30.dtsi new file +6 -0
new file mode 100644
index 0000000..e29f5f6
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "NVIDIA Tegra30";
+	compatible = "nvidia,tegra30";
+};
board/nvidia/dts/tegra30-cardhu.dts new file +14 -0
new file mode 100644
index 0000000..0aa2625
@@ -0,0 +1,14 @@
+/dts-v1/;
+
+/memreserve/ 0x1c000000 0x04000000;
+/include/ ARCH_CPU_DTS
+
+/ {
+	model = "NVIDIA Cardhu";
+	compatible = "nvidia,cardhu", "nvidia,tegra30";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0xc0000000>;
+	};
+};
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

arch/arm/dts/tegra30.dtsi line 4

Quoted 10 lines · Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

arch/arm/dts/tegra30.dtsi +2 -0
 
+/ {
+	model = "NVIDIA Tegra30";

We don't really need a model property here, but it's not a big deal.

board/nvidia/dts/tegra30-cardhu.dts

Quoted 3 lines
board/nvidia/dts/tegra30-cardhu.dts +1 -0
 
+/memreserve/ 0x1c000000 0x04000000;

/memreserve/ isn't correct for U-Boot; no memory should be reserved.

board/nvidia/dts/tegra30-cardhu.dts line 12

Quoted 7 lines
board/nvidia/dts/tegra30-cardhu.dts +7 -0
+/ {
+	model = "NVIDIA Cardhu";
+	compatible = "nvidia,cardhu", "nvidia,tegra30";
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0xc0000000>;

That last number should be 0x40000000; it's a size not an end-of-region value.

Note that once things get more advanced, we'll need to split this up into tegra30-cardhu.dtsi, tegra30-cardhu-a02.dts, tegra30-cardhu-a04.dts, but we can do that later.

#16 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

Hi Stephen,

Quoted 5 lines · Stephen Warren
Quoted 4 lines · Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

Quoted 8 lines

arch/arm/dts/tegra30.dtsi line 4

Quoted 6 lines
arch/arm/dts/tegra30.dtsi +2 -0
 
+/ {
+     model = "NVIDIA Tegra30";

We don't really need a model property here, but it's not a big deal.

We do actually use it in U-Boot (in ARM patches on the mailing list).

Quoted 6 lines

board/nvidia/dts/tegra30-cardhu.dts

Quoted 4 lines
board/nvidia/dts/tegra30-cardhu.dts +1 -0
 
+/memreserve/ 0x1c000000 0x04000000;

/memreserve/ isn't correct for U-Boot; no memory should be reserved.

But don't we want to use the same fdt for U-Boot as the kernel?

Quoted 12 lines

board/nvidia/dts/tegra30-cardhu.dts line 12

Quoted 8 lines
board/nvidia/dts/tegra30-cardhu.dts +7 -0
+/ {
+     model = "NVIDIA Cardhu";
+     compatible = "nvidia,cardhu", "nvidia,tegra30";
+
+     memory {
+             device_type = "memory";
+             reg = <0x80000000 0xc0000000>;

That last number should be 0x40000000; it's a size not an end-of-region value.

Quoted 7 lines

Note that once things get more advanced, we'll need to split this up into tegra30-cardhu.dtsi, tegra30-cardhu-a02.dts, tegra30-cardhu-a04.dts, but we can do that later.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
Simon

#17 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

Quoted 10 lines · Simon Glass

Hi Stephen,

Quoted 7 lines · Stephen Warren
Quoted 5 lines · Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

Quoted 8 lines
Quoted 6 lines

arch/arm/dts/tegra30.dtsi line 4

Quoted 4 lines
arch/arm/dts/tegra30.dtsi +2 -0
 
+/ {
+     model = "NVIDIA Tegra30";

We don't really need a model property here, but it's not a big deal.

We do actually use it in U-Boot (in ARM patches on the mailing list).

Hmmm. The tegra20.dtsi file doesn't have one...

Quoted 7 lines
Quoted 5 lines

board/nvidia/dts/tegra30-cardhu.dts

Quoted 3 lines
board/nvidia/dts/tegra30-cardhu.dts +1 -0
 
+/memreserve/ 0x1c000000 0x04000000;

/memreserve/ isn't correct for U-Boot; no memory should be reserved.

But don't we want to use the same fdt for U-Boot as the kernel?

The only reason for a memreserve are:

a) To reserve the current display frame-buffer. This is a run-time thing that U-Boot should add to the DTB itself, not pre-populated in the DT.

b) To reserve memory for some kind of co-processor. We shouldn't be using memreserve for this any more, but rather allocating the memory dynamically in the kernel.

So irrespective of the answer to your question we should still remove this.

Re: your question: Perhaps, but we're so far away from that right now, it almost doesn't seem worth caring yet. Also, while we should certainly use the same bindings, I'm not sure we should use the same actual .dtb file bitstream, since the .dtb passed to the kernel should be loaded from the filesystem/... where the kernel zImage was, not embedded into the bootloader.

#18 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

Hi Stephen,

Quoted 13 lines · Stephen Warren
Quoted 12 lines · Simon Glass

Hi Stephen,

Quoted 9 lines · Stephen Warren
Quoted 7 lines · Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

arch/arm/dts/tegra30.dtsi +0 -0
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

arch/arm/dts/tegra30.dtsi line 4

Quoted 2 lines
arch/arm/dts/tegra30.dtsi +2 -0
+/ {
+     model = "NVIDIA Tegra30";

We don't really need a model property here, but it's not a big deal.

We do actually use it in U-Boot (in ARM patches on the mailing list).

Hmmm. The tegra20.dtsi file doesn't have one...

No problem, then it won't display a model.

Quoted 18 lines
Quoted 8 lines
Quoted 6 lines

board/nvidia/dts/tegra30-cardhu.dts

Quoted 4 lines
board/nvidia/dts/tegra30-cardhu.dts +1 -0
 
+/memreserve/ 0x1c000000 0x04000000;

/memreserve/ isn't correct for U-Boot; no memory should be reserved.

But don't we want to use the same fdt for U-Boot as the kernel?

The only reason for a memreserve are:

a) To reserve the current display frame-buffer. This is a run-time thing that U-Boot should add to the DTB itself, not pre-populated in the DT.

b) To reserve memory for some kind of co-processor. We shouldn't be using memreserve for this any more, but rather allocating the memory dynamically in the kernel.

Quoted 8 lines

So irrespective of the answer to your question we should still remove this.

Re: your question: Perhaps, but we're so far away from that right now, it almost doesn't seem worth caring yet. Also, while we should certainly use the same bindings, I'm not sure we should use the same actual .dtb file bitstream, since the .dtb passed to the kernel should be loaded from the filesystem/... where the kernel zImage was, not embedded into the bootloader.

I don't really mind, but I hold fond hopes of using the same source for each at some point. Not an issue for now.

Regards,
Simon

author
#19 lore raw

PATCH v2 5/7 Tegra30: Cardhu: Add DT files

Simon,

Quoted 19 lines · Simon Glass

Hi Stephen,

Quoted 16 lines · Stephen Warren
Quoted 15 lines · Simon Glass

Hi Stephen,

Quoted 12 lines · Stephen Warren
Quoted 10 lines · Tom Warren

These are stripped down for bringup, They'll be filled out later to match-up with the kernel DT contents, and/or as devices are brought up (mmc, usb, spi, etc.).

arch/arm/dts/tegra30.dtsi +2 -0
 
+/ {
+     model = "NVIDIA Tegra30";
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

We don't really need a model property here, but it's not a big deal.

We do actually use it in U-Boot (in ARM patches on the mailing list).

Hmmm. The tegra20.dtsi file doesn't have one...

No problem, then it won't display a model.

Actually, every other build (T20) has the model declared in the .dts file. Stephen is correct that T30 has it in the .dtsi file, too (not sure why - another artifact of our internal repo), so removing it will bring it in line with all the other Tegra builds, and (I assume) will still display a model name.

Quoted 28 lines
Quoted 19 lines
Quoted 9 lines
Quoted 7 lines

board/nvidia/dts/tegra30-cardhu.dts

Quoted 5 lines
board/nvidia/dts/tegra30-cardhu.dts +1 -0
 
+/memreserve/ 0x1c000000 0x04000000;

/memreserve/ isn't correct for U-Boot; no memory should be reserved.

But don't we want to use the same fdt for U-Boot as the kernel?

The only reason for a memreserve are:

a) To reserve the current display frame-buffer. This is a run-time thing that U-Boot should add to the DTB itself, not pre-populated in the DT.

b) To reserve memory for some kind of co-processor. We shouldn't be using memreserve for this any more, but rather allocating the memory dynamically in the kernel.

Quoted 8 lines

So irrespective of the answer to your question we should still remove this.

Re: your question: Perhaps, but we're so far away from that right now, it almost doesn't seem worth caring yet. Also, while we should certainly use the same bindings, I'm not sure we should use the same actual .dtb file bitstream, since the .dtb passed to the kernel should be loaded from the filesystem/... where the kernel zImage was, not embedded into the bootloader.

Quoted 2 lines

I don't really mind, but I hold fond hopes of using the same source for each at some point. Not an issue for now.

Note that the only Tegra20 build that has a memreserve declared (besides T30) is Seaboard.

I'll remove it, as well as the extra model = line in the .dtsi.

Tom

Quoted 3 lines

Regards,
Simon

author
#20 lore raw

PATCH v2 6/7 Tegra30: Add generic Tegra30 build support

In reply to Tom Warren

This patch adds basic Tegra30 (T30) build support - no specific board is targeted.

---
V2:
* Use generic CONFIG_TEGRA in Makefile instead of specific SOC test
* Cleanup a couple of include files due to T20/T30 build differences
* Move pinmux_init to board code

 Makefile                    |    6 +++---
 arch/arm/cpu/armv7/Makefile |    2 +-
 arch/arm/cpu/armv7/start.S  |    4 ++--
 board/nvidia/common/board.c |   17 ++++++++++++++---
 include/serial.h            |    2 +-
 spl/Makefile                |    2 +-
 6 files changed, 22 insertions(+), 11 deletions(-)
Makefile +3 -3
index 8a04727..5bbfbaf 100644
@@ -344,7 +344,7 @@ endif
 ifeq ($(SOC),exynos)
 LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
 LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
 LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
@@ -408,7 +408,7 @@ ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 
 # enable combined SPL/u-boot/dtb rules for tegra
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_OF_SEPARATE),y)
 ALL-y += $(obj)u-boot-dtb-tegra.bin
 else
@@ -515,7 +515,7 @@ $(obj)u-boot.spr:	$(obj)u-boot.img $(obj)spl/u-boot-spl.bin
 			conv=notrunc 2>/dev/null
 		cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
 
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_OF_SEPARATE),y)
 nodtb=dtb
 dtbfile=$(obj)u-boot.dtb
arch/arm/cpu/armv7/Makefile +1 -1
index 4fdbee4..ee8c2b3 100644
@@ -32,7 +32,7 @@ COBJS	+= cache_v7.o
 COBJS	+= cpu.o
 COBJS	+= syslib.o
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA20),)
+ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA),)
 SOBJS	+= lowlevel_init.o
 endif
 
arch/arm/cpu/armv7/start.S +2 -2
index 7df97c5..213f452 100644
@@ -272,12 +272,12 @@ jump_2_ram:
 /*
  * Move vector table
  */
-#if !defined(CONFIG_TEGRA20)
+#if !defined(CONFIG_TEGRA)
 	/* Set vector address in CP15 VBAR register */
 	ldr     r0, =_start
 	add     r0, r0, r9
 	mcr     p15, 0, r0, c12, c0, 0  @Set VBAR
-#endif /* !Tegra20 */
+#endif /* !Tegra */
 
 	ldr	r0, _board_init_r_ofs
 	adr	r1, _start
board/nvidia/common/board.c +14 -3
index 819c120..a4af539 100644
@@ -26,22 +26,30 @@
 #include <linux/compiler.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
+#ifdef CONFIG_LCD
 #include <asm/arch/display.h>
-#include <asm/arch/emc.h>
+#endif
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/pmu.h>
+#ifdef CONFIG_PWM_TEGRA
 #include <asm/arch/pwm.h>
+#endif
 #include <asm/arch/tegra.h>
-#include <asm/arch/usb.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>
-#include <spi.h>
+#ifdef CONFIG_TEGRA_CLOCK_SCALING
+#include <asm/arch/emc.h>
+#endif
+#ifdef CONFIG_USB_EHCI_TEGRA
+#include <asm/arch/usb.h>
+#endif
 #include <i2c.h>
+#include <spi.h>
 #include "emc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -188,6 +196,9 @@ void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init")));
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_TEGRA30)
+	pinmux_init();
+#endif
 	board_init_uart_f();
 
 	/* Initialize periph GPIOs */
include/serial.h +1 -1
index 14f863e..f6bb2b9 100644
@@ -32,7 +32,7 @@ extern struct serial_device *default_serial_console(void);
 	defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
 	defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
 	defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
-	defined(CONFIG_TEGRA20) || defined(CONFIG_SYS_COREBOOT) || \
+	defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \
 	defined(CONFIG_MICROBLAZE)
 extern struct serial_device serial0_device;
 extern struct serial_device serial1_device;
spl/Makefile +1 -1
index 6a79c3c..8dee4e0 100644
@@ -65,7 +65,7 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
 endif
 
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
 LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
 LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
Signature · 1 line
1.7.0.4
#21 lore raw

PATCH v2 6/7 Tegra30: Add generic Tegra30 build support

board/nvidia/common/board.c void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init"))); · line 202

Quoted 11 lines · Tom Warren

This patch adds basic Tegra30 (T30) build support - no specific board is targeted.

board/nvidia/common/board.c +3 -0
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_TEGRA30)
+	pinmux_init();
+#endif
 	board_init_uart_f();

Why is that required? If it is, why doesn't Tegra20 require it too?

author
#22 lore raw

PATCH v2 6/7 Tegra30: Add generic Tegra30 build support

Stephen,

Quoted 6 lines · Stephen Warren
Quoted 4 lines · Tom Warren

This patch adds basic Tegra30 (T30) build support - no specific board is targeted.

board/nvidia/common/board.c +0 -0
Quoted 8 lines

board/nvidia/common/board.c void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init"))); · line 202

Quoted 6 lines

int board_early_init_f(void)
{

board/nvidia/common/board.c +3 -0
+#if defined(CONFIG_TEGRA30)
+     pinmux_init();
+#endif
      board_init_uart_f();

Why is that required? If it is, why doesn't Tegra20 require it too?

Tegra30 does a table-driven pinmux init. This has the advantage of ensuring all pinmuxes are in a non-conflicting state (some of the POR defaults can cause conflicts).

Drivers are free to reconfig during device discovery if necessary (it usually isn't), or while parsing the DT.

Tom

author
#23 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

In reply to Tom Warren

This build is stripped down. It boots to the command prompt. GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options for Tegra SoCs.

---
V2:
* Move pinmux_init to cardhu.c, move pinmux-config header here, too.
* tegra-common.h holds CONFIG options/defines commmon to all Tegra SoCs.

 board/nvidia/cardhu/Makefile               |   44 ++++
 board/nvidia/cardhu/cardhu.c               |   39 ++++
 board/nvidia/cardhu/pinmux-config-cardhu.h |  339 ++++++++++++++++++++++++++++
 boards.cfg                                 |    1 +
 include/configs/cardhu.h                   |   52 +++++
 include/configs/tegra-common.h             |  163 +++++++++++++
 include/configs/tegra20-common.h           |  171 ++------------
 include/configs/tegra30-common.h           |   54 +++++
 8 files changed, 716 insertions(+), 147 deletions(-)
 create mode 100644 board/nvidia/cardhu/Makefile
 create mode 100644 board/nvidia/cardhu/cardhu.c
 create mode 100644 board/nvidia/cardhu/pinmux-config-cardhu.h
 create mode 100644 include/configs/cardhu.h
 create mode 100644 include/configs/tegra-common.h
 create mode 100644 include/configs/tegra30-common.h
board/nvidia/cardhu/Makefile new file +44 -0
new file mode 100644
index 0000000..913f1ce
@@ -0,0 +1,44 @@
+#
+#  (C) Copyright 2010-2012
+#  NVIDIA Corporation <www.nvidia.com>
+#
+#
+#  See file CREDITS for list of people who contributed to this
+#  project.
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of
+#  the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+#  MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= $(BOARD).o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/nvidia/cardhu/cardhu.c new file +39 -0
new file mode 100644
index 0000000..df4cb6b
@@ -0,0 +1,39 @@
+/*
+ *  (C) Copyright 2010-2012
+ *  NVIDIA Corporation <www.nvidia.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/arch/pinmux.h>
+#include "pinmux-config-cardhu.h"
+
+/*
+ * Routine: pinmux_init
+ * Description: Do individual peripheral pinmux configs
+ */
+void pinmux_init(void)
+{
+	pinmux_config_table(tegra3_pinmux_common,
+		ARRAY_SIZE(tegra3_pinmux_common));
+
+	pinmux_config_table(unused_pins_lowpower,
+		ARRAY_SIZE(unused_pins_lowpower));
+}
board/nvidia/cardhu/pinmux-config-cardhu.h new file +339 -0

339 lines not on this page · raw message

boards.cfg +1 -0
index 6f21af0..01fd77f 100644
@@ -287,6 +287,7 @@ harmony                      arm         armv7:arm720t harmony           nvidia
 seaboard                     arm         armv7:arm720t seaboard          nvidia         tegra20
 ventana                      arm         armv7:arm720t ventana           nvidia         tegra20
 whistler                     arm         armv7:arm720t whistler          nvidia         tegra20
+cardhu                       arm         armv7:arm720t cardhu            nvidia         tegra30
 colibri_t20_iris             arm         armv7:arm720t colibri_t20_iris  toradex        tegra20
 u8500_href                   arm         armv7       u8500               st-ericsson    u8500
 snowball                     arm         armv7       snowball               st-ericsson    u8500
include/configs/cardhu.h new file +52 -0

52 lines not on this page · raw message

include/configs/tegra-common.h new file +163 -0

163 lines not on this page · raw message

include/configs/tegra20-common.h +24 -147

201 lines not on this page · raw message

include/configs/tegra30-common.h new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#24 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Quoted 7 lines · Tom Warren

This build is stripped down. It boots to the command prompt. GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options for Tegra SoCs.

board/nvidia/cardhu/cardhu.c line 39

Quoted 9 lines
board/nvidia/cardhu/cardhu.c +8 -0
 
+void pinmux_init(void)
+{
+	pinmux_config_table(tegra3_pinmux_common,
+		ARRAY_SIZE(tegra3_pinmux_common));
+
+	pinmux_config_table(unused_pins_lowpower,
+		ARRAY_SIZE(unused_pins_lowpower));
+}

Oh, I see. Is any of the pinmux configuration actually needed for just the UART to work? I suppose there's not much harm just setting up the whole configuration from the start rather than adding it piece-meal.

board/nvidia/cardhu/pinmux-config-cardhu.h line 258

Quoted 9 lines
board/nvidia/cardhu/pinmux-config-cardhu.h +6 -0
 
+static struct pingroup_config tegra3_pinmux_common[] = {
 
+#ifdef CONFIG_SND_HDA_CODEC_REALTEK
+	DEFAULT_PINMUX(SPDIF_IN, DAP2, DOWN, NORMAL, INPUT),
+#else
+	DEFAULT_PINMUX(SPDIF_IN, SPDIF, NORMAL, NORMAL, INPUT),
+#endif

I'm pretty sure that define will never be enabled; it was some temporary test thing that should be removed from our downstream kernel, which is where I assume you got this table from.

include/configs/tegra-common.h

Quoted 5 lines
include/configs/cardhu.h +0 -0
include/configs/tegra-common.h +1 -0
 
+#define CONFIG_SYS_CPU_OSC_FREQUENCY	1000000	/* Set CPU clock to 1GHz */

Is that correct for Tegra30?

Quoted 1 line

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

In this patch, you also should move MEM_LAYOUT_ENV_SETTINGS from tegra-common-post.h into tegraNN-common.h, or something like that.

author
#25 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Stephen,

Quoted 9 lines · Stephen Warren
Quoted 7 lines · Tom Warren

This build is stripped down. It boots to the command prompt. GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options for Tegra SoCs.

board/nvidia/cardhu/cardhu.c +0 -0
Quoted 12 lines

board/nvidia/cardhu/cardhu.c line 39

Quoted 8 lines
board/nvidia/cardhu/cardhu.c +8 -0
+void pinmux_init(void)
+{
+     pinmux_config_table(tegra3_pinmux_common,
+             ARRAY_SIZE(tegra3_pinmux_common));
+
+     pinmux_config_table(unused_pins_lowpower,
+             ARRAY_SIZE(unused_pins_lowpower));
+}

Oh, I see. Is any of the pinmux configuration actually needed for just the UART to work? I suppose there's not much harm just setting up the whole configuration from the start rather than adding it piece-meal.

Yep, see previous reply for an explanation of why it's done in one shot.

Quoted 5 lines
Quoted 4 lines
board/nvidia/cardhu/pinmux-config-cardhu.h +1 -0
 
+static struct pingroup_config tegra3_pinmux_common[] = {
Quoted 9 lines

board/nvidia/cardhu/pinmux-config-cardhu.h line 258

Quoted 5 lines
board/nvidia/cardhu/pinmux-config-cardhu.h +5 -0
+#ifdef CONFIG_SND_HDA_CODEC_REALTEK
+     DEFAULT_PINMUX(SPDIF_IN, DAP2, DOWN, NORMAL, INPUT),
+#else
+     DEFAULT_PINMUX(SPDIF_IN, SPDIF, NORMAL, NORMAL, INPUT),
+#endif

I'm pretty sure that define will never be enabled; it was some temporary test thing that should be removed from our downstream kernel, which is where I assume you got this table from.

No, this came from one of our internal T30 U-Boot branches. Not sure where the OD (original dev) got it from.

I'll remove the REALTEK parts.

Quoted 8 lines

include/configs/tegra-common.h

Quoted 6 lines
include/configs/cardhu.h +0 -0
include/configs/tegra-common.h +1 -0
 
+#define CONFIG_SYS_CPU_OSC_FREQUENCY 1000000 /* Set CPU clock to 1GHz */

Is that correct for Tegra30?

It was originally in tegra20-common.h, and was moved into tegra-common.h in a batch with other thought-to-be-non-HW-specific config defines.

Looking at the code, though, I don't see it used anywhere. It can be removed, either in V3 of this patchset or in a clean-up round of patches later once T30 is in.

Quoted 5 lines
Quoted 2 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Quoted 3 lines

In this patch, you also should move MEM_LAYOUT_ENV_SETTINGS from tegra-common-post.h into tegraNN-common.h, or something like that.

I can do that, or we can wait until those settings are going to be used, i.e. once I've added peripheral support so a kernel can be found and loaded and executed.

Tom

#26 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 11 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Considering that Tegra 30 support is still not really in a usable state after this patchset and the time left until things have to get ready for the next merge window, I suppose you could do it the right way from the start.

Regards,
Lucas

author
#27 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Lucas,

Quoted 20 lines · Lucas Stach

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 11 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Quoted 4 lines

Considering that Tegra 30 support is still not really in a usable state after this patchset and the time left until things have to get ready for the next merge window, I suppose you could do it the right way from the start.

I'll investigate.

Thanks,

Tom

Quoted 4 lines

Regards,
Lucas

#28 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

In reply to Lucas Stach
Quoted 11 lines · Lucas Stach

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

Quoted 8 lines
Quoted 4 lines

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Naively I'd have to agree here; it seems that programming the PLL for the correct rate would probably "just work" right from the outset? After all, if the code runs OK with the higher rate enabled a little later in boot, I see no reason it shouldn't run OK with that exact same rate the whole way through.

#29 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Hi,

Quoted 26 lines · Stephen Warren
Quoted 11 lines · Lucas Stach

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

Quoted 8 lines
Quoted 4 lines

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Naively I'd have to agree here; it seems that programming the PLL for the correct rate would probably "just work" right from the outset? After all, if the code runs OK with the higher rate enabled a little later in boot, I see no reason it shouldn't run OK with that exact same rate the whole way through.

author
#30 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Simon,

Quoted 30 lines · Simon Glass

Hi,

Quoted 21 lines · Stephen Warren
Quoted 11 lines · Lucas Stach

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

Quoted 8 lines
Quoted 4 lines

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Quoted 5 lines

Naively I'd have to agree here; it seems that programming the PLL for the correct rate would probably "just work" right from the outset? After all, if the code runs OK with the higher rate enabled a little later in boot, I see no reason it shouldn't run OK with that exact same rate the whole way through.

Quoted 8 lines

From memory, the problem was originally that we wanted to be able to configure the PLL speed at run time, because we we using both speeds. Since T30 now apparently only uses 408MHz, it should be ok to set it once and hard-code it.

Regards,
Simon

Thanks. As I remember it, it was a user-config option for early T30 boards to run at 216MHz or 408MHz. The 408MHz PLLP change generated a lot of email traffic on what the best output clocks (pllp_out1 thru 4) would be for the various periphs, subclocks, etc.

When I did the original bringup for upstream U-Boot on my (older) Cardhu, I wanted to start at 216MHz first, then step up to 408MHz when I was at a stable point. Much like when I rebuilt my Mustang - I took it out around the block first, to be sure everything was working OK before I took it on the highway ;)

I'm running OK at 408MHz on my Cardhu T33. I'll resubmit V3 of the patchset in the next day or so.

Thanks,

Tom

Quoted 5 lines
Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#31 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Hi Tom,

Quoted 46 lines · Tom Warren

Simon,

Quoted 30 lines · Simon Glass

Hi,

Quoted 21 lines · Stephen Warren
Quoted 11 lines · Lucas Stach

Hi Tom,

Am Dienstag, den 04.12.2012, 13:22 -0700 schrieb Tom Warren:
[...]

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

+#define V_NS16550_CLK 216000000 /* 216MHz (pllp_out0) */

I thought PLL_P ran at 408MHz on Tegra30? The kernel certainly sets it up that way.

Quoted 8 lines
Quoted 4 lines

See my previous reply. In the internal U-Boot repo I ported from, PLLP was initially set to 216MHz, then sped up to 408MHz. When this first round of patches is in, I can address going to 408MHz first thing.

Is running the PLL_P at 408MHz something which requires a lot of work? If not, please do this and fold it into this patchset. It doesn't look too nice adding things to upstream which have to be changed/removed immediately after going in.

Quoted 5 lines

Naively I'd have to agree here; it seems that programming the PLL for the correct rate would probably "just work" right from the outset? After all, if the code runs OK with the higher rate enabled a little later in boot, I see no reason it shouldn't run OK with that exact same rate the whole way through.

Quoted 8 lines

From memory, the problem was originally that we wanted to be able to configure the PLL speed at run time, because we we using both speeds. Since T30 now apparently only uses 408MHz, it should be ok to set it once and hard-code it.

Regards,
Simon

Thanks. As I remember it, it was a user-config option for early T30 boards to run at 216MHz or 408MHz. The 408MHz PLLP change generated a lot of email traffic on what the best output clocks (pllp_out1 thru 4) would be for the various periphs, subclocks, etc.

Quoted 8 lines

When I did the original bringup for upstream U-Boot on my (older) Cardhu, I wanted to start at 216MHz first, then step up to 408MHz when I was at a stable point. Much like when I rebuilt my Mustang - I took it out around the block first, to be sure everything was working OK before I took it on the highway ;)

I'm running OK at 408MHz on my Cardhu T33. I'll resubmit V3 of the patchset in the next day or so.

Sounds good, thanks. It would be good to get this in.

Regards,
Simon

Quoted 9 lines

Thanks,

Tom

Quoted 5 lines
Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#32 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

In reply to Tom Warren
Quoted 9 lines · Tom Warren

Stephen,

Quoted 6 lines · Stephen Warren
Quoted 5 lines · Tom Warren

This build is stripped down. It boots to the command prompt. GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options for Tegra SoCs.

...

Quoted 6 lines
Quoted 2 lines

In this patch, you also should move MEM_LAYOUT_ENV_SETTINGS from tegra-common-post.h into tegraNN-common.h, or something like that.

I can do that, or we can wait until those settings are going to be used, i.e. once I've added peripheral support so a kernel can be found and loaded and executed.

Isn't it just cut/pasting those 5 lines (well, and the comment before them I guess) and s/0x0/0x8/ in all the lines. It seems pretty easy to get the right values in from the start.

Without this, it's a PITA to test bootm with this U-Boot (you can download a kernel over serial with loady for example; something I tested with earlier revisions of this series).

author
#33 lore raw

PATCH v2 7/7 Tegra30: Add/enable Cardhu build (T30 reference board)

Quoted 18 lines · Stephen Warren
Quoted 9 lines · Tom Warren

Stephen,

Quoted 6 lines · Stephen Warren
Quoted 5 lines · Tom Warren

This build is stripped down. It boots to the command prompt. GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options for Tegra SoCs.

...

Quoted 6 lines
Quoted 2 lines

In this patch, you also should move MEM_LAYOUT_ENV_SETTINGS from tegra-common-post.h into tegraNN-common.h, or something like that.

I can do that, or we can wait until those settings are going to be used, i.e. once I've added peripheral support so a kernel can be found and loaded and executed.

Quoted 7 lines

Isn't it just cut/pasting those 5 lines (well, and the comment before them I guess) and s/0x0/0x8/ in all the lines. It seems pretty easy to get the right values in from the start.

Without this, it's a PITA to test bootm with this U-Boot (you can download a kernel over serial with loady for example; something I tested with earlier revisions of this series).

I'll move the MEM_LAYOUT_ENV_SETTINGS (and update the addresses) since I'm doing a V3.

Also, WRT the 408MHz tweak, I got it working w/relatively little pain. That'll also be the de facto PLLP speed for T30 in V3 of the patchset.

Thanks,

Tom

#34 lore raw

v2 cover Add support for NVIDIA Tegra30 SoC

In reply to Tom Warren
Quoted 10 lines · Tom Warren

This patch series adds basic (boot to cmd prompt) support for Tegra30. This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI) boot proc) first, then control is transferred to the CPU (A9 quad cluster). It is based on current u-boot-tegra/next. Some Tegra20 files were changed or moved to enable use of common code/headers.

Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND and other peripherals. The Cardhu T30 boards is supported initially.

V2: Rework patchset as per feedback from Stephen and Simon.

The series,

The diffstat in patch 0 looks good too; reviews of the patches to come later.