blob: 8d346c4421cff58f39d2582063f9a01dc942e8b5 [file] [log] [blame]
Pratik Patel7831c082011-06-08 21:44:37 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _ARCH_ARM_MACH_MSM_QDSS_H_
14#define _ARCH_ARM_MACH_MSM_QDSS_H_
15
Pratik Patelcf418622011-09-22 11:15:11 -070016#include <linux/bitops.h>
17
Pratik Patel7831c082011-06-08 21:44:37 -070018/* Coresight management registers (0xF00-0xFCC) */
19#define CS_ITCTRL (0xF00)
20#define CS_CLAIMSET (0xFA0)
21#define CS_CLAIMCLR (0xFA4)
22#define CS_LAR (0xFB0)
23#define CS_LSR (0xFB4)
24#define CS_AUTHSTATUS (0xFB8)
25#define CS_DEVID (0xFC8)
26#define CS_DEVTYPE (0xFCC)
27/* Peripheral id registers (0xFD0-0xFEC) */
28#define CS_PIDR4 (0xFD0)
29#define CS_PIDR5 (0xFD4)
30#define CS_PIDR6 (0xFD8)
31#define CS_PIDR7 (0xFDC)
32#define CS_PIDR0 (0xFE0)
33#define CS_PIDR1 (0xFE4)
34#define CS_PIDR2 (0xFE8)
35#define CS_PIDR3 (0xFEC)
36/* Component id registers (0xFF0-0xFFC) */
37#define CS_CIDR0 (0xFF0)
38#define CS_CIDR1 (0xFF4)
39#define CS_CIDR2 (0xFF8)
40#define CS_CIDR3 (0xFFC)
41
42
43#define TIMEOUT_US 100
44#define MAGIC1 0xC5ACCE55
45#define MAGIC2 0x0
46
47#define BM(lsb, msb) ((BIT(msb) - BIT(lsb)) + BIT(msb))
48#define BMVAL(val, lsb, msb) ((val & BM(lsb, msb)) >> lsb)
49#define BVAL(val, n) ((val & BIT(n)) >> n)
50
51/* TODO: clean this up */
52void etb_enable(void);
53void etb_disable(void);
54void etb_dump(void);
55void tpiu_disable(void);
56void funnel_enable(uint8_t id, uint32_t port_mask);
57void funnel_disable(uint8_t id, uint32_t port_mask);
58
Pratik Patelfd6f56a2011-10-10 17:47:55 -070059#ifdef CONFIG_MSM_DEBUG_ACROSS_PC
60extern void msm_save_jtag_debug(void);
61extern void msm_restore_jtag_debug(void);
62#else
63static inline void msm_save_jtag_debug(void) {}
64static inline void msm_restore_jtag_debug(void) {}
65#endif
Pratik Patele5771792011-09-17 18:33:54 -070066#ifdef CONFIG_MSM_TRACE_ACROSS_PC
67extern void etm_save_reg_check(void);
68extern void etm_restore_reg_check(void);
69#else
70static inline void etm_save_reg_check(void) {}
71static inline void etm_restore_reg_check(void) {}
72#endif
73
Pratik Patel7831c082011-06-08 21:44:37 -070074#endif