Skip to contentSkip to conversation

Tegra210 support for P2571

PATCH New Tom Warren 4 participants 21 messages Jun 3, 2015 – Jun 19, 2015

Subsystems (6)
lore
Share & tools
lore

Tom Warren

author
#0 lore raw

cover Tegra210 support for P2571

Adds support for Tegra210 SoC and P2571 NVIDIA board. Largely based on T124/Venice2. This is a baseline patchset - more will follow to make things more T210- specific as P2571 peripherals/devices are brought up.

Tom Warren (4):
ARM: Tegra210: Add SoC code/include files for T210
ARM: Tegra210: Add support to common Tegra source/config files
P2572: dts: Add DT files for Tegra210/P2572 board
T210: Add support for T210-based P2571 board

 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/hardware.h     |   16 +
 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                       |    4 +
 arch/arm/mach-tegra/Makefile                      |    4 +-
 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 +-
 arch/arm/mach-tegra/tegra210/Kconfig              |   18 +
 arch/arm/mach-tegra/tegra210/Makefile             |   13 +
 arch/arm/mach-tegra/tegra210/clock.c              | 1086 +++++++++++++++++++++
 arch/arm/mach-tegra/tegra210/cpu.c                |  328 +++++++
 arch/arm/mach-tegra/tegra210/funcmux.c            |   71 ++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c        |  494 ++++++++++
 board/nvidia/p2571/Kconfig                        |   12 +
 board/nvidia/p2571/MAINTAINERS                    |    6 +
 board/nvidia/p2571/Makefile                       |    9 +
 board/nvidia/p2571/max77620_init.c                |   47 +
 board/nvidia/p2571/max77620_init.h                |   14 +
 board/nvidia/p2571/p2571.c                        |   29 +
 board/nvidia/p2571/pinmux-config-p2571.h          |  235 +++++
 configs/p2571_defconfig                           |    5 +
 include/configs/p2571.h                           |   72 ++
 include/configs/tegra210-common.h                 |   73 ++
 include/dt-bindings/clock/tegra210-car.h          |  342 +++++++
 include/fdtdec.h                                  |    4 +
 lib/fdtdec.c                                      |    3 +
 46 files changed, 4878 insertions(+), 37 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/hardware.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/cpu.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 1/4 ARM: Tegra210: Add SoC code/include files for T210

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.

---
 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/hardware.h     |   16 +
 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             |   13 +
 arch/arm/mach-tegra/tegra210/clock.c              | 1086 +++++++++++++++++++++
 arch/arm/mach-tegra/tegra210/cpu.c                |  328 +++++++
 arch/arm/mach-tegra/tegra210/funcmux.c            |   71 ++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c        |  494 ++++++++++
 include/dt-bindings/clock/tegra210-car.h          |  342 +++++++
 20 files changed, 3646 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/hardware.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/cpu.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..e615618
@@ -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/hardware.h new file +16 -0
new file mode 100644
index 0000000..68691cb
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _TEGRA210_HARDWARE_H_
+#define _TEGRA210_HARDWARE_H_
+
+/*
+ * Include Tegra-specific hardware definitions
+ * Nothing needed currently for Tegra210
+ */
+
+#endif /* _TEGRA210_HARDWARE_H_ */
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..837ac81
@@ -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 Interrupt Controller Distrib */
+#define GICC_BASE		0x50042000	/* Generic Interrupt Controller 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	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 /* _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 +13 -0
new file mode 100644
index 0000000..a4d6327
@@ -0,0 +1,13 @@
+#
+# (C) Copyright 2013-2015
+# NVIDIA Corporation <www.nvidia.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-$(CONFIG_SPL_BUILD) += cpu.o
+
+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 +1086 -0

1,086 lines not on this page · raw message

arch/arm/mach-tegra/tegra210/cpu.c new file +328 -0

328 lines not on this page · raw message

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

71 lines not on this page · raw message

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

190 lines not on this page · raw message

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

342 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.

#2 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

Quoted 3 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.

Rather than duplicating lots of headers and code, can we share the content with other chips?

arch/arm/include/asm/arch-tegra210/funcmux.h

Quoted 1 line
arch/arm/include/asm/arch-tegra210/funcmux.h +0 -0

We should be able to drop funcmux support completely now that we're programming entire board pinmux tables.

arch/arm/include/asm/arch-tegra210/gpio.h line 46

Quoted 5 lines
arch/arm/include/asm/arch-tegra210/gpio.h +3 -0
 
