Skip to contentSkip to conversation

Tegra K1 support

PATCH Applied Lucas Stach 2 participants 32 messages Jun 3, 2014 – Jun 4, 2014

Subsystems (7)
lore
Share & tools
lore
#1 lore raw

PATCH 1/30 mci: implement non-removable property

In reply to Lucas Stach

There is no need to check the card-detect status
for non-removable devices.

---
 drivers/mci/mci-core.c | 5 ++++-
 include/mci.h          | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/mci/mci-core.c +4 -1
index 282d239..ce6e590 100644
@@ -1572,7 +1572,8 @@ static int mci_card_probe(struct mci *mci)
 	struct mci_host *host = mci->host;
 	int i, rc, disknum, ret;
 
-	if (host->card_present && !host->card_present(host)) {
+	if (host->card_present && !host->card_present(host) &&
+	    !host->non_removable) {
 		dev_err(&mci->dev, "no card inserted\n");
 		return -ENODEV;
 	}
@@ -1839,4 +1840,6 @@ void mci_of_parse(struct mci_host *host)
 			host->dsr_val = dsr_val;
 		}
 	}
+
+	host->non_removable = of_property_read_bool(np, "non-removable");
 }
include/mci.h +1 -0
index f2c6fd1..c5ab5b3 100644
@@ -302,6 +302,7 @@ struct mci_host {
 	unsigned max_req_size;
 	unsigned dsr_val;	/**< optional dsr value */
 	int use_dsr;		/**< optional dsr usage flag */
+	bool non_removable;	/**< device is non removable */
 	struct regulator *supply;
 
 	/** init the host interface */
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/30 tegra: lowlevel-dvc: use __always_inline macro

In reply to Lucas Stach

Cleaner code.

---
 arch/arm/mach-tegra/include/mach/lowlevel-dvc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-tegra/include/mach/lowlevel-dvc.h +3 -3
index 32f10d7..9ae8784 100644
@@ -59,7 +59,7 @@ void tegra_dvc_write_data(u32 data, u32 config)
 	writel(config, TEGRA_DVC_BASE + TEGRA_I2C_CNFG);
 }
 
-static inline __attribute__((always_inline))
+static __always_inline
 void tegra30_tps65911_cpu_rail_enable(void)
 {
 	tegra_dvc_write_addr(0x5a, 2);
@@ -71,7 +71,7 @@ void tegra30_tps65911_cpu_rail_enable(void)
 	tegra_ll_delay_usec(10 * 1000);
 }
 
-static inline __attribute__((always_inline))
+static __always_inline
 void tegra30_tps62366a_ramp_vddcore(void)
 {
 	tegra_dvc_write_addr(0xc0, 2);
@@ -80,7 +80,7 @@ void tegra30_tps62366a_ramp_vddcore(void)
 	tegra_ll_delay_usec(1000);
 }
 
-static inline __attribute__((always_inline))
+static __always_inline
 void tegra30_tps62361b_ramp_vddcore(void)
 {
 	tegra_dvc_write_addr(0xc0, 2);
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 6/30 tegra: add Tegra124 id to lowlevel functions

In reply to Lucas Stach
---
 arch/arm/mach-tegra/include/mach/lowlevel.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-tegra/include/mach/lowlevel.h +6 -0
index 80d65a6..662508a 100644
@@ -67,6 +67,8 @@ enum tegra_chiptype {
 	TEGRA_UNK_REV = -1,
 	TEGRA20 = 0,
 	TEGRA30 = 1,
+	TEGRA114 = 2,
+	TEGRA124 = 3,
 };
 
 static __always_inline
@@ -87,6 +89,8 @@ enum tegra_chiptype tegra_get_chiptype(void)
 		return TEGRA20;
 	case 0x30:
 		return TEGRA30;
+	case 0x40:
+		return TEGRA124;
 	default:
 		return TEGRA_UNK_REV;
 	}
@@ -99,6 +103,7 @@ int tegra_get_num_cores(void)
 	case TEGRA20:
 		return 2;
 	case TEGRA30:
+	case TEGRA124:
 		return 4;
 	default:
 		return 0;
@@ -213,6 +218,7 @@ int tegra_get_pllp_rate(void)
 	case TEGRA20:
 		return 216000000;
 	case TEGRA30:
+	case TEGRA124:
 		return 408000000;
 	default:
 		return 0;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#0 lore raw

cover Tegra K1 support

This is the next big round of Tegra updates, featuring Tegra K1 support. The series is based on -next as it has quite some dependencies on the earlier Tegra series.

The first 4 patches are some general useful additions, all others are adding K1 aka Tegra124 support. I've verified booting a Linux kernel to the rootfs panic.

The series is regression free on Tegra30.

Lucas Stach (30):
mci: implement non-removable property
tegra: lowlevel-dvc: use __always_inline macro
tegra: pmc: add Tegra30 compatible
tegra: pmc: add command to get into RCM
tegra: lowlevel: setup an early stack
tegra: add Tegra124 id to lowlevel functions
tegra: lowlevel: fix ODMdata fetch on Tegra124
tegra: recognize Tegra124 in maincomplex startup
tegra: recognize Tegra124 in common initcalls
tegra: add Tegra124 and AS3722 PMIC to lowlevel-dvc
tegra: disable IDDQ for PLL_X on Tegra124
tegra: power up additional partitions on Tegra124
tegra: fix MESLECT clock enable
tegra: change cpu internal reset layout for Tegra124
tegra: add Tegra124 PLL_X rate setup
tegra: apply cluster switch logic to all SoCs >=T30
tegra: hardcode entry address for main cluster
tegra: setup L2 cache on Tegra124
tegra: add architectural timer init
tegra: add Tegra124 Kconfig symbol
pinctrl: tegra30: introduce drvdata
pinctrl: tegra: add Tegra124 support
clk: tegra: allow variable sized muxes
clk: tegra: don't bug out on zero PLL postdiv
clk: tegra: add Tegra124 driver
mci: tegra: add Tegra124 compatible
tegra: pmc: add Tegra124 compatible
images: add Tegra124 image build rules
tegra: add NVIDIA Jetson-TK1 board support
tegra: refresh defconfig

 arch/arm/boards/Makefile                           |    1 +
 arch/arm/boards/nvidia-jetson-tk1/Makefile         |    7 +
 arch/arm/boards/nvidia-jetson-tk1/entry.c          |   39 +
 .../nvidia-jetson-tk1/jetson-tk1-2gb-emmc.bct.cfg  | 1287 ++++++++++++++
 arch/arm/configs/tegra_v7_defconfig                |   22 +-
 arch/arm/dts/Makefile                              |    4 +-
 arch/arm/dts/tegra124-jetson-tk1.dts               | 1828 ++++++++++++++++++++
 arch/arm/dts/tegra124.dtsi                         |    1 +
 arch/arm/mach-tegra/Kconfig                        |    8 +
 arch/arm/mach-tegra/include/mach/iomap.h           |    3 +
 arch/arm/mach-tegra/include/mach/lowlevel-dvc.h    |   61 +-
 arch/arm/mach-tegra/include/mach/lowlevel.h        |   58 +-
 arch/arm/mach-tegra/include/mach/tegra114-sysctr.h |   30 +
 arch/arm/mach-tegra/include/mach/tegra124-car.h    |   19 +
 arch/arm/mach-tegra/include/mach/tegra20-pmc.h     |    4 +
 arch/arm/mach-tegra/include/mach/tegra30-car.h     |    2 +
 arch/arm/mach-tegra/tegra20-pmc.c                  |   24 +
 arch/arm/mach-tegra/tegra20.c                      |   31 +-
 arch/arm/mach-tegra/tegra_avp_init.c               |   82 +-
 arch/arm/mach-tegra/tegra_maincomplex_init.c       |   14 +-
 drivers/clk/tegra/Makefile                         |    1 +
 drivers/clk/tegra/clk-periph.c                     |    6 +-
 drivers/clk/tegra/clk-pll.c                        |    2 -
 drivers/clk/tegra/clk-tegra124.c                   |  349 ++++
 drivers/mci/mci-core.c                             |    5 +-
 drivers/mci/tegra-sdmmc.c                          |    2 +
 drivers/pinctrl/Kconfig                            |    2 +-
 drivers/pinctrl/pinctrl-tegra30.c                  |  299 +++-
 images/.gitignore                                  |    2 +
 images/Makefile                                    |    2 +-
 images/Makefile.tegra                              |   19 +
 include/mci.h                                      |    1 +
 32 files changed, 4149 insertions(+), 66 deletions(-)
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/Makefile
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/entry.c
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/jetson-tk1-2gb-emmc.bct.cfg
 create mode 100644 arch/arm/dts/tegra124-jetson-tk1.dts
 create mode 100644 arch/arm/dts/tegra124.dtsi
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra114-sysctr.h
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra124-car.h
 create mode 100644 drivers/clk/tegra/clk-tegra124.c
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/30 tegra: pmc: add command to get into RCM

