Skip to contentSkip to conversation

Tegra124: Add arch-tegra124 include/header files

PATCH New Tom Warren 3 participants 19 messages Oct 7, 2013 – Jan 22, 2014

Subsystems (2)
lore
Share & tools
lore

Tom Warren

author
#0 lore raw

PATCH 1/8 Tegra124: Add arch-tegra124 include/header files

No real HW change on T124 for 90% of the toys, so just include a common T1x4 header file (based on T114 headers), and if a new register/bit is needed, add it at the end. Some headers (clk_rst, clock-tables, pinmux, etc.) had too many changes in structs, devices, etc. added/removed, so they are added as complete new files for T124, and can be diffed against T114 headers to see what's changed (again, not a lot).

In a future (RSN) patch I'll point the T114 headers at the new common tegra1x4-xxx files, too.

Change-Id I02a37e1a6bee0c62721f1ffb3968379b36d0f2dd
---
 arch/arm/include/asm/arch-tegra/clk_rst.h          | 160 +++++-
 arch/arm/include/asm/arch-tegra/pmc.h              |   2 +-
 arch/arm/include/asm/arch-tegra/spl.h              |  13 +
 arch/arm/include/asm/arch-tegra/tegra1x4_ahb.h     |  91 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_clock.h   |  19 +
 arch/arm/include/asm/arch-tegra/tegra1x4_emc.h     |  76 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_flow.h    |  40 ++
 arch/arm/include/asm/arch-tegra/tegra1x4_fush.h    |  28 +
 .../include/asm/arch-tegra/tegra1x4_gp_padctrl.h   |  74 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_pmu.h     |  14 +
 arch/arm/include/asm/arch-tegra/tegra1x4_spi.h     |  23 +-
 arch/arm/include/asm/arch-tegra/tegra1x4_sysctr.h  |  26 +
 arch/arm/include/asm/arch-tegra/tegra1x4_usb.h     | 272 +++++++++
 arch/arm/include/asm/arch-tegra124/ahb.h           |  13 +
 arch/arm/include/asm/arch-tegra124/clock-tables.h  | 496 +++++++++++++++++
 arch/arm/include/asm/arch-tegra124/clock.h         |  15 +
 arch/arm/include/asm/arch-tegra124/emc.h           |  13 +
 arch/arm/include/asm/arch-tegra124/flow.h          |  13 +
 arch/arm/include/asm/arch-tegra124/funcmux.h       |  23 +
 arch/arm/include/asm/arch-tegra124/fuse.h          |  13 +
 arch/arm/include/asm/arch-tegra124/gp_padctrl.h    |  13 +
 arch/arm/include/asm/arch-tegra124/gpio.h          | 303 ++++++++++
 arch/arm/include/asm/arch-tegra124/hardware.h      |  16 +
 arch/arm/include/asm/arch-tegra124/pinmux.h        | 618 +++++++++++++++++++++
 arch/arm/include/asm/arch-tegra124/pmc.h           | 368 ++++++++++++
 arch/arm/include/asm/arch-tegra124/pmu.h           |  13 +
 arch/arm/include/asm/arch-tegra124/spl.h           |  13 +
 arch/arm/include/asm/arch-tegra124/sysctr.h        |  13 +
 arch/arm/include/asm/arch-tegra124/tegra.h         |  30 +
 arch/arm/include/asm/arch-tegra124/usb.h           |  13 +
 30 files changed, 2773 insertions(+), 51 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra/spl.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_ahb.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_emc.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_fush.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_sysctr.h
 create mode 100644 arch/arm/include/asm/arch-tegra/tegra1x4_usb.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/ahb.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/emc.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/fuse.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/hardware.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/pmc.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/spl.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/sysctr.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/tegra.h
 create mode 100644 arch/arm/include/asm/arch-tegra124/usb.h
arch/arm/include/asm/arch-tegra/clk_rst.h +130 -30
index 7045266..b5f4708 100644
@@ -10,9 +10,10 @@
 
 /* PLL registers - there are several PLLs in the clock controller */
 struct clk_pll {
-	uint pll_base;		/* the control register */
-	uint pll_out[2];	/* output control */
-	uint pll_misc;		/* other misc things */
+	uint pll_base;	/* the control register */
+	/* pll_out[0] is output A control, pll_out[1] is output B control */
+	uint pll_out[2];
+	uint pll_misc;	/* other misc things */
 };
 
 /* PLL registers - there are several PLLs in the clock controller */
@@ -21,6 +22,13 @@ struct clk_pll_simple {
 	uint pll_misc;		/* other misc things */
 };
 
+struct clk_pllm {
+	uint pllm_base;		/* the control register */
+	uint pllm_out;		/* output control */
+	uint pllm_misc1;	/* misc1 */
+	uint pllm_misc2;	/* misc2 */
+};
+
 /* 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;
@@ -38,7 +46,8 @@ enum {
 	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*/
+	TEGRA_CLK_SOURCES_VW	= 32,	/* Number of ppl clock sources V/W */
+	TEGRA_CLK_SOURCES_X	= 32,	/* Number of ppl clock sources X */
 };
 
 /* Clock/Reset Controller (CLK_RST_CONTROLLER_) regs */
@@ -47,7 +56,7 @@ struct clk_rst_ctlr {
 	uint crc_rst_dev[TEGRA_CLK_REGS];	/* _RST_DEVICES_L/H/U_0 */
 	uint crc_clk_out_enb[TEGRA_CLK_REGS];	/* _CLK_OUT_ENB_L/H/U_0 */
 	uint crc_reserved0;		/* reserved_0,		0x1C */
-	uint crc_cclk_brst_pol;		/* _CCLK_BURST_POLICY_0,0x20 */
+	uint crc_cclk_brst_pol;		/* _CCLK_BURST_POLICY_0, 0x20 */
 	uint crc_super_cclk_div;	/* _SUPER_CCLK_DIVIDER_0,0x24 */
 	uint crc_sclk_brst_pol;		/* _SCLK_BURST_POLICY_0, 0x28 */
 	uint crc_super_sclk_div;	/* _SUPER_SCLK_DIVIDER_0,0x2C */
@@ -75,7 +84,21 @@ struct clk_rst_ctlr {
 
 	uint crc_clk_src[TEGRA_CLK_SOURCES]; /*_I2S1_0...	0x100-1fc */
 
-	uint crc_reserved20[64];	/* _reserved_20,	0x200-2fc */
+	uint crc_reserved20[32];	/* _reserved_20,	0x200-27c */
+
+	uint crc_clk_out_enb_x;		/* _CLK_OUT_ENB_X_0,	0x280 */
+	uint crc_clk_enb_x_set;		/* _CLK_ENB_X_SET_0,	0x284 */
+	uint crc_clk_enb_x_clr;		/* _CLK_ENB_X_CLR_0,	0x288 */
+
+	uint crc_rst_devices_x;		/* _RST_DEVICES_X_0,	0x28c */
+	uint crc_rst_dev_x_set;		/* _RST_DEV_X_SET_0,	0x290 */
+	uint crc_rst_dev_x_clr;		/* _RST_DEV_X_CLR_0,	0x294 */
+
+	uint crc_reserved21[23];	/* _reserved_21,	0x298-2f0 */
+
+	uint crc_dfll_base;		/* _DFLL_BASE_0,	0x2f4 */
+
+	uint crc_reserved22[2];		/* _reserved_22,	0x2f8-2fc */
 
 	/* _RST_DEV_L/H/U_SET_0 0x300 ~ 0x314 */
 	struct clk_set_clr crc_rst_dev_ex[TEGRA_CLK_REGS];
@@ -105,10 +128,10 @@ struct clk_rst_ctlr {
 	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_cpu_softrst_ctrl1;	/* _CPU_SOFTRST_CTR1L_0,    0x384 */
+	uint crc_cpu_softrst_ctrl1;	/* _CPU_SOFTRST_CTRL1_0,    0x384 */
 	uint crc_cpu_softrst_ctrl2;	/* _CPU_SOFTRST_CTRL2_0,    0x388 */
 	uint crc_reserved33[9];		/* _reserved_33,        0x38c-3ac */
-	uint crc_clk_src_vw[TEGRA_CLK_SOURCES_VW]; /* _G3D2_0..., 0x3b0-0x42c */
+	uint crc_clk_src_vw[TEGRA_CLK_SOURCES_VW];	/* 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 */
@@ -142,6 +165,47 @@ struct clk_rst_ctlr {
 	uint crc_audio_sync_clk_i2s3;	/* _AUDIO_SYNC_CLK_I2S3_0, 0x4AC */
 	uint crc_audio_sync_clk_i2s4;	/* _AUDIO_SYNC_CLK_I2S4_0, 0x4B0 */
 	uint crc_audio_sync_clk_spdif;	/* _AUDIO_SYNC_CLK_SPDIF_0, 0x4B4 */
+
+	uint crc_plld2_base;		/* _PLLD2_BASE_0, 0x4B8 */
+	uint crc_plld2_misc;		/* _PLLD2_MISC_0, 0x4BC */
+	uint crc_utmip_pll_cfg3;	/* _UTMIP_PLL_CFG3_0, 0x4C0 */
+	uint crc_pllrefe_base;		/* _PLLREFE_BASE_0, 0x4C4 */
+	uint crc_pllrefe_misc;		/* _PLLREFE_MISC_0, 0x4C8 */
+	uint crs_reserved_50[7];	/* _reserved_50, 0x4CC-0x4E4 */
+	uint crc_pllc2_base;		/* _PLLC2_BASE_0, 0x4E8 */
+	uint crc_pllc2_misc0;		/* _PLLC2_MISC_0_0, 0x4EC */
+	uint crc_pllc2_misc1;		/* _PLLC2_MISC_1_0, 0x4F0 */
+	uint crc_pllc2_misc2;		/* _PLLC2_MISC_2_0, 0x4F4 */
+	uint crc_pllc2_misc3;		/* _PLLC2_MISC_3_0, 0x4F8 */
+	uint crc_pllc3_base;		/* _PLLC3_BASE_0, 0x4FC */
+	uint crc_pllc3_misc0;		/* _PLLC3_MISC_0_0, 0x500 */
+	uint crc_pllc3_misc1;		/* _PLLC3_MISC_1_0, 0x504 */
+	uint crc_pllc3_misc2;		/* _PLLC3_MISC_2_0, 0x508 */
+	uint crc_pllc3_misc3;		/* _PLLC3_MISC_3_0, 0x50C */
+	uint crc_pllx_misc1;		/* _PLLX_MISC_1_0, 0x510 */
+	uint crc_pllx_misc2;		/* _PLLX_MISC_2_0, 0x514 */
+	uint crc_pllx_misc3;		/* _PLLX_MISC_3_0, 0x518 */
+	uint crc_xusbio_pll_cfg0;	/* _XUSBIO_PLL_CFG0_0, 0x51C */
+	uint crc_xusbio_pll_cfg1;	/* _XUSBIO_PLL_CFG0_1, 0x520 */
+	uint crc_plle_aux1;		/* _PLLE_AUX1_0, 0x524 */
+	uint crc_pllp_reshift;		/* _PLLP_RESHIFT_0, 0x528 */
+	uint crc_utmipll_hw_pwrdn_cfg0;	/* _UTMIPLL_HW_PWRDN_CFG0_0, 0x52C */
+	uint crc_pllu_hw_pwrdn_cfg0;	/* _PLLU_HW_PWRDN_CFG0_0, 0x530 */
+	uint crc_xusb_pll_cfg0;		/* _XUSB_PLL_CFG0_0, 0x534 */
+	uint crc_reserved51[1];		/* _reserved_51,     0x538 */
+	uint crc_clk_cpu_misc;		/* _CLK_CPU_MISC_0, 0x53C */
+	uint crc_clk_cpug_misc;		/* _CLK_CPUG_MISC_0, 0x540 */
+	uint crc_clk_cpulp_misc;	/* _CLK_CPULP_MISC_0, 0x544 */
+	uint crc_pllx_hw_ctrl_cfg;	/* _PLLX_HW_CTRL_CFG_0, 0x548 */
+	uint crc_pllx_sw_ramp_cfg;	/* _PLLX_SW_RAMP_CFG_0, 0x54C */
+	uint crc_pllx_hw_ctrl_status;	/* _PLLX_HW_CTRL_STATUS_0, 0x550 */
+	uint crc_reserved52[1];		/* _reserved_52,     0x554 */
+	uint crc_super_gr3d_clk_div;	/* _SUPER_GR3D_CLK_DIVIDER_0, 0x558 */
+	uint crc_spare_reg0;		/* _SPARE_REG0_0, 0x55C */
+
+	/* T124 - skip to 0x600 here for new CLK_SOURCE_ regs */
+	uint crc_reserved60[40];	/* _reserved_60,     0x560 - 0x5FC */
+	uint crc_clk_src_x[TEGRA_CLK_SOURCES_X]; /* XUSB, etc, 0x600-0x678 */
 };
 
 /* CLK_RST_CONTROLLER_CLK_CPU_CMPLX_0 */
@@ -226,9 +290,15 @@ enum {
 #define UTMIP_FORCE_PD_SAMP_B_POWERDOWN		(1 << 2)
 #define UTMIP_FORCE_PD_SAMP_A_POWERDOWN		(1 << 0)
 
-/* CLK_RST_CONTROLLER_OSC_CTRL_0 */
-#define OSC_XOBP_SHIFT		1
-#define OSC_XOBP_MASK		(1U << OSC_XOBP_SHIFT)
+/* CLK_RST_CONTROLLER_OSC_CTRL_0 0x50 */
+#define OSC_XOE_SHIFT			0
+#define OSC_XOE_MASK			(1 << OSC_XOE_SHIFT)
+#define OSC_XOE_ENABLE			(1 << OSC_XOE_SHIFT)
+#define OSC_XOBP_SHIFT			1
+#define OSC_XOBP_MASK			(1U << OSC_XOBP_SHIFT)
+#define OSC_XOFS_SHIFT			4
+#define OSC_XOFS_MASK			(0x3F << OSC_XOFS_SHIFT)
+#define OSC_DRIVE_STRENGTH		7
 
 /*
  * CLK_RST_CONTROLLER_CLK_SOURCE_x_OUT_0 - the mask here is normally 8 bits
@@ -300,7 +370,7 @@ enum {
 #define SUPER_SCLK_DIVISOR_SHIFT	0
 #define SUPER_SCLK_DIVISOR_MASK		(0xff << SUPER_SCLK_DIVISOR_SHIFT)
 
-/* CLK_RST_CONTROLLER_CLK_SYSTEM_RATE */
+/* CLK_RST_CONTROLLER_CLK_SYSTEM_RATE 0x30 */
 #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
@@ -310,23 +380,53 @@ enum {
 #define CLK_SYS_RATE_APB_RATE_SHIFT     0
 #define CLK_SYS_RATE_APB_RATE_MASK      (3 << CLK_SYS_RATE_AHB_RATE_SHIFT)
 
-/* CLK_RST_CONTROLLER_RST_CPUxx_CMPLX_CLR */
-#define CLR_CPURESET0		(1 << 0)
-#define CLR_CPURESET1		(1 << 1)
-#define CLR_CPURESET2		(1 << 2)
-#define CLR_CPURESET3		(1 << 3)
-#define CLR_DBGRESET0		(1 << 12)
-#define CLR_DBGRESET1		(1 << 13)
-#define CLR_DBGRESET2		(1 << 14)
-#define CLR_DBGRESET3		(1 << 15)
-#define CLR_CORERESET0		(1 << 16)
-#define CLR_CORERESET1		(1 << 17)
-#define CLR_CORERESET2		(1 << 18)
-#define CLR_CORERESET3		(1 << 19)
-#define CLR_CXRESET0		(1 << 20)
-#define CLR_CXRESET1		(1 << 21)
-#define CLR_CXRESET2		(1 << 22)
-#define CLR_CXRESET3		(1 << 23)
-#define CLR_NONCPURESET		(1 << 29)
+/* CLK_RST_CONTROLLER_RST_CPUxx_CMPLX_CLR 0x344 */
+#define CLR_CPURESET0			(1 << 0)
+#define CLR_CPURESET1			(1 << 1)
+#define CLR_CPURESET2			(1 << 2)
+#define CLR_CPURESET3			(1 << 3)
+#define CLR_DBGRESET0			(1 << 12)
+#define CLR_DBGRESET1			(1 << 13)
+#define CLR_DBGRESET2			(1 << 14)
+#define CLR_DBGRESET3			(1 << 15)
+#define CLR_CORERESET0			(1 << 16)
+#define CLR_CORERESET1			(1 << 17)
+#define CLR_CORERESET2			(1 << 18)
+#define CLR_CORERESET3			(1 << 19)
+#define CLR_CXRESET0			(1 << 20)
+#define CLR_CXRESET1			(1 << 21)
+#define CLR_CXRESET2			(1 << 22)
+#define CLR_CXRESET3			(1 << 23)
+#define CLR_L2RESET			(1 << 24)
+#define CLR_NONCPURESET			(1 << 29)
+#define CLR_PRESETDBG			(1 << 30)
+
+/* CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR 0x34c */
+#define CLR_CPU3_CLK_STP		(1 << 11)
+#define CLR_CPU2_CLK_STP		(1 << 10)
+#define CLR_CPU1_CLK_STP		(1 << 9)
+#define CLR_CPU0_CLK_STP		(1 << 8)
+
+/* CRC_CLK_SOURCE_MSELECT_0 0x3b4 */
+#define MSELECT_CLK_SRC_PLLP_OUT0	(0 << 29)
+
+/* CRC_CLK_ENB_V_SET_0 0x440 */
+#define SET_CLK_ENB_CPUG_ENABLE		(1 << 0)
+#define SET_CLK_ENB_CPULP_ENABLE	(1 << 1)
+#define SET_CLK_ENB_MSELECT_ENABLE	(1 << 3)
+
+/* CLK_RST_CONTROLLER_UTMIP_PLL_CFG1_0 0x484 */
+#define PLLU_POWERDOWN			(1 << 16)
+#define PLL_ENABLE_POWERDOWN		(1 << 14)
+#define PLL_ACTIVE_POWERDOWN		(1 << 12)
+
+/* CLK_RST_CONTROLLER_UTMIP_PLL_CFG2_0 0x488 */
+#define UTMIP_FORCE_PD_SAMP_C_POWERDOWN	(1 << 4)
+#define UTMIP_FORCE_PD_SAMP_B_POWERDOWN	(1 << 2)
+#define UTMIP_FORCE_PD_SAMP_A_POWERDOWN	(1 << 0)
+
+/* CLK_RST_CONTROLLER_PLLX_MISC_3 */
+#define PLLX_IDDQ_SHIFT			3
+#define PLLX_IDDQ_MASK			(1U << PLLX_IDDQ_SHIFT)
 
 #endif	/* _TEGRA_CLK_RST_H_ */
arch/arm/include/asm/arch-tegra/pmc.h +1 -1
index ba22236..84e4147 100644
@@ -21,7 +21,7 @@ struct pmc_ctlr {
 	uint pmc_dpd_sample;		/* _DPD_PADS_SAMPLE_0, offset 20 */
 	uint pmc_dpd_enable;		/* _DPD_PADS_ENABLE_0, offset 24 */
 	uint pmc_pwrgate_timer_off;	/* _PWRGATE_TIMER_OFF_0, offset 28 */
-	uint pmc_pwrgate_timer_on;	/* _PWRGATE_TIMER_ON_0, offset 2C */
+	uint pmc_clamp_status;		/* _CLAMP_STATUS_0, offset 2C */
 	uint pmc_pwrgate_toggle;	/* _PWRGATE_TOGGLE_0, offset 30 */
 	uint pmc_remove_clamping;	/* _REMOVE_CLAMPING_CMD_0, offset 34 */
 	uint pmc_pwrgate_status;	/* _PWRGATE_STATUS_0, offset 38 */
arch/arm/include/asm/arch-tegra/spl.h new file +13 -0
new file mode 100644
index 0000000..76af1f7
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef	_ARCH_TEGRA_SPL_H_
+#define	_ARCH_TEGRA_SPL_H_
+
+#define BOOT_DEVICE_RAM         1
+
+#endif
arch/arm/include/asm/arch-tegra/tegra1x4_ahb.h new file +91 -0

91 lines not on this page · raw message

arch/arm/include/asm/arch-tegra/tegra1x4_clock.h new file +19 -0
new file mode 100644
index 0000000..e652b50
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* Tegra1x4 clock control functions */
+
+#ifndef _TEGRA1x4_CLOCK_H_
+#define _TEGRA1x4_CLOCK_H_
+
+#include <asm/arch-tegra/clock.h>
+
+/* CLK_RST_CONTROLLER_OSC_CTRL_0 */
+#define OSC_FREQ_SHIFT          28
+#define OSC_FREQ_MASK           (0xF << OSC_FREQ_SHIFT)
+
+#endif	/* _TEGRA1x4_CLOCK_H_ */
arch/arm/include/asm/arch-tegra/tegra1x4_emc.h new file +76 -0

76 lines not on this page · raw message

arch/arm/include/asm/arch-tegra/tegra1x4_flow.h new file +40 -0
new file mode 100644
index 0000000..4654191
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA1x4_FLOW_H_
+#define _TEGRA1x4_FLOW_H_
+
+struct flow_ctlr {
+	u32 halt_cpu_events;	/* offset 0x00 */
+	u32 halt_cop_events;	/* offset 0x04 */
+	u32 cpu_csr;		/* offset 0x08 */
+	u32 cop_csr;		/* offset 0x0c */
+	u32 xrq_events;		/* offset 0x10 */
+	u32 halt_cpu1_events;	/* offset 0x14 */
+	u32 cpu1_csr;		/* offset 0x18 */
+	u32 halt_cpu2_events;	/* offset 0x1c */
+	u32 cpu2_csr;		/* offset 0x20 */
+	u32 halt_cpu3_events;	/* offset 0x24 */
+	u32 cpu3_csr;		/* offset 0x28 */
+	u32 cluster_control;	/* offset 0x2c */
+	u32 halt_cop1_events;	/* offset 0x30 */
+	u32 halt_cop1_csr;	/* offset 0x34 */
+	u32 cpu_pwr_csr;	/* offset 0x38 */
+	u32 mpid;		/* offset 0x3c */
+	u32 ram_repair;		/* offset 0x40 */
+};
+
+/* HALT_COP_EVENTS_0, 0x04 */
+#define EVENT_MSEC		(1 << 24)
+#define EVENT_USEC		(1 << 25)
+#define EVENT_JTAG		(1 << 28)
+#define EVENT_MODE_STOP		(2 << 29)
+
+/* FLOW_CTLR_CLUSTER_CONTROL_0 0x2c */
+#define ACTIVE_LP		(1 << 0)
+
+#endif	/*  _TEGRA1x4_FLOW_H_ */
arch/arm/include/asm/arch-tegra/tegra1x4_fush.h new file +28 -0
new file mode 100644
index 0000000..bafbc56
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA1x4_FUSE_H_
+#define _TEGRA1x4_FUSE_H_
+
+/* FUSE registers */
+struct fuse_regs {
+	u32 reserved0[9];		/* 0x00 - 0x20: */
+	u32 fuse_bypass;		/* 0x24: FUSE_FUSEBYPASS */
+	u32 private_key_disable;	/* 0x28: FUSE_PRIVATEKEYDISABLE */
+	u32 disable_reg_program;	/* 0x2C:  FUSE_DISABLEREGPROGRAM */
+	u32 write_access_sw;		/* 0x30:  FUSE_WRITE_ACCESS_SW */
+	u32 reserved01[51];		/* 0x34 - 0xFC: */
+	u32 production_mode;		/* 0x100: FUSE_PRODUCTION_MODE */
+	u32 reserved1[3];		/* 0x104 - 0x10c: */
+	u32 sku_info;			/* 0x110 */
+	u32 reserved2[13];		/* 0x114 - 0x144: */
+	u32 fa;				/* 0x148: FUSE_FA */
+	u32 reserved3[21];		/* 0x14C - 0x19C: */
+	u32 security_mode;		/* 0x1A0 - FUSE_SECURITY_MODE */
+};
+
+#endif	/* _TEGRA1x4_FUSE_H_ */
arch/arm/include/asm/arch-tegra/tegra1x4_gp_padctrl.h new file +74 -0

74 lines not on this page · raw message

arch/arm/include/asm/arch-tegra/tegra1x4_pmu.h new file +14 -0
new file mode 100644
index 0000000..30d87fd
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA1x4_PMU_H_
+#define _TEGRA1x4_PMU_H_
+
+/* Set core and CPU voltages to nominal levels */
+int pmu_set_nominal(void);
+
+#endif	/* _TEGRA1x4_PMU_H_ */
arch/arm/include/asm/arch-tegra/tegra1x4_spi.h +3 -20
index 93aa9ac..e797214 100644
@@ -1,25 +1,8 @@
 /*
- * NVIDIA Tegra SPI controller
+ * (C) Copyright 2010-2013
+ * NVIDIA Corporation <www.nvidia.com>
  *
- * Copyright 2010-2013 NVIDIA Corporation
- *
- * This software may be used and distributed according to the
- * terms of the GNU Public License, Version 2, incorporated
- * herein by reference.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- *
- * 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
+ * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #ifndef _TEGRA1x4_SPI_H_
arch/arm/include/asm/arch-tegra/tegra1x4_sysctr.h new file +26 -0
new file mode 100644
index 0000000..71a2ef2
@@ -0,0 +1,26 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA1x4_SYSCTR_H_
+#define _TEGRA1x4_SYSCTR_H_
+
+struct sysctr_ctlr {
+	u32 cntcr;		/* 0x00: SYSCTR0_CNTCR Counter Control */
+	u32 cntsr;		/* 0x04: SYSCTR0_CNTSR Counter Status */
+	u32 cntcv0;		/* 0x08: SYSCTR0_CNTCV0 Counter Count 31:00 */
+	u32 cntcv1;		/* 0x0C: SYSCTR0_CNTCV1 Counter Count 63:32 */
+	u32 reserved1[4];	/* 0x10 - 0x1C */
+	u32 cntfid0;		/* 0x20: SYSCTR0_CNTFID0 Freq Table Entry */
+	u32 cntfid1;		/* 0x24: SYSCTR0_CNTFID1 Freq Table End */
+	u32 reserved2[1002];	/* 0x28 - 0xFCC */
+	u32 counterid[12];	/* 0xFD0 - 0xFxx CounterID regs, RO */
+};
+
+#define TSC_CNTCR_ENABLE	(1 << 0)	/* Enable */
+#define TSC_CNTCR_HDBG		(1 << 1)	/* Halt on debug */
+
+#endif	/* _TEGRA1x4_SYSCTR_H_ */
arch/arm/include/asm/arch-tegra/tegra1x4_usb.h new file +272 -0

272 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/ahb.h new file +13 -0
new file mode 100644
index 0000000..3479d96
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_AHB_H_
+#define _TEGRA124_AHB_H_
+
+#include <asm/arch-tegra/tegra1x4_ahb.h>
+
+#endif	/* _TEGRA124_AHB_H_ */
arch/arm/include/asm/arch-tegra124/clock-tables.h new file +496 -0

496 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/clock.h new file +15 -0
new file mode 100644
index 0000000..8298133
@@ -0,0 +1,15 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* Tegra124 clock control functions */
+
+#ifndef _TEGRA124_CLOCK_H_
+#define _TEGRA124_CLOCK_H_
+
+#include <asm/arch-tegra/tegra1x4_clock.h>
+
+#endif	/* _TEGRA124_CLOCK_H_ */
arch/arm/include/asm/arch-tegra124/emc.h new file +13 -0
new file mode 100644
index 0000000..eb4a7c9
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_EMC_H_
+#define _TEGRA124_EMC_H_
+
+#include <asm/arch-tegra/tegra1x4_emc.h>
+
+#endif	/* _TEGRA124_EMC_H_ */
arch/arm/include/asm/arch-tegra124/flow.h new file +13 -0
new file mode 100644
index 0000000..41758d8
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_FLOW_H_
+#define _TEGRA124_FLOW_H_
+
+#include <asm/arch-tegra/tegra1x4_flow.h>
+
+#endif	/* _TEGRA124_FLOW_H_ */
arch/arm/include/asm/arch-tegra124/funcmux.h new file +23 -0
new file mode 100644
index 0000000..df94d13
@@ -0,0 +1,23 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* Tegra124 high-level function multiplexing */
+
+#ifndef _TEGRA124_FUNCMUX_H_
+#define _TEGRA124_FUNCMUX_H_
+
+#include <asm/arch-tegra/funcmux.h>
+
+/* Configs supported by the func mux */
+enum {
+	FUNCMUX_DEFAULT = 0,	/* default config */
+
+	/* UART configs */
+	FUNCMUX_UART1_KBC = 0,
+	FUNCMUX_UART4_GPIO = 0,
+};
+#endif	/* _TEGRA124_FUNCMUX_H_ */
arch/arm/include/asm/arch-tegra124/fuse.h new file +13 -0
new file mode 100644
index 0000000..de3ad6f
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_FUSE_H_
+#define _TEGRA124_FUSE_H_
+
+#include <asm/arch-tegra/tegra1x4_fuse.h>
+
+#endif	/* _TEGRA124_FUSE_H_ */
arch/arm/include/asm/arch-tegra124/gp_padctrl.h new file +13 -0
new file mode 100644
index 0000000..bb8ef45
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_GP_PADCTRL_H_
+#define _TEGRA124_GP_PADCTRL_H_
+
+#include <asm/arch-tegra/tegra1x4_gp_padctrl.h>
+
+#endif	/* _TEGRA124_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra124/gpio.h new file +303 -0

303 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/hardware.h new file +16 -0
new file mode 100644
index 0000000..faaad91
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_HARDWARE_H_
+#define _TEGRA124_HARDWARE_H_
+
+/*
+ * Include Tegra-specific hardware definitions
+ * Nothing needed currently for T124
+ */
+
+#endif /* _TEGRA124_HARDWARE_H_ */
arch/arm/include/asm/arch-tegra124/pinmux.h new file +618 -0

618 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/pmc.h new file +368 -0

368 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/pmu.h new file +13 -0
new file mode 100644
index 0000000..deb9244
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_PMU_H_
+#define _TEGRA124_PMU_H_
+
+#include <asm/arch-tegra/tegra1x4_pmu.h>
+
+#endif	/* _TEGRA124_PMU_H_ */
arch/arm/include/asm/arch-tegra124/spl.h new file +13 -0
new file mode 100644
index 0000000..918124e
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef	_TEGRA124_SPL_H_
+#define	_TEGRA124_SPL_H_
+
+#include <asm/arch-tegra/spl.h>
+
+#endif	/* TEGRA124_SPL_H */
arch/arm/include/asm/arch-tegra124/sysctr.h new file +13 -0
new file mode 100644
index 0000000..078ed9c
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_SYSCTR_H_
+#define _TEGRA124_SYSCTR_H_
+
+#include <asm/arch-tegra/tegra1x4_sysctr.h>
+
+#endif	/* _TEGRA124_SYSCTR_H_ */
arch/arm/include/asm/arch-tegra124/tegra.h new file +30 -0
new file mode 100644
index 0000000..feadd2f
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_H_
+#define _TEGRA124_H_
+
+#define NV_PA_SDRAM_BASE	0x80000000	/* 0x80000000 for real T1x4 */
+#define NV_PA_TSC_BASE		0x700F0000	/* System Counter TSC regs */
+#define NV_PA_MC_BASE		0x70019000	/* Mem Ctlr regs (MCB, etc.) */
+#define NV_PA_AHB_BASE		0x6000C000	/* System regs (AHB, etc.) */
+
+#include <asm/arch-tegra/tegra.h>
+
+#define BCT_ODMDATA_OFFSET	1704	/* offset to ODMDATA word */
+
+#undef NVBOOTINFOTABLE_BCTSIZE
+#undef NVBOOTINFOTABLE_BCTPTR
+#define NVBOOTINFOTABLE_BCTSIZE	0x48	/* BCT size in BIT in IRAM */
+#define NVBOOTINFOTABLE_BCTPTR	0x4C	/* BCT pointer in BIT in IRAM */
+
+#define MAX_NUM_CPU		4
+#define MCB_EMEM_ARB_OVERRIDE	(NV_PA_MC_BASE + 0xE8)
+
+#define TEGRA_USB1_BASE		0x7D000000
+
+#endif /* _TEGRA124_H_ */
arch/arm/include/asm/arch-tegra124/usb.h new file +13 -0
new file mode 100644
index 0000000..806c4ac
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA124_USB_H_
+#define _TEGRA124_USB_H_
+
+#include <asm/arch-tegra/tegra1x4_usb.h>
+
+#endif	/* _TEGRA124_USB_H_ */
Signature · 1 line
1.8.1.5
author
#1 lore raw

PATCH 2/8 Tegra124: Add changes to common arch-tegra header files

Minor changes to support T124 chip and sku IDs.

Change-Id I44092a2ec558e01952be8cc7c0534e384a810ffd
---
 arch/arm/include/asm/arch-tegra/gp_padctrl.h | 1 +
 arch/arm/include/asm/arch-tegra/tegra.h      | 2 ++
 2 files changed, 3 insertions(+)
arch/arm/include/asm/arch-tegra/gp_padctrl.h +1 -0
index c840c08..7a86acb 100644
@@ -20,5 +20,6 @@
 #define CHIPID_TEGRA20			0x20
 #define CHIPID_TEGRA30			0x30
 #define CHIPID_TEGRA114			0x35
+#define CHIPID_TEGRA124			0x40
 
 #endif	/* _TEGRA_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra/tegra.h +2 -0
index 25d1fc4..3b3e016 100644
@@ -67,6 +67,7 @@ enum {
 	SKU_ID_T30		= 0x81, /* Cardhu value */
 	SKU_ID_T114_ENG		= 0x00, /* Dalmore value, unfused */
 	SKU_ID_T114_1		= 0x01,
+	SKU_ID_T124_ENG		= 0x00, /* Venice2 value, unfused */
 };
 
 /*
@@ -80,6 +81,7 @@ enum {
 	TEGRA_SOC_T25,
 	TEGRA_SOC_T30,
 	TEGRA_SOC_T114,
+	TEGRA_SOC_T124,
 
 	TEGRA_SOC_CNT,
 	TEGRA_SOC_UNKNOWN	= -1,
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 2/8 Tegra124: Add changes to common arch-tegra header files

Quoted 1 line · Tom Warren

Minor changes to support T124 chip and sku IDs.

SKU is an abbreviation, therefore should be uppercase.

Thierry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131008/13064ec6/attachment.pgp>

author
#3 lore raw

PATCH 3/8 Tegra124: Add SPL/AVP (arm720t) cpu files

In reply to Tom Warren

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

Change-Id I721f83f1d5fa549e0698e0cc76ab3e5ea11ba895
---
 arch/arm/cpu/arm720t/tegra-common/cpu.c |  63 +++++--
 arch/arm/cpu/arm720t/tegra-common/cpu.h |   6 +-
 arch/arm/cpu/arm720t/tegra124/Makefile  |  31 ++++
 arch/arm/cpu/arm720t/tegra124/config.mk |   7 +
 arch/arm/cpu/arm720t/tegra124/cpu.c     | 301 ++++++++++++++++++++++++++++++++
 5 files changed, 387 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra124/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra124/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra124/cpu.c
arch/arm/cpu/arm720t/tegra-common/cpu.c +44 -19
index 72c69b9..fbe553a 100644
@@ -1,17 +1,8 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
  *
- * 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/>.
+ * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
@@ -112,6 +103,22 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 		{ .n = 116, .m = 1, .p = 1 }, /* OSC: 12.0 MHz */
 		{ .n = 108, .m = 2, .p = 1 }, /* OSC: 26.0 MHz */
 	},
+
+	/*
+	 * T124: 700 MHz
+	 *
+	 * Register   Field  Bits   Width
+	 * ------------------------------
+	 * PLLX_BASE  p      23:20    4
+	 * PLLX_BASE  n      15: 8    8
+	 * PLLX_BASE  m       7: 0    8
+	 */
+	{
+		{ .n = 108, .m = 1, .p = 1 }, /* OSC: 13.0 MHz */
+		{ .n =  73, .m = 1, .p = 1 }, /* OSC: 19.2 MHz */
+		{ .n = 116, .m = 1, .p = 1 }, /* OSC: 12.0 MHz */
+		{ .n = 108, .m = 2, .p = 1 }, /* OSC: 26.0 MHz */
+	},
 };
 
 void adjust_pllp_out_freqs(void)
@@ -146,6 +153,18 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 
 	debug(" pllx_set_rate entry\n");
 
+#if defined(CONFIG_TEGRA124)
+	struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+
+	/* Disable IDDQ */
+	reg = readl(&clkrst->crc_pllx_misc3);
+	reg &= ~PLLX_IDDQ_MASK;
+	writel(reg, &clkrst->crc_pllx_misc3);
+	udelay(2);
+	debug("%s: IDDQ: PLLX IDDQ = 0x%08X\n", __func__,
+	      readl(&clkrst->crc_pllx_misc3));
+#endif	/* T124 */
+
 	/* Set BYPASS, m, n and p to PLLX_BASE */
 	reg = PLL_BYPASS_MASK | (divm << PLL_DIVM_SHIFT);
 	reg |= ((divn << PLL_DIVN_SHIFT) | (divp << PLL_DIVP_SHIFT));
@@ -162,18 +181,23 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 		reg |= (1 << PLL_DCCON_SHIFT);
 	writel(reg, &pll->pll_misc);
 
-	/* Enable PLLX */
-	reg = readl(&pll->pll_base);
-	reg |= PLL_ENABLE_MASK;
-
 	/* Disable BYPASS */
+	reg = readl(&pll->pll_base);
 	reg &= ~PLL_BYPASS_MASK;
 	writel(reg, &pll->pll_base);
+	debug(" pllx_set_rate: base = 0x%08X\n", reg);
 
 	/* Set lock_enable to PLLX_MISC */
 	reg = readl(&pll->pll_misc);
 	reg |= PLL_LOCK_ENABLE_MASK;
 	writel(reg, &pll->pll_misc);
+	debug(" pllx_set_rate: misc = 0x%08X\n", reg);
+
+	/* Enable PLLX last, as per JZ */
+	reg = readl(&pll->pll_base);
+	reg |= PLL_ENABLE_MASK;
+	writel(reg, &pll->pll_base);
+	debug(" pllx_set_rate: base final = 0x%08X\n", reg);
 
 	return 0;
 }
@@ -208,7 +232,7 @@ void init_pllx(void)
 	sel = &tegra_pll_x_table[chip_sku][osc];
 	pllx_set_rate(pll, sel->n, sel->m, sel->p, sel->cpcon);
 
-	/* adjust PLLP_out1-4 on T3x/T114 */
+	/* adjust PLLP_out1-4 on T3x/T1x4 */
 	if (soc_type >= CHIPID_TEGRA30) {
 		debug("  init_pllx: adjusting PLLP out freqs\n");
 		adjust_pllp_out_freqs();
@@ -343,13 +367,14 @@ void clock_enable_coresight(int enable)
 	if (enable) {
 		/*
 		 * Put CoreSight on PLLP_OUT0 and divide it down as per
-		 * PLLP base frequency based on SoC type (T20/T30/T114).
+		 * PLLP base frequency based on SoC type (T20/T30/T1x4).
 		 * Clock divider request would setup CSITE clock as 144MHz
 		 * for PLLP base 216MHz and 204MHz for PLLP base 408MHz
 		 */
 
 		soc_type = tegra_get_chip();
-		if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114)
+		if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114 ||
+		    soc_type == CHIPID_TEGRA124)
 			src = CLK_DIVIDER(NVBL_PLLP_KHZ, 204000);
 		else if (soc_type == CHIPID_TEGRA20)
 			src = CLK_DIVIDER(NVBL_PLLP_KHZ, 144000);
arch/arm/cpu/arm720t/tegra-common/cpu.h +4 -2
index 60412c7..7e0b314 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2011
+ * (C) Copyright 2010-2013
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -12,7 +12,8 @@
 
 #if defined(CONFIG_TEGRA20)
 #define NVBL_PLLP_KHZ	(216000)
-#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114)
+#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) || \
+	defined(CONFIG_TEGRA124)
 #define NVBL_PLLP_KHZ	(408000)
 #else
 #error "Unknown Tegra chip!"
@@ -68,3 +69,4 @@ int tegra_get_chip(void);
 int tegra_get_sku_info(void);
 int tegra_get_chip_sku(void);
 void adjust_pllp_out_freqs(void);
+void pmic_enable_cpu_vdd(void);
arch/arm/cpu/arm720t/tegra124/Makefile new file +31 -0
new file mode 100644
index 0000000..836eca0
@@ -0,0 +1,31 @@
+#
+# (C) Copyright 2010-2013
+# NVIDIA Corporation <www.nvidia.com>
+# (C) Copyright 2000-2008
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+     
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+COBJS-y	+= cpu.o
+
+SRCS	:= $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+
+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/arm720t/tegra124/config.mk new file +7 -0
new file mode 100644
index 0000000..5e10701
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2010-2013
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#/
+USE_PRIVATE_LIBGCC = yes
arch/arm/cpu/arm720t/tegra124/cpu.c new file +301 -0

301 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#4 lore raw

PATCH 3/8 Tegra124: Add SPL/AVP (arm720t) cpu files

Quoted 21 lines · Tom Warren

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

Change-Id I721f83f1d5fa549e0698e0cc76ab3e5ea11ba895
---
 arch/arm/cpu/arm720t/tegra-common/cpu.c |  63 +++++--
 arch/arm/cpu/arm720t/tegra-common/cpu.h |   6 +-
 arch/arm/cpu/arm720t/tegra124/Makefile  |  31 ++++
 arch/arm/cpu/arm720t/tegra124/config.mk |   7 +
 arch/arm/cpu/arm720t/tegra124/cpu.c     | 301 ++++++++++++++++++++++++++++++++
 5 files changed, 387 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra124/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra124/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra124/cpu.c
arch/arm/cpu/arm720t/tegra-common/cpu.c +0 -0
index 72c69b9..fbe553a 100644

arch/arm/cpu/arm720t/tegra-common/cpu.c line 3

Quoted 4 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -1
@@ -1,17 +1,8 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>

What about years 2010-2012? Shouldn't they be kept in the copyright line? Also, we should probably try to be more consistent with our copyright notices. There's a variety of ways that we use:

	(C) Copyright 2013
	NVIDIA Corporation <www.nvidia.com>

	Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.

	(C) Copyright 2010-2013, NVIDIA Corporation <www.nvidia.com>

	Copyright (c) 2010-2011 NVIDIA Corporation

There may be more. I personally have a preference for the last of these, but as long as we can keep some consistency I don't mind which one we settle on.

Quoted 6 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +1 -0
 void adjust_pllp_out_freqs(void)
@@ -146,6 +153,18 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 
        debug(" pllx_set_rate entry\n");
 
+#if defined(CONFIG_TEGRA124)

arch/arm/cpu/arm720t/tegra-common/cpu.c int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm, · line 166

Quoted 10 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +10 -0
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+
+       /* Disable IDDQ */
+       reg = readl(&clkrst->crc_pllx_misc3);
+       reg &= ~PLLX_IDDQ_MASK;
+       writel(reg, &clkrst->crc_pllx_misc3);
+       udelay(2);
+       debug("%s: IDDQ: PLLX IDDQ = 0x%08X\n", __func__,
+             readl(&clkrst->crc_pllx_misc3));
+#endif /* T124 */

Perhaps this should be moved to a separate function that can be provided as a dummy for non-Tegra124?

arch/arm/cpu/arm720t/tegra-common/cpu.c int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm, · line 188

Quoted 13 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -4
@@ -162,18 +181,23 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
                reg |= (1 << PLL_DCCON_SHIFT);
        writel(reg, &pll->pll_misc);
 
-       /* Enable PLLX */
-       reg = readl(&pll->pll_base);
-       reg |= PLL_ENABLE_MASK;
-
        /* Disable BYPASS */
+       reg = readl(&pll->pll_base);
        reg &= ~PLL_BYPASS_MASK;
        writel(reg, &pll->pll_base);
+       debug(" pllx_set_rate: base = 0x%08X\n", reg);

Why's there a leading space in that debug message? I see that other debug messages have it as well, but I don't see any reason for it. Copied and pasted?

arch/arm/cpu/arm720t/tegra-common/cpu.c int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm, · line 196

Quoted 7 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +3 -0
        /* Set lock_enable to PLLX_MISC */
        reg = readl(&pll->pll_misc);
        reg |= PLL_LOCK_ENABLE_MASK;
        writel(reg, &pll->pll_misc);
+       debug(" pllx_set_rate: misc = 0x%08X\n", reg);
+
+       /* Enable PLLX last, as per JZ */

I guess JZ is Jimmy Zhang, but a proper explanation for why this is done on necessary would be more valuable.

arch/arm/cpu/arm720t/tegra-common/cpu.c void init_pllx(void) · line 235

Quoted 2 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +1 -1
-       /* adjust PLLP_out1-4 on T3x/T114 */
+       /* adjust PLLP_out1-4 on T3x/T1x4 */

I don't know about this. What ever happens if engineering comes up with a chip, say, T194 that's not compatible? I think there's some sense in being explicit here and making this T3x/T114/T124. I don't know why T3x is used here either for that matter.

arch/arm/cpu/arm720t/tegra-common/cpu.c void clock_enable_coresight(int enable) · line 377

Quoted 4 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -1
                soc_type = tegra_get_chip();
-               if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114)
+               if (soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114 ||
+                   soc_type == CHIPID_TEGRA124)

Perhaps:

		if (soc_type >= CHIPID_TEGRA30)

?

Quoted 11 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -1
@@ -12,7 +12,8 @@
 
 #if defined(CONFIG_TEGRA20)
 #define NVBL_PLLP_KHZ  (216000)
-#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114)
+#elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) || \
+       defined(CONFIG_TEGRA124)
 #define NVBL_PLLP_KHZ  (408000)
 #else
 #error "Unknown Tegra chip!"

arch/arm/cpu/arm720t/tegra-common/cpu.c int tegra_get_chip(void); · line 72

Quoted 4 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +1 -0
@@ -68,3 +69,4 @@ int tegra_get_chip(void);
 int tegra_get_sku_info(void);
 int tegra_get_chip_sku(void);
 void adjust_pllp_out_freqs(void);
+void pmic_enable_cpu_vdd(void);

This doesn't seem to exist until patch 8. Perhaps this should really be an weak function so that it always exists but can still be overwritten by individual boards?

Quoted 6 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +5 -0
+static void enable_cpu_power_rail(void)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       debug("enable_cpu_power_rail entry\n");

arch/arm/cpu/arm720t/tegra124/cpu.c line 36

Quoted 10 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +10 -0
+
+       /* un-tristate PWR_I2C SCL/SDA, rest of the defaults are correct */
+       pinmux_tristate_disable(PINGRP_PWR_I2C_SCL);
+       pinmux_tristate_disable(PINGRP_PWR_I2C_SDA);
+
+       pmic_enable_cpu_vdd();
+
+       /*
+        * Set CPUPWRGOOD_TIMER - APB clock is 1/2 of SCLK (102MHz),
+        * set it for 5ms as per SysEng (102MHz/5mS = 510000 (7C830h).

Nit: "102MHz/5ms". And it should probably be 102MHz*5ms to yield the correct result.

arch/arm/cpu/arm720t/tegra124/cpu.c line 56

Quoted 12 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +12 -0
+static void enable_cpu_clocks(void)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg;
+
+       debug("enable_cpu_clocks entry\n");
+
+       /* Wait for PLL-X to lock */
+       do {
+               reg = readl(&clkrst->crc_pll_simple[SIMPLE_PLLX].pll_base);
+               debug("%s: PLLX base = 0x%08X\n", __func__, reg);
+       } while ((reg & (1 << 27)) == 0);

1 << 27 -> PLLX_LOCK?

arch/arm/cpu/arm720t/tegra124/cpu.c line 71

Quoted 6 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +6 -0
+       debug("%s: Enabling clock to all CPUs\n", __func__);
+       /* Enable the clock to all CPUs */
+       reg = readl(&clkrst->crc_clk_cpu_cmplx_clr);
+       reg |= (CLR_CPU3_CLK_STP + CLR_CPU2_CLK_STP);
+       reg |= CLR_CPU1_CLK_STP;
+       writel((reg | CLR_CPU0_CLK_STP), &clkrst->crc_clk_cpu_cmplx_clr);

Perhaps:

	reg = readl(&clkrst->crc_clk_cpu_cmplx_clr);
	reg |= CLR_CPU3_CLK_STP | CLR_CPU2_CLK_STP | CLR_CPU1_CLK_STP |
	       CLR_CPU0_CLK_STP;
	writel(reg, &clkrst->crc_clk_cpu_cmplx_clr);

? Also this is a write-1-to-clear register, right? So there should be no need to read it first and OR in the new bits.

Quoted 5 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +5 -0
+static void remove_cpu_resets(void)
+{
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+       u32 reg;
+

arch/arm/cpu/arm720t/tegra124/cpu.c line 96

Quoted 10 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +10 -0
+       debug("remove_cpu_resets entry\n");
+
+       /* Take the slow and fast partitions out of reset */
+       reg = CLR_NONCPURESET;
+       writel(reg, &clkrst->crc_rst_cpulp_cmplx_clr);
+       writel(reg, &clkrst->crc_rst_cpug_cmplx_clr);
+
+       /* Clear the SW-controlled reset of the slow cluster */
+       reg = (CLR_CPURESET0 + CLR_DBGRESET0 + CLR_CORERESET0 + CLR_CXRESET0);
+       reg |= (CLR_L2RESET + CLR_PRESETDBG);

s/+/|/? And you can safely drop the parentheses as they aren't required.

arch/arm/cpu/arm720t/tegra124/cpu.c line 104

Quoted 8 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +8 -0
+       writel(reg, &clkrst->crc_rst_cpulp_cmplx_clr);
+
+       /* Clear the SW-controlled reset of the fast cluster */
+       reg = (CLR_CPURESET0 + CLR_DBGRESET0 + CLR_CORERESET0 + CLR_CXRESET0);
+       reg |= (CLR_CPURESET1 + CLR_DBGRESET1 + CLR_CORERESET1 + CLR_CXRESET1);
+       reg |= (CLR_CPURESET2 + CLR_DBGRESET2 + CLR_CORERESET2 + CLR_CXRESET2);
+       reg |= (CLR_CPURESET3 + CLR_DBGRESET3 + CLR_CORERESET3 + CLR_CXRESET3);
+       reg |= (CLR_L2RESET + CLR_PRESETDBG);

Same here.

Quoted 1 line

+static int is_partition_powered(u32 mask)

Perhaps this should return bool?

Quoted 5 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +5 -0
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+       u32 reg;
+
+       /* Get power gate status */
+       reg = readl(&pmc->pmc_pwrgate_status);

arch/arm/cpu/arm720t/tegra124/cpu.c line 211

Quoted 10 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +10 -0
+       return (reg & mask) == mask;
+}
+
+static void power_partition(u32 status, u32 partid)
+{
+       struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+
+       debug("%s: status = %08X, part ID = %08X\n", __func__, status, partid);
+       /* Is the partition already on? */
+       if (!is_partition_powered(status)) {

Shouldn't this pass along the partid as well? Otherwise, how does the is_partition_powered() function know what to check for. Perhaps I'm confused by the API here. Why do we even pass around status in the first place? The partition ID should be enough, shouldn't it?

arch/arm/cpu/arm720t/tegra124/cpu.c line 216

Quoted 5 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +5 -0
+               /* No, toggle the partition power state (OFF -> ON) */
+               debug("power_partition, toggling state\n");
+               clrbits_le32(&pmc->pmc_pwrgate_toggle, 0x1F);
+               setbits_le32(&pmc->pmc_pwrgate_toggle, partid);
+               setbits_le32(&pmc->pmc_pwrgate_toggle, START_CP);

The register has only two fields, so no need for read/modify/write. This can be abbreviated to:

		writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);

arch/arm/cpu/arm720t/tegra124/cpu.c line 236

Quoted 10 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +10 -0
+void powerup_cpus(void)
+{
+       debug("powerup_cpus entry\n");
+
+       /* We boot to the fast cluster */
+       debug("powerup_cpus entry: G cluster\n");
+
+       /* Power up the fast cluster rail partition */
+       debug("powerup_cpus: CRAIL\n");
+       power_partition(CRAIL, CRAILID);

Ah, I see now. I'd find something like the following more intuitive:

	power_partition_set(CRAIL, true);

But looking deeper I see that we already have the same API for earlier SoC generations, so I suppose we might as well stick with it.

The current API always has the risk of someone doing something like:

	power_partition(CONC, CRAILID);
Quoted 2 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +2 -0
+void start_cpu(u32 reset_vector)
+{

[...]

Quoted 7 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +7 -0
+       /* Enable VDD_CPU */
+       enable_cpu_power_rail();
+
+       /* Get the CPU(s) running */
+       enable_cpu_clocks();
+
+       /* Enable CoreSight */

arch/arm/cpu/arm720t/tegra124/cpu.c line 277

Quoted 10 lines
arch/arm/cpu/arm720t/tegra124/cpu.c +10 -0
+       clock_enable_coresight(1);
+
+       /* Take CPU(s) out of reset */
+       remove_cpu_resets();
+
+       /* Set the entry point for CPU execution from reset */
+       writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
+
+       /* If the CPU(s) don't already have power, power 'em up */
+       powerup_cpus();

I don't think any of the comments above add value, so they can just as well be dropped. The code is self-explanatory.

Quoted 2 lines

+/*
+ * On poweron, AVP clock source (also called system clock) is set to PLLP_out0

Nit: "power on"

Thierry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131008/c0a960a8/attachment.pgp>

#5 lore raw

PATCH 3/8 Tegra124: Add SPL/AVP (arm720t) cpu files

Quoted 4 lines · Thierry Reding
Quoted 2 lines · Tom Warren

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

Quoted 8 lines
Quoted 4 lines

soc_type = tegra_get_chip(); - if (soc_type ==
CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114) + if
(soc_type == CHIPID_TEGRA30 || soc_type == CHIPID_TEGRA114 || + soc_type == CHIPID_TEGRA124)

Perhaps:

if (soc_type >= CHIPID_TEGRA30)

Given that the only exception is Tegra20, wouldn't it be better as:

if (soc_type == CHIPID_TEGRA20)

and then swap the Tegra20/not-Tegra20 branches of the if statement?

#6 lore raw

PATCH 3/8 Tegra124: Add SPL/AVP (arm720t) cpu files

In reply to Thierry Reding
Quoted 4 lines · Thierry Reding
Quoted 2 lines · Tom Warren

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

Quoted 14 lines

arch/arm/cpu/arm720t/tegra-common/cpu.c int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm, · line 166

Quoted 11 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +11 -0
+#if defined(CONFIG_TEGRA124)
+       struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+
+       /* Disable IDDQ */
+       reg = readl(&clkrst->crc_pllx_misc3);
+       reg &= ~PLLX_IDDQ_MASK;
+       writel(reg, &clkrst->crc_pllx_misc3);
+       udelay(2);
+       debug("%s: IDDQ: PLLX IDDQ = 0x%08X\n", __func__,
+             readl(&clkrst->crc_pllx_misc3));
+#endif /* T124 */

Perhaps this should be moved to a separate function that can be provided as a dummy for non-Tegra124?

(I'm working on finalizing this patch for submission now)

I think it's fine for the core driver to know about the different SoCs. A simple ifdef like this is quite manageable. If the code starts to get unmanageable, or does a lot of things that aren't common across chips, we can always split it out into the SoC-specific files.

Quoted 5 lines
Quoted 1 line

+void pmic_enable_cpu_vdd(void);

This doesn't seem to exist until patch 8. Perhaps this should really be an weak function so that it always exists but can still be overwritten by individual boards?

The build of these files isn't enabled until the last patch anyway, so it's all perfectly bisectable. I'm not included to do anything to fix this unless you feel strongly..

I'll fix up all the other issues you mentioned.

#7 lore raw

PATCH 3/8 Tegra124: Add SPL/AVP (arm720t) cpu files

In reply to Tom Warren
Quoted 4 lines · Tom Warren

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

 arch/arm/cpu/arm720t/tegra124/cpu.c     | 301 ++++++++++++++++++++++++++++++++

I would have expected a lot more of that file to be common with tegra114/cpu.c, considering the tiny size of the kernel patches for SMP support, CPU hotplug support, etc.

author
#8 lore raw

PATCH 4/8 Tegra124: Add CPU (armv7) files

In reply to Tom Warren

These files are for code that runs on the CPU (A15) on T124 boards. At this time, there is no A15-specific code here. The warmboot/LP0 files aren't included as that code hasn't been ported yet.

Change-Id I299409ca1b051f8a76df641be73f1f4489d491ab
---
 arch/arm/cpu/armv7/tegra124/Makefile   |  30 ++
 arch/arm/cpu/armv7/tegra124/config.mk  |   9 +
 arch/arm/cpu/tegra124-common/Makefile  |  31 ++
 arch/arm/cpu/tegra124-common/clock.c   | 840 +++++++++++++++++++++++++++++++++
 arch/arm/cpu/tegra124-common/funcmux.c |  69 +++
 arch/arm/cpu/tegra124-common/pinmux.c  | 731 ++++++++++++++++++++++++++++
 6 files changed, 1710 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/tegra124/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra124/config.mk
 create mode 100644 arch/arm/cpu/tegra124-common/Makefile
 create mode 100644 arch/arm/cpu/tegra124-common/clock.c
 create mode 100644 arch/arm/cpu/tegra124-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra124-common/pinmux.c
arch/arm/cpu/armv7/tegra124/Makefile new file +30 -0
new file mode 100644
index 0000000..7da9966
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2013
+# NVIDIA Corporation <www.nvidia.com>
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#/
+
+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/tegra124/config.mk new file +9 -0
new file mode 100644
index 0000000..270143a
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2013
+# NVIDIA Corporation <www.nvidia.com>
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#/
+CONFIG_ARCH_DEVICE_TREE := tegra124
arch/arm/cpu/tegra124-common/Makefile new file +31 -0
new file mode 100644
index 0000000..13ae268
@@ -0,0 +1,31 @@
+#
+# (C) Copyright 2013
+# NVIDIA Corporation <www.nvidia.com>
+# (C) Copyright 2000-2008
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#/
+     
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC)-common.o
+
+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)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/tegra124-common/clock.c new file +840 -0

840 lines not on this page · raw message

arch/arm/cpu/tegra124-common/funcmux.c new file +69 -0

69 lines not on this page · raw message

arch/arm/cpu/tegra124-common/pinmux.c new file +731 -0

731 lines not on this page · raw message

Signature · 1 line
1.8.1.5
author
#9 lore raw

PATCH 5/8 Tegra124: Add common CPU (shared) files

In reply to Tom Warren

These files are used by both SPL and main U-Boot.

Change-Id I5b762fc3f9886f588372c7706feaf80c50305c75
---
 arch/arm/cpu/tegra-common/ap.c    | 11 +++++++++--
 arch/arm/cpu/tegra-common/board.c |  8 +++++++-
 arch/arm/cpu/tegra-common/cache.c | 38 +++++++++++++++-----------------------
 3 files changed, 31 insertions(+), 26 deletions(-)
arch/arm/cpu/tegra-common/ap.c +9 -2
index 6fb11cb..c2c4a0b 100644
@@ -27,7 +27,7 @@ int tegra_get_chip(void)
 	/*
 	 * This is undocumented, Chip ID is bits 15:8 of the register
 	 * APB_MISC + 0x804, and has value 0x20 for Tegra20, 0x30 for
-	 * Tegra30, and 0x35 for T114.
+	 * Tegra30, 0x35 for T114 and 0x40 for T124.
 	 */
 	rev = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK) >> HIDREV_CHIPID_SHIFT;
 	debug("%s: CHIPID is 0x%02X\n", __func__, rev);
@@ -81,7 +81,14 @@ int tegra_get_chip_sku(void)
 			return TEGRA_SOC_T114;
 		}
 		break;
+	case CHIPID_TEGRA124:
+		switch (sku_id) {
+		}
+		case SKU_ID_T124_ENG:
+			return TEGRA_SOC_T124;
+		break;
 	}
+
 	/* unknown chip/sku id */
 	printf("%s: ERROR: UNKNOWN CHIP/SKU ID COMBO (0x%02X/0x%02X)\n",
 		__func__, chip_id, sku_id);
@@ -117,7 +124,7 @@ static u32 get_odmdata(void)
 	 * The BCT start and size are stored in the BIT in IRAM.
 	 * Read the data @ bct_start + (bct_size - 12). This works
 	 * on T20 and T30 BCTs, which are locked down. If this changes
-	 * in new chips (T114, etc.), we can revisit this algorithm.
+	 * in new chips (T1x4, etc.), we can revisit this algorithm.
 	 */
 
 	u32 bct_start, odmdata;
arch/arm/cpu/tegra-common/board.c +7 -1
index d9cbda8..2c9613e 100644
@@ -109,12 +109,18 @@ static int uart_configs[] = {
 	-1,
 	-1,
 	-1,
-#else	/* Tegra114 */
+#elif defined(CONFIG_TEGRA114)
 	-1,
 	-1,
 	-1,
 	FUNCMUX_UART4_GMI,	/* UARTD */
 	-1,
+#else	/* Tegra12x */
+	FUNCMUX_UART1_KBC,	/* UARTA */
+	-1,
+	-1,
+	FUNCMUX_UART4_GPIO,	/* UARTD */
+	-1,
 #endif
 };
 
arch/arm/cpu/tegra-common/cache.c +15 -23
index 48e9319..11fe960 100644
@@ -1,17 +1,8 @@
 /*
- * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
  *
- * 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/>.
+ * SPDX-License-Identifier:     GPL-2.0+
  */
 
 /* Tegra cache routines */
@@ -33,16 +24,17 @@ void config_cache(void)
 		"orr r0, r0, #0x41\n"
 		"mcr p15, 0, r0, c1, c0, 1\n");
 
-	/* Currently, only T114 needs this L2 cache change to boot Linux */
+	/* Currently, only T1x4 needs this L2 cache change to boot Linux */
 	reg = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK);
-	if (reg != (CHIPID_TEGRA114 << HIDREV_CHIPID_SHIFT))
-		return;
-	/*
-	 * Systems with an architectural L2 cache must not use the PL310.
-	 * Config L2CTLR here for a data RAM latency of 3 cycles.
-	 */
-	asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
-	reg &= ~7;
-	reg |= 2;
-	asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	reg = (reg >> HIDREV_CHIPID_SHIFT) & 0xFF;
+	if ((reg == CHIPID_TEGRA114) || (reg == CHIPID_TEGRA124)) {
+		/*
+		 * SoCs with an architectural L2 cache must not use the PL310.
+		 * Config L2CTLR here for a data RAM latency of 3 cycles.
+		 */
+		asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
+		reg &= ~7;
+		reg |= 2;
+		asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	}
 }
