ARM: tegra: Add Tegra124 powergate support
Subsystems (3)
PATCH 1/2 ARM: tegra: Add Tegra124 powergate support
Three new gates have been added for Tegra124: SOR, VIC and IRAM. In addition, PCIe and SATA gates are again supported, like on Tegra20 and Tegra30.
--- arch/arm/mach-tegra/powergate.c | 42 +++++++++++++++++++++++++++++++++++++++++ include/linux/tegra-powergate.h | 3 +++ 2 files changed, 45 insertions(+)
arch/arm/mach-tegra/powergate.c +42 -0
@@ -74,6 +74,13 @@ static const u8 tegra114_cpu_domains[] = { TEGRA_POWERGATE_CPU3, }; +static const u8 tegra124_cpu_domains[] = { +TEGRA_POWERGATE_CPU0 , +TEGRA_POWERGATE_CPU1 , +TEGRA_POWERGATE_CPU2 , +TEGRA_POWERGATE_CPU3 , +}; +static DEFINE_SPINLOCK (tegra_powergate_lock);static void __iomem *pmc =IO_ADDRESS (TEGRA_PMC_BASE );
@@ -221,6 +228,11 @@ int __init tegra_powergate_init(void) tegra_num_cpu_domains =4 ; tegra_cpu_domains = tegra114_cpu_domains;break ; +case TEGRA124 : + tegra_num_powerdomains =25 ; + tegra_num_cpu_domains =4 ; + tegra_cpu_domains = tegra124_cpu_domains; +break ;default :/* Unknown Tegra variant. Disable powergating */ tegra_num_powerdomains =0 ;
@@ -282,6 +294,33 @@ static const char * const powergate_name_t114[] = { [TEGRA_POWERGATE_XUSBC] = "xusbc", }; +static const char *const powergate_name_t124[] = { + [TEGRA_POWERGATE_CPU ] ="crail" , + [TEGRA_POWERGATE_3D ] ="3d" , + [TEGRA_POWERGATE_VENC ] ="venc" , + [TEGRA_POWERGATE_PCIE ] ="pcie" , + [TEGRA_POWERGATE_VDEC ] ="vdec" , + [TEGRA_POWERGATE_L2 ] ="l2" , + [TEGRA_POWERGATE_MPE ] ="mpe" , + [TEGRA_POWERGATE_HEG ] ="heg" , + [TEGRA_POWERGATE_SATA ] ="sata" , + [TEGRA_POWERGATE_CPU1 ] ="cpu1" , + [TEGRA_POWERGATE_CPU2 ] ="cpu2" , + [TEGRA_POWERGATE_CPU3 ] ="cpu3" , + [TEGRA_POWERGATE_CELP ] ="celp" , + [TEGRA_POWERGATE_CPU0 ] ="cpu0" , + [TEGRA_POWERGATE_C0NC ] ="c0nc" , + [TEGRA_POWERGATE_C1NC ] ="c1nc" , + [TEGRA_POWERGATE_SOR ] ="sor" , + [TEGRA_POWERGATE_DIS ] ="dis" , + [TEGRA_POWERGATE_DISB ] ="disb" , + [TEGRA_POWERGATE_XUSBA ] ="xusba" , + [TEGRA_POWERGATE_XUSBB ] ="xusbb" , + [TEGRA_POWERGATE_XUSBC ] ="xusbc" , + [TEGRA_POWERGATE_VIC ] ="vic" , + [TEGRA_POWERGATE_IRAM ] ="iram" , +}; +static int powergate_show (struct seq_file *s,void *data) {int i;
@@ -326,6 +365,9 @@ int __init tegra_powergate_debugfs_init(void)case TEGRA114 : powergate_name = powergate_name_t114;break ; +case TEGRA124 : + powergate_name = powergate_name_t124; +break ; }if (powergate_name) {
include/linux/tegra-powergate.h +3 -0
@@ -38,11 +38,14 @@ struct reset_control;#define TEGRA_POWERGATE_CPU0 14#define TEGRA_POWERGATE_C0NC 15#define TEGRA_POWERGATE_C1NC 16 +#define TEGRA_POWERGATE_SOR 17#define TEGRA_POWERGATE_DIS 18#define TEGRA_POWERGATE_DISB 19#define TEGRA_POWERGATE_XUSBA 20#define TEGRA_POWERGATE_XUSBB 21#define TEGRA_POWERGATE_XUSBC 22 +#define TEGRA_POWERGATE_VIC 23 +#define TEGRA_POWERGATE_IRAM 24#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
Signature · 1 line
1.8.4.2
A message that is not in the archive (sent off-list or not yet received): 1386952264-6773-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
PATCH 2/2 ARM: tegra: Special-case the 3D clamps on Tegra124
A separate register is used to remove the clamps for the GPU on Tegra124. In order to be able to use the same API, special-case this particular partition.
--- arch/arm/mach-tegra/powergate.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/mach-tegra/powergate.c +13 -0
@@ -56,6 +56,8 @@#define IO_DPD2_STATUS 0x1c4#define SEL_DPD_TIM 0x1c8 +#define GPU_RG_CNTRL 0x2d4 +static int tegra_num_powerdomains;static int tegra_num_cpu_domains;static const u8 *tegra_cpu_domains;
@@ -152,6 +154,17 @@ int tegra_powergate_remove_clamping(int id)return -EINVAL ;/* +* The Tegra124 GPU has a separate register (with different semantics) +* to remove clamps. +*/ +if (tegra_chip_id ==TEGRA124 ) { +if (id ==TEGRA_POWERGATE_3D ) { +pmc_write (0 ,GPU_RG_CNTRL ); +return 0 ; + } + } + +/* * Tegra 2 has a bug where PCIE and VDE clamping masks are * swapped relatively to the partition ids */
Signature · 1 line
1.8.4.2
Stephen Warren
AppliedQuoted 3 lines · Thierry Reding
Three new gates have been added for Tegra124: SOR, VIC and IRAM. In addition, PCIe and SATA gates are again supported, like on Tegra20 and Tegra30.
I've applied the series to Tegra's for-3.14/soc branch.