In RCM aka recovery mode the BootROM waits for a usbloader to take over control. On most boards this is triggered by holding a physical switch which may be inconvinient at times. Add a command to switch into RCM from software.

---
 arch/arm/mach-tegra/tegra20-pmc.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm/mach-tegra/tegra20-pmc.c +20 -0
index 1069df9..37496ac 100644
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <init.h>
 #include <io.h>
 
@@ -47,6 +48,14 @@ static int tegra20_pmc_probe(struct device_d *dev)
 	return 0;
 }
 
+static int do_tegrarcm(int argc, char *argv[])
+{
+	writel(2, pmc_base + PMC_SCRATCH(0));
+	reset_cpu(0);
+
+	return 0;
+}
+
 static __maybe_unused struct of_device_id tegra20_pmc_dt_ids[] = {
 	{
 		.compatible = "nvidia,tegra20-pmc",
@@ -68,3 +77,14 @@ static int tegra20_pmc_init(void)
 	return platform_driver_register(&tegra20_pmc_driver);
 }
 coredevice_initcall(tegra20_pmc_init);
+
+BAREBOX_CMD_HELP_START(tegrarcm)
+BAREBOX_CMD_HELP_TEXT("Get into recovery mode without using a physical switch\n")
+BAREBOX_CMD_HELP_END
+
+BAREBOX_CMD_START(tegrarcm)
+	.cmd		= do_tegrarcm,
+	BAREBOX_CMD_DESC("Usage: tegrarcm")
+	BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
+	BAREBOX_CMD_HELP(cmd_tegrarcm_help)
+BAREBOX_CMD_END
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH 10/30 tegra: add Tegra124 and AS3722 PMIC to lowlevel-dvc

In reply to Lucas Stach
---
 arch/arm/mach-tegra/include/mach/lowlevel-dvc.h | 55 +++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
arch/arm/mach-tegra/include/mach/lowlevel-dvc.h +55 -0
index 9ae8784..1deae4e 100644
@@ -40,6 +40,22 @@ void tegra_dvc_init(void)
 	writel(CRC_RST_DEV_H_DVC, TEGRA_CLK_RESET_BASE + CRC_RST_DEV_H_CLR);
 }
 
+static __always_inline
+void tegra124_dvc_pinmux(void)
+{
+	u32 val;
+
+	/* disable tristate for pin PWR_I2C_SCL_PZ6 */
+	val = readl(TEGRA_APB_MISC_BASE + 0x32b4);
+	val &= ~(1 << 4);
+	writel(val, TEGRA_APB_MISC_BASE + 0x32b4);
+
+	/* disable tristate for pin PWR_I2C_SDA_PZ7 */
+	val = readl(TEGRA_APB_MISC_BASE + 0x32b8);
+	val &= ~(1 << 4);
+	writel(val, TEGRA_APB_MISC_BASE + 0x32b8);
+}
+
 #define TEGRA_I2C_CNFG		0x00
 #define TEGRA_I2C_CMD_ADDR0	0x04
 #define TEGRA_I2C_CMD_DATA1	0x0c
@@ -88,3 +104,42 @@ void tegra30_tps62361b_ramp_vddcore(void)
 	tegra_dvc_write_data(0x4603, TEGRA_I2C_SEND_2_BYTES);
 	tegra_ll_delay_usec(1000);
 }
+
+static __always_inline
+void tegra124_as3722_enable_essential_rails(u32 sd0voltage)
+{
+	/*
+	 * Bring up VDD_CPU via the AS3722 PMIC on the PWR I2C bus.
+	 * First set VDD to 1.0V, then enable the VDD regulator.
+	 */
+	tegra_dvc_write_addr(0x80, 2);
+	tegra_dvc_write_data(sd0voltage | 0x00, TEGRA_I2C_SEND_2_BYTES);
+	tegra_ll_delay_usec(10 * 1000);
+
+	/*
+	 * Bring up VDD_GPU via the AS3722 PMIC on the PWR I2C bus.
+	 * First set VDD to 1.0V, then enable the VDD regulator.
+	 */
+	tegra_dvc_write_addr(0x80, 2);
+	tegra_dvc_write_data(0x2800 | 0x06, TEGRA_I2C_SEND_2_BYTES);
+	tegra_ll_delay_usec(10 * 1000);
+
+	/*
+	 * Bring up VPP_FUSE via the AS3722 PMIC on the PWR I2C bus.
+	 * First set VDD to 1.2V, then enable the VDD regulator.
+	 */
+	tegra_dvc_write_addr(0x80, 2);
+	tegra_dvc_write_data(0x1000 | 0x12, TEGRA_I2C_SEND_2_BYTES);
+	tegra_ll_delay_usec(10 * 1000);
+
+	/*
+	 * Bring up VDD_SDMMC via the AS3722 PMIC on the PWR I2C bus.
+	 * First set it to bypass 3.3V straight thru, then enable the regulator
+	 *
+	 * NOTE: We do this early because doing it later seems to hose the CPU
+	 * power rail/partition startup. Need to debug.
+	 */
+	tegra_dvc_write_addr(0x80, 2);
+	tegra_dvc_write_data(0x3f00 | 0x16, TEGRA_I2C_SEND_2_BYTES);
+	tegra_ll_delay_usec(10 * 1000);
+}
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#14 lore raw

PATCH 14/30 tegra: change cpu internal reset layout for Tegra124

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra_avp_init.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
arch/arm/mach-tegra/tegra_avp_init.c +15 -4
index d25c1dd..61cfa05 100644
@@ -43,8 +43,12 @@ static void assert_maincomplex_reset(int num_cores)
 	u32 mask = 0;
 	int i;
 
-	for (i = 0; i < num_cores; i++)
-		mask |= 0x1111 << i;
+	for (i = 0; i < num_cores; i++) {
+		if (tegra_get_chiptype() >= TEGRA114)
+			mask |= 0x111001 << i;
+		else
+			mask |= 0x1111 << i;
+	}
 
 	writel(mask, TEGRA_CLK_RESET_BASE + CRC_RST_CPU_CMPLX_SET);
 	writel(CRC_RST_DEV_L_CPU, TEGRA_CLK_RESET_BASE + CRC_RST_DEV_L_SET);