Signature · 1 line
1.8.1.5
#10 lore raw

PATCH 5/8 Tegra124: Add common CPU (shared) files

Quoted 5 lines · Tom Warren

These files are used by both SPL and main U-Boot.

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

Quoted 10 lines
arch/arm/cpu/tegra-common/ap.c +6 -0
@@ -81,7 +81,14 @@ int tegra_get_chip_sku(void)
 			return TEGRA_SOC_T114;
 		}
 		break;
+	case CHIPID_TEGRA124:
+		switch (sku_id) {
+		}
+		case SKU_ID_T124_ENG:
+			return TEGRA_SOC_T124;
+		break;
 	}

Something is wrong with the block layout there. Is the switch's closing } two lines too early?

Quoted 21 lines
arch/arm/cpu/tegra-common/cache.c +3 -11
@@ -33,16 +24,17 @@ void config_cache(void)
 		"orr r0, r0, #0x41\n"
 		"mcr p15, 0, r0, c1, c0, 1\n");
 
-	/* Currently, only T114 needs this L2 cache change to boot Linux */
+	/* Currently, only T1x4 needs this L2 cache change to boot Linux */
 	reg = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK);
-	if (reg != (CHIPID_TEGRA114 << HIDREV_CHIPID_SHIFT))
-		return;
-	/*
-	 * Systems with an architectural L2 cache must not use the PL310.
-	 * Config L2CTLR here for a data RAM latency of 3 cycles.
-	 */
-	asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
-	reg &= ~7;
-	reg |= 2;
-	asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	reg = (reg >> HIDREV_CHIPID_SHIFT) & 0xFF;
+	if ((reg == CHIPID_TEGRA114) || (reg == CHIPID_TEGRA124)) {

arch/arm/cpu/tegra-common/cache.c void config_cache(void) · line 40

Quoted 10 lines
arch/arm/cpu/tegra-common/cache.c +9 -0
+		/*
+		 * SoCs with an architectural L2 cache must not use the PL310.
+		 * Config L2CTLR here for a data RAM latency of 3 cycles.
+		 */
+		asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
+		reg &= ~7;
+		reg |= 2;
+		asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	}
 }

