Skip to contentSkip to conversation

Tegra210/P2571 initial support

PATCH Superseded Tom Warren 2 participants 24 messages Jul 20, 2015 – Jul 23, 2015

Subsystems (6)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tom Warren

author
#0 lore raw

v2 cover Tegra210/P2571 initial support

This patch series adds support for the Tegra210 SoC and the P2571 board. Most of the T210 info
is identical to T124 at this point, so I just cloned Venice2/Jetson-TK1 board files and T124 header/SoC code. Pinmux is the major area of difference at this time, but other changes will be made as more features of the board are brought up.

T210 is a 64-bit build, and hence has no SPL portion. A separate 32-bit AVP/BPMP loader must be used to get the 64-bit CPU portion running. Once that procedure is locked down, a README will be added to outline the process.

Thierry Reding's dozen or so patches to fix various 64-bit build problems are also required to get this to build & boot. They should precede this series so git-bisect will work.

Tom Warren (6):
Tegra210: Fix 64-bit build warning about save_boot_params_ret()
Tegra: Rework KConfig options to allow 64-bit builds (T210)
ARM: Tegra210: Add SoC code/include files for T210
ARM: Tegra210: Add support to common Tegra source/config files
P2571: dts: Add DT files for Tegra210/P2571 board
T210: Add support for 64-bit T210-based P2571 board

 arch/arm/Kconfig                                  |   11 -
 arch/arm/dts/Makefile                             |    3 +-
 arch/arm/dts/tegra210-p2571.dts                   |  106 ++
 arch/arm/dts/tegra210.dtsi                        |  511 ++++++++++
 arch/arm/include/asm/arch-tegra/ap.h              |    6 +-
 arch/arm/include/asm/arch-tegra/clk_rst.h         |   28 +-
 arch/arm/include/asm/arch-tegra/gp_padctrl.h      |    3 +-
 arch/arm/include/asm/arch-tegra/pmc.h             |    7 +-
 arch/arm/include/asm/arch-tegra/tegra.h           |    4 +-
 arch/arm/include/asm/arch-tegra210/ahb.h          |   91 ++
 arch/arm/include/asm/arch-tegra210/clock-tables.h |  566 +++++++++++
 arch/arm/include/asm/arch-tegra210/clock.h        |   27 +
 arch/arm/include/asm/arch-tegra210/flow.h         |   45 +
 arch/arm/include/asm/arch-tegra210/funcmux.h      |   23 +
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h   |   74 ++
 arch/arm/include/asm/arch-tegra210/gpio.h         |  303 ++++++
 arch/arm/include/asm/arch-tegra210/mc.h           |   72 ++
 arch/arm/include/asm/arch-tegra210/pmu.h          |   14 +
 arch/arm/include/asm/arch-tegra210/powergate.h    |   12 +
 arch/arm/include/asm/arch-tegra210/sysctr.h       |   26 +
 arch/arm/include/asm/arch-tegra210/tegra.h        |   32 +
 arch/arm/mach-tegra/Kconfig                       |   56 ++
 arch/arm/mach-tegra/Makefile                      |    5 +-
 arch/arm/mach-tegra/ap.c                          |    9 +-
 arch/arm/mach-tegra/board.c                       |    2 +
 arch/arm/mach-tegra/clock.c                       |    3 +-
 arch/arm/mach-tegra/cpu.c                         |   55 +-
 arch/arm/mach-tegra/cpu.h                         |   10 +-
 arch/arm/mach-tegra/tegra210/Kconfig              |   18 +
 arch/arm/mach-tegra/tegra210/Makefile             |   11 +
 arch/arm/mach-tegra/tegra210/clock.c              | 1091 +++++++++++++++++++++
 arch/arm/mach-tegra/tegra210/funcmux.c            |   80 ++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c        |  495 ++++++++++
 board/nvidia/p2571/Kconfig                        |   12 +
 board/nvidia/p2571/MAINTAINERS                    |    6 +
 board/nvidia/p2571/Makefile                       |    9 +
 board/nvidia/p2571/max77620_init.c                |   85 ++
 board/nvidia/p2571/max77620_init.h                |   67 ++
 board/nvidia/p2571/p2571.c                        |   29 +
 board/nvidia/p2571/pinmux-config-p2571.h          |  235 +++++
 configs/p2571_defconfig                           |   16 +
 include/configs/p2571.h                           |   71 ++
 include/configs/tegra210-common.h                 |   76 ++
 include/dt-bindings/clock/tegra210-car.h          |  342 +++++++
 include/fdtdec.h                                  |    3 +
 lib/fdtdec.c                                      |    2 +
 46 files changed, 4704 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/dts/tegra210-p2571.dts
 create mode 100644 arch/arm/dts/tegra210.dtsi
 create mode 100644 arch/arm/include/asm/arch-tegra210/ahb.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/mc.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/tegra.h
 create mode 100644 arch/arm/mach-tegra/tegra210/Kconfig
 create mode 100644 arch/arm/mach-tegra/tegra210/Makefile
 create mode 100644 arch/arm/mach-tegra/tegra210/clock.c
 create mode 100644 arch/arm/mach-tegra/tegra210/funcmux.c
 create mode 100644 arch/arm/mach-tegra/tegra210/xusb-padctl.c
 create mode 100644 board/nvidia/p2571/Kconfig
 create mode 100644 board/nvidia/p2571/MAINTAINERS
 create mode 100644 board/nvidia/p2571/Makefile
 create mode 100644 board/nvidia/p2571/max77620_init.c
 create mode 100644 board/nvidia/p2571/max77620_init.h
 create mode 100644 board/nvidia/p2571/p2571.c
 create mode 100644 board/nvidia/p2571/pinmux-config-p2571.h
 create mode 100644 configs/p2571_defconfig
 create mode 100644 include/configs/p2571.h
 create mode 100644 include/configs/tegra210-common.h
 create mode 100644 include/dt-bindings/clock/tegra210-car.h
Signature · 1 line
1.8.2.1.610.g562af5b
author
#1 lore raw

PATCH v2 1/6 Tegra210: Fix 64-bit build warning about save_boot_params_ret()

Simon's 'tegra124: Implement spl_was_boot_source()' needs a prototype for save_boot_params_ret() to build cleanly for 64-bit Tegra210.

---
 arch/arm/mach-tegra/board.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-tegra/board.c +2 -0
index f113041..036bf5e 100644
@@ -18,6 +18,8 @@
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/warmboot.h>
 
+void save_boot_params_ret(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 enum {
Signature · 1 line
1.8.2.1.610.g562af5b
author
#2 lore raw

PATCH v2 2/6 Tegra: Rework KConfig options to allow 64-bit builds (T210)

In reply to Tom Warren

Moved Tegra config options to mach-tegra/Kconfig so that both 32-bit and 64-bit builds can co-exist for Tegra SoCs.

T210 will be 64-bit only (no SPL) and will requires a 32-bit AVP/BPMP loader.

---
 arch/arm/Kconfig            | 11 -----------
 arch/arm/mach-tegra/Kconfig | 44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 11 deletions(-)
arch/arm/Kconfig +0 -11
index 506463c..20ab398 100644
@@ -681,17 +681,6 @@ config TARGET_XILINX_ZYNQMP
 
 config TEGRA
 	bool "NVIDIA Tegra"
-	select SUPPORT_SPL
-	select SPL
-	select OF_CONTROL
-	select SPL_DISABLE_OF_CONTROL
-	select CPU_V7
-	select DM
-	select DM_SPI_FLASH
-	select DM_SERIAL
-	select DM_I2C
-	select DM_SPI
-	select DM_GPIO
 
 config TARGET_VEXPRESS64_AEMV8A
 	bool "Support vexpress_aemv8a"
arch/arm/mach-tegra/Kconfig +44 -0

59 lines not on this page · raw message

Signature · 1 line
1.8.2.1.610.g562af5b
#3 lore raw

PATCH v2 2/6 Tegra: Rework KConfig options to allow 64-bit builds (T210)

Quoted 11 lines · Tom Warren

Moved Tegra config options to mach-tegra/Kconfig so that both 32-bit and 64-bit builds can co-exist for Tegra SoCs.

T210 will be 64-bit only (no SPL) and will requires a 32-bit AVP/BPMP loader.

arch/arm/mach-tegra/Kconfig +1 -0
 
  config TEGRA20
  	bool "Tegra20 family"
+	select SUPPORT_SPL

arch/arm/mach-tegra/Kconfig choice · line 19

Quoted 10 lines
arch/arm/mach-tegra/Kconfig +10 -0
+	select SPL
+	select OF_CONTROL
+	select SPL_DISABLE_OF_CONTROL
+	select CPU_V7
+	select DM
+	select DM_SPI_FLASH
+	select DM_SERIAL
+	select DM_I2C
+	select DM_SPI
+	select DM_GPIO

This patch duplicates all those added lines for all current chips. Could we add a new config variable to share these; something like:

config TEGRA_ARMV7_COMMON
select SUPPORT_SPL
select SPL
select OF_CONTROL
select SPL_DISABLE_OF_CONTROL
select CPU_V7
select DM
select DM_SPI_FLASH
select DM_SERIAL
select DM_I2C
select DM_SPI
select DM_GPIO

config TEGRA20
bool "Tegra20 family"
select TEGRA_ARMv7_COMMON

author
#4 lore raw

PATCH v2 2/6 Tegra: Rework KConfig options to allow 64-bit builds (T210)

Stephen,

Quoted 48 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 10:40 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 2/6] Tegra: Rework KConfig options to allow 64-bit builds (T210)

Quoted 11 lines · Tom Warren

Moved Tegra config options to mach-tegra/Kconfig so that both 32-bit and 64-bit builds can co-exist for Tegra SoCs.

T210 will be 64-bit only (no SPL) and will requires a 32-bit AVP/BPMP loader.

arch/arm/mach-tegra/Kconfig +1 -0
 
  config TEGRA20
  	bool "Tegra20 family"
+	select SUPPORT_SPL

arch/arm/mach-tegra/Kconfig choice · line 19

Quoted 10 lines
arch/arm/mach-tegra/Kconfig +10 -0
+	select SPL
+	select OF_CONTROL
+	select SPL_DISABLE_OF_CONTROL
+	select CPU_V7
+	select DM
+	select DM_SPI_FLASH
+	select DM_SERIAL
+	select DM_I2C
+	select DM_SPI
+	select DM_GPIO

This patch duplicates all those added lines for all current chips. Could we add a new config variable to share these; something like:

config TEGRA_ARMV7_COMMON
select SUPPORT_SPL
select SPL
select OF_CONTROL
select SPL_DISABLE_OF_CONTROL
select CPU_V7
select DM
select DM_SPI_FLASH
select DM_SERIAL
select DM_I2C
select DM_SPI
select DM_GPIO

Quoted 3 lines

config TEGRA20
bool "Tegra20 family"
select TEGRA_ARMv7_COMMON

Great idea - I'll do that for V3. Thanks.

--
nvpublic

author
#5 lore raw

PATCH v2 3/6 ARM: Tegra210: Add SoC code/include files for T210

In reply to Tom Warren

All based off of Tegra124. As a Tegra210 board is brought up, these may change a bit to match the HW more closely, but probably 90% of this is identical to T124.

Note that since T210 is a 64-bit build, it has no SPL component, and hence no cpu.c for Tegra210.

---
 arch/arm/include/asm/arch-tegra210/ahb.h          |   91 ++
 arch/arm/include/asm/arch-tegra210/clock-tables.h |  566 +++++++++++
 arch/arm/include/asm/arch-tegra210/clock.h        |   27 +
 arch/arm/include/asm/arch-tegra210/flow.h         |   45 +
 arch/arm/include/asm/arch-tegra210/funcmux.h      |   23 +
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h   |   74 ++
 arch/arm/include/asm/arch-tegra210/gpio.h         |  303 ++++++
 arch/arm/include/asm/arch-tegra210/mc.h           |   72 ++
 arch/arm/include/asm/arch-tegra210/pmu.h          |   14 +
 arch/arm/include/asm/arch-tegra210/powergate.h    |   12 +
 arch/arm/include/asm/arch-tegra210/sysctr.h       |   26 +
 arch/arm/include/asm/arch-tegra210/tegra.h        |   32 +
 arch/arm/mach-tegra/tegra210/Kconfig              |   11 +
 arch/arm/mach-tegra/tegra210/Makefile             |   11 +
 arch/arm/mach-tegra/tegra210/clock.c              | 1091 +++++++++++++++++++++
 arch/arm/mach-tegra/tegra210/funcmux.c            |   80 ++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c        |  495 ++++++++++
 include/dt-bindings/clock/tegra210-car.h          |  342 +++++++
 18 files changed, 3315 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-tegra210/ahb.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/mc.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 create mode 100644 arch/arm/include/asm/arch-tegra210/tegra.h
 create mode 100644 arch/arm/mach-tegra/tegra210/Kconfig
 create mode 100644 arch/arm/mach-tegra/tegra210/Makefile
 create mode 100644 arch/arm/mach-tegra/tegra210/clock.c
 create mode 100644 arch/arm/mach-tegra/tegra210/funcmux.c
 create mode 100644 arch/arm/mach-tegra/tegra210/xusb-padctl.c
 create mode 100644 include/dt-bindings/clock/tegra210-car.h
arch/arm/include/asm/arch-tegra210/ahb.h new file +91 -0
new file mode 100644
index 0000000..3a37af4
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA210_AHB_H_
+#define _TEGRA210_AHB_H_
+
+struct ahb_ctlr {
+	u32 reserved0;			/* 00h */
+	u32 arbitration_disable;	/* _ARBITRATION_DISABLE_0,	04h */
+	u32 arbitration_priority_ctrl;	/* _ARBITRATION_PRIORITY_CTRL_0,08h */
+	u32 arbitration_usr_protect;	/* _ARBITRATION_USR_PROTECT_0,	0ch */
+	u32 gizmo_ahb_mem;		/* _GIZMO_AHB_MEM_0,		10h */
+	u32 gizmo_apb_dma;		/* _GIZMO_APB_DMA_0,		14h */
+	u32 reserved6[2];		/* 18h, 1ch */
+	u32 gizmo_usb;			/* _GIZMO_USB_0,		20h */
+	u32 gizmo_ahb_xbar_bridge;	/* _GIZMO_AHB_XBAR_BRIDGE_0,	24h */
+	u32 gizmo_cpu_ahb_bridge;	/* _GIZMO_CPU_AHB_BRIDGE_0,	28h */
+	u32 gizmo_cop_ahb_bridge;	/* _GIZMO_COP_AHB_BRIDGE_0,	2ch */
+	u32 gizmo_xbar_apb_ctlr;	/* _GIZMO_XBAR_APB_CTLR_0,	30h */
+	u32 gizmo_vcp_ahb_bridge;	/* _GIZMO_VCP_AHB_BRIDGE_0,	34h */
+	u32 reserved13[2];		/* 38h, 3ch */
+	u32 gizmo_nand;			/* _GIZMO_NAND_0,		40h */
+	u32 reserved15;			/* 44h */
+	u32 gizmo_sdmmc4;		/* _GIZMO_SDMMC4_0,		48h */
+	u32 reserved17;			/* 4ch */
+	u32 gizmo_se;			/* _GIZMO_SE_0,			50h */
+	u32 gizmo_tzram;		/* _GIZMO_TZRAM_0,		54h */
+	u32 reserved20[3];		/* 58h, 5ch, 60h */
+	u32 gizmo_bsev;			/* _GIZMO_BSEV_0,		64h */
+	u32 reserved22[3];		/* 68h, 6ch, 70h */
+	u32 gizmo_bsea;			/* _GIZMO_BSEA_0,		74h */
+	u32 gizmo_nor;			/* _GIZMO_NOR_0,		78h */
+	u32 gizmo_usb2;			/* _GIZMO_USB2_0,		7ch */
+	u32 gizmo_usb3;			/* _GIZMO_USB3_0,		80h */
+	u32 gizmo_sdmmc1;		/* _GIZMO_SDMMC1_0,		84h */
+	u32 gizmo_sdmmc2;		/* _GIZMO_SDMMC2_0,		88h */
+	u32 gizmo_sdmmc3;		/* _GIZMO_SDMMC3_0,		8ch */
+	u32 reserved30[13];		/* 90h ~ c0h */
+	u32 ahb_wrq_empty;		/* _AHB_WRQ_EMPTY_0,		c4h */
+	u32 reserved32[5];		/* c8h ~ d8h */
+	u32 ahb_mem_prefetch_cfg_x;	/* _AHB_MEM_PREFETCH_CFG_X_0,	dch */
+	u32 arbitration_xbar_ctrl;	/* _ARBITRATION_XBAR_CTRL_0,	e0h */
+	u32 ahb_mem_prefetch_cfg3;	/* _AHB_MEM_PREFETCH_CFG3_0,	e4h */
+	u32 ahb_mem_prefetch_cfg4;	/* _AHB_MEM_PREFETCH_CFG3_0,	e8h */
+	u32 avp_ppcs_rd_coh_status;	/* _AVP_PPCS_RD_COH_STATUS_0,	ech */
+	u32 ahb_mem_prefetch_cfg1;	/* _AHB_MEM_PREFETCH_CFG1_0,	f0h */
+	u32 ahb_mem_prefetch_cfg2;	/* _AHB_MEM_PREFETCH_CFG2_0,	f4h */
+	u32 ahbslvmem_status;		/* _AHBSLVMEM_STATUS_0, f8h */
+	/* _ARBITRATION_AHB_MEM_WRQUE_MST_ID_0, fch */
+	u32 arbitration_ahb_mem_wrque_mst_id;
+	u32 arbitration_cpu_abort_addr;	/* _ARBITRATION_CPU_ABORT_ADDR_0,100h */
+	u32 arbitration_cpu_abort_info;	/* _ARBITRATION_CPU_ABORT_INFO_0,104h */
+	u32 arbitration_cop_abort_addr;	/* _ARBITRATION_COP_ABORT_ADDR_0,108h */
+	u32 arbitration_cop_abort_info;	/* _ARBITRATION_COP_ABORT_INFO_0,10ch */
+	u32 reserved46[4];		/* 110h ~ 11ch */
+	u32 avpc_mccif_fifoctrl;	/* _AVPC_MCCIF_FIFOCTRL_0,	120h */
+	u32 timeout_wcoal_avpc;		/* _TIMEOUT_WCOAL_AVPC_0,	124h */
+	u32 mpcorelp_mccif_fifoctrl;	/* _MPCORELP_MCCIF_FIFOCTRL_0,	128h */
+	u32 mpcore_mccif_fifoctrl;	/* _MPCORE_MCCIF_FIFOCTRL_0,	12ch */
+	u32 axicif_fastsync_ctrl;	/* AXICIF_FASTSYNC_CTRL_0,	130h */
+	u32 axicif_fastsync_statistics;	/* _AXICIF_FASTSYNC_STATISTICS_0,134h */
+	/* _AXICIF_FASTSYNC0_CPUCLK_TO_MCCLK_0,	138h */
+	u32 axicif_fastsync0_cpuclk_to_mcclk;
+	/* _AXICIF_FASTSYNC1_CPUCLK_TO_MCCLK_0, 13ch */
+	u32 axicif_fastsync1_cpuclk_to_mcclk;
+	/* _AXICIF_FASTSYNC2_CPUCLK_TO_MCCLK_0, 140h */
+	u32 axicif_fastsync2_cpuclk_to_mcclk;
+	/* _AXICIF_FASTSYNC0_MCCLK_TO_CPUCLK_0, 144h */
+	u32 axicif_fastsync0_mcclk_to_cpuclk;
+	/* _AXICIF_FASTSYNC1_MCCLK_TO_CPUCLK_0, 148h */
+	u32 axicif_fastsync1_mcclk_to_cpuclk;
+	/* _AXICIF_FASTSYNC2_MCCLK_TO_CPUCLK_0, 14ch */
+	u32 axicif_fastsync2_mcclk_to_cpuclk;
+};
+
+#define PPSB_STOPCLK_ENABLE	(1 << 2)
+
+#define GIZ_ENABLE_SPLIT	(1 << 0)
+#define GIZ_ENB_FAST_REARB	(1 << 2)
+#define GIZ_DONT_SPLIT_AHB_WR	(1 << 7)
+
+#define GIZ_USB_IMMEDIATE	(1 << 18)
+
+/* AHB_ARBITRATION_XBAR_CTRL_0 0xe0 */
+#define ARBITRATION_XBAR_CTRL_PPSB_ENABLE	(1 << 2)
+
+#endif	/* _TEGRA210_AHB_H_ */
arch/arm/include/asm/arch-tegra210/clock-tables.h new file +566 -0

566 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/clock.h new file +27 -0
new file mode 100644
index 0000000..3501be2
@@ -0,0 +1,27 @@
+/*
+ * (C) Copyright 2010-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* Tegra210 clock control definitions */
+
+#ifndef _TEGRA210_CLOCK_H_
+#define _TEGRA210_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)
+
+/* PLL bits that differ from generic clk_rst.h */
+#define PLLC_RESET		30
+#define PLLC_IDDQ		27
+#define PLLD_ENABLE_CLK		21
+#define PLLD_EN_LCKDET		28
+
+int tegra_plle_enable(void);
+
+#endif	/* _TEGRA210_CLOCK_H_ */
arch/arm/include/asm/arch-tegra210/flow.h new file +45 -0

45 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/funcmux.h new file +23 -0
new file mode 100644
index 0000000..7ad116a
@@ -0,0 +1,23 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* Tegra210 high-level function multiplexing */
+
+#ifndef _TEGRA210_FUNCMUX_H_
+#define _TEGRA210_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	/* _TEGRA210_FUNCMUX_H_ */
arch/arm/include/asm/arch-tegra210/gp_padctrl.h new file +74 -0

74 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/gpio.h new file +303 -0

303 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/mc.h new file +72 -0

72 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/pmu.h new file +14 -0
new file mode 100644
index 0000000..1e5f388
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2010-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA210_PMU_H_
+#define _TEGRA210_PMU_H_
+
+/* Set core and CPU voltages to nominal levels */
+int pmu_set_nominal(void);
+
+#endif	/* _TEGRA210_PMU_H_ */
arch/arm/include/asm/arch-tegra210/powergate.h new file +12 -0
new file mode 100644
index 0000000..df6f91d
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _TEGRA210_POWERGATE_H_
+#define _TEGRA210_POWERGATE_H_
+
+#include <asm/arch-tegra/powergate.h>
+
+#endif /* _TEGRA210_POWERGATE_H_ */
arch/arm/include/asm/arch-tegra210/sysctr.h new file +26 -0
new file mode 100644
index 0000000..e8a13b5
@@ -0,0 +1,26 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA210_SYSCTR_H_
+#define _TEGRA210_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	/* _TEGRA210_SYSCTR_H_ */
arch/arm/include/asm/arch-tegra210/tegra.h new file +32 -0
new file mode 100644
index 0000000..95c67fb
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA210_TEGRA_H_
+#define _TEGRA210_TEGRA_H_
+
+#define GICD_BASE		0x50041000	/* Generic Int Cntrlr Distrib */
+#define GICC_BASE		0x50042000	/* Generic Int Cntrlr CPU I/F */
+#define NV_PA_AHB_BASE		0x6000C000	/* System regs (AHB, etc.) */
+#define NV_PA_TSC_BASE		0x700F0000	/* System Counter TSC regs */
+#define NV_PA_MC_BASE		0x70019000	/* Mem Ctlr regs (MCB, etc.) */
+#define NV_PA_SDRAM_BASE	0x80000000
+
+#include <asm/arch-tegra/tegra.h>
+
+#define BCT_ODMDATA_OFFSET	1288	/* 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 /* _TEGRA210_TEGRA_H_ */
arch/arm/mach-tegra/tegra210/Kconfig new file +11 -0
new file mode 100644
index 0000000..f2a0059
@@ -0,0 +1,11 @@
+if TEGRA210
+
+choice
+	prompt "Tegra210 board select"
+
+endchoice
+
+config SYS_SOC
+	default "tegra210"
+
+endif
arch/arm/mach-tegra/tegra210/Makefile new file +11 -0
new file mode 100644
index 0000000..1fb8d1a
@@ -0,0 +1,11 @@
+#
+# (C) Copyright 2013-2015
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= clock.o
+obj-y	+= funcmux.o
+obj-y	+= pinmux.o
+obj-y	+= xusb-padctl.o
arch/arm/mach-tegra/tegra210/clock.c new file +1091 -0

1,091 lines not on this page · raw message

arch/arm/mach-tegra/tegra210/funcmux.c new file +80 -0

80 lines not on this page · raw message

arch/arm/mach-tegra/tegra210/xusb-padctl.c new file +495 -0

495 lines not on this page · raw message

include/dt-bindings/clock/tegra210-car.h new file +342 -0

27 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.2.1.610.g562af5b

Part of the diff is not shown here. View the raw message.

#6 lore raw

PATCH v2 3/6 ARM: Tegra210: Add SoC code/include files for T210

Quoted 25 lines · Tom Warren

All based off of Tegra124. As a Tegra210 board is brought up, these may change a bit to match the HW more closely, but probably 90% of this is identical to T124.

Note that since T210 is a 64-bit build, it has no SPL component, and hence no cpu.c for Tegra210.

arch/arm/mach-tegra/tegra210/funcmux.c +16 -0
 
+int funcmux_select(enum periph_id id, int config)
+{
+	int bad_config = config != FUNCMUX_DEFAULT;
+
+	switch (id) {
+	case PERIPH_ID_UART4:
+		switch (config) {
+		case FUNCMUX_UART4_GPIO: /* TXD,RXD,CTS,RTS */
+			pinmux_set_func(PMUX_PINGRP_UART4_TX_PI4,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_RX_PI5,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_CTS_PI7,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_RTS_PI6,
+					PMUX_FUNC_UARTD);

...

arch/arm/mach-tegra/tegra210/funcmux.c line 54

Quoted 6 lines
arch/arm/mach-tegra/tegra210/funcmux.c +6 -0
+	case PERIPH_ID_UART1:
+		switch (config) {
+		case FUNCMUX_UART1_KBC:
+			pinmux_set_func(PMUX_PINGRP_UART1_TX_PU0,
+					PMUX_FUNC_UARTA);
+			pinmux_set_func(PMUX_PINGRP_UART1_RX_PU1,

Those are the wrong FUNCMUX_* enum names; they're supposed to be FUNCMUX_${hwblock}_${pinset}. ${hwblock} is correctly UART1/4 above. ${pinset} doesn't look right to me; I see no GPIO or KBC pins being used. Rather, I'd expect FUNCMUX_UART4_UART4 and FUNCMUX_UART1_UART1.

author
#7 lore raw

PATCH v2 3/6 ARM: Tegra210: Add SoC code/include files for T210

Stephen,

Quoted 36 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 10:45 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 3/6] ARM: Tegra210: Add SoC code/include files for T210

Quoted 25 lines · Tom Warren

All based off of Tegra124. As a Tegra210 board is brought up, these may change a bit to match the HW more closely, but probably 90% of this is identical to T124.

Note that since T210 is a 64-bit build, it has no SPL component, and hence no cpu.c for Tegra210.

arch/arm/mach-tegra/tegra210/funcmux.c +15 -0
 
+int funcmux_select(enum periph_id id, int config) {
+	int bad_config = config != FUNCMUX_DEFAULT;
+
+	switch (id) {
+	case PERIPH_ID_UART4:
+		switch (config) {
+		case FUNCMUX_UART4_GPIO: /* TXD,RXD,CTS,RTS */
+			pinmux_set_func(PMUX_PINGRP_UART4_TX_PI4,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_RX_PI5,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_CTS_PI7,
+					PMUX_FUNC_UARTD);
+			pinmux_set_func(PMUX_PINGRP_UART4_RTS_PI6,
+					PMUX_FUNC_UARTD);

...

Quoted 11 lines

arch/arm/mach-tegra/tegra210/funcmux.c line 54

Quoted 6 lines
arch/arm/mach-tegra/tegra210/funcmux.c +6 -0
+	case PERIPH_ID_UART1:
+		switch (config) {
+		case FUNCMUX_UART1_KBC:
+			pinmux_set_func(PMUX_PINGRP_UART1_TX_PU0,
+					PMUX_FUNC_UARTA);
+			pinmux_set_func(PMUX_PINGRP_UART1_RX_PU1,

Those are the wrong FUNCMUX_* enum names; they're supposed to be FUNCMUX_${hwblock}_${pinset}. ${hwblock} is correctly UART1/4 above. ${pinset} doesn't look right to me; I see no GPIO or KBC pins being used. Rather, I'd expect FUNCMUX_UART4_UART4 and FUNCMUX_UART1_UART1.

These were cloned from T124. I'll add FUNCMUX_UARTx_ to uart_configs[] in board.c and use them here. Thanks.

Tom

--
nvpublic

author
#8 lore raw

PATCH v2 4/6 ARM: Tegra210: Add support to common Tegra source/config files

In reply to Tom Warren

Derived from Tegra124, modified as appropriate during T210 board bringup. Cleaned up debug statements to conserve string space, too.

---
 arch/arm/include/asm/arch-tegra/ap.h         |  6 +--
 arch/arm/include/asm/arch-tegra/clk_rst.h    | 28 +++++++++++---
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |  3 +-
 arch/arm/include/asm/arch-tegra/pmc.h        |  7 ++--
 arch/arm/include/asm/arch-tegra/tegra.h      |  4 +-
 arch/arm/mach-tegra/Kconfig                  | 12 ++++++
 arch/arm/mach-tegra/Makefile                 |  5 ++-
 arch/arm/mach-tegra/ap.c                     |  9 ++++-
 arch/arm/mach-tegra/clock.c                  |  3 +-
 arch/arm/mach-tegra/cpu.c                    | 55 ++++++++++++++++++++--------
 arch/arm/mach-tegra/cpu.h                    | 10 +++--
 include/fdtdec.h                             |  3 ++
 lib/fdtdec.c                                 |  2 +
 13 files changed, 111 insertions(+), 36 deletions(-)
arch/arm/include/asm/arch-tegra/ap.h +2 -4
index ca40e4e..76773b7 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2011
+ * (C) Copyright 2010-2015
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -24,8 +24,6 @@
 #define PG_UP_TAG_0_PID_CPU	0x55555555	/* CPU aka "a9" aka "mpcore" */
 #define PG_UP_TAG_0		0x0
 
-#define CORESIGHT_UNLOCK	0xC5ACCE55;
-
 /* AP base physical address of internal SRAM */
 #define NV_PA_BASE_SRAM		0x40000000
 
@@ -66,7 +64,7 @@ int tegra_get_sku_info(void);
 /* Do any chip-specific cache config */
 void config_cache(void);
 
-#if defined(CONFIG_TEGRA124)
+#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
 /* Do chip-specific vpr config */
 void config_vpr(void);
 #else
arch/arm/include/asm/arch-tegra/clk_rst.h +23 -5
index de50e08..43efa65 100644
@@ -48,6 +48,7 @@ enum {
 	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_X	= 32,	/* Number of ppl clock sources X */
+	TEGRA_CLK_SOURCES_Y	= 18,	/* Number of ppl clock sources Y */
 };
 
 /* Clock/Reset Controller (CLK_RST_CONTROLLER_) regs */
@@ -94,7 +95,15 @@ struct clk_rst_ctlr {
 	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_clk_out_enb_y;		/* _CLK_OUT_ENB_Y_0,	0x298 */
+	uint crc_clk_enb_y_set;		/* _CLK_ENB_Y_SET_0,	0x29c */
+	uint crc_clk_enb_y_clr;		/* _CLK_ENB_Y_CLR_0,	0x2a0 */
+
+	uint crc_rst_devices_y;		/* _RST_DEVICES_Y_0,	0x2a4 */
+	uint crc_rst_dev_y_set;		/* _RST_DEV_Y_SET_0,	0x2a8 */
+	uint crc_rst_dev_y_clr;		/* _RST_DEV_Y_CLR_0,	0x2ac */
+
+	uint crc_reserved21[17];	/* _reserved_21,	0x2b0-2f0 */
 
 	uint crc_dfll_base;		/* _DFLL_BASE_0,	0x2f4 */
 
@@ -136,7 +145,7 @@ struct clk_rst_ctlr {
 	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];
-	/* Additional (T114) registers */
+	/* Additional (T114+) registers */
 	uint crc_rst_cpug_cmplx_set;	/* _RST_CPUG_CMPLX_SET_0,  0x450 */
 	uint crc_rst_cpug_cmplx_clr;	/* _RST_CPUG_CMPLX_CLR_0,  0x454 */
 	uint crc_rst_cpulp_cmplx_set;	/* _RST_CPULP_CMPLX_SET_0, 0x458 */
@@ -207,9 +216,18 @@ struct clk_rst_ctlr {
 	u32 _rsv32_1[7];		/*                      0x574-58c */
 	struct clk_pll_simple plldp;	/* _PLLDP_BASE, 0x590 _PLLDP_MISC */
 	u32 crc_plldp_ss_cfg;		/* _PLLDP_SS_CFG, 0x598 */
-	u32 _rsrv32_2[25];
-	/* Tegra124 */
-	uint crc_clk_src_x[TEGRA_CLK_SOURCES_X]; /* XUSB, etc, 0x600-0x678 */
+
+	/* Tegra124+ - skip to 0x600 here for new CLK_SOURCE_ regs */
+	uint _rsrv32_2[25];			/* _0x59C - 0x5FC */
+	uint crc_clk_src_x[TEGRA_CLK_SOURCES_X]; /* XUSB, etc, 0x600-0x67C */
+
+	/* Tegra210 - skip to 0x694 here for new CLK_SOURCE_ regs */
+	uint crc_reserved61[5];	/* _reserved_61, 0x680 - 0x690 */
+	/*
+	 * NOTE: PLLA1 regs are in the middle of this Y region. Break this in
+	 * two later if PLLA1 is needed, but for now this is cleaner.
+	 */
+	uint crc_clk_src_y[TEGRA_CLK_SOURCES_Y]; /* SPARE1, etc, 0x694-0x6D8 */
 };
 
 /* CLK_RST_CONTROLLER_CLK_CPU_CMPLX_0 */
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -1
index 7a86acb..695f3e6 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2010-2012
+ *  (C) Copyright 2010-2015
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -21,5 +21,6 @@
 #define CHIPID_TEGRA30			0x30
 #define CHIPID_TEGRA114			0x35
 #define CHIPID_TEGRA124			0x40
+#define CHIPID_TEGRA210			0x21
 
 #endif	/* _TEGRA_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra/pmc.h +4 -3
index 1dd3154..66c0879 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2010,2011,2014
+ *  (C) Copyright 2010-2015
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -294,6 +294,7 @@ struct pmc_ctlr {
 #define CRAIL		0
 #define CE0		14
 #define C0NC		15
+#define SOR		17
 
 #define PMC_XOFS_SHIFT	1
 #define PMC_XOFS_MASK	(0x3F << PMC_XOFS_SHIFT)
@@ -303,7 +304,7 @@ struct pmc_ctlr {
 #define TIMER_MULT_MASK		(3 << TIMER_MULT_SHIFT)
 #define TIMER_MULT_CPU_SHIFT	2
 #define TIMER_MULT_CPU_MASK	(3 << TIMER_MULT_CPU_SHIFT)
-#elif defined(CONFIG_TEGRA124)
+#elif defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
 #define TIMER_MULT_SHIFT	0
 #define TIMER_MULT_MASK		(7 << TIMER_MULT_SHIFT)
 #define TIMER_MULT_CPU_SHIFT	3
@@ -314,7 +315,7 @@ struct pmc_ctlr {
 #define MULT_2			1
 #define MULT_4			2
 #define MULT_8			3
-#if defined(CONFIG_TEGRA124)
+#if defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
 #define MULT_16			4
 #endif
 
arch/arm/include/asm/arch-tegra/tegra.h +3 -1
index d63af0e..b6c7cab 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010,2011
+ * (C) Copyright 2010-2015
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -74,6 +74,7 @@ enum {
 	SKU_ID_T114_ENG		= 0x00, /* Dalmore value, unfused */
 	SKU_ID_T114_1		= 0x01,
 	SKU_ID_T124_ENG		= 0x00, /* Venice2 value, unfused */
+	SKU_ID_T210_ENG		= 0x00, /* unfused value TBD */
 };
 
 /*
@@ -88,6 +89,7 @@ enum {
 	TEGRA_SOC_T30,
 	TEGRA_SOC_T114,
 	TEGRA_SOC_T124,
+	TEGRA_SOC_T210,
 
 	TEGRA_SOC_CNT,
 	TEGRA_SOC_UNKNOWN	= -1,
arch/arm/mach-tegra/Kconfig +12 -0
index 7494f8d..38f9d09 100644
@@ -60,6 +60,17 @@ config TEGRA124
 	select DM_SPI
 	select DM_GPIO
 
+config TEGRA210
+	bool "Tegra210 family"
+	select OF_CONTROL
+	select ARM64
+	select DM
+	select DM_SPI_FLASH
+	select DM_SERIAL
+	select DM_I2C
+	select DM_SPI
+	select DM_GPIO
+
 endchoice
 
 config SYS_MALLOC_F_LEN
@@ -69,5 +80,6 @@ source "arch/arm/mach-tegra/tegra20/Kconfig"
 source "arch/arm/mach-tegra/tegra30/Kconfig"
 source "arch/arm/mach-tegra/tegra114/Kconfig"
 source "arch/arm/mach-tegra/tegra124/Kconfig"
+source "arch/arm/mach-tegra/tegra210/Kconfig"
 
 endif
arch/arm/mach-tegra/Makefile +4 -1
index fefc180..0db8ee0 100644
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2010,2011 Nvidia Corporation.
+# (C) Copyright 2010-2015 Nvidia Corporation.
 #
 # (C) Copyright 2000-2008
 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -24,7 +24,9 @@ obj-y += pinmux-common.o
 obj-y += powergate.o
 obj-y += xusb-padctl.o
 obj-$(CONFIG_DISPLAY_CPUINFO) += sys_info.o
+#TCW Fix this to use a common config switch (CONFIG_LOCK_VPR?)
 obj-$(CONFIG_TEGRA124) += vpr.o
+obj-$(CONFIG_TEGRA210) += vpr.o
 obj-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o
 
 ifndef CONFIG_SPL_BUILD
@@ -35,3 +37,4 @@ obj-$(CONFIG_TEGRA20) += tegra20/
 obj-$(CONFIG_TEGRA30) += tegra30/
 obj-$(CONFIG_TEGRA114) += tegra114/
 obj-$(CONFIG_TEGRA124) += tegra124/
+obj-$(CONFIG_TEGRA210) += tegra210/
arch/arm/mach-tegra/ap.c +8 -1
index 7b89c01..ee84967 100644
@@ -1,5 +1,5 @@
 /*
-* (C) Copyright 2010-2014
+* (C) Copyright 2010-2015
 * NVIDIA Corporation <www.nvidia.com>
 *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -92,6 +92,13 @@ int tegra_get_chip_sku(void)
 			return TEGRA_SOC_T124;
 		}
 		break;
+	case CHIPID_TEGRA210:
+		switch (sku_id) {
+		case SKU_ID_T210_ENG:
+		default:
+			return TEGRA_SOC_T210;
+		}
+		break;
 	}
 
 	/* unknown chip/sku id */
arch/arm/mach-tegra/clock.c +2 -1
index 24047b8..992bc41 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2015, 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,
@@ -634,6 +634,7 @@ static void set_avp_clock_source(u32 src)
 /*
  * This function is useful on Tegra30, and any later SoCs that have compatible
  * PLLP configuration registers.
+ * NOTE: Not used on Tegra210 - see tegra210_setup_pllp in T210 clock.c
  */
 void tegra30_set_up_pllp(void)
 {
arch/arm/mach-tegra/cpu.c +39 -16

165 lines not on this page · raw message

arch/arm/mach-tegra/cpu.h +7 -3
index b4ca44f..3f38969 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2014
+ * (C) Copyright 2010-2015
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -14,7 +14,7 @@
 #define NVBL_PLLP_KHZ	216000
 #define CSITE_KHZ	144000
 #elif defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) || \
-	defined(CONFIG_TEGRA124)
+	defined(CONFIG_TEGRA124) || defined(CONFIG_TEGRA210)
 #define NVBL_PLLP_KHZ	408000
 #define CSITE_KHZ	204000
 #else
@@ -35,7 +35,7 @@
 #define PG_UP_TAG_0_PID_CPU	0x55555555	/* CPU aka "a9" aka "mpcore" */
 #define PG_UP_TAG_0             0x0
 
-#define CORESIGHT_UNLOCK	0xC5ACCE55;
+#define CORESIGHT_UNLOCK	0xC5ACCE55
 
 #define EXCEP_VECTOR_CPU_RESET_VECTOR	(NV_PA_EVP_BASE + 0x100)
 #define CSITE_CPU_DBG0_LAR		(NV_PA_CSITE_BASE + 0x10FB0)
@@ -53,6 +53,10 @@
 
 #define SIMPLE_PLLX     (CLOCK_ID_XCPU - CLOCK_ID_FIRST_SIMPLE)
 
+/* SB_AA64_RESET_LOW and _HIGH defines for CPU reset vector */
+#define SB_AA64_RESET_LOW	0x6000C230
+#define SB_AA64_RESET_HIGH	0x6000C234
+
 struct clk_pll_table {
 	u16	n;
 	u16	m;
include/fdtdec.h +3 -0
index 2323603..4b3f8d1 100644
@@ -137,6 +137,7 @@ enum fdt_compat_id {
 	COMPAT_NVIDIA_TEGRA124_SOR,	/* Tegra 124 Serial Output Resource */
 	COMPAT_NVIDIA_TEGRA124_PMC,	/* Tegra 124 power mgmt controller */
 	COMPAT_NVIDIA_TEGRA20_DC,	/* Tegra 2 Display controller */
+	COMPAT_NVIDIA_TEGRA210_SDMMC,	/* Tegra210 SDMMC controller */
 	COMPAT_NVIDIA_TEGRA124_SDMMC,	/* Tegra124 SDMMC controller */
 	COMPAT_NVIDIA_TEGRA30_SDMMC,	/* Tegra30 SDMMC controller */
 	COMPAT_NVIDIA_TEGRA20_SDMMC,	/* Tegra20 SDMMC controller */
@@ -145,6 +146,8 @@ enum fdt_compat_id {
 	COMPAT_NVIDIA_TEGRA20_PCIE,	/* Tegra 20 PCIe controller */
 	COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL,
 					/* Tegra124 XUSB pad controller */
+	COMPAT_NVIDIA_TEGRA210_XUSB_PADCTL,
+					/* Tegra210 XUSB pad controller */
 	COMPAT_SMSC_LAN9215,		/* SMSC 10/100 Ethernet LAN9215 */
 	COMPAT_SAMSUNG_EXYNOS5_SROMC,	/* Exynos5 SROMC */
 	COMPAT_SAMSUNG_S3C2440_I2C,	/* Exynos I2C Controller */
lib/fdtdec.c +2 -0
index c0c471d..3eef250 100644
@@ -31,6 +31,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(NVIDIA_TEGRA124_SOR, "nvidia,tegra124-sor"),
 	COMPAT(NVIDIA_TEGRA124_PMC, "nvidia,tegra124-pmc"),
 	COMPAT(NVIDIA_TEGRA20_DC, "nvidia,tegra20-dc"),
+	COMPAT(NVIDIA_TEGRA210_SDMMC, "nvidia,tegra210-sdhci"),
 	COMPAT(NVIDIA_TEGRA124_SDMMC, "nvidia,tegra124-sdhci"),
 	COMPAT(NVIDIA_TEGRA30_SDMMC, "nvidia,tegra30-sdhci"),
 	COMPAT(NVIDIA_TEGRA20_SDMMC, "nvidia,tegra20-sdhci"),
@@ -38,6 +39,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(NVIDIA_TEGRA30_PCIE, "nvidia,tegra30-pcie"),
 	COMPAT(NVIDIA_TEGRA20_PCIE, "nvidia,tegra20-pcie"),
 	COMPAT(NVIDIA_TEGRA124_XUSB_PADCTL, "nvidia,tegra124-xusb-padctl"),
+	COMPAT(NVIDIA_TEGRA210_XUSB_PADCTL, "nvidia,tegra210-xusb-padctl"),
 	COMPAT(SMSC_LAN9215, "smsc,lan9215"),
 	COMPAT(SAMSUNG_EXYNOS5_SROMC, "samsung,exynos-sromc"),
 	COMPAT(SAMSUNG_S3C2440_I2C, "samsung,s3c2440-i2c"),
Signature · 1 line
1.8.2.1.610.g562af5b
#9 lore raw

PATCH v2 4/6 ARM: Tegra210: Add support to common Tegra source/config files

include/fdtdec.h

Quoted 9 lines · Tom Warren

Derived from Tegra124, modified as appropriate during T210 board bringup. Cleaned up debug statements to conserve string space, too.

include/fdtdec.h +2 -0
 
+	COMPAT_NVIDIA_TEGRA210_SDMMC,	/* Tegra210 SDMMC controller */
 
+	COMPAT_NVIDIA_TEGRA210_XUSB_PADCTL,

The DT files added in the next patch contain only the Tegra124 compatible values, implying that the Tegra210 HW modules are backwards-compatible with the Tegra124 HW modules. If this is actually true, we don't need to update the U-Boot drivers to match against the Tegra210 compatible values; they can continue to match against the Tegra124 compatible values.

That said, our downstream DT files contain only Tegra210 compatible values for these modules, so I suspect the bug is that the DT patch needs fixing to contain the correct compatible values. This might apply to more HW modules too, so you might actually need to add more entries into this table rather than fewer...

author
#10 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

In reply to Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

---
 arch/arm/dts/Makefile                              |   3 +-
 .../{tegra124-venice2.dts => tegra210-p2571.dts}   |  40 ++++--
 arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------
 3 files changed, 56 insertions(+), 140 deletions(-)
 copy arch/arm/dts/{tegra124-venice2.dts => tegra210-p2571.dts} (65%)
 copy arch/arm/dts/{tegra124.dtsi => tegra210.dtsi} (76%)
arch/arm/dts/Makefile +2 -1
index 19e1de6..9bd7014 100644
@@ -32,7 +32,8 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra114-dalmore.dtb \
 	tegra124-jetson-tk1.dtb \
 	tegra124-nyan-big.dtb \
-	tegra124-venice2.dtb
+	tegra124-venice2.dtb \
+	tegra210-p2571.dtb
 dtb-$(CONFIG_ARCH_UNIPHIER) += \
 	uniphier-ph1-sld3-ref.dtb \
 	uniphier-ph1-pro4-ref.dtb \
arch/arm/dts/tegra210-p2571.dts renamed from arch/arm/dts/tegra124-venice2.dts +25 -15
similarity index 65%
copy from arch/arm/dts/tegra124-venice2.dts
copy to arch/arm/dts/tegra210-p2571.dts
index 9e93cf9..ca41390 100644
@@ -1,10 +1,10 @@
 /dts-v1/;
 
-#include "tegra124.dtsi"
+#include "tegra210.dtsi"
 
 / {
-	model = "NVIDIA Venice2";
-	compatible = "nvidia,venice2", "nvidia,tegra124";
+	model = "NVIDIA P2571";
+	compatible = "nvidia,p2571", "nvidia,tegra210";
 
 	chosen {
 		stdout-path = &uarta;
@@ -18,16 +18,15 @@
 		i2c4 = "/i2c at 7000c700";
 		i2c5 = "/i2c at 7000d100";
 		sdhci0 = "/sdhci at 700b0600";
-		sdhci1 = "/sdhci at 700b0400";
+		sdhci1 = "/sdhci at 700b0000";
 		spi0 = "/spi at 7000d400";
 		spi1 = "/spi at 7000da00";
+		spi2 = "/spi at 70410000";
 		usb0 = "/usb at 7d000000";
-		usb1 = "/usb at 7d008000";
 	};
 
 	memory {
-		device_type = "memory";
-		reg = <0x80000000 0x80000000>;
+		reg = <0x0 0x80000000 0x0 0xc0000000>;
 	};
 
 	i2c at 7000c000 {
@@ -70,11 +69,15 @@
 		spi-max-frequency = <25000000>;
 	};
 
-	sdhci at 700b0400 {
+	spi at 70410000 {
 		status = "okay";
-		cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
-		power-gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>;
-		wp-gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
+		spi-max-frequency = <24000000>;
+	};
+
+	sdhci at 700b0000 {
+		status = "okay";
+		cd-gpios = <&gpio TEGRA_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
+		power-gpios = <&gpio TEGRA_GPIO(Z, 4) GPIO_ACTIVE_HIGH>;
 		bus-width = <4>;
 	};
 
@@ -86,11 +89,18 @@
 	usb at 7d000000 {
 		status = "okay";
 		dr_mode = "otg";
-		nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
 	};
 
-	usb at 7d008000 {
-		status = "okay";
-		nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 5) GPIO_ACTIVE_HIGH>;
+	clocks {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		clk32k_in: clock at 0 {
+			compatible = "fixed-clock";
+			reg = <0>;
+			#clock-cells = <0>;
+			clock-frequency = <32768>;
+		};
 	};
 };
arch/arm/dts/tegra210.dtsi renamed from arch/arm/dts/tegra124.dtsi +29 -124

266 lines not on this page · raw message

Signature · 1 line
1.8.2.1.610.g562af5b
#11 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 1 line · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

I would expect the SoC DT file to be part of the previous patch which adds Tegra210 support.

I would expect the P2571 file to be part of the next patch which adds P2571 board support.

arch/arm/dts/tegra210.dtsi

Quoted 1 line
arch/arm/dts/tegra210.dtsi renamed from arch/arm/dts/tegra124.dtsi +0 -0

I'd expect many more changes in this file, to add the tegra210 compatible values to the compatible properties (or replace the tegra124 values with tegra210 as appropriate depending on actual HW compatibility).

Also, both #address-cells=<2> and #size-cells=<2> should be present, since this is a 64-bit SoC. That'd also require that all reg values be updated to include 2 cells for address and size, and the unit address in the node names to be updated.

Quoted 3 lines
  	pwm: pwm at 7000a000 {
  		compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm";
  		reg = <0x7000a000 0x100>;

For example, that should probably be:

pwm: pwm at 0,7000a000 {
	compatible = "nvidia,tegra210-pwm", "nvidia,tegra20-pwm";
	reg = <0 0x7000a000 0 0x100>;
}

(Assuming the new PWM HW module is still a 100%-backwards-compatible superset of Tegra20 PWM)

Fixing this issue might mean depending on more of Thierry's local 64-bit fixes, especially w.r.t. DT parsing. I'm not sure.

author
#12 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Stephen,

Quoted 9 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 10:57 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 8 lines
Quoted 1 line · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

I would expect the SoC DT file to be part of the previous patch which adds Tegra210 support.

I would expect the P2571 file to be part of the next patch which adds P2571 board support.

The DT files are split in the same manner as I did for T124/Venice2 back in Jan of '14, and Dalmore/T114 back in Jan '13. This is the way I've always done it. But I see the value in having the DTSI file in with the Tegra210 support patch - I'll move it there.

Quoted 18 lines

arch/arm/dts/tegra210.dtsi

Quoted 2 lines
arch/arm/dts/tegra210.dtsi renamed from arch/arm/dts/tegra124.dtsi +0 -0

I'd expect many more changes in this file, to add the tegra210 compatible values to the compatible properties (or replace the tegra124 values with tegra210 as appropriate depending on actual HW compatibility).

Also, both #address-cells=<2> and #size-cells=<2> should be present, since this is a 64-bit SoC. That'd also require that all reg values be updated to include 2 cells for address and size, and the unit address in the node names to be updated.

Quoted 3 lines
  	pwm: pwm at 7000a000 {
  		compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm";
  		reg = <0x7000a000 0x100>;

For example, that should probably be:

Quoted 8 lines
pwm: pwm at 0,7000a000 {
	compatible = "nvidia,tegra210-pwm", "nvidia,tegra20-pwm";
	reg = <0 0x7000a000 0 0x100>;
}

(Assuming the new PWM HW module is still a 100%-backwards-compatible superset of Tegra20 PWM)

This was cloned/ported from T124 (32-bit), so it's the first 64-bit Tegra SoC - I'm not up-to-speed on 64-bit DT requirements. I'll make the changes and see how it builds/boots.

Quoted 2 lines

Fixing this issue might mean depending on more of Thierry's local 64-bit fixes, especially w.r.t. DT parsing. I'm not sure.

--
nvpublic

#13 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

In reply to Tom Warren
Quoted 3 lines · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

  arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------

There's also a lot of stuff in that file that isn't used in U-Boot or isn't validated yet (audio, SPI?, PWM, I2C?, APBDMA, PCIe). I'd suggest trimming the DT down to the absolute bare minimum for what U-Boot is using right now. That will help prevent any inconsistencies between the U-Boot and kernel DT files for Tegra210.

author
#14 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Stephen,

Quoted 12 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 11:17 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 1 line · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

Quoted 7 lines
Quoted 1 line
  arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------

There's also a lot of stuff in that file that isn't used in U-Boot or isn't validated yet (audio, SPI?, PWM, I2C?, APBDMA, PCIe). I'd suggest trimming the DT down to the absolute bare minimum for what U-Boot is using right now. That will help prevent any inconsistencies between the U-Boot and kernel DT files for Tegra210.

Audio, PCIE make sense. UART and SPI both have DMA properties, so I can' t remove APBDMA. I'll do a cleanup run and see what shakes out.

--
nvpublic

#15 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 16 lines · Tom Warren

Stephen,

Quoted 14 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 11:17 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 3 lines · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

   arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------
Quoted 7 lines
Quoted 5 lines

There's also a lot of stuff in that file that isn't used in U-Boot or isn't validated yet (audio, SPI?, PWM, I2C?, APBDMA, PCIe). I'd suggest trimming the DT down to the absolute bare minimum for what U-Boot is using right now. That will help prevent any inconsistencies between the U-Boot and kernel DT files for Tegra210.

Audio, PCIE make sense. UART and SPI both have DMA properties, so I can' t remove APBDMA. I'll do a cleanup run and see what shakes out.

I believe the DMA properties should be optional in the bindings for UART and SPI. So, you should be able to remove the DMA properties from the client nodes and hence also the APBDMA node. (Especially given that the U-Boot drivers those HW blocks don't do DMA).

author
#16 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Stephen,

Quoted 32 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Thursday, July 23, 2015 11:00 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 22 lines · Tom Warren

Stephen,

Quoted 19 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 11:17 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 3 lines · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

   arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------

There's also a lot of stuff in that file that isn't used in U-Boot or isn't validated yet (audio, SPI?, PWM, I2C?, APBDMA, PCIe). I'd suggest trimming the DT down to the absolute bare minimum for what U-Boot is using right now. That will help prevent any inconsistencies between the U-Boot and kernel DT files for Tegra210.

Quoted 7 lines
Quoted 1 line

Audio, PCIE make sense. UART and SPI both have DMA properties, so I can' t

remove APBDMA. I'll do a cleanup run and see what shakes out.

I believe the DMA properties should be optional in the bindings for UART and SPI. So, you should be able to remove the DMA properties from the client nodes and hence also the APBDMA node. (Especially given that the U-Boot drivers those HW blocks don't do DMA).

If they're optional, why are they in tegra124.dtsi? (and T114 and T30). I wonder how they got in there originally?

Regardless, I'll remove 'em from T210 if you feel that strongly about it.

--
nvpublic

#17 lore raw

PATCH v2 5/6 P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 35 lines · Tom Warren

Stephen,

Quoted 33 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Thursday, July 23, 2015 11:00 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 23 lines · Tom Warren

Stephen,

Quoted 12 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 11:17 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 5/6] P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 1 line · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot.

Quoted 7 lines
Quoted 1 line
    arch/arm/dts/{tegra124.dtsi => tegra210.dtsi}      | 153 ++++-----------------

There's also a lot of stuff in that file that isn't used in U-Boot or isn't validated yet (audio, SPI?, PWM, I2C?, APBDMA, PCIe). I'd suggest trimming the DT down to the absolute bare minimum for what U-Boot is using right now. That will help prevent any inconsistencies between the U-Boot and kernel DT files for Tegra210.

Audio, PCIE make sense. UART and SPI both have DMA properties, so I can' t

Quoted 8 lines
Quoted 6 lines

remove APBDMA. I'll do a cleanup run and see what shakes out.

I believe the DMA properties should be optional in the bindings for UART and SPI. So, you should be able to remove the DMA properties from the client nodes and hence also the APBDMA node. (Especially given that the U-Boot drivers those HW blocks don't do DMA).

If they're optional, why are they in tegra124.dtsi? (and T114 and T30). I wonder how they got in there originally?

DMA is a useful feature, and all the bindings design work and testing for APBDMA has happened on earlier chips in order to enable DMA usage in the Linux kernel. Consequently, the DMA-related properties exist in the Linux kernel's copy of the DT.

The whole point of a DT is that it's identical between all users of the DT. Consequently, (parts of I suspect) the DT file from the Linux kernel have been sync'd into U-Boot's copy of the DT, and hence the DMA properties showed up in U-Boot.

For T210, we haven't yet validated that all the DMA related bindings/... are appropriate, so we shouldn't be adding them to /any/ copy of the DT yet, in case design/... changes are required. This will avoid adding incorrect content and then having to fix it later. Once DMA usage is validated in the kernel, and hence DMA-related properties are added to the kernel's copy of the DT, we should keep the nodes/properties in sync between the kernel and U-Boot just like earlier chips.

author
#18 lore raw

PATCH v2 6/6 T210: Add support for 64-bit T210-based P2571 board

In reply to Tom Warren

Based on Venice2, incorporates Stephen Warren's
latest P2571 pinmux table.

With Thierry Reding's 64-bit build fixes, this
will build and and boot in 64-bit on my P2571
(when used with a 32-bit AVP loader).

---
 arch/arm/mach-tegra/tegra210/Kconfig               |   7 +
 board/nvidia/{beaver => p2571}/Kconfig             |   6 +-
 board/nvidia/p2571/MAINTAINERS                     |   6 +
 .../tegra210 => board/nvidia/p2571}/Makefile       |   6 +-
 board/nvidia/p2571/max77620_init.c                 |  85 ++++++++
 board/nvidia/p2571/max77620_init.h                 |  67 ++++++
 board/nvidia/p2571/p2571.c                         |  29 +++
 board/nvidia/p2571/pinmux-config-p2571.h           | 235 +++++++++++++++++++++
 configs/{beaver_defconfig => p2571_defconfig}      |   6 +-
 include/configs/{venice2.h => p2571.h}             |  42 ++--
 .../{tegra124-common.h => tegra210-common.h}       |  15 +-
 11 files changed, 469 insertions(+), 35 deletions(-)
 copy board/nvidia/{beaver => p2571}/Kconfig (61%)
 create mode 100644 board/nvidia/p2571/MAINTAINERS
 copy {arch/arm/mach-tegra/tegra210 => board/nvidia/p2571}/Makefile (59%)
 create mode 100644 board/nvidia/p2571/max77620_init.c
 create mode 100644 board/nvidia/p2571/max77620_init.h
 create mode 100644 board/nvidia/p2571/p2571.c
 create mode 100644 board/nvidia/p2571/pinmux-config-p2571.h
 copy configs/{beaver_defconfig => p2571_defconfig} (77%)
 copy include/configs/{venice2.h => p2571.h} (62%)
 copy include/configs/{tegra124-common.h => tegra210-common.h} (89%)
arch/arm/mach-tegra/tegra210/Kconfig +7 -0
index f2a0059..147e6a8 100644
@@ -3,9 +3,16 @@ if TEGRA210
 choice
 	prompt "Tegra210 board select"
 
+config TARGET_P2571
+	bool "NVIDIA Tegra210 P2571 base board"
+	help
+	  P2571 is a P2530 married to a P1963 I/O board
+
 endchoice
 
 config SYS_SOC
 	default "tegra210"
 
+source "board/nvidia/p2571/Kconfig"
+
 endif
board/nvidia/p2571/Kconfig renamed from board/nvidia/beaver/Kconfig +3 -3
similarity index 61%
copy from board/nvidia/beaver/Kconfig
copy to board/nvidia/p2571/Kconfig
index 23f7c94..7bc4874 100644
@@ -1,12 +1,12 @@
-if TARGET_BEAVER
+if TARGET_P2571
 
 config SYS_BOARD
-	default "beaver"
+	default "p2571"
 
 config SYS_VENDOR
 	default "nvidia"
 
 config SYS_CONFIG_NAME
-	default "beaver"
+	default "p2571"
 
 endif
board/nvidia/p2571/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..c165135
@@ -0,0 +1,6 @@
+P2571 BOARD
+M:	Tom Warren <[email protected]>
+S:	Maintained
+F:	board/nvidia/p2571/
+F:	include/configs/p2571.h
+F:	configs/p2571_defconfig
board/nvidia/p2571/Makefile renamed from arch/arm/mach-tegra/tegra210/Makefile +2 -4
similarity index 59%
copy from arch/arm/mach-tegra/tegra210/Makefile
copy to board/nvidia/p2571/Makefile
index 1fb8d1a..223062e 100644
@@ -5,7 +5,5 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y	+= clock.o
-obj-y	+= funcmux.o
-obj-y	+= pinmux.o
-obj-y	+= xusb-padctl.o
+obj-y	+= max77620_init.o
+obj-y	+= p2571.o
board/nvidia/p2571/max77620_init.c new file +85 -0

85 lines not on this page · raw message

board/nvidia/p2571/max77620_init.h new file +67 -0

67 lines not on this page · raw message

board/nvidia/p2571/p2571.c new file +29 -0
new file mode 100644
index 0000000..fc710c1
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/pinmux.h>
+#include "pinmux-config-p2571.h"
+
+/*
+ * Routine: pinmux_init
+ * Description: Do individual peripheral pinmux configs
+ */
+void pinmux_init(void)
+{
+	pinmux_clear_tristate_input_clamping();
+
+	gpio_config_table(p2571_gpio_inits,
+			  ARRAY_SIZE(p2571_gpio_inits));
+
+	pinmux_config_pingrp_table(p2571_pingrps,
+				   ARRAY_SIZE(p2571_pingrps));
+
+	pinmux_config_drvgrp_table(p2571_drvgrps,
+				   ARRAY_SIZE(p2571_drvgrps));
+}
board/nvidia/p2571/pinmux-config-p2571.h new file +235 -0

235 lines not on this page · raw message

configs/p2571_defconfig renamed from configs/beaver_defconfig +3 -3
similarity index 77%
copy from configs/beaver_defconfig
copy to configs/p2571_defconfig
index ad74b85..8494bb5 100644
@@ -1,8 +1,8 @@
 CONFIG_ARM=y
 CONFIG_TEGRA=y
-CONFIG_TEGRA30=y
-CONFIG_TARGET_BEAVER=y
-CONFIG_DEFAULT_DEVICE_TREE="tegra30-beaver"
+CONFIG_TEGRA210=y
+CONFIG_TARGET_P2571=y
+CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2571"
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
include/configs/p2571.h renamed from include/configs/venice2.h +23 -19

70 lines not on this page · raw message

include/configs/tegra210-common.h renamed from include/configs/tegra124-common.h +9 -6
similarity index 89%
copy from include/configs/tegra124-common.h
copy to include/configs/tegra210-common.h
index af7698d..0348d47 100644
@@ -1,16 +1,16 @@
 /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2015
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
-#ifndef _TEGRA124_COMMON_H_
-#define _TEGRA124_COMMON_H_
+#ifndef _TEGRA210_COMMON_H_
+#define _TEGRA210_COMMON_H_
 
 #include "tegra-common.h"
 
-/* Cortex-A15 uses a cache line size of 64 bytes */
+/* Cortex-A57 uses a cache line size of 64 bytes */
 #define CONFIG_SYS_CACHELINE_SIZE	64
 
 /*
@@ -26,7 +26,10 @@
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
-#define CONFIG_SYS_TEXT_BASE	0x80110000
+#define CONFIG_SYS_TEXT_BASE	0x8010E000
+
+/* Generic Interrupt Controller */
+#define CONFIG_GICV2
 
 /*
  * Memory layout for where various images get loaded by boot scripts:
@@ -70,4 +73,4 @@
 #define CONFIG_USB_EHCI_TXFIFO_THRESH	0x10
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1
 
-#endif /* _TEGRA124_COMMON_H_ */
+#endif /* _TEGRA210_COMMON_H_ */
Signature · 1 line
1.8.2.1.610.g562af5b
#19 lore raw

PATCH v2 6/6 T210: Add support for 64-bit T210-based P2571 board

Quoted 8 lines · Tom Warren

Based on Venice2, incorporates Stephen Warren's latest P2571 pinmux table.

With Thierry Reding's 64-bit build fixes, this will build and and boot in 64-bit on my P2571 (when used with a 32-bit AVP loader).

include/configs/p2571.h line 56

Quoted 6 lines
include/configs/p2571.h renamed from include/configs/venice2.h +1 -1
 
  /* USB Host support */
  #define CONFIG_USB_EHCI
  #define CONFIG_USB_EHCI_TEGRA
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	1

Why's that?

include/configs/p2571.h line 62

Quoted 6 lines
include/configs/p2571.h renamed from include/configs/venice2.h +0 -6
-/* USB networking support */
-#define CONFIG_USB_HOST_ETHER
-#define CONFIG_USB_ETHER_ASIX
-
-/* General networking support */
-#define CONFIG_CMD_DHCP

I assume that's to solve some compile issue? If so, a FIXME/TODO comment (like you added for tegra-common-usb-gadget.h) would be better, so it's obvious we need to go back and re-enable it.

include/configs/p2571.h line 69

Quoted 4 lines
include/configs/p2571.h renamed from include/configs/venice2.h +4 -0
+#if defined(CONFIG_ARM64)
+#define COUNTER_FREQUENCY	12000000
+#define CPU_RELEASE_ADDR	0x80000000
+#endif

CONFIG_ARM64 is always true now.

According to the schematics, the crystal frequency is 38.4MHz.

Where did the value of CPU_RELEASE_ADDR come from? It's odd that there are 4 CPUs but only 1 release address.

include/configs/tegra210-common.h line 29

Quoted 4 lines
include/configs/tegra210-common.h renamed from include/configs/tegra124-common.h +1 -1
 
-#define CONFIG_SYS_TEXT_BASE	0x80110000
+#define CONFIG_SYS_TEXT_BASE	0x8010E000

It'd be best to keep that consistent with earlier chips.

author
#20 lore raw

PATCH v2 6/6 T210: Add support for 64-bit T210-based P2571 board

Stephen,

Quoted 18 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 11:05 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 6/6] T210: Add support for 64-bit T210-based P2571 board

Quoted 7 lines · Tom Warren

Based on Venice2, incorporates Stephen Warren's latest P2571 pinmux table.

With Thierry Reding's 64-bit build fixes, this will build and and boot in 64-bit on my P2571 (when used with a 32-bit AVP loader).

include/configs/p2571.h renamed from include/configs/venice2.h +0 -0
Quoted 7 lines

include/configs/p2571.h line 56

Quoted 5 lines
  /* USB Host support */
  #define CONFIG_USB_EHCI
  #define CONFIG_USB_EHCI_TEGRA
include/configs/p2571.h renamed from include/configs/venice2.h +1 -1
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
+#define CONFIG_USB_MAX_CONTROLLER_COUNT	1

Why's that?

There's only 1 usable USB2.0 port on P2571 (micro-USB). AFAIK the other ports on the other controller aren't usable in U-Boot.

Quoted 12 lines

include/configs/p2571.h line 62

Quoted 7 lines
include/configs/p2571.h renamed from include/configs/venice2.h +0 -6
-/* USB networking support */
-#define CONFIG_USB_HOST_ETHER
-#define CONFIG_USB_ETHER_ASIX
-
-/* General networking support */
-#define CONFIG_CMD_DHCP

I assume that's to solve some compile issue? If so, a FIXME/TODO comment (like you added for tegra-common-usb-gadget.h) would be better, so it's obvious we need to go back and re-enable it.

Quoted 6 lines

include/configs/p2571.h line 69

Quoted 4 lines
include/configs/p2571.h renamed from include/configs/venice2.h +4 -0
+#if defined(CONFIG_ARM64)
+#define COUNTER_FREQUENCY	12000000
+#define CPU_RELEASE_ADDR	0x80000000
+#endif

CONFIG_ARM64 is always true now.

True. I'll remove it.

Quoted 5 lines

According to the schematics, the crystal frequency is 38.4MHz.

Where did the value of CPU_RELEASE_ADDR come from? It's odd that there are 4 CPUs but only 1 release address.

Both of these came from Thierry's staging/work branch - perhaps he can answer (I'll change the freq to 38.4MHz).

Quoted 8 lines

include/configs/tegra210-common.h line 29

Quoted 6 lines
include/configs/tegra210-common.h renamed from include/configs/tegra124-common.h +1 -1
 
-#define CONFIG_SYS_TEXT_BASE	0x80110000
+#define CONFIG_SYS_TEXT_BASE	0x8010E000

It'd be best to keep that consistent with earlier chips.

This is due to a change Simon just put in for Tegra124 only (running out of SPL space, I assume due to the Nyan-Big ChromeOS-isms). I don't think it's needed right now for T210 w/o SPL, and everyone tends to think of the CPU starting address as 0x8010E000, so I thought I'd keep T210 there.

--
nvpublic

#21 lore raw

v2 cover Tegra210/P2571 initial support

In reply to Tom Warren
Quoted 9 lines · Tom Warren

This patch series adds support for the Tegra210 SoC and the P2571 board. Most of the T210 info
is identical to T124 at this point, so I just cloned Venice2/Jetson-TK1 board files and T124 header/SoC code. Pinmux is the major area of difference at this time, but other changes will be made as more features of the board are brought up.

Quoted 8 lines

T210 is a 64-bit build, and hence has no SPL portion. A separate 32-bit AVP/BPMP loader must be used to get the 64-bit CPU portion running. Once that procedure is locked down, a README will be added to outline the process.

Thierry Reding's dozen or so patches to fix various 64-bit build problems are also required to get this to build & boot. They should precede this series so git-bisect will work.

BTW, I tested this series on a different board using the BPMP-Lite-side bootloader from L4T. It works for me! I put a branch on my github (t210-testing) which also contains all of the dependencies from Thierry that are needed to make it compile (based on the list in our downstream bug tracker; I just blindly cherry-picked them all and didn't really look at them).

#22 lore raw

v2 cover Tegra210/P2571 initial support

In reply to Tom Warren
Quoted 9 lines · Tom Warren

This patch series adds support for the Tegra210 SoC and the P2571 board. Most of the T210 info
is identical to T124 at this point, so I just cloned Venice2/Jetson-TK1 board files and T124 header/SoC code. Pinmux is the major area of difference at this time, but other changes will be made as more features of the board are brought up.

Quoted 8 lines

T210 is a 64-bit build, and hence has no SPL portion. A separate 32-bit AVP/BPMP loader must be used to get the 64-bit CPU portion running. Once that procedure is locked down, a README will be added to outline the process.

Thierry Reding's dozen or so patches to fix various 64-bit build problems are also required to get this to build & boot. They should precede this series so git-bisect will work.

Somewhere in this series, fdt_high/initrd_high need to be modified from ffffffff to ffffffffffffffff. In an old downstream version of this series, this was done by "ARM: Tegra210: Thierry's FDT/DTS changes for 64-bit, WIP".

author
#23 lore raw

v2 cover Tegra210/P2571 initial support

Quoted 22 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, July 22, 2015 1:35 PM
To: Tom Warren
Cc: u-boot at lists.denx.de; Thierry Reding; Stephen Warren; tomcwarren3959 at gmail.com
Subject: Re: [U-Boot] [PATCH V2 0/6] Tegra210/P2571 initial support

Quoted 11 lines · Tom Warren

This patch series adds support for the Tegra210 SoC and the P2571 board. Most of the T210 info is identical to T124 at this point, so I just cloned Venice2/Jetson-TK1 board files and T124 header/SoC code. Pinmux is the major area of difference at this time, but other changes will be made as more features of the board are brought up.

T210 is a 64-bit build, and hence has no SPL portion.
A separate 32-bit AVP/BPMP loader must be used to get the 64-bit CPU portion running. Once that procedure is locked down, a README will be added to outline the process.

Quoted 7 lines
Quoted 3 lines

Thierry Reding's dozen or so patches to fix various 64-bit build problems are also required to get this to build & boot. They should precede this series so git-bisect will work.

Somewhere in this series, fdt_high/initrd_high need to be modified from ffffffff to ffffffffffffffff. In an old downstream version of this series, this was done by "ARM: Tegra210: Thierry's FDT/DTS changes for 64-bit, WIP".

It's coming in a future patch. Only needed to boot the kernel, so I withheld it to get basic T210 support in.

--
nvpublic