usb: gadget: f_mtp: Avoid race between mtp_read and mtp_function_disable
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / arch / arm64 / include / asm / core_regs.h
CommitLineData
1cac41cb
MB
1/*
2 * Copyright 2014 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com/
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8*/
9
10#ifndef __CORESIGHT_REGS_H
11#define __CORESIGHT_REGS_H
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15
16#define OSLOCK_MAGIC (0xc5acce55)
17
18/* Defines are used by core-sight */
19#define CS_SJTAG_OFFSET (0x8000)
20#define SJTAG_STATUS (0x4)
21#define SJTAG_SOFT_LOCK (1<<2)
22
23/* DBG Registers */
24#define DBGWFAR (0x018) /* RW */
25#define DBGVCR (0x01c) /* RW */
26#define DBGECR (0x024) /* RW or RAZ */
27#define DBGDSCCR (0x028) /* RW or RAZ */
28#define DBGDSMCR (0x02c) /* RW or RAZ */
29#define DBGDTRRX (0x080) /* RW */
30#define DBGITR (0x084) /* RW */
31#define DBGDSCR (0x088) /* RW */
32#define DBGDTRTX (0x08c) /* RW */
33#define DBGDRCR (0x090) /* WO */
34#define DBGEACR (0x094) /* RW */
35#define DBGECCR (0x098) /* RW */
36#define DBGPCSRlo (0x0a0) /* RO */
37#define DBGCIDSR (0x0a4) /* RO */
38#define DBGVIDSR (0x0a8) /* RO */
39#define DBGPCSRhi (0x0ac) /* RO */
40#define DBGBXVR0 (0x250) /* RW */
41#define DBGBXVR1 (0x254) /* RW */
42#define DBGOSLAR (0x300) /* WO */
43#define DBGOSLSR (0x304) /* RO */
44#define DBGPRCR (0x310) /* RW */
45#define DBGPRSR (0x314) /* RO, OSLSR in ARMv8 */
46#define DBGITOCTRL (0xef8) /* WO */
47#define DBGITISR (0xefc) /* RO */
48#define DBGITCTRL (0xf00) /* RW */
49#define DBGCLAIMSET (0xfa0) /* RW */
50#define DBGCLAIMCLR (0xfa4) /* RW */
51#define DBGLAR (0xfb0) /* WO */
52#define DBGLSR (0xfb4) /* RO */
53#define DBGAUTHSTATUS (0xfb8) /* RO */
54#define DBGDEVID2 (0xfc0) /* RO */
55#define DBGDEVID1 (0xfc4) /* RO, PC offset */
56#define DBGDEVID0 (0xfc8) /* RO */
57#define DBGDEVTYPE (0xfcc) /* RO */
58
59#define MIDR (0xd00) /* RO */
60#define ID_AA64DFR0_EL1 (0xd28)
61
62/* DBG breakpoint registers (All RW) */
63#define DBGBVRn(n) (0x400 + (n * 0x10)) /* 64bit */
64#define DBGBCRn(n) (0x408 + (n * 0x10))
65/* DBG watchpoint registers (All RW) */
66#define DBGWVRn(n) (0x800 + (n * 0x10)) /* 64bit */
67#define DBGWCRn(n) (0x808 + (n * 0x10))
68
69/* DIDR or ID_AA64DFR0_EL1 bit */
70#define DEBUG_ARCH_V8 (0x6)
71
72/* MIDR bit */
73#define ARMV8_PROCESSOR (0xd00)
74#define ARMV8_CORTEXA53 (0xd03)
75#define ARMV8_CORTEXA57 (0xd07)
76
77#ifdef CONFIG_EXYNOS_CORESIGHT_PC_INFO
78extern void exynos_cs_show_pcval(void);
79#else
80#define exynos_cs_show_pcval() do { } while(0)
81#endif
82
83/* TMC(ETB/ETF/ETR) registers */
84#define TMCRSZ (0x004)
85#define TMCSTS (0x00c)
86#define TMCRRD (0x010)
87#define TMCRRP (0x014)
88#define TMCRWP (0x018)
89#define TMCTGR (0x01c)
90#define TMCCTL (0x020)
91#define TMCRWD (0x024)
92#define TMCMODE (0x028)
93#define TMCLBUFLEVEL (0x02c)
94#define TMCCBUFLEVEL (0x030)
95#define TMCBUFWM (0x034)
96#define TMCRRPHI (0x038)
97#define TMCRWPHI (0x03c)
98#define TMCAXICTL (0x110)
99#define TMCDBALO (0x118)
100#define TMCDBAHI (0x11c)
101#define TMCFFSR (0x300)
102#define TMCFFCR (0x304)
103#define TMCPSCR (0x308)
104
105/* Coresight manager register */
106#define ITCTRL (0xf00)
107#define CLAIMSET (0xfa0)
108#define CLAIMCLR (0xfa4)
109#define LAR (0xfb0)
110#define LSR (0xfb4)
111#define AUTHSTATUS (0xfb8)
112
113/* FUNNEL configuration register */
114#define FUNCTRL (0x0)
115#define FUNPRIORCTRL (0x4)
116
117/* ETM registers */
118#define ETMCTLR (0x004)
119#define ETMPROCSELR (0x008)
120#define ETMSTATUS (0x00c)
121#define ETMCONFIG (0x010)
122#define ETMAUXCTLR (0x018)
123#define ETMEVENTCTL0R (0x020)
124#define ETMEVENTCTL1R (0x024)
125#define ETMSTALLCTLR (0x02c)
126#define ETMTSCTLR (0x030)
127#define ETMSYNCPR (0x034)
128#define ETMCCCCTLR (0x038)
129#define ETMBBCTLR (0x03c)
130#define ETMTRACEIDR (0x040)
131#define ETMQCTRLR (0x044)
132#define ETMVICTLR (0x080)
133#define ETMVIIECTLR (0x084)
134#define ETMVISSCTLR (0x088)
135#define ETMVIPCSSCTLR (0x08c)
136#define ETMVDCTLR (0x0a0)
137#define ETMVDSACCTLR (0x0a4)
138#define ETMVDARCCTLR (0x0a8)
139#define ETMSEQEVR(n) (0x100 + (n * 4))
140#define ETMSEQRSTEVR (0x118)
141#define ETMSEQSTR (0x11c)
142#define ETMEXTINSELR (0x120)
143#define ETMCNTRLDVR(n) (0x140 + (n * 4))
144#define ETMCNTCTLR(n) (0x150 + (n * 4))
145#define ETMCNTVR(n) (0x160 + (n * 4))
146#define ETMIDR8 (0x180)
147#define ETMIDR9 (0x184)
148#define ETMID10 (0x188)
149#define ETMID11 (0x18c)
150#define ETMID12 (0x190)
151#define ETMID13 (0x194)
152#define ETMID0 (0x1e0)
153#define ETMID1 (0x1e4)
154#define ETMID2 (0x1e8)
155#define ETMID3 (0x1ec)
156#define ETMID4 (0x1f0)
157#define ETMID5 (0x1f4)
158#define ETMID6 (0x1f8)
159#define ETMID7 (0x1fc)
160#define ETMRSCTLR(n) (0x200 + (n * 4))
161#define ETMSSCCR(n) (0x280 + (n * 4))
162#define ETMSSCSR(n) (0x2a0 + (n * 4))
163#define ETMSSPCICR(n) (0x2c0 + (n * 4))
164#define ETMOSLAR (0x300)
165#define ETMOSLSR (0x304)
166#define ETMPDCR (0x310)
167#define ETMPDSR (0x314)
168#define ETMACVR(n) (0x400 + (n * 4))
169#define ETMACAT(n) (0x480 + (n * 4))
170#define ETMDVCVR(n) (0x500 + (n * 4))
171#define ETMDVCMR(n) (0x580 + (n * 4))
172#define ETMCIDCVR(n) (0x600 + (n * 4))
173#define ETMVMIDCVR(n) (0x640 + (n * 4))
174#define ETMCCIDCCTLR0 (0x680)
175#define ETMCCIDCCTLR1 (0x684)
176#define ETMVMIDCCTLR0 (0x688)
177#define ETMVMIDCCTLR1 (0x68c)
178
179#ifdef CONFIG_EXYNOS_CORESIGHT_ETM
180extern void exynos_trace_stop(void);
181#else
182#define exynos_trace_stop() do { } while(0)
183#endif
184
185/* defines for MNGS reset */
186#define PEND_MNGS (1 << 1)
187#define PEND_APOLLO (1 << 0)
188#define DEFAULT_VAL_CPU_RESET_DISABLE 0xFFFFFFFC
189
190#define RESET_DISABLE_GPR_CPUPORESET (1 << 15)
191#define RESET_DISABLE_WDT_CPUPORESET (1 << 12)
192#define RESET_DISABLE_CORERESET (1 << 9)
193#define RESET_DISABLE_CPUPORESET (1 << 8)
194
195#define RESET_DISABLE_WDT_PRESET_DBG (1 << 25)
196#define RESET_DISABLE_PRESET_DBG (1 << 18)
197#define DFD_EDPCSR_DUMP_EN (1 << 0)
198
199#define RESET_DISABLE_L2RESET (1 << 16)
200#endif