Why change the indentation level here? The if (xxx) return could have been enhanced to check for either chip without changing the indentation level of the rest of the function.

Also, we shouldn't be checking for the SoC, but rather for the CPU core type. On A9 we want to return. On A15, we want to continue. If we had written the code to check the correct thing before, we wouldn't have to touch this function at all when porting to Tegra124.

author
#11 lore raw

PATCH 6/8 Tegra124: Add generic T124 build support

In reply to Tom Warren

Basic Tegra124 build support added - no specific
board is targeted.

Change-Id Id16b44b5b394e03b121e702eaef2f49f55ab3da3
---
 board/nvidia/common/board.c | 3 +++
 1 file changed, 3 insertions(+)
board/nvidia/common/board.c +3 -0
index 126e56e..3f78787 100644
@@ -77,9 +77,12 @@ void __gpio_early_init_uart(void)
 void gpio_early_init_uart(void)
 __attribute__((weak, alias("__gpio_early_init_uart")));
 
+/* TODO(twarren at nvidia.com): Create this only in boards that have NAND */
 void __pin_mux_nand(void)
 {
+#if defined(CONFIG_TEGRA_NAND)
 	funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT);
+#endif
 }
 
 void pin_mux_nand(void) __attribute__((weak, alias("__pin_mux_nand")));
Signature · 1 line
1.8.1.5
#12 lore raw

PATCH 6/8 Tegra124: Add generic T124 build support

Quoted 2 lines · Tom Warren

Basic Tegra124 build support added - no specific
board is targeted.

The content of this patch seems entirely unrelated to the commit description.

BTW, if I apply each one of these patches in turn, rather than all of them at once, can the entire code-base build correctly for all SoCs, or will I get build errors? I suppose that the boards.cfg is added near the end of the series, so perhaps there's no issue here.

author
#13 lore raw

PATCH 7/8 Tegra124: Venice2: fdt: Add device-tree files

In reply to Tom Warren

These are fairly complete, and near-clones of T114 Venice, with an additional I2C port, and MMC address changes for T124.

Change-Id Icf9d34a2ebf15b5389bbc5293a067a08938ef16a
---
 arch/arm/dts/tegra124.dtsi            | 328 ++++++++++++++++++++++++++++++++++
 board/nvidia/dts/tegra124-venice2.dts | 112 ++++++++++++
 2 files changed, 440 insertions(+)
 create mode 100644 arch/arm/dts/tegra124.dtsi
 create mode 100644 board/nvidia/dts/tegra124-venice2.dts
arch/arm/dts/tegra124.dtsi new file +328 -0
new file mode 100644
index 0000000..a796f3d
@@ -0,0 +1,328 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "nvidia,tegra124";
+
+	tegra_car: clock {
+		compatible = "nvidia,tegra114-car";
+		reg = <0x60006000 0x1000>;
+		#clock-cells = <1>;
+	};
+
+	apbdma: dma {
+		compatible = "nvidia,tegra114-apbdma", "nvidia,tegra30-apbdma";
+		reg = <0x6000a000 0x1400>;
+		interrupts = <0 104 0x04
+			      0 105 0x04
+			      0 106 0x04
+			      0 107 0x04
+			      0 108 0x04
+			      0 109 0x04
+			      0 110 0x04
+			      0 111 0x04
+			      0 112 0x04
+			      0 113 0x04
+			      0 114 0x04
+			      0 115 0x04
+			      0 116 0x04
+			      0 117 0x04
+			      0 118 0x04
+			      0 119 0x04
+			      0 128 0x04
+			      0 129 0x04
+			      0 130 0x04
+			      0 131 0x04
+			      0 132 0x04
+			      0 133 0x04
+			      0 134 0x04
+			      0 135 0x04
+			      0 136 0x04
+			      0 137 0x04
+			      0 138 0x04
+			      0 139 0x04
+			      0 140 0x04
+			      0 141 0x04
+			      0 142 0x04
+			      0 143 0x04>;
+	};
+
+	gpio: gpio {
+		compatible = "nvidia,tegra114-gpio";
+		reg = <0x6000d000 0x1000>;
+		interrupts = <0 32 0x04
+			      0 33 0x04
+			      0 34 0x04
+			      0 35 0x04
+			      0 55 0x04
+			      0 87 0x04
+			      0 89 0x04
+			      0 125 0x04>;
+		#gpio-cells = <2>;
+		gpio-controller;
+		#interrupt-cells = <2>;
+		interrupt-controller;
+	};
+
+	i2c at 7000c000 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000c000 0x100>;
+		interrupts = <0 38 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 12>;
+		status = "disabled";
+	};
+
+	i2c at 7000c400 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000c400 0x100>;
+		interrupts = <0 84 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 54>;
+		status = "disabled";
+	};
+
+	i2c at 7000c500 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000c500 0x100>;
+		interrupts = <0 92 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 67>;
+		status = "disabled";
+	};
+
+	i2c at 7000c700 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000c700 0x100>;
+		interrupts = <0 120 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 103>;
+		status = "disabled";
+	};
+
+	i2c at 7000d000 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000d000 0x100>;
+		interrupts = <0 53 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 47>;
+		status = "disabled";
+	};
+
+	i2c at 7000d100 {
+		compatible = "nvidia,tegra114-i2c";
+		reg = <0x7000d100 0x100>;
+		interrupts = <0 53 0x04>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		clocks = <&tegra_car 47>;
+		status = "disabled";
+        };
+
+	spi at 7000d400 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000d400 0x200>;
+		interrupts = <0 59 0x04>;
+		nvidia,dma-request-selector = <&apbdma 15>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 41>;
+	};
+
+	spi at 7000d600 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000d600 0x200>;
+		interrupts = <0 82 0x04>;
+		nvidia,dma-request-selector = <&apbdma 16>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 44>;
+	};
+
+	spi at 7000d800 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000d800 0x200>;
+		interrupts = <0 83 0x04>;
+		nvidia,dma-request-selector = <&apbdma 17>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 46>;
+	};
+
+	spi at 7000da00 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000da00 0x200>;
+		interrupts = <0 93 0x04>;
+		nvidia,dma-request-selector = <&apbdma 18>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 68>;
+	};
+
+	spi at 7000dc00 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000dc00 0x200>;
+		interrupts = <0 94 0x04>;
+		nvidia,dma-request-selector = <&apbdma 27>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 104>;
+	};
+
+	spi at 7000de00 {
+		compatible = "nvidia,tegra114-spi";
+		reg = <0x7000de00 0x200>;
+		interrupts = <0 79 0x04>;
+		nvidia,dma-request-selector = <&apbdma 28>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+		clocks = <&tegra_car 105>;
+	};
+
+	sdhci at 700b0000 {
+		compatible = "nvidia,tegra30-sdhci";
+		reg = <0x700b0000 0x200>;
+		interrupts = <0 14 0x04>;
+		clocks = <&tegra_car 14>;
+		status = "disable";
+	};
+
+	sdhci at 700b0200 {
+		compatible = "nvidia,tegra30-sdhci";
+		reg = <0x700b0200 0x200>;
+		interrupts = <0 15 0x04>;
+		clocks = <&tegra_car 9>;
+		status = "disable";
+	};
+
+	sdhci at 700b0400 {
+		compatible = "nvidia,tegra30-sdhci";
+		reg = <0x700b0400 0x200>;
+		interrupts = <0 19 0x04>;
+		clocks = <&tegra_car 69>;
+		status = "disable";
+	};
+
+	sdhci at 700b0600 {
+		compatible = "nvidia,tegra30-sdhci";
+		reg = <0x700b0600 0x200>;
+		interrupts = <0 31 0x04>;
+		clocks = <&tegra_car 15>;
+		status = "disable";
+	};
+
+/* This table has USB timing parameters for each Oscillator frequency we
+ * support. There are four sets of values:
+ *
+ * 1. PLLU configuration information (reference clock is osc/clk_m and
+ * PLLU-FOs are fixed at 12MHz/60MHz/480MHz).
+ * Reference frequency MHZ 12.0  13.0 19.2  26.0
+ * ----------------------------------------------------
+ *      DIVN              960   960    200   960
+ *      DIVM               12    13      4    26
+ *      CPCON              12    12      3    12
+ *      LFCON               2     2      2     2
+ *
+ * 2. PLL CONFIGURATION & PARAMETERS for different clock generators:
+ * Reference frequency MHZ 12.0  13.0  19.2  26.0
+ * ----------------------------------------------------
+ * PLLU_ENABLE_DLY_COUNT   02     2     3     4
+ * PLLU_STABLE_COUNT       47    51    75   102
+ * PLL_ACTIVE_DLY_COUNT    08     9    12     9
+ * XTAL_FREQ_COUNT        118   127   188   254
+ *
+ * 3. Debounce values IdDig, Avalid, Bvalid, VbusValid, VbusWakeUp, and
+ * SessEnd. Each of these signals have their own debouncer and for each of
+ * those one out of two debouncing times can be chosen (BIAS_DEBOUNCE_A or
+ * BIAS_DEBOUNCE_B).
+ *
+ * The values of DEBOUNCE_A and DEBOUNCE_B are calculated as follows:
+ *    0xffff -> No debouncing at all
+ *    <n> ms = <n> * 1000 / (1/19.2MHz) / 4
+ *
+ * So to program a 10 ms debounce for BIAS_DEBOUNCE_A, we have:
+ * BIAS_DEBOUNCE_A[15:0] = 10 * 1000 * 19.2 / 4  = 48000 = 0xBB80
+ *
+ * We need to use only DebounceA for BOOTROM. We don't need the DebounceB
+ * values, so we can keep those to default.
+ *
+ * 4. The 20 microsecond delay after bias cell operation.
+ *    UTMIP_BIAS_PAD_TRK_COUNT
+ *
+ * enum {
+ *	PARAM_DIVN,                     // PLL FEEDBACK DIVIDER
+ *	PARAM_DIVM,                     // PLL INPUT DIVIDER
+ *	PARAM_DIVP,                     // POST DIVIDER (2^N)
+ *	PARAM_CPCON,                    // BASE PLLC CHARGE Pump setup ctrl
+ *	PARAM_LFCON,                    // BASE PLLC LOOP FILter setup ctrl
+ *	PARAM_ENABLE_DELAY_COUNT,       // PLL-U Enable Delay Count
+ *	PARAM_STABLE_COUNT,             // PLL-U STABLE count
+ *	PARAM_ACTIVE_DELAY_COUNT,       // PLL-U Active delay count
+ *	PARAM_XTAL_FREQ_COUNT,          // PLL-U XTAL frequency count
+ *	PARAM_DEBOUNCE_A_TIME,          // 10MS DELAY for BIAS_DEBOUNCE_A
+ *	PARAM_BIAS_TIME,                // 20US DELAY AFter bias cell op
+ *					// UTMIP_BIAS_PAD_TRK_COUNT
+ *};
+ */
+	usbparams at 0 {
+		compatible = "nvidia,usbparams";
+		osc-frequency = <13000000>;
+		/* DivN, DivM, DivP, CPCON, LFCON, Delays      Debounce, Bias */
+		params = <0x3c0 0x0d 0x00 0xc 2  0x02 0x33 0x09 0x7f  0x7ef4 6>;
+	};
+
+	usbparams at 1 {
+		compatible = "nvidia,usbparams";
+		osc-frequency = <19200000>;
+		params = <0x0c8 0x04 0x00 0x3 2  0x03 0x4b 0x0c 0xbc  0xbb80 8>;
+	};
+
+	usbparams at 2 {
+		compatible = "nvidia,usbparams";
+		osc-frequency = <12000000>;
+		params = <0x3c0 0x0c 0x00 0xc 2  0x02 0x2f 0x08 0x76  0x7530 5>;
+	};
+
+	usbparams at 3 {
+		compatible = "nvidia,usbparams";
+		osc-frequency = <26000000>;
+		params = <0x3c0 0x1a 0x00 0xc 2  0x04 0x66 0x09 0xfe  0xfde8 0xb>;
+	};
+
+	usb at 7d000000 {
+		compatible = "nvidia,tegra114-ehci", "nvidia,tegra30-ehci";
+		reg = <0x7d000000 0x4000>;
+		interrupts = < 52 >;
+		phy_type = "utmi";
+		clocks = <&tegra_car 22>;	/* PERIPH_ID_USBD */
+		status = "disabled";
+	};
+
+	usb at 7d004000 {
+		compatible = "nvidia,tegra114-ehci", "nvidia,tegra30-ehci";
+		reg = <0x7d004000 0x4000>;
+		interrupts = < 53 >;
+		phy_type = "hsic";
+		clocks = <&tegra_car 58>;	/* PERIPH_ID_USB2 */
+		status = "disabled";
+	};
+
+	usb at 7d008000 {
+		compatible = "nvidia,tegra114-ehci", "nvidia,tegra30-ehci";
+		reg = <0x7d008000 0x4000>;
+		interrupts = < 129 >;
+		phy_type = "utmi";
+		clocks = <&tegra_car 59>;	/* PERIPH_ID_USB3 */
+		status = "disabled";
+	};
+};
board/nvidia/dts/tegra124-venice2.dts new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#14 lore raw

PATCH 7/8 Tegra124: Venice2: fdt: Add device-tree files

arch/arm/dts/tegra124.dtsi line 7

Quoted 7 lines · Tom Warren

These are fairly complete, and near-clones of T114 Venice, with an additional I2C port, and MMC address changes for T124.

arch/arm/dts/tegra124.dtsi +2 -0
 
+	tegra_car: clock {
+		compatible = "nvidia,tegra114-car";

I strongly doubt that the Tegra124 CAR is backwards-compatible with the Tegra114 CAR. I think that should be:

		compatible = "nvidia,tegra124-car";

Have you validated all the compatible values in this file to make sure they're accurate? I'd tend towards leaving out DT nodes that aren't useful yet to reduce the need to verify this, unless you intend to add all the drivers very quickly.

arch/arm/dts/tegra124.dtsi line 8

Quoted 1 line
arch/arm/dts/tegra124.dtsi +1 -0
+		reg = <0x60006000 0x1000>;

There's been a DT rule change/clarification. All DT nodes that contain a reg property must contain a unit address in their node name. DT nodes without a reg property must not contain a unit address in their node name. As such, this should be "clock at 60006000" not "clock". I'd like to see this rule applied to DTs for all new SoCs going forward, even if we haven't yet thought through fixing up all the existing DTs to comply with the rule.

arch/arm/dts/tegra124.dtsi line 15

Quoted 4 lines
arch/arm/dts/tegra124.dtsi +4 -0
+	apbdma: dma {
+		compatible = "nvidia,tegra114-apbdma", "nvidia,tegra30-apbdma";
+		reg = <0x6000a000 0x1400>;
+		interrupts = <0 104 0x04

It'd be nice to finally import include/dt-bindings from the kernel so we could use named constants instead of magic numbers for the "0x04" here...

arch/arm/dts/tegra124.dtsi

Quoted 1 line
arch/arm/dts/tegra124.dtsi +1 -0
+		status = "disable";

"disabled" not "disable".

Quoted 2 lines

+/* This table has USB timing parameters for each Oscillator frequency we
+ * support. There are four sets of values:

This table should be part of the driver, not DT. Hence, all the usbparams nodes should be removed.

arch/arm/dts/tegra124.dtsi line 309

Quoted 8 lines
arch/arm/dts/tegra124.dtsi +8 -0
+	usb at 7d000000 {
+		compatible = "nvidia,tegra114-ehci", "nvidia,tegra30-ehci";
+		reg = <0x7d000000 0x4000>;
+		interrupts = < 52 >;
+		phy_type = "utmi";
+		clocks = <&tegra_car 22>;	/* PERIPH_ID_USBD */
+		status = "disabled";
+	};

These don't conform to the latest USB bindings, which have split EHCI controller and PHY nodes.

board/nvidia/dts/tegra124-venice2.dts line 9

Quoted 9 lines
board/nvidia/dts/tegra124-venice2.dts +7 -0
 
+/include/ "tegra124.dtsi"
+#ifdef CONFIG_CHROMEOS
+/include/ "flashmap-tegra-ro.dtsi"
+/include/ "flashmap-tegra-4mb-rw.dtsi"
+/include/ "chromeos-tegra.dtsi"
+/include/ "crostegra-common.dtsi"
+#endif

CONFIG_CHROMEOS doesn't exist upstream; I think that should be removed.

board/nvidia/dts/tegra124-venice2.dts line 17

Quoted 3 lines
board/nvidia/dts/tegra124-venice2.dts +3 -0
+	config {
+		hwid = "NVIDIA Venice2";
+	};

That looks like another non-standard ChromeOS-ism.

board/nvidia/dts/tegra124-venice2.dts line 39

Quoted 4 lines
board/nvidia/dts/tegra124-venice2.dts +4 -0
+	i2c at 7000c000 {
+		status = "okay";
+		clock-frequency = <100000>;
+		nvidia,use-repeat-start;

That's not a standard property.

board/nvidia/dts/tegra124-venice2.dts line 82

Quoted 4 lines
board/nvidia/dts/tegra124-venice2.dts +4 -0
+	spi at 7000d400 {
+		status = "okay";
+		spi-max-frequency = <25000000>;
+		spi-deactivate-delay = <100>;

That's not a standard property.

board/nvidia/dts/tegra124-venice2.dts line 90

Quoted 8 lines
board/nvidia/dts/tegra124-venice2.dts +8 -0
+		cros-ec {
+			compatible = "google,cros-ec";
+			spi-half-duplex;
+			spi-frame-header = <0xec>;
+			spi-max-frequency = <4000000>;
+			ec-interrupt = <&gpio 23 1>; /* PC7, KBC_IRQ_L */
+			reg = <0>;
+		};

I don't think that conforms to the binding in the kernel's Documentation/devicetree/bindings/mfd/cros-ec.txt. At least the compatible value doesn't match.

board/nvidia/dts/tegra124-venice2.dts line 95

Quoted 3 lines
board/nvidia/dts/tegra124-venice2.dts +3 -0
+	sdhci at 700b0400 {
+		cd-gpios = <&gpio 170 0>; /* gpio PV2 */
+		power-gpios = <&gpio 136 0>; /* gpio PR0 */

power-gpios hasn't been part of the binding for a long time. That should be an xxx-supply property.

board/nvidia/dts/tegra124-venice2.dts line 98

Quoted 3 lines
board/nvidia/dts/tegra124-venice2.dts +3 -0
+		bus-width = <4>;
+		status = "okay";
+		nvidia,removable = <1>;

That's not a standard property.

author
#15 lore raw

PATCH 8/8 Tegra124: Add Venice2 (T124) build

In reply to Tom Warren

These are the board files for Venice2 (t124), plus the AS3722 PMIC files. PMIC init will be moved to pmic_common_init later.

This builds/boots on Venice2, SPI/MMC/USB/I2C all work. Audio and display and WB/LP0 are not supported yet.

Change-Id Ic9f023c0d62e2ee24b9189d93e61c2f492e568fd
---
 board/nvidia/venice2/Makefile                |  27 +++
 board/nvidia/venice2/as3722_init.c           |  91 +++++++
 board/nvidia/venice2/as3722_init.h           |  38 +++
 board/nvidia/venice2/pinmux-config-venice2.h | 339 +++++++++++++++++++++++++++
 board/nvidia/venice2/venice2.c               | 115 +++++++++
 boards.cfg                                   |   1 +
 include/configs/tegra124-common.h            |  76 ++++++
 include/configs/venice2.h                    |  89 +++++++
 8 files changed, 776 insertions(+)
 create mode 100644 board/nvidia/venice2/Makefile
 create mode 100644 board/nvidia/venice2/as3722_init.c
 create mode 100644 board/nvidia/venice2/as3722_init.h
 create mode 100644 board/nvidia/venice2/pinmux-config-venice2.h
 create mode 100644 board/nvidia/venice2/venice2.c
 create mode 100644 include/configs/tegra124-common.h
 create mode 100644 include/configs/venice2.h
board/nvidia/venice2/Makefile new file +27 -0
new file mode 100644
index 0000000..2e59e51
@@ -0,0 +1,27 @@
+#
+# (C) Copyright 2010-2013
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= $(BOARD).o as3722_init.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/venice2/as3722_init.c new file +91 -0

91 lines not on this page · raw message

board/nvidia/venice2/as3722_init.h new file +38 -0
new file mode 100644
index 0000000..2a9e7cd
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2013
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* AS3722-PMIC-specific early init regs */
+
+#define AS3722_I2C_ADDR		0x80
+
+#define AS3722_SD0VOLTAGE_REG	0x00	/* CPU */
+#define AS3722_SD1VOLTAGE_REG	0x01	/* CORE, already set by OTP */
+#define AS3722_SD6VOLTAGE_REG	0x06	/* GPU */
+#define AS3722_SDCONTROL_REG	0x4D
+
+#define AS3722_LDO2VOLTAGE_REG	0x12	/* VPP_FUSE */
+#define AS3722_LDO6VOLTAGE_REG	0x16	/* VDD_SDMMC */
+#define AS3722_LDCONTROL_REG	0x4E
+
+#define AS3722_SD0VOLTAGE_DATA	(0x2800 | AS3722_SD0VOLTAGE_REG)
+#define AS3722_SD0CONTROL_DATA	(0x0100 | AS3722_SDCONTROL_REG)
+
+#define AS3722_SD1VOLTAGE_DATA	(0x3200 | AS3722_SD1VOLTAGE_REG)
+#define AS3722_SD1CONTROL_DATA	(0x0200 | AS3722_SDCONTROL_REG)
+
+#define AS3722_SD6CONTROL_DATA	(0x4000 | AS3722_SDCONTROL_REG)
+#define AS3722_SD6VOLTAGE_DATA	(0x2800 | AS3722_SD6VOLTAGE_REG)
+
+#define AS3722_LDO2CONTROL_DATA	(0x0400 | AS3722_LDCONTROL_REG)
+#define AS3722_LDO2VOLTAGE_DATA	(0x1000 | AS3722_LDO2VOLTAGE_REG)
+
+#define AS3722_LDO6CONTROL_DATA	(0x4000 | AS3722_LDCONTROL_REG)
+#define AS3722_LDO6VOLTAGE_DATA	(0x3F00 | AS3722_LDO6VOLTAGE_REG)
+
+#define I2C_SEND_2_BYTES	0x0A02
+
+void pmic_enable_cpu_vdd(void);
board/nvidia/venice2/pinmux-config-venice2.h new file +339 -0

339 lines not on this page · raw message

board/nvidia/venice2/venice2.c new file +115 -0

115 lines not on this page · raw message

boards.cfg +1 -0
index d5008d8..14c3059 100644
@@ -344,6 +344,7 @@ Active  arm         armv7          u8500       st-ericsson     u8500
 Active  arm         armv7          vf610       freescale       vf610twr            vf610twr                             vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg                                                                         Alison Wang <[email protected]>
 Active  arm         armv7          zynq        xilinx          zynq                zynq                                 -                                                                                                                                 Michal Simek <[email protected]>
 Active  arm         armv7          zynq        xilinx          zynq                zynq_dcc                             zynq:ZYNQ_DCC                                                                                                                     Michal Simek <[email protected]>
+Active  arm         armv7:arm720t  tegra124    nvidia          venice2             venice2                              -                                                                                                                                 Tom Warren <[email protected]>
 Active  arm         armv7:arm720t  tegra114    nvidia          dalmore             dalmore                              -                                                                                                                                 Tom Warren <[email protected]>
 Active  arm         armv7:arm720t  tegra20     avionic-design  medcom-wide         medcom-wide                          -                                                                                                                                 Alban Bedel <[email protected]>
 Active  arm         armv7:arm720t  tegra20     avionic-design  plutux              plutux                               -                                                                                                                                 Alban Bedel <[email protected]>
include/configs/tegra124-common.h new file +76 -0

76 lines not on this page · raw message

include/configs/venice2.h new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#16 lore raw

PATCH 8/8 Tegra124: Add Venice2 (T124) build

Quoted 7 lines · Tom Warren

These are the board files for Venice2 (t124), plus the AS3722 PMIC files. PMIC init will be moved to pmic_common_init later.

This builds/boots on Venice2, SPI/MMC/USB/I2C all work. Audio and display and WB/LP0 are not supported yet.

board/nvidia/venice2/venice2.c line 84

Quoted 9 lines
board/nvidia/venice2/venice2.c +8 -0
 
+void board_sdmmc_voltage_init(void)
+{
+#if defined(VENICE2_LATE_PMIC_INIT)
+	/*
+	 * TODO(twarren at nvidia.com):
+	 *  Find out why writing the SDMMC LDO this late hangs the CPU
+	 *  Maybe it's the re-write of the enable bit? (already set by OTP)
+	 */

Wouldn't it be better to only include the active code? We can always just make a patch to move to different code later if we want.

Quoted 2 lines
+Active  arm         armv7:arm720t  tegra124    nvidia          venice2             venice2                              -                                                                                                                                 Tom Warren <[email protected]>
 Active  arm         armv7:arm720t  tegra114    nvidia          dalmore             dalmore                              -                                                                                                                                 Tom Warren <[email protected]>

That doesn't seem sorted. I would have expected tegra114 before tegra124? Same if it's sorted by board name.

include/configs/tegra124-common.h line 10

Quoted 5 lines
include/configs/tegra124-common.h +3 -0
 
+#ifndef _TEGRA124_COMMON_H_
+#define _TEGRA124_COMMON_H_
+#include "tegra-common.h"

A blank line is typical after the include guard.

Quoted 1 line

+#define CONFIG_TEGRA124 /* in a NVidia Tegra124 core */

NVIDIA not NVidia.

Quoted 1 line

+#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/tegra124/u-boot-spl.lds"

I don't think that's used upstream. Perhaps diff these files against the Tegra114 versions and check for unexpected differences?

include/configs/venice2.h line 16

Quoted 4 lines
include/configs/venice2.h +2 -0
 
+/* Use memory controller SDRAM size instead of ODMDATA */
+#define CONFIG_TEGRA_USE_EMC_DRAM_SIZE

We should either always do that or never; boards shouldn't make the decision. Rather, the core Tegra code should make the decision based on the SoC ID.

Also, CONFIG_TEGRA_USE_EMC_DRAM_SIZE doesn't exist upstream.

include/configs/venice2.h line 53

Quoted 5 lines
include/configs/venice2.h +5 -0
+/* Environment in eMMC, at the end of 2nd "boot sector" */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_SYS_MMC_ENV_PART		2
+#define CONFIG_ENV_OFFSET		((4096 * 1024) - CONFIG_ENV_SIZE)

Dalmore says:

#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)

... which seems a bit more self-managing.

#17 lore raw

PATCH 1/8 Tegra124: Add arch-tegra124 include/header files

In reply to Tom Warren
Quoted 8 lines · Tom Warren

No real HW change on T124 for 90% of the toys, so just include a common T1x4 header file (based on T114 headers), and if a new register/bit is needed, add it at the end. Some headers (clk_rst, clock-tables, pinmux, etc.) had too many changes in structs, devices, etc. added/removed, so they are added as complete new files for T124, and can be diffed against T114 headers to see what's changed (again, not a lot).

Quoted 4 lines

In a future (RSN) patch I'll point the T114 headers at the new common tegra1x4-xxx files, too.

Change-Id: I02a37e1a6bee0c62721f1ffb3968379b36d0f2dd

As a general note: you should strip these Change-Id tags when posting patches upstream. It's completely useless unless you provide a URL and access to the gerrit instance that carries the change.

Thierry

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131008/2a7cf455/attachment.pgp>

#18 lore raw

PATCH 1/8 Tegra124: Add arch-tegra124 include/header files

In reply to Tom Warren
Quoted 11 lines · Tom Warren

No real HW change on T124 for 90% of the toys, so just include a common T1x4 header file (based on T114 headers), and if a new register/bit is needed, add it at the end. Some headers (clk_rst, clock-tables, pinmux, etc.) had too many changes in structs, devices, etc. added/removed, so they are added as complete new files for T124, and can be diffed against T114 headers to see what's changed (again, not a lot).

In a future (RSN) patch I'll point the T114 headers at the new common tegra1x4-xxx files, too.

Quoted 10 lines
 arch/arm/include/asm/arch-tegra/tegra1x4_ahb.h     |  91 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_clock.h   |  19 +
 arch/arm/include/asm/arch-tegra/tegra1x4_emc.h     |  76 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_flow.h    |  40 ++
 arch/arm/include/asm/arch-tegra/tegra1x4_fush.h    |  28 +
 .../include/asm/arch-tegra/tegra1x4_gp_padctrl.h   |  74 +++
 arch/arm/include/asm/arch-tegra/tegra1x4_pmu.h     |  14 +
 arch/arm/include/asm/arch-tegra/tegra1x4_spi.h     |  23 +-
 arch/arm/include/asm/arch-tegra/tegra1x4_sysctr.h  |  26 +
 arch/arm/include/asm/arch-tegra/tegra1x4_usb.h     | 272 +++++++++

For the reasons I mentioned earlier, I'd like to avoid "tegra1x4" in these filenames too.