Tegra K1 support
Subsystems (7)
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
PATCH 1/30 mci: implement non-removable property
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
@@ -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
@@ -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
PATCH 2/30 tegra: lowlevel-dvc: use __always_inline macro
In reply to Lucas StachCleaner 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
@@ -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
PATCH 3/30 tegra: pmc: add Tegra30 compatible
In reply to Lucas StachAllows 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
@@ -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
PATCH 4/30 tegra: pmc: add command to get into RCM
In reply to Lucas StachIn 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
@@ -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
PATCH 5/30 tegra: lowlevel: setup an early stack
In reply to Lucas StachEven 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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
PATCH 11/30 tegra: disable IDDQ for PLL_X on Tegra124
In reply to Lucas StachThis 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
@@ -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
@@ -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
PATCH 12/30 tegra: power up additional partitions on Tegra124
In reply to Lucas StachThose 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
@@ -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
@@ -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
PATCH 13/30 tegra: fix MESLECT clock enable
In reply to Lucas StachDon'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
@@ -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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
PATCH 17/30 tegra: hardcode entry address for main cluster
In reply to Lucas StachI 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
@@ -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
PATCH 18/30 tegra: setup L2 cache on Tegra124
In reply to Lucas StachSet 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
@@ -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
PATCH 19/30 tegra: add architectural timer init
In reply to Lucas StachIf 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
@@ -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
@@ -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
@@ -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
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
@@ -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
PATCH 21/30 pinctrl: tegra30: introduce drvdata
In reply to Lucas StachAccess 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
@@ -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
PATCH 22/30 pinctrl: tegra: add Tegra124 support
In reply to Lucas StachWe 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
@@ -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
@@ -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
PATCH 23/30 clk: tegra: allow variable sized muxes
In reply to Lucas StachTegra124 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
@@ -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
PATCH 24/30 clk: tegra: don't bug out on zero PLL postdiv
In reply to Lucas StachAs 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
@@ -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
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
@@ -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
PATCH 26/30 mci: tegra: add Tegra124 compatible
In reply to Lucas StachThe 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
@@ -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
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
@@ -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
PATCH 28/30 images: add Tegra124 image build rules
In reply to Lucas StachAllows 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
@@ -12,6 +12,8 @@ *.t20img.cfg *.t30img *.t30img.cfg +*.t124img +*.t124img.cfg pbl.lds barebox.x barebox.z
images/Makefile +1 -1
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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.
PATCH 30/30 tegra: refresh defconfig
In reply to Lucas StachMainly 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
@@ -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
Sascha Hauer
AppliedQuoted 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_inlinemacro
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 forPLL_Xon Tegra124
tegra: power up additional partitions on Tegra124
tegra: fix MESLECT clock enable
tegra: change cpu internal reset layout for Tegra124
tegra: add Tegra124PLL_Xrate 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 Tegra124Kconfigsymbol
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