@@ -53,7 +57,14 @@ static void assert_maincomplex_reset(int num_cores)
 /* release reset state of the first core of the main CPU complex */
 static void deassert_cpu0_reset(void)
 {
-	writel(0x1111, TEGRA_CLK_RESET_BASE + CRC_RST_CPU_CMPLX_CLR);
+	u32 reg;
+
+	if (tegra_get_chiptype() >= TEGRA114)
+		reg = 0x21fff00f;
+	else
+		reg = 0x1111;
+
+	writel(reg, TEGRA_CLK_RESET_BASE + CRC_RST_CPU_CMPLX_CLR);
 	writel(CRC_RST_DEV_L_CPU, TEGRA_CLK_RESET_BASE + CRC_RST_DEV_L_CLR);
 }
 
@@ -185,7 +196,7 @@ static void start_cpu0_clocks(void)
 
 	/* deassert clock stop for cpu 0 */
 	reg = readl(TEGRA_CLK_RESET_BASE + CRC_CLK_CPU_CMPLX);
-	reg &= ~CRC_CLK_CPU_CMPLX_CPU0_CLK_STP;
+	reg &= ~(0xf << 8);
 	writel(reg, TEGRA_CLK_RESET_BASE + CRC_CLK_CPU_CMPLX);
 
 	/* enable main CPU complex clock */
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 5/30 tegra: lowlevel: setup an early stack

In reply to Lucas Stach

Even the lowlevel functions are growing to a
size where having a stack seem beneficial.

---
 arch/arm/mach-tegra/include/mach/lowlevel.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-tegra/include/mach/lowlevel.h +2 -0
index 1026518..80d65a6 100644
@@ -272,6 +272,8 @@ void tegra_cpu_lowlevel_setup(void)
 	r &= ~0x1f;
 	r |= 0xd3;
 	__asm__ __volatile__("msr cpsr, %0" : : "r"(r));
+
+	arm_setup_stack(TEGRA_IRAM_BASE + SZ_256K - 8);
 	tegra_ll_delay_setup();
 }
 
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH 9/30 tegra: recognize Tegra124 in common initcalls

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra20.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/tegra20.c +4 -2
index 0773972..752bbb0 100644
@@ -30,7 +30,8 @@ static int tegra_add_debug_console(void)
 	unsigned long base = 0;
 
 	if (!of_machine_is_compatible("nvidia,tegra20") &&
-	    !of_machine_is_compatible("nvidia,tegra30"))
+	    !of_machine_is_compatible("nvidia,tegra30") &&
+	    !of_machine_is_compatible("nvidia,tegra124"))
 		return 0;
 
 	/* figure out which UART to use */
@@ -74,7 +75,8 @@ mem_initcall(tegra20_mem_init);
 
 static int tegra30_mem_init(void)
 {
-	if (!of_machine_is_compatible("nvidia,tegra30"))
+	if (!of_machine_is_compatible("nvidia,tegra30") &&
+	    !of_machine_is_compatible("nvidia,tegra124"))
 		return 0;
 
 	arm_add_mem_device("ram0", SZ_2G, tegra30_get_ramsize());
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

PATCH 11/30 tegra: disable IDDQ for PLL_X on Tegra124

In reply to Lucas Stach

This is an additional power down control.

---
 arch/arm/mach-tegra/include/mach/tegra124-car.h | 19 +++++++++++++++++++
 arch/arm/mach-tegra/tegra_avp_init.c            |  9 +++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra124-car.h
arch/arm/mach-tegra/include/mach/tegra124-car.h new file +19 -0
new file mode 100644
index 0000000..1fb924d
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2014 Lucas Stach <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Register definitions */
+#define CRC_PLLX_MISC_3			0x518
+#define CRC_PLLX_MISC_3_IDDQ		(1 << 3)
arch/arm/mach-tegra/tegra_avp_init.c +9 -0
index 53e81d9..cc8b0e2 100644
@@ -25,6 +25,7 @@
 #include <mach/tegra20-pmc.h>
 #include <mach/tegra30-car.h>
 #include <mach/tegra30-flow.h>
+#include <mach/tegra124-car.h>
 
 /* instruct the PMIC to enable the CPU power rail */
 static void enable_maincomplex_powerrail(void)
@@ -107,6 +108,14 @@ static void init_pllx(void)
 
 	chiptype = tegra_get_chiptype();
 
+	/* disable IDDQ on T124 */
+	if (chiptype == TEGRA124) {
+		reg = readl(TEGRA_CLK_RESET_BASE + CRC_PLLX_MISC_3);
+		reg &= ~CRC_PLLX_MISC_3_IDDQ;
+		writel(reg, TEGRA_CLK_RESET_BASE + CRC_PLLX_MISC_3);
+		tegra_ll_delay_usec(2);
+	}
+
 	osc_freq = (readl(TEGRA_CLK_RESET_BASE + CRC_OSC_CTRL) &
 		    CRC_OSC_CTRL_OSC_FREQ_MASK) >> CRC_OSC_CTRL_OSC_FREQ_SHIFT;
 
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#15 lore raw

PATCH 15/30 tegra: add Tegra124 PLL_X rate setup

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra_avp_init.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/mach-tegra/tegra_avp_init.c +8 -0
index 61cfa05..be35843 100644
@@ -104,6 +104,14 @@ static struct pll_config pllx_config_table[][4] = {
 		{600,  12, 0, 8 },
 		{600,  26, 0, 8 },
 	}, /* TEGRA 30 */
+	{
+	}, /* TEGRA 114 */
+	{
+		{ 108,  1, 1, 0 },
+		{  73,  1, 1, 0 },
+		{ 116,  1, 1, 0 },
+		{ 108,  2, 1, 0 },
+	}, /* TEGRA 124 */
 };
 
 static void init_pllx(void)
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#16 lore raw

PATCH 16/30 tegra: apply cluster switch logic to all SoCs >=T30

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra_avp_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-tegra/tegra_avp_init.c +1 -1
index be35843..63ccfb5 100644
@@ -262,7 +262,7 @@ void tegra_avp_reset_vector(uint32_t boarddata)
 	int num_cores;
 
 	/* we want to bring up the high performance CPU complex */
-	if (tegra_get_chiptype() == TEGRA30)
+	if (tegra_get_chiptype() >= TEGRA30)
 		tegra_cluster_switch_hp();
 
 	/* get the number of cores in the main CPU complex of the current SoC */
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/30 tegra: pmc: add Tegra30 compatible

In reply to Lucas Stach

Allows reset command to work on T30.

---
 arch/arm/mach-tegra/tegra20-pmc.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-tegra/tegra20-pmc.c +2 -0
index b7d84d8..1069df9 100644
@@ -51,6 +51,8 @@ static __maybe_unused struct of_device_id tegra20_pmc_dt_ids[] = {
 	{
 		.compatible = "nvidia,tegra20-pmc",
 	}, {
+		.compatible = "nvidia,tegra30-pmc",
+	}, {
 		/* sentinel */
 	}
 };
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 8/30 tegra: recognize Tegra124 in maincomplex startup

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra_maincomplex_init.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-tegra/tegra_maincomplex_init.c +1 -0
index 2a85f26..83ad33d 100644
@@ -42,6 +42,7 @@ void tegra_maincomplex_entry(void)
 		ramsize = tegra20_get_ramsize();
 		break;
 	case TEGRA30:
+	case TEGRA124:
 		rambase = SZ_2G;
 		ramsize = tegra30_get_ramsize();
 		break;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

PATCH 12/30 tegra: power up additional partitions on Tegra124

In reply to Lucas Stach

Those 3 are needed to power CPU0 from the CPUG cluster.

---
 arch/arm/mach-tegra/include/mach/tegra20-pmc.h |  4 ++++
 arch/arm/mach-tegra/tegra_avp_init.c           | 24 ++++++++++++++++++------
 2 files changed, 22 insertions(+), 6 deletions(-)
arch/arm/mach-tegra/include/mach/tegra20-pmc.h +4 -0
index 3a05e0f..30ac065 100644
@@ -66,4 +66,8 @@
 #define PMC_PWRGATE_STATUS_TD		(1 << 1)
 #define PMC_PWRGATE_STATUS_CPU		(1 << 0)
 
+#define PMC_PARTID_CRAIL		0
+#define PMC_PARTID_CE0			14
+#define PMC_PARTID_C0NC			15
+
 #define PMC_SCRATCH(i)			(0x050 + 0x4*i)
arch/arm/mach-tegra/tegra_avp_init.c +18 -6
index cc8b0e2..3d21963 100644
@@ -197,26 +197,38 @@ static void start_cpu0_clocks(void)
 	tegra_ll_delay_usec(300);
 }
 
-static void maincomplex_powerup(void)
+static void power_up_partition(u32 partid)
 {
 	u32 reg;
 
-	if (!(readl(TEGRA_PMC_BASE + PMC_PWRGATE_STATUS) &
-	      PMC_PWRGATE_STATUS_CPU)) {
-		writel(PMC_PWRGATE_TOGGLE_START | PMC_PWRGATE_TOGGLE_PARTID_CPU,
+	if (!(readl(TEGRA_PMC_BASE + PMC_PWRGATE_STATUS) & (1 << partid))) {
+		writel(PMC_PWRGATE_TOGGLE_START | partid,
 		       TEGRA_PMC_BASE + PMC_PWRGATE_TOGGLE);
 
 		while (!(readl(TEGRA_PMC_BASE + PMC_PWRGATE_STATUS) &
-			 PMC_PWRGATE_STATUS_CPU));
+			(1 << partid)));
 
 		reg = readl(TEGRA_PMC_BASE + PMC_REMOVE_CLAMPING_CMD);
-		reg |= PMC_REMOVE_CLAMPING_CMD_CPU;
+		reg |= (1 << partid);
 		writel(reg, TEGRA_PMC_BASE + PMC_REMOVE_CLAMPING_CMD);
 
 		tegra_ll_delay_usec(1000);
 	}
 }
 
