aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm.h
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-10-21 03:01:13 -0400
committerPaul Walmsley <paul@pwsan.com>2012-10-21 03:01:13 -0400
commit2bb2a5d30abb0dc99d074877bfad2056142c730b (patch)
tree6da1f32009cec6777baa0a474f7c2579cc57a6bc /arch/arm/mach-omap2/prm.h
parentb5c5353d417580f7a6ac21a0954f1c500a5cc4f5 (diff)
ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver
The OMAP watchdog timer driver needs to determine what caused the SoC to reset for its GETBOOTSTATUS ioctl. So, define a set of standard reset sources across OMAP SoCs. For OMAP2xxx, 3xxx, and 4xxx SoCs, define mappings from the SoC-specific reset source register bits to the standardized reset source IDs. Create SoC-specific PRM functions that read the appropriate per-SoC register and use the mapping to return the standardized reset bits. Register the SoC-specific PRM functions with the common PRM code via prm_register(). Create a function in the common PRM code, prm_read_reset_sources(), that calls the SoC-specific function, registered during boot. This patch does not yet handle some SoCs, such as AM33xx. Those SoCs were not handled by the code this will replace. Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm.h')
-rw-r--r--arch/arm/mach-omap2/prm.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 3e51c1d15757..c30ab5de8d1d 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -52,16 +52,58 @@
52#define OMAP_POWERSTATE_SHIFT 0 52#define OMAP_POWERSTATE_SHIFT 0
53#define OMAP_POWERSTATE_MASK (0x3 << 0) 53#define OMAP_POWERSTATE_MASK (0x3 << 0)
54 54
55/*
56 * Standardized OMAP reset source bits
57 *
58 * To the extent these happen to match the hardware register bit
59 * shifts, it's purely coincidental. Used by omap-wdt.c.
60 * OMAP_UNKNOWN_RST_SRC_ID_SHIFT is a special value, used whenever
61 * there are any bits remaining in the global PRM_RSTST register that
62 * haven't been identified, or when the PRM code for the current SoC
63 * doesn't know how to interpret the register.
64 */
65#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
66#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
67#define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT 2
68#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
69#define OMAP_SECU_WD_RST_SRC_ID_SHIFT 4
70#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
71#define OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT 6
72#define OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT 7
73#define OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT 8
74#define OMAP_ICEPICK_RST_SRC_ID_SHIFT 9
75#define OMAP_ICECRUSHER_RST_SRC_ID_SHIFT 10
76#define OMAP_C2C_RST_SRC_ID_SHIFT 11
77#define OMAP_UNKNOWN_RST_SRC_ID_SHIFT 12
78
55#ifndef __ASSEMBLER__ 79#ifndef __ASSEMBLER__
56 80
57/** 81/**
82 * struct prm_reset_src_map - map register bitshifts to standard bitshifts
83 * @reg_shift: bitshift in the PRM reset source register
84 * @std_shift: bitshift equivalent in the standard reset source list
85 *
86 * The fields are signed because -1 is used as a terminator.
87 */
88struct prm_reset_src_map {
89 s8 reg_shift;
90 s8 std_shift;
91};
92
93/**
58 * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations 94 * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations
95 * @read_reset_sources: ptr to the Soc PRM-specific get_reset_source impl
59 */ 96 */
60struct prm_ll_data {}; 97struct prm_ll_data {
98 u32 (*read_reset_sources)(void);
99};
61 100
62extern int prm_register(struct prm_ll_data *pld); 101extern int prm_register(struct prm_ll_data *pld);
63extern int prm_unregister(struct prm_ll_data *pld); 102extern int prm_unregister(struct prm_ll_data *pld);
64 103
104extern u32 prm_read_reset_sources(void);
105
65#endif 106#endif
66 107
108
67#endif 109#endif