aboutsummaryrefslogtreecommitdiffstats
path: root/include/soc/tegra/flowctrl.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
commit0160e00ae8e987be8822745fb166aa76451c9bcc (patch)
treedeca2d09a729155ed0cb631f2bc8f557e634ab06 /include/soc/tegra/flowctrl.h
parentc81ee18e97e4e3162169a749eb7f2b79b3510c7a (diff)
parentb6942b68f85ed3161c91741791ec6f1779574919 (diff)
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "Driver updates for ARM SoCs: Reset subsystem, merged through arm-soc by tradition: - Make bool drivers explicitly non-modular - New support for i.MX7 and Arria10 reset controllers PATA driver for Palmchip BK371 (acked by Tejun) Power domain drivers for i.MX (GPC, GPCv2) - Moved out of mach-imx for GPC - Bunch of tweaks, fixes, etc PMC support for Tegra186 SoC detection support for Renesas RZ/G1H and RZ/G1N Move Tegra flow controller driver from mach directory to drivers/soc - (Power management / CPU power driver) Misc smaller tweaks for other platforms" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits) soc: pm-domain: Fix the mangled urls soc: renesas: rcar-sysc: Add support for R-Car H3 ES2.0 soc: renesas: rcar-sysc: Add support for fixing up power area tables soc: renesas: Register SoC device early soc: imx: gpc: add workaround for i.MX6QP to the GPC PD driver dt-bindings: imx-gpc: add i.MX6 QuadPlus compatible soc: imx: gpc: add defines for domain index soc: imx: Add GPCv2 power gating driver dt-bindings: Add GPCv2 power gating driver ARM/clk: move the ICST library to drivers/clk ARM: plat-versatile: remove stale clock header ARM: keystone: Drop PM domain support for k2g soc: ti: Add ti_sci_pm_domains driver dt-bindings: Add TI SCI PM Domains PM / Domains: Do not check if simple providers have phandle cells PM / Domains: Add generic data pointer to genpd data struct soc/tegra: Add initial flowctrl support for Tegra132/210 soc/tegra: flowctrl: Add basic platform driver soc/tegra: Move Tegra flowctrl driver ARM: tegra: Remove unnecessary inclusion of flowctrl header ...
Diffstat (limited to 'include/soc/tegra/flowctrl.h')
-rw-r--r--include/soc/tegra/flowctrl.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/include/soc/tegra/flowctrl.h b/include/soc/tegra/flowctrl.h
new file mode 100644
index 000000000000..8f86aea4024b
--- /dev/null
+++ b/include/soc/tegra/flowctrl.h
@@ -0,0 +1,82 @@
1/*
2 * Functions and macros to control the flowcontroller
3 *
4 * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __SOC_TEGRA_FLOWCTRL_H__
20#define __SOC_TEGRA_FLOWCTRL_H__
21
22#define FLOW_CTRL_HALT_CPU0_EVENTS 0x0
23#define FLOW_CTRL_WAITEVENT (2 << 29)
24#define FLOW_CTRL_WAIT_FOR_INTERRUPT (4 << 29)
25#define FLOW_CTRL_JTAG_RESUME (1 << 28)
26#define FLOW_CTRL_SCLK_RESUME (1 << 27)
27#define FLOW_CTRL_HALT_CPU_IRQ (1 << 10)
28#define FLOW_CTRL_HALT_CPU_FIQ (1 << 8)
29#define FLOW_CTRL_HALT_LIC_IRQ (1 << 11)
30#define FLOW_CTRL_HALT_LIC_FIQ (1 << 10)
31#define FLOW_CTRL_HALT_GIC_IRQ (1 << 9)
32#define FLOW_CTRL_HALT_GIC_FIQ (1 << 8)
33#define FLOW_CTRL_CPU0_CSR 0x8
34#define FLOW_CTRL_CSR_INTR_FLAG (1 << 15)
35#define FLOW_CTRL_CSR_EVENT_FLAG (1 << 14)
36#define FLOW_CTRL_CSR_ENABLE_EXT_CRAIL (1 << 13)
37#define FLOW_CTRL_CSR_ENABLE_EXT_NCPU (1 << 12)
38#define FLOW_CTRL_CSR_ENABLE_EXT_MASK ( \
39 FLOW_CTRL_CSR_ENABLE_EXT_NCPU | \
40 FLOW_CTRL_CSR_ENABLE_EXT_CRAIL)
41#define FLOW_CTRL_CSR_ENABLE (1 << 0)
42#define FLOW_CTRL_HALT_CPU1_EVENTS 0x14
43#define FLOW_CTRL_CPU1_CSR 0x18
44
45#define TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 (1 << 4)
46#define TEGRA20_FLOW_CTRL_CSR_WFE_BITMAP (3 << 4)
47#define TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP 0
48
49#define TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 (1 << 8)
50#define TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP (0xF << 4)
51#define TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP (0xF << 8)
52
53#ifndef __ASSEMBLY__
54#ifdef CONFIG_SOC_TEGRA_FLOWCTRL
55u32 flowctrl_read_cpu_csr(unsigned int cpuid);
56void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value);
57void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value);
58
59void flowctrl_cpu_suspend_enter(unsigned int cpuid);
60void flowctrl_cpu_suspend_exit(unsigned int cpuid);
61#else
62static inline u32 flowctrl_read_cpu_csr(unsigned int cpuid)
63{
64 return 0;
65}
66
67static inline void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value)
68{
69}
70
71static inline void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) {}
72
73static inline void flowctrl_cpu_suspend_enter(unsigned int cpuid)
74{
75}
76
77static inline void flowctrl_cpu_suspend_exit(unsigned int cpuid)
78{
79}
80#endif /* CONFIG_SOC_TEGRA_FLOWCTRL */
81#endif /* __ASSEMBLY */
82#endif /* __SOC_TEGRA_FLOWCTRL_H__ */