+static void maincomplex_powerup(void)
+{
+	/* main cpu rail */
+	power_up_partition(PMC_PARTID_CRAIL);
+
+	if (tegra_get_chiptype() >= TEGRA114) {
+		/* fast cluster uncore part */
+		power_up_partition(PMC_PARTID_C0NC);
+		/* fast cluster cpu0 part */
+		power_up_partition(PMC_PARTID_CE0);
+	}
+}
+
 static void tegra_cluster_switch_hp(void)
 {
 	u32 reg;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#18 lore raw

PATCH 18/30 tegra: setup L2 cache on Tegra124

In reply to Lucas Stach

Set SRAM latency to 3 clock cycles.

---
 arch/arm/mach-tegra/tegra_maincomplex_init.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/tegra_maincomplex_init.c +12 -1
index 83ad33d..17490a4 100644
@@ -25,6 +25,8 @@
 void tegra_maincomplex_entry(void)
 {
 	uint32_t rambase, ramsize;
+	enum tegra_chiptype chiptype;
+	u32 reg = 0;
 
 	arm_cpu_lowlevel_init();
 
@@ -36,7 +38,16 @@ void tegra_maincomplex_entry(void)
 	       TEGRA_CLK_RESET_BASE + CRC_CCLK_BURST_POLICY);
 	writel(CRC_SUPER_CDIV_ENB, TEGRA_CLK_RESET_BASE + CRC_SUPER_CCLK_DIV);
 
-	switch (tegra_get_chiptype()) {
+	chiptype = tegra_get_chiptype();
+
+	if (chiptype >= TEGRA114) {
+		asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
+		reg &= ~7;
+		reg |= 2;
+		asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	}
+
+	switch (chiptype) {
 	case TEGRA20:
 		rambase = 0x0;
 		ramsize = tegra20_get_ramsize();
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#20 lore raw

PATCH 20/30 tegra: add Tegra124 Kconfig symbol

In reply to Lucas Stach
---
 arch/arm/mach-tegra/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-tegra/Kconfig +3 -0
index 5e2b4cb..a895fd7 100644
@@ -50,6 +50,9 @@ config ARCH_TEGRA_3x_SOC
 	bool
 	select PINCTRL_TEGRA30
 
+config ARCH_TEGRA_124_SOC
+	bool
+
 menu "select Tegra boards to be built"
 
 config MACH_TORADEX_COLIBRI_T20
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#24 lore raw

PATCH 24/30 clk: tegra: don't bug out on zero PLL postdiv

In reply to Lucas Stach

As the real value is 2^p a input value of 0 is
actually valid.

---
 drivers/clk/tegra/clk-pll.c | 2 --
 1 file changed, 2 deletions(-)
drivers/clk/tegra/clk-pll.c +0 -2
index f3257c4..c18c67f 100644
@@ -196,8 +196,6 @@ static int _get_table_rate(struct clk *hw,
 	if (sel->input_rate == 0)
 		return -EINVAL;
 
-	BUG_ON(sel->p < 1);
-
 	cfg->input_rate = sel->input_rate;
 	cfg->output_rate = sel->output_rate;
 	cfg->m = sel->m;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#19 lore raw

PATCH 19/30 tegra: add architectural timer init

In reply to Lucas Stach

If the bootloader doesn't init the architectural timer on Cortex A15 Linux falls over when trying to boot.

---
 arch/arm/mach-tegra/include/mach/iomap.h           |  3 +++
 arch/arm/mach-tegra/include/mach/tegra114-sysctr.h | 30 ++++++++++++++++++++++
 arch/arm/mach-tegra/tegra20.c                      | 25 ++++++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra114-sysctr.h
arch/arm/mach-tegra/include/mach/iomap.h +3 -0
index b74e5d2..cdaab6a 100644
@@ -257,6 +257,9 @@
 #define TEGRA_CSITE_BASE		0x70040000
 #define TEGRA_CSITE_SIZE		SZ_256K
 
+#define TEGRA_SYSCTR0_BASE		0x700F0000
+#define TEGRA_SYSCTR0_SIZE		SZ_64K
+
 #define TEGRA_USB_BASE			0xC5000000
 #define TEGRA_USB_SIZE			SZ_16K
 
arch/arm/mach-tegra/include/mach/tegra114-sysctr.h new file +30 -0
new file mode 100644
index 0000000..45d17c4
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2014 Lucas Stach <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Register definitions */
+#define TEGRA_SYSCTR0_CNTCR		0x00
+#define TEGRA_SYSCTR0_CNTCR_ENABLE	(1 << 0)
+#define TEGRA_SYSCTR0_CNTCR_HDBG	(1 << 1)
+
+#define TEGRA_SYSCTR0_CNTSR		0x04
+
+#define TEGRA_SYSCTR0_CNTCV0		0x08
+
+#define TEGRA_SYSCTR0_CNTCV1		0x0c
+
+#define TEGRA_SYSCTR0_CNTFID0		0x20
+
+#define TEGRA_SYSCTR0_CNTFID1		0x24
arch/arm/mach-tegra/tegra20.c +25 -0
index 752bbb0..dcc55ae 100644
@@ -20,6 +20,7 @@
 #include <asm/memory.h>
 #include <mach/iomap.h>
 #include <mach/lowlevel.h>
+#include <mach/tegra114-sysctr.h>
 
 static struct NS16550_plat debug_uart = {
 	.shift = 2,
@@ -84,3 +85,27 @@ static int tegra30_mem_init(void)
 	return 0;
 }
 mem_initcall(tegra30_mem_init);
+
+static int tegra114_architected_timer_init(void)
+{
+	u32 freq, reg;
+
+	if (!of_machine_is_compatible("nvidia,tegra114") &&
+	    !of_machine_is_compatible("nvidia,tegra124"))
+		return 0;
+
+	freq = tegra_get_osc_clock();
+
+	/* ARM CNTFRQ */
+	asm("mcr p15, 0, %0, c14, c0, 0\n" : : "r" (freq));
+
+	/* Tegra specific SYSCTR */
+	writel(freq, TEGRA_SYSCTR0_BASE + TEGRA_SYSCTR0_CNTFID0);
+
+	reg = readl(TEGRA_SYSCTR0_BASE + TEGRA_SYSCTR0_CNTCR);
+	reg |= TEGRA_SYSCTR0_CNTCR_ENABLE | TEGRA_SYSCTR0_CNTCR_HDBG;
+	writel(reg, TEGRA_SYSCTR0_BASE + TEGRA_SYSCTR0_CNTCR);
+
+	return 0;
+}
+coredevice_initcall(tegra114_architected_timer_init);
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#21 lore raw

PATCH 21/30 pinctrl: tegra30: introduce drvdata

In reply to Lucas Stach

Access pin and drivegroups through a drvdata pointer. This allows to insert other groups for SoCs with a similar bit layout easily.

---
 drivers/pinctrl/pinctrl-tegra30.c | 48 +++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 14 deletions(-)
drivers/pinctrl/pinctrl-tegra30.c +34 -14
index 888bf04..d1e87a7 100644
@@ -23,21 +23,24 @@
 #include <malloc.h>
 #include <pinctrl.h>
 
+struct pinctrl_tegra30_drvdata;
+
 struct pinctrl_tegra30 {
 	struct {
 		u32 __iomem *ctrl;
 		u32 __iomem *mux;
 	} regs;
 	struct pinctrl_device pinctrl;
+	struct pinctrl_tegra30_drvdata *drvdata;
 };
 
-struct tegra30_pingroup {
+struct tegra_pingroup {
 	const char *name;
 	const char *funcs[4];
 	u16 reg;
 };
 
-struct tegra30_drive_pingroup {
+struct tegra_drive_pingroup {
 	const char *name;
 	u16 reg;
 	u32 hsm_bit:5;
@@ -54,6 +57,13 @@ struct tegra30_drive_pingroup {
 	u32 slwf_width:6;
 };
 
+struct pinctrl_tegra30_drvdata {
+	const struct tegra_pingroup *pingrps;
+	const unsigned int num_pingrps;
+	const struct tegra_drive_pingroup *drvgrps;
+	const unsigned int num_drvgrps;
+};
+
 #define PG(pg_name, f0, f1, f2, f3, offset)		\
 	{						\
 		.name = #pg_name,			\
@@ -80,7 +90,7 @@ struct tegra30_drive_pingroup {
 		.slwf_width = slwf_w,			\
 	}
 
-static const struct tegra30_pingroup tegra30_groups[] = {
+static const struct tegra_pingroup tegra30_pin_groups[] = {
 	/* name,                 f0,        f1,        f2,        f3,           reg  */
 	PG(clk_32k_out_pa0,      blink,     rsvd2,     rsvd3,     rsvd4,        0x31c),
 	PG(uart3_cts_n_pa1,      uartc,     rsvd2,     gmi,       rsvd4,        0x17c),
@@ -333,7 +343,7 @@ static const struct tegra30_pingroup tegra30_groups[] = {
 	PG(pwr_int_n,            pwr_int_n, rsvd2,     rsvd3,     rsvd4,        0x32c),
 };
 
-static const struct tegra30_drive_pingroup tegra30_drive_groups[] = {
+static const struct tegra_drive_pingroup tegra30_drive_groups[] = {
 	DRV_PG(ao1,   0x868,  2,  3,  4,  12,  5,  20,  5,  28,  2,  30,  2),
 	DRV_PG(ao2,   0x86c,  2,  3,  4,  12,  5,  20,  5,  28,  2,  30,  2),
 	DRV_PG(at1,   0x870,  2,  3,  4,  14,  5,  19,  5,  24,  2,  28,  2),
@@ -377,11 +387,18 @@ static const struct tegra30_drive_pingroup tegra30_drive_groups[] = {
 	DRV_PG(vi1,   0x8c8, -1, -1, -1,  14,  5,  19,  5,  24,  4,  28,  4),
 };
 
+static const struct pinctrl_tegra30_drvdata tegra30_drvdata = {
+	.pingrps = tegra30_pin_groups,
+	.num_pingrps = ARRAY_SIZE(tegra30_pin_groups),
+	.drvgrps = tegra30_drive_groups,
+	.num_drvgrps = ARRAY_SIZE(tegra30_drive_groups),
+};
+
 static int pinctrl_tegra30_set_drvstate(struct pinctrl_tegra30 *ctrl,
                                         struct device_node *np)
 {
 	const char *pins = NULL;
-	const struct tegra30_drive_pingroup *group = NULL;
+	const struct tegra_drive_pingroup *group = NULL;
 	int hsm = -1, schmitt = -1, pds = -1, pus = -1, srr = -1, srf = -1;
 	int i;
 	u32 __iomem *regaddr;
@@ -390,14 +407,14 @@ static int pinctrl_tegra30_set_drvstate(struct pinctrl_tegra30 *ctrl,
 	if (of_property_read_string(np, "nvidia,pins", &pins))
 		return 0;
 
-	for (i = 0; i < ARRAY_SIZE(tegra30_drive_groups); i++) {
-		if (!strcmp(pins, tegra30_drive_groups[i].name)) {
-			group = &tegra30_drive_groups[i];
+	for (i = 0; i < ctrl->drvdata->num_drvgrps; i++) {
+		if (!strcmp(pins, ctrl->drvdata->drvgrps[i].name)) {
+			group = &ctrl->drvdata->drvgrps[i];
 			break;
 		}
 	}
 	/* if no matching drivegroup is found */
-	if (i == ARRAY_SIZE(tegra30_groups))
+	if (i == ctrl->drvdata->num_drvgrps)
 		return 0;
 
 	regaddr = ctrl->regs.ctrl + (group->reg >> 2);
@@ -529,7 +546,7 @@ static int pinctrl_tegra30_set_state(struct pinctrl_device *pdev,
 	struct device_node *childnode;
 	int pull = -1, tri = -1, in = -1, od = -1, ior = -1, i, j, k;
 	const char *pins, *func = NULL;
-	const struct tegra30_pingroup *group;
+	const struct tegra_pingroup *group = NULL;
 
 	/*
 	 * At first look if the node we are pointed at has children,
@@ -551,14 +568,14 @@ static int pinctrl_tegra30_set_state(struct pinctrl_device *pdev,
 		if (of_property_read_string_index(np, "nvidia,pins", i, &pins))
 			break;
 
-		for (j = 0; j < ARRAY_SIZE(tegra30_groups); j++) {
-			if (!strcmp(pins, tegra30_groups[j].name)) {
-				group = &tegra30_groups[j];
+		for (j = 0; j < ctrl->drvdata->num_pingrps; j++) {
+			if (!strcmp(pins, ctrl->drvdata->pingrps[j].name)) {
+				group = &ctrl->drvdata->pingrps[j];
 				break;
 			}
 		}
 		/* if no matching pingroup is found */
-		if (j == ARRAY_SIZE(tegra30_groups)) {
+		if (j == ctrl->drvdata->num_pingrps) {
 			/* see if we can find a drivegroup */
 			if (pinctrl_tegra30_set_drvstate(ctrl, np))
 				continue;
@@ -629,6 +646,8 @@ static int pinctrl_tegra30_probe(struct device_d *dev)
 		}
 	}
 
+	dev_get_drvdata(dev, (unsigned long *)&ctrl->drvdata);
+
 	ctrl->pinctrl.dev = dev;
 	ctrl->pinctrl.ops = &pinctrl_tegra30_ops;
 
@@ -642,6 +661,7 @@ static int pinctrl_tegra30_probe(struct device_d *dev)
 static __maybe_unused struct of_device_id pinctrl_tegra30_dt_ids[] = {
 	{
 		.compatible = "nvidia,tegra30-pinmux",
+		.data = (unsigned long)&tegra30_drvdata,
 	}, {
 		/* sentinel */
 	}
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#28 lore raw

PATCH 28/30 images: add Tegra124 image build rules

In reply to Lucas Stach

Allows to build persistent images for the Tegra124 line of SoCs.

---
 images/.gitignore     | 2 ++
 images/Makefile       | 2 +-
 images/Makefile.tegra | 9 +++++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
images/.gitignore +2 -0
index 42991af..ec9e3c0 100644
@@ -12,6 +12,8 @@
 *.t20img.cfg
 *.t30img
 *.t30img.cfg
+*.t124img
+*.t124img.cfg
 pbl.lds
 barebox.x
 barebox.z
images/Makefile +1 -1
index b050dbf..740c197 100644
@@ -118,5 +118,5 @@ images: $(addprefix $(obj)/, $(image-y)) FORCE
 
 clean-files := *.pbl *.pblb *.pblx *.map start_*.imximg *.img barebox.z start_*.kwbimg \
 	start_*.kwbuartimg *.socfpgaimg *.mlo *.t20img *.t20img.cfg *.t30img \
-	*.t30img.cfg
+	*.t30img.cfg *.t124img *.t124img.cfg
 clean-files += pbl.lds
images/Makefile.tegra +9 -0
index f22c2d3..0d76062 100644
@@ -19,6 +19,15 @@ quiet_cmd_tegra30_image = T30IMG  $@
 $(obj)/%.t30img: $(obj)/% FORCE
 	$(call if_changed,tegra30_image)
 
+quiet_cmd_tegra124_image = T124IMG  $@
+      cmd_tegra124_image = echo "Version = 0x00400001;Bctcopy = 1; \
+                                Bctfile = $(BCT_$(@F)); \
+                                BootLoader = $(subst .t124img,,$@),0x80108000,0x80108000,Complete;" \
+                                > [email protected]; \
+                          $(objtree)/scripts/tegra/cbootimage -s tegra124 [email protected] $@
+$(obj)/%.t124img: $(obj)/% FORCE
+	$(call if_changed,tegra124_image)
+
 board = $(srctree)/arch/$(ARCH)/boards
 
 # ----------------------- Tegra20 based boards ---------------------------
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#22 lore raw

PATCH 22/30 pinctrl: tegra: add Tegra124 support

In reply to Lucas Stach

We can reuse the Tegra30 pinctrl driver, as the bit layout is the same. Just add the pin and drivegroups and some compile-time magic to avoid bloat.

---
 arch/arm/mach-tegra/Kconfig       |   1 +
 drivers/pinctrl/Kconfig           |   2 +-
 drivers/pinctrl/pinctrl-tegra30.c | 251 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 253 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/Kconfig +1 -0
index a895fd7..ea2e045 100644
@@ -52,6 +52,7 @@ config ARCH_TEGRA_3x_SOC
 
 config ARCH_TEGRA_124_SOC
 	bool
+	select PINCTRL_TEGRA30
 
 menu "select Tegra boards to be built"
 
drivers/pinctrl/Kconfig +1 -1
index b9b66f9..421525b 100644
@@ -45,4 +45,4 @@ config PINCTRL_TEGRA30
 	select PINCTRL
 	bool
 	help
-	  The pinmux controller found on the Tegra 30 line of SoCs.
+	  The pinmux controller found on the Tegra 30+ line of SoCs.
drivers/pinctrl/pinctrl-tegra30.c +251 -0

266 lines not on this page · raw message

Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

PATCH 13/30 tegra: fix MESLECT clock enable

In reply to Lucas Stach

Don't disable clk to unrelated devices in the process.

---
 arch/arm/mach-tegra/include/mach/tegra30-car.h | 2 ++
 arch/arm/mach-tegra/tegra_avp_init.c           | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/include/mach/tegra30-car.h +2 -0
index 286a2a6..c8f6c9f 100644
@@ -31,3 +31,5 @@
 #define CRC_RST_DEV_V_MSELECT		(1 << 3)
 
 #define CRC_RST_DEV_V_CLR		0x434
+
+#define CRC_CLK_OUT_ENB_V_SET		0x440
arch/arm/mach-tegra/tegra_avp_init.c +1 -1
index 3d21963..d25c1dd 100644
@@ -177,7 +177,7 @@ static void start_cpu0_clocks(void)
 		       CRC_CLK_SOURCE_MSEL_SRC_SHIFT),
 		       TEGRA_CLK_RESET_BASE + CRC_CLK_SOURCE_MSEL);
 		writel(CRC_CLK_OUT_ENB_V_MSELECT,
-		       TEGRA_CLK_RESET_BASE + CRC_CLK_OUT_ENB_V);
+		       TEGRA_CLK_RESET_BASE + CRC_CLK_OUT_ENB_V_SET);
 		tegra_ll_delay_usec(3);
 		writel(CRC_RST_DEV_V_MSELECT,
 		       TEGRA_CLK_RESET_BASE + CRC_RST_DEV_V_CLR);
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#17 lore raw

PATCH 17/30 tegra: hardcode entry address for main cluster

In reply to Lucas Stach

I don't know why get_runtime_offset fails on T124 yet, but this is a safe workaround, with the nice side-effect of fixing second stage barebox loading.

---
 arch/arm/mach-tegra/tegra_avp_init.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/tegra_avp_init.c +16 -2
index 63ccfb5..619fecf 100644
@@ -260,6 +260,10 @@ static void tegra_cluster_switch_hp(void)
 void tegra_avp_reset_vector(uint32_t boarddata)
 {
 	int num_cores;
+	unsigned int entry_address = 0;
+
+	if (tegra_cpu_is_maincomplex())
+		tegra_maincomplex_entry();
 
 	/* we want to bring up the high performance CPU complex */
 	if (tegra_get_chiptype() >= TEGRA30)
@@ -274,8 +278,18 @@ void tegra_avp_reset_vector(uint32_t boarddata)
 	stop_maincomplex_clocks(num_cores);
 
 	/* set start address for the main CPU complex processors */
-	writel(tegra_maincomplex_entry - get_runtime_offset(),
-	       TEGRA_EXCEPTION_VECTORS_BASE + 0x100);
+	switch (tegra_get_chiptype()) {
+	case TEGRA20:
+		entry_address = 0x108000;
+		break;
+	case TEGRA30:
+	case TEGRA124:
+		entry_address = 0x80108000;
+		break;
+	default:
+		break;
+	}
+	writel(entry_address, TEGRA_EXCEPTION_VECTORS_BASE + 0x100);
 
 	/* put boarddata in scratch reg, for main CPU to fetch after startup */
 	writel(boarddata, TEGRA_PMC_BASE + PMC_SCRATCH(10));
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 7/30 tegra: lowlevel: fix ODMdata fetch on Tegra124

In reply to Lucas Stach
---
 arch/arm/mach-tegra/include/mach/lowlevel.h | 50 ++++++++++++++++++++---------
 1 file changed, 35 insertions(+), 15 deletions(-)
arch/arm/mach-tegra/include/mach/lowlevel.h +35 -15
index 662508a..c65be0b 100644
@@ -31,8 +31,9 @@
 
 /* Bootinfotable */
 
-#define NV_BIT_BCTSIZE		0x38	/* size of the BCT in IRAM */
-#define NV_BIT_BCTPTR		0x3C	/* location of the BCT in IRAM */
+/* location of the BCT in IRAM */
+#define NV_BIT_BCTPTR_T20	0x3c
+#define NV_BIT_BCTPTR_T114	0x4c
 
 /* ODM data */
 #define BCT_ODMDATA_OFFSET	12	/* offset from the _end_ of the BCT */
@@ -45,19 +46,6 @@
 #define T20_ODMDATA_UARTID_SHIFT	15
 #define T20_ODMDATA_UARTID_MASK		(7 << T20_ODMDATA_UARTID_SHIFT)
 
-static __always_inline
-u32 tegra_get_odmdata(void)
-{
-	u32 bctsize, bctptr, odmdata;
-
-	bctsize = cpu_readl(TEGRA_IRAM_BASE + NV_BIT_BCTSIZE);
-	bctptr = cpu_readl(TEGRA_IRAM_BASE + NV_BIT_BCTPTR);
-
-	odmdata = cpu_readl(bctptr + bctsize - BCT_ODMDATA_OFFSET);
-
-	return odmdata;
-}
-
 /* chip ID */
 #define APB_MISC_HIDREV			0x804
 #define HIDREV_CHIPID_SHIFT		8
@@ -97,6 +85,38 @@ enum tegra_chiptype tegra_get_chiptype(void)
 }
 
 static __always_inline
+u32 tegra_get_odmdata(void)
+{
+	u32 bctptr_offset, bctptr, odmdata_offset;
+	enum tegra_chiptype chiptype = tegra_get_chiptype();
+
+	switch(chiptype) {
+	case TEGRA20:
+		bctptr_offset = NV_BIT_BCTPTR_T20;
+		odmdata_offset = 4068;
+		break;
+	case TEGRA30:
+		bctptr_offset = NV_BIT_BCTPTR_T20;
+		odmdata_offset = 6116;
+		break;
+	case TEGRA114:
+		bctptr_offset = NV_BIT_BCTPTR_T114;
+		odmdata_offset = 1752;
+		break;
+	case TEGRA124:
+		bctptr_offset = NV_BIT_BCTPTR_T114;
+		odmdata_offset = 1704;
+		break;
+	default:
+		return 0;
+	}
+
+	bctptr = cpu_readl(TEGRA_IRAM_BASE + bctptr_offset);
+
+	return cpu_readl(bctptr + odmdata_offset);
+}
+
+static __always_inline
 int tegra_get_num_cores(void)
 {
 	switch (tegra_get_chiptype()) {
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#23 lore raw

PATCH 23/30 clk: tegra: allow variable sized muxes

In reply to Lucas Stach

Tegra124 extended the mux by 1bit to allow for
more PLL sources.

---
 drivers/clk/tegra/clk-periph.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/tegra/clk-periph.c +4 -2
index e4e5412..fd1e2ed 100644
@@ -21,6 +21,7 @@
 #include <malloc.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/log2.h>
 
 #include "clk.h"
 
@@ -113,6 +114,7 @@ static struct clk *_tegra_clk_register_periph(const char *name,
 {
 	struct tegra_clk_periph *periph;
 	int ret, gate_offs, rst_offs;
+	u8 mux_size = order_base_2(num_parents);
 
 	periph = kzalloc(sizeof(*periph), GFP_KERNEL);
 	if (!periph) {
@@ -121,8 +123,8 @@ static struct clk *_tegra_clk_register_periph(const char *name,
 		goto out_periph;
 	}
 
-	periph->mux = clk_mux_alloc(NULL, clk_base + reg_offset, 30, 2,
-				    parent_names, num_parents, 0);
+	periph->mux = clk_mux_alloc(NULL, clk_base + reg_offset, 32 - mux_size,
+				    mux_size, parent_names, num_parents, 0);
 	if (!periph->mux)
 		goto out_mux;
 
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#26 lore raw

PATCH 26/30 mci: tegra: add Tegra124 compatible

In reply to Lucas Stach

The controller is similar enough to the ones found on earlier generation SoCs to not need any additional changes.

---
 drivers/mci/tegra-sdmmc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mci/tegra-sdmmc.c +2 -0
index 62cf730..08b9dac 100644
@@ -481,6 +481,8 @@ static int tegra_sdmmc_probe(struct device_d *dev)
 
 static __maybe_unused struct of_device_id tegra_sdmmc_compatible[] = {
 	{
+		.compatible = "nvidia,tegra124-sdhci",
+	}, {
 		.compatible = "nvidia,tegra30-sdhci",
 	}, {
 		.compatible = "nvidia,tegra20-sdhci",
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#27 lore raw

PATCH 27/30 tegra: pmc: add Tegra124 compatible

In reply to Lucas Stach
---
 arch/arm/mach-tegra/tegra20-pmc.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-tegra/tegra20-pmc.c +2 -0
index 37496ac..94167d6 100644
@@ -62,6 +62,8 @@ static __maybe_unused struct of_device_id tegra20_pmc_dt_ids[] = {
 	}, {
 		.compatible = "nvidia,tegra30-pmc",
 	}, {
+		.compatible = "nvidia,tegra124-pmc",
+	}, {
 		/* sentinel */
 	}
 };
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#25 lore raw

PATCH 25/30 clk: tegra: add Tegra124 driver

In reply to Lucas Stach
---
 drivers/clk/tegra/Makefile       |   1 +
 drivers/clk/tegra/clk-tegra124.c | 349 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 350 insertions(+)
 create mode 100644 drivers/clk/tegra/clk-tegra124.c
drivers/clk/tegra/Makefile +1 -0
index 7317f22..75569c7 100644
@@ -6,3 +6,4 @@ obj-y	+= clk-pll-out.o
 
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)		+= clk-tegra20.o
 obj-$(CONFIG_ARCH_TEGRA_3x_SOC)		+= clk-tegra30.o
+obj-$(CONFIG_ARCH_TEGRA_124_SOC)	+= clk-tegra124.o
drivers/clk/tegra/clk-tegra124.c new file +349 -0

349 lines not on this page · raw message

Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#29 lore raw

PATCH 29/30 tegra: add NVIDIA Jetson-TK1 board support

In reply to Lucas Stach
---
 arch/arm/boards/Makefile                           |    1 +
 arch/arm/boards/nvidia-jetson-tk1/Makefile         |    7 +
 arch/arm/boards/nvidia-jetson-tk1/entry.c          |   39 +
 .../nvidia-jetson-tk1/jetson-tk1-2gb-emmc.bct.cfg  | 1287 ++++++++++++++
 arch/arm/dts/Makefile                              |    4 +-
 arch/arm/dts/tegra124-jetson-tk1.dts               | 1828 ++++++++++++++++++++
 arch/arm/dts/tegra124.dtsi                         |    1 +
 arch/arm/mach-tegra/Kconfig                        |    4 +
 images/Makefile.tegra                              |   10 +
 9 files changed, 3180 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/Makefile
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/entry.c
 create mode 100644 arch/arm/boards/nvidia-jetson-tk1/jetson-tk1-2gb-emmc.bct.cfg
 create mode 100644 arch/arm/dts/tegra124-jetson-tk1.dts
 create mode 100644 arch/arm/dts/tegra124.dtsi
arch/arm/boards/Makefile +1 -0
index 91e0f30..39a5f31 100644
@@ -58,6 +58,7 @@ obj-$(CONFIG_MACH_MX6Q_ARM2)			+= freescale-mx6-arm2/
 obj-$(CONFIG_MACH_NESO)				+= guf-neso/
 obj-$(CONFIG_MACH_NOMADIK_8815NHK)		+= nhk8815/
 obj-$(CONFIG_MACH_NVIDIA_BEAVER)		+= nvidia-beaver/
+obj-$(CONFIG_MACH_NVIDIA_JETSON)		+= nvidia-jetson-tk1/
 obj-$(CONFIG_MACH_NXDB500)			+= netx/
 obj-$(CONFIG_MACH_OMAP343xSDP)			+= omap343xdsp/
 obj-$(CONFIG_MACH_OMAP3EVM)			+= omap3evm/
arch/arm/boards/nvidia-jetson-tk1/Makefile new file +7 -0
new file mode 100644
index 0000000..f1e4620
@@ -0,0 +1,7 @@
+CFLAGS_pbl-entry.o := \
+	-mcpu=arm7tdmi -march=armv4t \
+	-fno-tree-switch-conversion -fno-jump-tables
+soc := tegra124
+lwl-y += entry.o
+#obj-y += board.o
+extra-y += jetson-tk1-2gb-emmc.bct
arch/arm/boards/nvidia-jetson-tk1/entry.c new file +39 -0
new file mode 100644
index 0000000..76c95a8
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2014 Lucas Stach <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <mach/lowlevel.h>
+#include <mach/lowlevel-dvc.h>
+
+extern char __dtb_tegra124_jetson_tk1_start[];
+
+ENTRY_FUNCTION(start_nvidia_jetson, r0, r1, r2)
+{
+	uint32_t fdt;
+
+	tegra_cpu_lowlevel_setup();
+
+	tegra_dvc_init();
+	tegra124_dvc_pinmux();
+	tegra124_as3722_enable_essential_rails(0x3c00);
+
+	fdt = (uint32_t)__dtb_tegra124_jetson_tk1_start - get_runtime_offset();
+
+	tegra_avp_reset_vector(fdt);
+}
arch/arm/boards/nvidia-jetson-tk1/jetson-tk1-2gb-emmc.bct.cfg new file +1287 -0

1,287 lines not on this page · raw message

arch/arm/dts/Makefile +3 -1
index 63d59f7..ef65302 100644
@@ -37,7 +37,8 @@ dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5_sockit.dtb \
 dtb-$(CONFIG_ARCH_TEGRA) += \
 	tegra20-colibri-iris.dtb \
 	tegra20-paz00.dtb \
-	tegra30-beaver.dtb
+	tegra30-beaver.dtb \
+	tegra124-jetson-tk1.dtb
 
 BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME))
 obj-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o
@@ -50,6 +51,7 @@ pbl-$(CONFIG_MACH_FREESCALE_MX53_LOCO) += imx53-qsb.dtb.o imx53-qsrb.dtb.o
 pbl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o
 pbl-$(CONFIG_MACH_DFI_FS700_M60) += imx6q-dfi-fs700-m60-6q.dtb.o imx6dl-dfi-fs700-m60-6s.dtb.o
 pbl-$(CONFIG_MACH_NVIDIA_BEAVER) += tegra30-beaver.dtb.o
+pbl-$(CONFIG_MACH_NVIDIA_JETSON) += tegra124-jetson-tk1.dtb.o
 pbl-$(CONFIG_MACH_PCM051) += am335x-phytec-phycore.dtb.o
 pbl-$(CONFIG_MACH_PHYTEC_PFLA02) += imx6s-phytec-pbab01.dtb.o imx6dl-phytec-pbab01.dtb.o imx6q-phytec-pbab01.dtb.o
 pbl-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o
arch/arm/dts/tegra124-jetson-tk1.dts new file +1828 -0

1,644 lines not on this page · raw message

arch/arm/dts/tegra124.dtsi new file +1 -0
new file mode 100644
index 0000000..7d0fafa

Lines of this file are not shown. View the raw message.

arch/arm/mach-tegra/Kconfig +4 -0
index ea2e045..7214eca 100644

Lines of this file are not shown. View the raw message.

images/Makefile.tegra +10 -0
index 0d76062..4f876e4 100644

Lines of this file are not shown. View the raw message.

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

Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

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

#30 lore raw

PATCH 30/30 tegra: refresh defconfig

In reply to Lucas Stach

Mainly for Jetson TK1 support, but -next moved
some stuff around. Also enable some filesystems.

---
 arch/arm/configs/tegra_v7_defconfig | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
arch/arm/configs/tegra_v7_defconfig +13 -9
index 83d2851..22f5765 100644
@@ -2,37 +2,41 @@ CONFIG_ARCH_TEGRA=y
 CONFIG_MACH_TORADEX_COLIBRI_T20=y
 CONFIG_MACH_TOSHIBA_AC100=y
 CONFIG_MACH_NVIDIA_BEAVER=y
+CONFIG_MACH_NVIDIA_JETSON=y
 CONFIG_AEABI=y
-CONFIG_CMD_ARM_MMUINFO=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_ARM_UNWIND=y
 CONFIG_MMU=y
 CONFIG_STACK_SIZE=0x10000
 CONFIG_MALLOC_SIZE=0x4000000
 CONFIG_KALLSYMS=y
-CONFIG_LONGHELP=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_BLSPEC=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_MEMINFO=y
+CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_ARM_MMUINFO=y
 CONFIG_CMD_BOOTM_INITRD=y
 CONFIG_CMD_BOOTM_OFTREE=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_RESET=y
-CONFIG_CMD_OFTREE=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_LOADENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_EDIT=y
 CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_GPIO=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DETECT=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_OFTREE=y
 CONFIG_DRIVER_SERIAL_NS16550=y
 CONFIG_MCI=y
 CONFIG_MCI_MMC_BOOT_PARTITIONS=y
 CONFIG_MCI_TEGRA=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_FAT=y
+CONFIG_FS_FAT_LFN=y
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#31 lore raw
In reply to Lucas Stach
Quoted 33 lines · Lucas Stach

This is the next big round of Tegra updates, featuring Tegra K1 support. The series is based on -next as it has quite some dependencies on the earlier Tegra series.

The first 4 patches are some general useful additions, all others are adding K1 aka Tegra124 support. I've verified booting a Linux kernel to the rootfs panic.

The series is regression free on Tegra30.

Lucas Stach (30):
mci: implement non-removable property
tegra: lowlevel-dvc: use __always_inline macro
tegra: pmc: add Tegra30 compatible
tegra: pmc: add command to get into RCM
tegra: lowlevel: setup an early stack
tegra: add Tegra124 id to lowlevel functions
tegra: lowlevel: fix ODMdata fetch on Tegra124
tegra: recognize Tegra124 in maincomplex startup
tegra: recognize Tegra124 in common initcalls
tegra: add Tegra124 and AS3722 PMIC to lowlevel-dvc
tegra: disable IDDQ for PLL_X on Tegra124
tegra: power up additional partitions on Tegra124
tegra: fix MESLECT clock enable
tegra: change cpu internal reset layout for Tegra124
tegra: add Tegra124 PLL_X rate setup
tegra: apply cluster switch logic to all SoCs >=T30
tegra: hardcode entry address for main cluster
tegra: setup L2 cache on Tegra124
tegra: add architectural timer init
tegra: add Tegra124 Kconfig symbol
pinctrl: tegra30: introduce drvdata
pinctrl: tegra: add Tegra124 support

Quoted 8 lines

clk: tegra: allow variable sized muxes
clk: tegra: don't bug out on zero PLL postdiv
clk: tegra: add Tegra124 driver
mci: tegra: add Tegra124 compatible
tegra: pmc: add Tegra124 compatible
images: add Tegra124 image build rules
tegra: add NVIDIA Jetson-TK1 board support
tegra: refresh defconfig

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox