Timer support for ARM Tegra
Subsystems (5)
v7 cover Timer support for ARM Tegra
- ARM: tegra: remap clock_osc_freq for all Tegra family Enum clock_osc_freq was designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.
- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in tegra-common.h use architected timer.
- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable TEGRA_TIMER for TEGRA_ARMV7_COMMON and TEGRA210. Additionally enable SPL_TIMER if build as SPL part and drop deprecated configs from common header.
P. S. I have no arm64 Tegra and according to comment in tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.
---
Changeog from V6
- use clk_m as timer calibration clock (this should properly fix T210)
- enable timer for T210
Changed from v5:
- added paz00 tester
Changed from v4:
- added comments
Changed from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remap clock_osc_freq for all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default option
arch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-) create mode 100644 drivers/timer/tegra-timer.c
Signature · 1 line
2.37.2
PATCH v7 1/3 ARM: tegra: remap clock_osc_freq for all Tegra family
Enum clock_osc_freq was designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.
--- arch/arm/include/asm/arch-tegra/clock.h | 9 ++-- arch/arm/mach-tegra/clock.c | 17 ++++-- arch/arm/mach-tegra/cpu.c | 70 ++++++++++++++++++++----- arch/arm/mach-tegra/tegra114/clock.c | 13 ++--- arch/arm/mach-tegra/tegra124/clock.c | 13 ++--- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 ++------ arch/arm/mach-tegra/tegra30/clock.c | 10 +--- drivers/usb/host/ehci-tegra.c | 46 ++++++++++++---- 9 files changed, 131 insertions(+), 73 deletions(-)
arch/arm/include/asm/arch-tegra/clock.h +5 -4
@@ -13,12 +13,13 @@ struct udevice;/* Set of oscillator frequencies supported in the internal API. */ enum clock_osc_freq {/* All in MHz, so 13_0 is 13.0MHz */ -CLOCK_OSC_FREQ_13_0 , -CLOCK_OSC_FREQ_19_2 , -CLOCK_OSC_FREQ_12_0 , -CLOCK_OSC_FREQ_26_0 , +CLOCK_OSC_FREQ_13_0 =0 , +CLOCK_OSC_FREQ_16_8 , +CLOCK_OSC_FREQ_19_2 =4 ,CLOCK_OSC_FREQ_38_4 , +CLOCK_OSC_FREQ_12_0 =8 ,CLOCK_OSC_FREQ_48_0 , +CLOCK_OSC_FREQ_26_0 =12 ,CLOCK_OSC_FREQ_COUNT , };
arch/arm/mach-tegra/clock.c +14 -3
@@ -28,16 +28,23 @@static unsigned pll_rate[CLOCK_ID_COUNT ];/* -* The oscillator frequency is fixed to one of four set values. Based on this +* The oscillator frequency is fixed to one of seven set values. Based on this * the other clocks are set up appropriately. */ static unsigned osc_freq[CLOCK_OSC_FREQ_COUNT ] = {13000000 , +16800000 , +0 , +0 ,19200000 , -12000000 , -26000000 ,38400000 , +0 , +0 , +12000000 ,48000000 , +0 , +0 , +26000000 , };/* return 1 if a peripheral ID is in range */
@@ -766,6 +773,7 @@ void tegra30_set_up_pllp(void)*/ switch (clock_get_osc_freq ()) {case CLOCK_OSC_FREQ_12_0 :/* OSC is 12Mhz */ +case CLOCK_OSC_FREQ_48_0 :/* OSC is 48Mhz */ clock_set_rate (CLOCK_ID_PERIPH ,408 ,12 ,0 ,8 );clock_set_rate (CLOCK_ID_CGENERAL ,456 ,12 ,1 ,8 );break ;
@@ -776,10 +784,13 @@ void tegra30_set_up_pllp(void)break ;case CLOCK_OSC_FREQ_13_0 :/* OSC is 13Mhz */ +case CLOCK_OSC_FREQ_16_8 :/* OSC is 16.8Mhz */ clock_set_rate (CLOCK_ID_PERIPH ,408 ,13 ,0 ,8 );clock_set_rate (CLOCK_ID_CGENERAL ,600 ,13 ,0 ,8 );break ; +case CLOCK_OSC_FREQ_19_2 : +case CLOCK_OSC_FREQ_38_4 :default :/* * These are not supported. It is too early to print a
arch/arm/mach-tegra/cpu.c +56 -14
123 lines not on this page · raw message
arch/arm/mach-tegra/tegra114/clock.c +5 -8
@@ -459,8 +459,7 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = {/* * Get the oscillator frequency, from the corresponding hardware configuration -* field. Note that T30/T114 support 3 new higher freqs, but we map back -* to the old T20 freqs. Support for the higher oscillators is TBD. +* field. Note that T30+ supports 3 new higher freqs. */ enum clock_osc_freq clock_get_osc_freq (void ) {
@@ -469,12 +468,7 @@ enum clock_osc_freq clock_get_osc_freq(void)u32 reg; reg =readl (&clkrst->crc_osc_ctrl); - reg = (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; - -if (reg &1 )/* one of the newer freqs */ -printf ("Warning: OSC_FREQ is unsupported! (%d)\n" , reg); - -return reg >>2 ;/* Map to most common (T20) freqs */ +return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; }/* Returns a pointer to the clock source register for a peripheral */
@@ -674,6 +668,7 @@ void clock_early_init(void)*/ switch (clock_get_osc_freq ()) {case CLOCK_OSC_FREQ_12_0 :/* OSC is 12Mhz */ +case CLOCK_OSC_FREQ_48_0 :/* OSC is 48Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,12 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,12 ,0 ,12 );break ;
@@ -684,10 +679,12 @@ void clock_early_init(void)break ;case CLOCK_OSC_FREQ_13_0 :/* OSC is 13Mhz */ +case CLOCK_OSC_FREQ_16_8 :/* OSC is 16.8Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,13 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,13 ,0 ,12 );break ;case CLOCK_OSC_FREQ_19_2 : +case CLOCK_OSC_FREQ_38_4 :default :/* * These are not supported. It is too early to print a
arch/arm/mach-tegra/tegra124/clock.c +5 -8
@@ -601,8 +601,7 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = {/* * Get the oscillator frequency, from the corresponding hardware configuration -* field. Note that Tegra30+ support 3 new higher freqs, but we map back -* to the old T20 freqs. Support for the higher oscillators is TBD. +* field. Note that T30+ supports 3 new higher freqs. */ enum clock_osc_freq clock_get_osc_freq (void ) {
@@ -611,12 +610,7 @@ enum clock_osc_freq clock_get_osc_freq(void)u32 reg; reg =readl (&clkrst->crc_osc_ctrl); - reg = (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; - -if (reg &1 )/* one of the newer freqs */ -printf ("Warning: OSC_FREQ is unsupported! (%d)\n" , reg); - -return reg >>2 ;/* Map to most common (T20) freqs */ +return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; }/* Returns a pointer to the clock source register for a peripheral */
@@ -854,6 +848,7 @@ void clock_early_init(void)*/ switch (clock_get_osc_freq ()) {case CLOCK_OSC_FREQ_12_0 :/* OSC is 12Mhz */ +case CLOCK_OSC_FREQ_48_0 :/* OSC is 48Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,12 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,12 ,0 ,12 );break ;
@@ -864,10 +859,12 @@ void clock_early_init(void)break ;case CLOCK_OSC_FREQ_13_0 :/* OSC is 13Mhz */ +case CLOCK_OSC_FREQ_16_8 :/* OSC is 16.8Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,13 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,13 ,0 ,12 );break ;case CLOCK_OSC_FREQ_19_2 : +case CLOCK_OSC_FREQ_38_4 :default :/* * These are not supported. It is too early to print a
arch/arm/mach-tegra/tegra20/clock.c +3 -1
@@ -399,7 +399,9 @@ enum clock_osc_freq clock_get_osc_freq(void)u32 reg; reg =readl (&clkrst->crc_osc_ctrl); -return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; + reg = (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; + +return reg <<2 ; }/* Returns a pointer to the clock source register for a peripheral */
arch/arm/mach-tegra/tegra210/clock.c +4 -18
@@ -672,8 +672,7 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = {/* * Get the oscillator frequency, from the corresponding hardware configuration -* field. Note that Tegra30+ support 3 new higher freqs, but we map back -* to the old T20 freqs. Support for the higher oscillators is TBD. +* field. Note that T30+ supports 3 new higher freqs. */ enum clock_osc_freq clock_get_osc_freq (void ) {
@@ -682,22 +681,7 @@ enum clock_osc_freq clock_get_osc_freq(void)u32 reg; reg =readl (&clkrst->crc_osc_ctrl); - reg = (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; -/* -* 0 = 13MHz, 1 = 16.8MHz, 4 = 19.2MHz, 5 = 38.4MHz, -* 8 = 12MHz, 9 = 48MHz, 12 = 26MHz -*/ -if (reg ==5 ) { -debug ("OSC_FREQ is 38.4MHz (%d) ...\n" , reg); -/* Map it to the 5th CLOCK_OSC_ enum, i.e. 4 */ -return 4 ; - } - -/* -* Map to most common (T20) freqs (except 38.4, handled above): -* 13/16.8 = 0, 19.2 = 1, 12/48 = 2, 26 = 3 -*/ -return reg >>2 ; +return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; }/* Returns a pointer to the clock source register for a peripheral */
@@ -986,6 +970,7 @@ void clock_early_init(void)*/ switch (clock_get_osc_freq ()) {case CLOCK_OSC_FREQ_12_0 :/* OSC is 12Mhz */ +case CLOCK_OSC_FREQ_48_0 :/* OSC is 48Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,12 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,12 ,0 ,12 );break ;
@@ -996,6 +981,7 @@ void clock_early_init(void)break ;case CLOCK_OSC_FREQ_13_0 :/* OSC is 13Mhz */ +case CLOCK_OSC_FREQ_16_8 :/* OSC is 16.8Mhz */ clock_set_rate (CLOCK_ID_CGENERAL ,600 ,13 ,0 ,8 );clock_set_rate (CLOCK_ID_DISPLAY ,925 ,13 ,0 ,12 );break ;
arch/arm/mach-tegra/tegra30/clock.c +2 -8
@@ -439,8 +439,7 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = {/* * Get the oscillator frequency, from the corresponding hardware configuration -* field. Note that T30 supports 3 new higher freqs, but we map back -* to the old T20 freqs. Support for the higher oscillators is TBD. +* field. Note that T30+ supports 3 new higher freqs. */ enum clock_osc_freq clock_get_osc_freq (void ) {
@@ -449,12 +448,7 @@ enum clock_osc_freq clock_get_osc_freq(void)u32 reg; reg =readl (&clkrst->crc_osc_ctrl); - reg = (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; - -if (reg &1 )/* one of the newer freqs */ -printf ("Warning: OSC_FREQ is unsupported! (%d)\n" , reg); - -return reg >>2 ;/* Map to most common (T20) freqs */ +return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; }/* Returns a pointer to the clock source register for a peripheral */
drivers/usb/host/ehci-tegra.c +37 -9
79 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH v7 2/3 drivers: timer: add driver for ARMv7 based Tegra devices and T210
In reply to Svyatoslav RyhelAdd timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in tegra-common.h use architected timer.
--- drivers/timer/Kconfig | 8 +++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 drivers/timer/tegra-timer.c
drivers/timer/Kconfig +8 -0
@@ -252,6 +252,14 @@ config STM32_TIMER Select this to enable support for the timer found on STM32 devices. +config TEGRA_TIMER + bool "Tegra timer support" + depends on TIMER + select TIMER_EARLY + help + Select this to enable support for the timer found on + Tegra devices. + config X86_TSC_TIMER bool "x86 Time-Stamp Counter (TSC) timer support" depends on TIMER && X86
drivers/timer/Makefile +1 -0
@@ -27,6 +27,7 @@ obj-$(CONFIG_SP804_TIMER) += sp804_timer.o obj-$(CONFIG_$(SPL_)SIFIVE_CLINT) += sifive_clint_timer.o obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o obj-$(CONFIG_STM32_TIMER) += stm32_timer.o +obj-$(CONFIG_TEGRA_TIMER) += tegra-timer.o obj-$(CONFIG_X86_TSC_TIMER) += tsc_timer.o obj-$(CONFIG_MTK_TIMER) += mtk_timer.o obj-$(CONFIG_MCHP_PIT64B_TIMER) += mchp-pit64b-timer.o
drivers/timer/tegra-timer.c new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
2.37.2
PATCH v7 3/3 ARM: tegra: include timer as default option
In reply to Svyatoslav RyhelEnable TIMER as default option for all Tegra devices and enable TEGRA_TIMER for TEGRA_ARMV7_COMMON and TEGRA210. Additionally enable SPL_TIMER if build as SPL part and drop deprecated configs from common header.
--- arch/arm/Kconfig | 1 + arch/arm/mach-tegra/Kconfig | 3 +++ include/configs/tegra-common.h | 6 ------ 3 files changed, 4 insertions(+), 6 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1284,6 +1284,7 @@ config ARCH_TEGRA select GPIO_EXTRA_HEADER imply DISTRO_DEFAULTS imply FAT_WRITE + imply SPL_TIMER if SPL config ARCH_VEXPRESS64 bool "Support ARMv8 Arm Ltd. VExpress based boards and models"
arch/arm/mach-tegra/Kconfig +3 -0
@@ -56,6 +56,7 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI + select TIMER imply CMD_DM imply CRC32_VERIFY
@@ -81,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_NO_BPMP select TEGRA_PINCTRL select TEGRA_PMC + select TEGRA_TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"
@@ -134,6 +136,7 @@ config TEGRA210 select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_PMC_SECURE + select TEGRA_TIMER config TEGRA186 bool "Tegra186 family"
include/configs/tegra-common.h +0 -6
@@ -15,12 +15,6 @@#include <asm/arch/tegra.h> /* get chip and board defs */ -/* Use the Tegra US timer on ARMv7, but the architected timer on ARMv8. */ -#ifndef CONFIG_ARM64 -#define CFG_SYS_TIMER_RATE 1000000 -#define CFG_SYS_TIMER_COUNTER NV_PA_TMRUS_BASE -#endif -/* Environment */ /*
Signature · 1 line
2.37.2
Quoted 52 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210. Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +---
Quoted 8 lines
arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-) create mode 100644 drivers/timer/tegra-timer.c
Ugh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2 -1
@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY
@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"
@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family"
--- >8 ---
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
Thierry
Quoted 99 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210. Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---
Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into TEGRA_TIMER config option. This will eliminate need of including it into mach-tegra Kconfigs.
BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to clk_m as timer calibration clock.
Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
Quoted 97 lines · Svyatoslav R.
Quoted 96 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210. Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---
Quoted 5 lines
Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.
TEGRA_TIMER itself depends on TIMER, which is a more correct dependency given how that's all structured.
Quoted 3 lines
BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.
With the above on top, the series works fine on Tegra124, Tegra210 and Tegra186.
Thierry
Thanks. In this case we should stick with clk_m use and add TIMER config into non-T186 places of mach-tegra Kconfig. That should be it.
вт, 31 січ. 2023 р. о 17:17 Thierry Reding <[email protected]> пише:
Quoted 116 lines · Svyatoslav R.
Quoted 97 lines · Thierry Reding
Quoted 96 lines · Svyatoslav Ryhel
Quoted 59 lines
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210. Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.h
Use the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 5 lines
Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.
TEGRA_TIMERitself depends on TIMER, which is a more correct dependency given how that's all structured.Quoted 3 lines
BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.With the above on top, the series works fine on Tegra124, Tegra210 and Tegra186.
Thierry
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra
External email: Use caution opening links or attachments
Quoted 99 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---
Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into TEGRA_TIMER config option. This will eliminate need of including it into mach-tegra Kconfigs.
BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to clk_m as timer calibration clock.
Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 127 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 99 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be used, but there is no DM driver for the architected timer that's used on Tegra186.
The quickest fix would be to do this:
--- >8 ---
arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra
External email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 139 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be
used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
I will upload v8 tomorrow once I have some time.
Yes, Timer series should go first since some clock related commits of "General Tegra improvements" may conflict. Those are not direct dependencies but rather changed code overlaps.
Thanks
Best Regards.
Svyatoslav R.
вт, 31 січ. 2023 р. о 22:27 Tom Warren <[email protected]> пише:
Quoted 158 lines
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 139 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be
used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
I've merged your 3 timer patches w/TOT u-boot-tegra, and sent a PR to Tom Rini.
However, your v1 16-patch series here does no apply cleanly on top of the new u-boot-tegra/master (fast-forwarded to u-boot/master TOT, and then with your 3 timer patches applied on top). PTAL, git am error spew below:
git am -s --whitespace=strip /home/tom/Downloads/bundle-23280-Svyatoslav-16-v1.mbox
Applying: tegra30: clock: add EXTPERIPH
Applying: ARM: t20/t30: swap host1x and disp1 clock parents
Applying: ARM: tegra: clock: add clk_id_to_pll_id helper
Applying: ARM: tegra: clock: add clock_decode_pair helper
Applying: ARM: tegra30: add PLLD to pll setup
error: patch failed: arch/arm/mach-tegra/clock.c:791
error: arch/arm/mach-tegra/clock.c: patch does not apply
Patch failed at 0005 ARM: tegra30: add PLLD to pll setup
The copy of the patch that failed is found in:
/home/tom/denx/uboot-tegra/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 2:53 PM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra
External email: Use caution opening links or attachments
I will upload v8 tomorrow once I have some time.
Yes, Timer series should go first since some clock related commits of "General Tegra improvements" may conflict. Those are not direct dependencies but rather changed code overlaps.
Thanks
Best Regards.
Svyatoslav R.
вт, 31 січ. 2023 р. о 22:27 Tom Warren <[email protected]> пише:
Quoted 171 lines
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 140 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on
Tegra186 and it wasn't working at all. The problem is that the
selection of the TIMER symbol for all of Tegra causes the driver
model to be used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
Hm, you are correct. Patchset I have sent was based on u-boot/master without timer patches. Now, since those are merged, I need to adjust them a bit. It is not a big issue since I have some more optimisations to be added anyway. I will send an updated version within an hour if nothing interferes.
Thanks.
Best Regards.
Svyatoslav R.
чт, 2 лют. 2023 р. о 19:54 Tom Warren <[email protected]> пише:
Quoted 212 lines
I've merged your 3 timer patches w/TOT u-boot-tegra, and sent a PR to Tom Rini.
However, your v1 16-patch series here does no apply cleanly on top of the new u-boot-tegra/master (fast-forwarded to u-boot/master TOT, and then with your 3 timer patches applied on top). PTAL, git am error spew below:
git am -s --whitespace=strip
/home/tom/Downloads/bundle-23280-Svyatoslav-16-v1.mbox
Applying: tegra30: clock: add EXTPERIPH
Applying: ARM: t20/t30: swap host1x and disp1 clock parents
Applying: ARM: tegra: clock: addclk_id_to_pll_idhelper
Applying: ARM: tegra: clock: addclock_decode_pairhelper
Applying: ARM: tegra30: add PLLD to pll setup
error: patch failed:arch/arm/mach-tegra/clock.c:791
error:arch/arm/mach-tegra/clock.c: patch does not apply
Patch failed at 0005 ARM: tegra30: add PLLD to pll setup
The copy of the patch that failed is found in:
/home/tom/denx/uboot-tegra/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 2:53 PM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
I will upload v8 tomorrow once I have some time.
Yes, Timer series should go first since some clock related commits of "General Tegra improvements" may conflict. Those are not direct dependencies but rather changed code overlaps.
Thanks
Best Regards.
Svyatoslav R.вт, 31 січ. 2023 р. о 22:27 Tom Warren <[email protected]> пише:
Quoted 171 lines
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 140 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on
Tegra186 and it wasn't working at all. The problem is that the
selection of the TIMER symbol for all of Tegra causes the driver
model to be used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
Svyatoslav Ryhel
Tested-by Thierry RedingGreetings! This should be it. May you add
into
drivers: timer: add driver for ARMv7 based Tegra devices and T210 once applying patches? Thanks
вт, 31 січ. 2023 р. о 22:27 Tom Warren <[email protected]> пише:
Quoted 158 lines
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 139 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on Tegra186 and it wasn't working at all. The problem is that the selection of the TIMER symbol for all of Tegra causes the driver model to be
used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry
Tom Warren
Tested-by Thierry RedingSure. Thierry - have you tested v8 of these patches on all of your Tegra boards?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Wednesday, February 1, 2023 1:59 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra
External email: Use caution opening links or attachments
Greetings! This should be it. May you add
drivers: timer: add driver for ARMv7 based Tegra devices and T210 once applying patches? Thanks
вт, 31 січ. 2023 р. о 22:27 Tom Warren <[email protected]> пише:
Quoted 171 lines
OK, I'll wait for your v8 with the adjusted timer enabling.
Does this series need to go in first before your recent 16-patch series "General Tegra improvements"? i.e. are there any dependencies?
Tom
-----Original Message-----
From: Svyatoslav Ryhel <[email protected]>
Sent: Tuesday, January 31, 2023 8:26 AM
To: Tom Warren <[email protected]>
Cc: Thierry Reding <[email protected]>; Rayagonda Kokatanur <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Yes, it works perfectly fine on the T20/T30/T124/T186 and T210, T114 board no one has on hand. Timer enabling has to be adjusted as Thierry suggested.
вт, 31 січ. 2023 р. о 17:18 Tom Warren <[email protected]> пише:
Quoted 140 lines
Has this been tested yet? I want to get it into the next PR, and I need a tested-by for V7 before I can do that.
Thanks,
Tom
-----Original Message-----
From: Svyatoslav R. <[email protected]>
Sent: Friday, January 27, 2023 1:28 PM
To: Thierry Reding <[email protected]>
Cc: Rayagonda Kokatanur <[email protected]>; Tom Warren <[email protected]>; Marek Vasut <[email protected]>; Maxim Schwalm <[email protected]>; Dmitry Osipenko <[email protected]>; Jonas Schwöbel <[email protected]>; Agneli <[email protected]>; Heinrich Schuchardt <[email protected]>; Michal Simek <[email protected]>; Stefan Roese <[email protected]>; Eugen Hristev <[email protected]>; Michael Walle <[email protected]>; Simon Glass <[email protected]>; Jim Liu <[email protected]>; William Zhang <[email protected]>; Rick Chen <[email protected]>; Stefan Herbrechtsmeier <[email protected]>; Andre Przywara <[email protected]>; Jaehoon Chung <[email protected]>; [email protected]
Subject: Re: [PATCH v7 0/3] Timer support for ARM TegraExternal email: Use caution opening links or attachments
Quoted 100 lines · Thierry Reding
Quoted 59 lines · Svyatoslav Ryhel
- ARM: tegra: remap
clock_osc_freqfor all Tegra family Enumclock_osc_freqwas designed to use only with T20. This patch remaps it to use additional frequencies, added in T30+ SoC while maintaining backwards compatibility with T20.- drivers: timer: add timer driver for ARMv7 based Tegra devices Add timer support for T20/T30/T114/T124 and T210 based devices. Driver is based on DM, has device tree support and can be used on SPL and early boot stage.
Arm64 Tegra (apart T210) according to comment in
tegra-common.huse architected timer.- ARM: tegra: include timer as default option Enable TIMER as default option for all Tegra devices and enable
TEGRA_TIMERforTEGRA_ARMV7_COMMONand TEGRA210.
Additionally enableSPL_TIMERif build as SPL part and drop deprecated configs from common header.P. S. I have no arm64 Tegra and according to comment in
tegra-common.hUse the Tegra US timer on ARMv7, but the architected timer on ARMv8.---
Changeog from V6
- useclk_mas timer calibration clock (this should properly fix T210)
- enable timer for T210Changed from v5:
- added paz00 testerChanged from v4:
- added commentsChanged from v3:
- removed BOOTSTAGE ifdefs
- use early timer on boot stage unconditionally
---
Svyatoslav Ryhel (3):
ARM: tegra: remapclock_osc_freqfor all Tegra family
drivers: timer: add driver for ARMv7 based Tegra devices and T210
ARM: tegra: include timer as default optionarch/arm/Kconfig | 1 + arch/arm/include/asm/arch-tegra/clock.h | 9 +- arch/arm/mach-tegra/Kconfig | 3 + arch/arm/mach-tegra/clock.c | 17 +++- arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- arch/arm/mach-tegra/tegra114/clock.c | 13 +-- arch/arm/mach-tegra/tegra124/clock.c | 13 +-- arch/arm/mach-tegra/tegra20/clock.c | 4 +- arch/arm/mach-tegra/tegra210/clock.c | 22 +--- arch/arm/mach-tegra/tegra30/clock.c | 10 +- drivers/timer/Kconfig | 8 ++ drivers/timer/Makefile | 1 + drivers/timer/tegra-timer.c | 130 ++++++++++++++++++++++++ drivers/usb/host/ehci-tegra.c | 46 +++++++-- include/configs/tegra-common.h | 6 -- 15 files changed, 274 insertions(+), 79 deletions(-)Quoted 1 line
create mode 100644
drivers/timer/tegra-timer.cUgh... turns out I had completely messed up the testing on
Tegra186 and it wasn't working at all. The problem is that the
selection of the TIMER symbol for all of Tegra causes the driver
model to be used, but there is no DM driver for the architected timer that's used on Tegra186.The quickest fix would be to do this:
--- >8 ---
(quoted diff) +0
-0b/arch/arm/mach-tegra/Kconfig index
b50eec5b8c9b..05c8ce0e08dd100644arch/arm/mach-tegra/Kconfig +2
-2@@ -56,7 +56,6 @@ config TEGRA_COMMON select MISC select OF_CONTROL select SPI - select TIMER imply CMD_DM imply CRC32_VERIFY@@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON select TEGRA_PINCTRL select TEGRA_PMC select TEGRA_TIMER + select TIMER config TEGRA_ARMV8_COMMON bool "Tegra 64-bit common options"@@ -137,6 +137,7 @@ config TEGRA210 select TEGRA_PMC select TEGRA_PMC_SECURE select TEGRA_TIMER + select TIMER config TEGRA186 bool "Tegra186 family" --- >8 ---Quoted 2 lines
So basically make TIMER selected on everything except Tegra186, so that on Tegra186 things are basically unmodified.
I can propose to include 'select TIMER' directly into
TEGRA_TIMERconfig option. This will eliminate need of including it into mach-tegra Kconfigs.BTW, may you check current patch set on T124 and T210 if those work properly. My T30 devices work fine and same as before after switch to
clk_mas timer calibration clock.Best Regards, Svyatoslav R.
Quoted 1 line
Thierry