+enum gpio_pin {
+	GPIO_PA0 = 0,	/* pin 0 */
+	GPIO_PA1,

Given the move to DT, are any of these GPIO_xxx values actually used? I wonder how many other types/defines in the other files are actually used, rather than simply left over from times gone by.

arch/arm/include/asm/arch-tegra210/hardware.h

Quoted 1 line
arch/arm/include/asm/arch-tegra210/hardware.h +0 -0

Can we drop this file? I don't see a hardware.h in any of the other arch-tegra*/ directories.

arch/arm/include/asm/arch-tegra210/tegra.h line 25

Quoted 8 lines
arch/arm/include/asm/arch-tegra210/tegra.h +6 -0
 
+#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 */

Have you validated those? I'm pretty sure the BCT and perhaps BIT layout changed in T210, and those values match T124.

Have all the clock tables and IDs been updated to match T210? If not, I think we should do that before checking in the code, or it'll be misleading.

#3 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

Quoted 10 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 10:11 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

Quoted 7 lines
Quoted 3 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.

Rather than duplicating lots of headers and code, can we share the content with other chips?

Sure, but I wasn't looking at this patchset as a reworking of all Tegra common headers, but an inclusion of T210 support. We can then move to common/shared content after this is in, or someone (you?) can do it now before I add T210 support, but that'll delay it.

Quoted 6 lines

arch/arm/include/asm/arch-tegra210/funcmux.h

Quoted 3 lines
arch/arm/include/asm/arch-tegra210/funcmux.h +0 -0

We should be able to drop funcmux support completely now that we're programming entire board pinmux tables.

I'll look into it, but I believe funcmux is only used to get early UART muxes set, which is done before the pinmux table is parsed/written.

Quoted 11 lines

arch/arm/include/asm/arch-tegra210/gpio.h line 46

Quoted 7 lines
arch/arm/include/asm/arch-tegra210/gpio.h +3 -0
 
+enum gpio_pin {
+	GPIO_PA0 = 0,	/* pin 0 */
+	GPIO_PA1,

Given the move to DT, are any of these GPIO_xxx values actually used? I wonder how many other types/defines in the other files are actually used, rather than simply left over from times gone by.

Again, that's more of a general Tegra cleanup phase then this patchset is intended for. I'll take a quick look, but I don't want to get delayed by doing a bunch of Tegra cleanup stuff right now.

Quoted 6 lines

arch/arm/include/asm/arch-tegra210/hardware.h

Quoted 3 lines
arch/arm/include/asm/arch-tegra210/hardware.h +0 -0

Can we drop this file? I don't see a hardware.h in any of the other arch-tegra*/ directories.

Sure. It's never been used AFAICT.

Quoted 10 lines

arch/arm/include/asm/arch-tegra210/tegra.h

Quoted 9 lines
arch/arm/include/asm/arch-tegra210/tegra.h +5 -0
 
+#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 */

Quoted 5 lines
Quoted 1 line

+#define NVBOOTINFOTABLE_BCTPTR 0x4C /* BCT pointer in BIT in

IRAM */

Have you validated those? I'm pretty sure the BCT and perhaps BIT layout changed in T210, and those values match T124.

Good point. They have changed, since the BCT structure has changed. I'll update them w/real T210 offsets.

Quoted 3 lines

Have all the clock tables and IDs been updated to match T210? If not, I think we should do that before checking in the code, or it'll be misleading.

I believe so - I'm using the clock tables from my 'fully working' branch, so they should be accurate/jibe with the TRM, but I'll double-check.

--
nvpublic

#4 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

Quoted 11 lines · Tom Warren
Quoted 11 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 10:11 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

On 06/03/2015 02:35 PM, Tom Warren wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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.

Rather than duplicating lots of headers and code, can we share the content with other chips?

Sure, but I wasn't looking at this patchset as a reworking of all Tegra common headers, but an inclusion of T210 support. We can then move to common/shared content after this is in, or someone (you?) can do it now before I add T210 support, but that'll delay it.

The problem here is that the same excuse against cleanup is made every time a new SoC comes along, and the cleanup never happens.

Quoted 7 lines
Quoted 5 lines

arch/arm/include/asm/arch-tegra210/funcmux.h

Quoted 2 lines
arch/arm/include/asm/arch-tegra210/funcmux.h +0 -0

We should be able to drop funcmux support completely now that we're programming entire board pinmux tables.

I'll look into it, but I believe funcmux is only used to get early UART muxes set, which is done before the pinmux table is parsed/written.

There's no guarantee funcmux will work in general for the UARTs. The best solution would be to apply the pinmux table before doing anything. That way, we wouldn't need anything custom to try and get the UART working.

#5 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

In reply to Stephen Warren

Update WRT gpio.h and hardware.h, below.

Quoted 50 lines

-----Original Message-----
From: Tom Warren
Sent: Monday, June 15, 2015 1:05 PM
To: 'Stephen Warren'; Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren
Subject: RE: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

Quoted 8 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 10:11 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

Quoted 7 lines
Quoted 3 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.

Rather than duplicating lots of headers and code, can we share the content with other chips?

Sure, but I wasn't looking at this patchset as a reworking of all Tegra common headers, but an inclusion of T210 support. We can then move to common/shared content after this is in, or someone (you?) can do it now before I add T210 support, but that'll delay it.

Quoted 6 lines

arch/arm/include/asm/arch-tegra210/funcmux.h

Quoted 3 lines
arch/arm/include/asm/arch-tegra210/funcmux.h +0 -0

We should be able to drop funcmux support completely now that we're programming entire board pinmux tables.

I'll look into it, but I believe funcmux is only used to get early UART muxes set, which is done before the pinmux table is parsed/written.

Quoted 11 lines

arch/arm/include/asm/arch-tegra210/gpio.h line 46

Quoted 7 lines
arch/arm/include/asm/arch-tegra210/gpio.h +3 -0
 
+enum gpio_pin {
+	GPIO_PA0 = 0,	/* pin 0 */
+	GPIO_PA1,

Given the move to DT, are any of these GPIO_xxx values actually used? I wonder how many other types/defines in the other files are actually used, rather than simply left over from times gone by.

Quoted 3 lines

Again, that's more of a general Tegra cleanup phase then this patchset is intended for. I'll take a quick look, but I don't want to get delayed by doing a bunch of Tegra cleanup stuff right now.

They're used in the pinmux table (pinmux-config-venice2.h, for example) and some board files (nyan-big.c, cardhu.c, seaboard.c). Can't remove 'em.

Quoted 8 lines
Quoted 7 lines

arch/arm/include/asm/arch-tegra210/hardware.h

Quoted 4 lines
arch/arm/include/asm/arch-tegra210/hardware.h +0 -0

Can we drop this file? I don't see a hardware.h in any of the other arch-tegra*/ directories.

Sure. It's never been used AFAICT.

Can't drop hardware.h. It's expected to be in every build, included from arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.

Quoted 27 lines
Quoted 11 lines

arch/arm/include/asm/arch-tegra210/tegra.h

Quoted 10 lines
arch/arm/include/asm/arch-tegra210/tegra.h +5 -0
 
+#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 */

Quoted 5 lines
Quoted 1 line

+#define NVBOOTINFOTABLE_BCTPTR 0x4C /* BCT pointer in BIT in

IRAM */

Have you validated those? I'm pretty sure the BCT and perhaps BIT layout changed in T210, and those values match T124.

Good point. They have changed, since the BCT structure has changed. I'll update them w/real T210 offsets.

Quoted 3 lines

Have all the clock tables and IDs been updated to match T210? If not, I think we should do that before checking in the code, or it'll be misleading.

I believe so - I'm using the clock tables from my 'fully working' branch, so they should be accurate/jibe with the TRM, but I'll double-check.

--
nvpublic

#6 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

Quoted 8 lines · Tom Warren

Update WRT gpio.h and hardware.h, below.

Tom Warren wrote at Monday, June 15, 2015 1:05 PM:

Quoted 5 lines

Stephen Warren wrote at Monday, June 15, 2015 10:11 AM:

Quoted 4 lines · Tom Warren
Quoted 3 lines

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.

...

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

arch/arm/include/asm/arch-tegra210/hardware.h

Quoted 2 lines
arch/arm/include/asm/arch-tegra210/hardware.h +0 -0

Can we drop this file? I don't see a hardware.h in any of the other arch-tegra*/ directories.

Sure. It's never been used AFAICT.

Can't drop hardware.h. It's expected to be in every build, included from arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.

But there is no hardware.h in any of arch/arm/include/asm/arch-tegra*.h in u-boot.git's master branch as of today.

#7 lore raw

PATCH 1/4 ARM: Tegra210: Add SoC code/include files for T210

Quoted 23 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Tuesday, June 16, 2015 1:29 PM
To: Tom Warren; Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren
Subject: Re: [U-Boot] [PATCH 1/4] ARM: Tegra210: Add SoC code/include files for T210

Quoted 8 lines · Tom Warren

Update WRT gpio.h and hardware.h, below.

Tom Warren wrote at Monday, June 15, 2015 1:05 PM:

Quoted 5 lines

Stephen Warren wrote at Monday, June 15, 2015 10:11 AM:

Quoted 4 lines · Tom Warren
Quoted 3 lines

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.

...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

arch/arm/include/asm/arch-tegra210/hardware.h

Quoted 2 lines
arch/arm/include/asm/arch-tegra210/hardware.h +0 -0

Can we drop this file? I don't see a hardware.h in any of the other arch-tegra*/ directories.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

Sure. It's never been used AFAICT.

Can't drop hardware.h. It's expected to be in every build, included from

arch/arm/include/asm/hardware.h, created by Wolfgang way back in 2003.

But there is no hardware.h in any of arch/arm/include/asm/arch-tegra*.h in u-boot.git's master branch as of today.

Sorry, I must have been looking at my u-boot-tegra/next branch, which hasn't been sync'd w/master (u-boot or u-boot-tegra) in a while. I'll remove hardware.h in the next patchset.

Thanks

--
nvpublic

author
#8 lore raw

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

In reply to Tom Warren

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

Note that the 'empty' Kconfig for Tegra210 will cause an innocuous build warning, but it'll go away when a real T210 board is instantiated.

---
 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                  |  4 ++
 arch/arm/mach-tegra/Makefile                 |  4 +-
 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                             |  4 ++
 lib/fdtdec.c                                 |  3 ++
 13 files changed, 104 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 +4 -0
index fce1c1d..02164ee 100644
@@ -15,6 +15,9 @@ config TEGRA114
 config TEGRA124
 	bool "Tegra124 family"
 
+config TEGRA210
+	bool "Tegra210 family"
+
 endchoice
 
 config SYS_MALLOC_F_LEN
@@ -48,5 +51,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 +3 -1
index 68eec5c..f000e1a 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.
@@ -25,8 +25,10 @@ obj-y += powergate.o
 obj-y += xusb-padctl.o
 obj-$(CONFIG_DISPLAY_CPUINFO) += sys_info.o
 obj-$(CONFIG_TEGRA124) += vpr.o
+obj-$(CONFIG_TEGRA210) += vpr.o
 
 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 a17dfd1..8d95069 100644
@@ -1,5 +1,5 @@
 /*
-* (C) Copyright 2010-2014
+* (C) Copyright 2010-2015
 * NVIDIA Corporation <www.nvidia.com>
 *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -91,6 +91,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 cdd5438..2ef8ae2 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,
@@ -629,6 +629,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 +4 -0
index 207035a..fc84258 100644
@@ -115,6 +115,7 @@ enum fdt_compat_id {
 	COMPAT_NVIDIA_TEGRA20_USB,	/* Tegra20 USB port */
 	COMPAT_NVIDIA_TEGRA30_USB,	/* Tegra30 USB port */
 	COMPAT_NVIDIA_TEGRA114_USB,	/* Tegra114 USB port */
+	COMPAT_NVIDIA_TEGRA210_USB,	/* Tegra210 USB port */
 	COMPAT_NVIDIA_TEGRA20_EMC,	/* Tegra20 memory controller */
 	COMPAT_NVIDIA_TEGRA20_EMC_TABLE, /* Tegra20 memory timing table */
 	COMPAT_NVIDIA_TEGRA20_KBC,	/* Tegra20 Keyboard */
@@ -124,6 +125,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 */
@@ -132,6 +134,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 +3 -0
index 576b797..cf8c573 100644
@@ -24,6 +24,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
 	COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
 	COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
+	COMPAT(NVIDIA_TEGRA210_USB, "nvidia,tegra210-ehci"),
 	COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
 	COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
 	COMPAT(NVIDIA_TEGRA20_KBC, "nvidia,tegra20-kbc"),
@@ -33,6 +34,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"),
@@ -40,6 +42,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 2/4 ARM: Tegra210: Add support to common Tegra source/config files

Quoted 20 lines · Tom Warren

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

Note that the 'empty' Kconfig for Tegra210 will cause an innocuous build warning, but it'll go away when a real T210 board is instantiated.

arch/arm/mach-tegra/clock.c +1 -1
index cdd5438..2ef8ae2 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,

arch/arm/mach-tegra/clock.c static void set_avp_clock_source(u32 src) · line 632

Quoted 4 lines
arch/arm/mach-tegra/clock.c +1 -0
@@ -629,6 +629,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

I think we're only meant to update the copyright date for non-trivial changes.

arch/arm/mach-tegra/cpu.c int get_num_cpus(void) · line 44

Quoted 8 lines
arch/arm/mach-tegra/cpu.c +2 -0
@@ -39,6 +40,8 @@ int get_num_cpus(void)
  		break;
  	case CHIPID_TEGRA30:
  	case CHIPID_TEGRA114:
+	case CHIPID_TEGRA124:
+	case CHIPID_TEGRA210:

It would be nice to break out the T124 change as a separate patch, since it affects something other than T210.

arch/arm/mach-tegra/cpu.h line 38

Quoted 4 lines
arch/arm/mach-tegra/cpu.h +1 -1
 
-#define CORESIGHT_UNLOCK	0xC5ACCE55;
+#define CORESIGHT_UNLOCK	0xC5ACCE55

Do we use that anywhere? If not, perhaps just delete it, probably as a separate patch.

author
#10 lore raw

PATCH 3/4 P2571: dts: Add DT files for Tegra210/P2571 board

In reply to Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot. Using tegra124 compat names for now to get everything working. May need minor work to match the real board.

---
 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 f897e6d..3e09cb5 100644
@@ -33,7 +33,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 3/4 P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 3 lines · Tom Warren

Based on T124 Venice2. SDMMC1 is SD-card slot. Using tegra124 compat names for now to get everything working. May need minor work to match the real board.

This looks OK at a quick glance, although the "may need minor rework" comment is worrying; can't we simply not add things into the DT until they've been validated? Otherwise, we run the risk of the DT containing incorrect misleading data.

#12 lore raw

PATCH 3/4 P2571: dts: Add DT files for Tegra210/P2571 board

Quoted 11 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 10:23 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 3/4] P2571: dts: Add DT files for Tegra210/P2571 board

On 06/03/2015 02:35 PM, Tom Warren wrote:

Quoted 8 lines
Quoted 3 lines

Based on T124 Venice2. SDMMC1 is SD-card slot.
Using tegra124 compat names for now to get everything working. May need minor work to match the real board.

This looks OK at a quick glance, although the "may need minor rework" comment is worrying; can't we simply not add things into the DT until they've been validated? Otherwise, we run the risk of the DT containing incorrect misleading data.

That's a disclaimer I had in originally before working through all the bringup issues. Should be removed, the DT files match what I have in my 'fully-ported & working' branch.

--
nvpublic

author
#13 lore raw

PATCH 4/4 T210: Add support for T210-based P2571 board

In reply to Tom Warren

Based on Venice2, may change as P2571 board is fully brought up. Incorporates Stephen Warren's P2571 pinmux table.

---
 arch/arm/mach-tegra/tegra210/Kconfig               |   7 +
 board/nvidia/{beaver => p2571}/Kconfig             |   6 +-
 board/nvidia/p2571/MAINTAINERS                     |   6 +
 board/nvidia/{venice2 => p2571}/Makefile           |   6 +-
 board/nvidia/p2571/max77620_init.c                 |  47 +++++
 board/nvidia/p2571/max77620_init.h                 |  14 ++
 board/nvidia/p2571/p2571.c                         |  29 +++
 board/nvidia/p2571/pinmux-config-p2571.h           | 235 +++++++++++++++++++++
 configs/p2571_defconfig                            |   5 +
 include/configs/{venice2.h => p2571.h}             |  17 +-
 .../{tegra124-common.h => tegra210-common.h}       |   8 +-
 11 files changed, 363 insertions(+), 17 deletions(-)
 copy board/nvidia/{beaver => p2571}/Kconfig (61%)
 create mode 100644 board/nvidia/p2571/MAINTAINERS
 copy board/nvidia/{venice2 => p2571}/Makefile (55%)
 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
 copy include/configs/{venice2.h => p2571.h} (81%)
 copy include/configs/{tegra124-common.h => tegra210-common.h} (95%)
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 board/nvidia/venice2/Makefile +3 -3
similarity index 55%
copy from board/nvidia/venice2/Makefile
copy to board/nvidia/p2571/Makefile
index 5fac5ab..223062e 100644
@@ -1,9 +1,9 @@
 #
-# (C) Copyright 2013-2014
+# (C) Copyright 2013-2015
 # NVIDIA Corporation <www.nvidia.com>
 #
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y	+= as3722_init.o
-obj-y	+= venice2.o
+obj-y	+= max77620_init.o
+obj-y	+= p2571.o
board/nvidia/p2571/max77620_init.c new file +47 -0

47 lines not on this page · raw message

board/nvidia/p2571/max77620_init.h new file +14 -0
new file mode 100644
index 0000000..2278386
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2013-2015
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+/* MAX77620-PMIC-specific early init regs */
+
+#define MAX77620_I2C_ADDR	0x78		/* or 0x3C 7-bit */
+
+#define I2C_SEND_2_BYTES	0x0A02
+
+void pmic_enable_cpu_vdd(void);
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 new file +5 -0
new file mode 100644
index 0000000..a91ff22
@@ -0,0 +1,5 @@
+CONFIG_ARM=y
+CONFIG_TEGRA=y
+CONFIG_TEGRA210=y
+CONFIG_TARGET_P2571=y
+CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2571"
include/configs/p2571.h renamed from include/configs/venice2.h +10 -7
similarity index 81%
copy from include/configs/venice2.h
copy to include/configs/p2571.h
index 4594002..b015452 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2014
+ * (C) Copyright 2013-2015
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -10,11 +10,14 @@
 
 #include <linux/sizes.h>
 
-#include "tegra124-common.h"
+/* enable PMIC */
+#define CONFIG_MAX77620_POWER
+
+#include "tegra210-common.h"
 
 /* High-level configuration options */
-#define V_PROMPT			"Tegra124 (Venice2) # "
-#define CONFIG_TEGRA_BOARD_STRING	"NVIDIA Venice2"
+#define V_PROMPT			"Tegra210 (P2571) # "
+#define CONFIG_TEGRA_BOARD_STRING	"NVIDIA P2571"
 
 /* Board-specific serial config */
 #define CONFIG_SERIAL_MULTI
@@ -42,11 +45,11 @@
 #define CONFIG_TEGRA114_SPI_CTRLS	6
 #define CONFIG_SPI_FLASH
 #define CONFIG_SPI_FLASH_WINBOND
-#define CONFIG_SF_DEFAULT_MODE         SPI_MODE_0
-#define CONFIG_SF_DEFAULT_SPEED        24000000
+#define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
+#define CONFIG_SF_DEFAULT_SPEED		24000000
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_SF
-#define CONFIG_SPI_FLASH_SIZE          (4 << 20)
+#define CONFIG_SPI_FLASH_SIZE		(4 << 20)
 
 /* USB Host support */
 #define CONFIG_USB_EHCI
include/configs/tegra210-common.h renamed from include/configs/tegra124-common.h +4 -4
similarity index 95%
copy from include/configs/tegra124-common.h
copy to include/configs/tegra210-common.h
index 1aee5c8..cebe598 100644
@@ -1,12 +1,12 @@
 /*
- * (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"
 
@@ -70,4 +70,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
#14 lore raw

PATCH 4/4 T210: Add support for T210-based P2571 board

Quoted 11 lines · Tom Warren

Based on Venice2, may change as P2571 board is fully brought up. Incorporates Stephen Warren's P2571 pinmux table.

board/nvidia/p2571/max77620_init.c +6 -0
 
+void tegra_i2c_ll_write_addr(uint addr, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(addr, &reg->cmd_addr0);
+	writel(config, &reg->cnfg);

board/nvidia/p2571/max77620_init.c line 30

Quoted 10 lines
board/nvidia/p2571/max77620_init.c +10 -0
+}
+
+void tegra_i2c_ll_write_data(uint data, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(data, &reg->cmd_data1);
+	writel(config, &reg->cnfg);
+}
+

We really should put that into a lilbrary function, probably along with the definition of things like I2C_SEND_2_BYTES (or make some more helper functions to hide that too).

board/nvidia/p2571/max77620_init.c line 36

Quoted 6 lines
board/nvidia/p2571/max77620_init.c +6 -0
+void pmic_enable_cpu_vdd(void)
+{
+	debug("%s entry\n", __func__);
+
+        //from TegraShell init script: Set GPIO5 to drive CPU_REG_EN
+        //                              then 1.0V on ???

I don't think we should mention internal tool names in upstream source.

board/nvidia/p2571/max77620_init.c line 40

Quoted 4 lines
board/nvidia/p2571/max77620_init.c +4 -0
+        debug("%s: Setting GPIO5 to push-pull out, logic high to enable CPU regulator\n", __func__);
+        tegra_i2c_ll_write_addr(MAX77620_I2C_ADDR, 2);
+        tegra_i2c_ll_write_data(0x2040, I2C_SEND_2_BYTES);      //data/reg
+        udelay(10*1000);

Need spaces around "*".

I'm not sure what "data/reg" means?

board/nvidia/p2571/max77620_init.c line 44

Quoted 4 lines
board/nvidia/p2571/max77620_init.c +4 -0
+
+        tegra_i2c_ll_write_addr(MAX77620_I2C_ADDR, 2);
+        tegra_i2c_ll_write_data(0x093B, I2C_SEND_2_BYTES);      //B3=1=logic high,B2=dontcare,B1=0=output,B0=1=push-pull
+        udelay(10 * 1000);

Can we wrap that put that comment on a separate line, since it's rather long. I don't think U-Boot likes // comments.

Does this patch pass checkpatch?

board/nvidia/p2571/pinmux-config-p2571.h

Quoted 1 line
board/nvidia/p2571/pinmux-config-p2571.h +0 -0

I think I generated this a long time ago. I'd like to get this into tegra-pinmux-scripts, and make sure we're pulling in data from the latest board spreadsheet, before we commit this. I'll look into that today.

#15 lore raw

PATCH 4/4 T210: Add support for T210-based P2571 board

Quoted 27 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 10:59 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 4/4] T210: Add support for T210-based P2571 board

Quoted 16 lines · Tom Warren

Based on Venice2, may change as P2571 board is fully brought up. Incorporates Stephen Warren's P2571 pinmux table.

board/nvidia/p2571/max77620_init.c +10 -0
 
+void tegra_i2c_ll_write_addr(uint addr, uint config) {
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(addr, &reg->cmd_addr0);
+	writel(config, &reg->cnfg);
+}
+
+void tegra_i2c_ll_write_data(uint data, uint config) {
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
Quoted 8 lines

board/nvidia/p2571/max77620_init.c line 30

Quoted 4 lines
board/nvidia/p2571/max77620_init.c +4 -0
+	writel(data, &reg->cmd_data1);
+	writel(config, &reg->cnfg);
+}
+

We really should put that into a lilbrary function, probably along with the definition of things like I2C_SEND_2_BYTES (or make some more helper functions to hide that too).

Yep, we should make a PMIC driver for this part, but haven't yet. This is cut&paste from all the other Tegra boards. I'll look into moving things around to make it cleaner, but that'll affect all boards and would be a separate effort.

Quoted 9 lines

board/nvidia/p2571/max77620_init.c line 36

Quoted 7 lines
board/nvidia/p2571/max77620_init.c +6 -0
+void pmic_enable_cpu_vdd(void)
+{
+	debug("%s entry\n", __func__);
+
+        //from TegraShell init script: Set GPIO5 to drive CPU_REG_EN
+        //                              then 1.0V on ???

I don't think we should mention internal tool names in upstream source.

Good catch, thanks. This has been addressed in a V2 patchset I did last week when I ran checkpatch.

Quoted 10 lines
Quoted 2 lines

+ debug("%s: Setting GPIO5 to push-pull out, logic high to enable CPU

regulator\n", __func__);

board/nvidia/p2571/max77620_init.c line 40

Quoted 3 lines
board/nvidia/p2571/max77620_init.c +3 -0
+        tegra_i2c_ll_write_addr(MAX77620_I2C_ADDR, 2);
+        tegra_i2c_ll_write_data(0x2040, I2C_SEND_2_BYTES);      //data/reg
+        udelay(10*1000);

Need spaces around "*".

I'm not sure what "data/reg" means?

0x2040 is 0x20 data, 0x40 register. Just a note to myself during bringup. Removed.

Quoted 11 lines

board/nvidia/p2571/max77620_init.c

Quoted 4 lines
board/nvidia/p2571/max77620_init.c +3 -0
+
+        tegra_i2c_ll_write_addr(MAX77620_I2C_ADDR, 2);
+        tegra_i2c_ll_write_data(0x093B, I2C_SEND_2_BYTES);      //B3=1=logic

high,B2=dontcare,B1=0=output,B0=1=push-pull

Quoted 1 line

+ udelay(10 * 1000);

Can we wrap that put that comment on a separate line, since it's rather long. I don't think U-Boot likes // comments.

Does this patch pass checkpatch?

V2 does, all C99 // comments removed, 80-char+ lines fixed, etc. I'll post it when I address your other concerns.

Quoted 7 lines

board/nvidia/p2571/pinmux-config-p2571.h

Quoted 3 lines
board/nvidia/p2571/pinmux-config-p2571.h +0 -0

I think I generated this a long time ago. I'd like to get this into tegra-pinmux- scripts, and make sure we're pulling in data from the latest board spreadsheet, before we commit this. I'll look into that today.

Good idea. Thanks.

--
Nvpublic

#16 lore raw

PATCH 4/4 T210: Add support for T210-based P2571 board

In reply to Stephen Warren
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Tom Warren

Based on Venice2, may change as P2571 board is fully brought up. Incorporates Stephen Warren's P2571 pinmux table.

...

Quoted 6 lines

board/nvidia/p2571/pinmux-config-p2571.h

Quoted 2 lines
board/nvidia/p2571/pinmux-config-p2571.h +0 -0

I think I generated this a long time ago. I'd like to get this into tegra-pinmux-scripts, and make sure we're pulling in data from the latest board spreadsheet, before we commit this. I'll look into that today.

I've validated that the pinmux data in this patch is up-to-date. There are some whitespace differences in the definition of the PINCFG() macro, so it might be nice to regenerate pinmux-config-p2571.h before any future patch version to make sure it 100% matches what the scripts output.

#17 lore raw

PATCH 4/4 T210: Add support for T210-based P2571 board

Quoted 22 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Monday, June 15, 2015 11:22 AM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 4/4] T210: Add support for T210-based P2571 board

Quoted 3 lines · Stephen Warren
Quoted 2 lines · Tom Warren

Based on Venice2, may change as P2571 board is fully brought up. Incorporates Stephen Warren's P2571 pinmux table.

...

Quoted 6 lines

board/nvidia/p2571/pinmux-config-p2571.h

Quoted 2 lines
board/nvidia/p2571/pinmux-config-p2571.h +0 -0

I think I generated this a long time ago. I'd like to get this into tegra-pinmux-scripts, and make sure we're pulling in data from the latest board spreadsheet, before we commit this. I'll look into that today.

Quoted 4 lines

I've validated that the pinmux data in this patch is up-to-date. There are some whitespace differences in the definition of the PINCFG() macro, so it might be nice to regenerate pinmux-config-p2571.h before any future patch version to make sure it 100% matches what the scripts output.

I don't know how to generate the pinmux table header from the SS, so if you could do that and pass it to me for the next patchset, I'd appreciate it.

Tom

--
nvpublic

#18 lore raw

cover Tegra210 support for P2571

In reply to Tom Warren
Quoted 4 lines · Tom Warren

Adds support for Tegra210 SoC and P2571 NVIDIA board. Largely based on T124/Venice2. This is a baseline patchset - more will follow to make things more T210- specific as P2571 peripherals/devices are brought up.

Does this add support for a 32-bit or a 64-bit U-Boot? Since T210 is a 64-bit CPU I would have expected a 64-bit U-Boot, yet:

a)

arch/arm/Kconfig contains:

config TEGRA
...
select CPU_V7

and this patch doesn't modify that.

b)

I can built an executable with these patches applied (after manually fixing up some merge problems) with an ARMv7 compiler, but not with an ARMv8 compiler.

I think that means this is a 32-bit port. We need a 64-bit port.

#19 lore raw

cover Tegra210 support for P2571

Yes, it's a 32-bit T210 U-Boot. T210 supports both AARCH32 and AARCH64.

A 64-bit build will follow, but I haven't figured out how to meld the 32-bit AVP SPL portion/build with the 64-bit CPU portion/build in one clean build command, so I'm building them separately and then fusing them together in a separate script. If anyone has ideas on how to generate a hybrid 32-bit (AVP)/64-bit (A57) U-Boot binary in one fell swoop, I'm all ears. :)

Tom

Quoted 26 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, June 17, 2015 1:07 PM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 0/4] Tegra210 support for P2571

Quoted 4 lines · Tom Warren

Adds support for Tegra210 SoC and P2571 NVIDIA board. Largely based on T124/Venice2. This is a baseline patchset - more will follow to make things more T210- specific as P2571 peripherals/devices are brought up.

Does this add support for a 32-bit or a 64-bit U-Boot? Since T210 is a 64-bit CPU I would have expected a 64-bit U-Boot, yet:

a)

arch/arm/Kconfig contains:

config TEGRA
...
select CPU_V7

and this patch doesn't modify that.

Quoted 7 lines

b)

I can built an executable with these patches applied (after manually fixing up some merge problems) with an ARMv7 compiler, but not with an ARMv8 compiler.

I think that means this is a 32-bit port. We need a 64-bit port.

-----------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------

#20 lore raw

cover Tegra210 support for P2571

Hi Tom,

I've got one of these shield things - it is a seriously cool piece of hardware. I've have to read a bit about what is it for.

So, any idea where to find a UART and recovery button?

Regards,
Simon

Quoted 49 lines · Tom Warren

Yes, it's a 32-bit T210 U-Boot. T210 supports both AARCH32 and AARCH64.

A 64-bit build will follow, but I haven't figured out how to meld the 32-bit AVP SPL portion/build with the 64-bit CPU portion/build in one clean build command, so I'm building them separately and then fusing them together in a separate script. If anyone has ideas on how to generate a hybrid 32-bit (AVP)/64-bit (A57) U-Boot binary in one fell swoop, I'm all ears. :)

Tom

Quoted 26 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Wednesday, June 17, 2015 1:07 PM
To: Tom Warren
Cc: u-boot at lists.denx.de; Stephen Warren; Tom Warren
Subject: Re: [U-Boot] [PATCH 0/4] Tegra210 support for P2571

Quoted 4 lines · Tom Warren

Adds support for Tegra210 SoC and P2571 NVIDIA board. Largely based on T124/Venice2. This is a baseline patchset - more will follow to make things more T210- specific as P2571 peripherals/devices are brought up.

Does this add support for a 32-bit or a 64-bit U-Boot? Since T210 is a 64-bit CPU I would have expected a 64-bit U-Boot, yet:

a)

arch/arm/Kconfig contains:

config TEGRA
...
select CPU_V7

and this patch doesn't modify that.

Quoted 7 lines

b)

I can built an executable with these patches applied (after manually fixing up some merge problems) with an ARMv7 compiler, but not with an ARMv8 compiler.

I think that means this is a 32-bit port. We need a 64-bit port.

-----------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot