Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 1 | /* 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 Patel | cf41862 | 2011-09-22 11:15:11 -0700 | [diff] [blame] | 16 | #include <linux/bitops.h> |
| 17 | |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 18 | /* 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 */ |
| 52 | void etb_enable(void); |
| 53 | void etb_disable(void); |
| 54 | void etb_dump(void); |
| 55 | void tpiu_disable(void); |
| 56 | void funnel_enable(uint8_t id, uint32_t port_mask); |
| 57 | void funnel_disable(uint8_t id, uint32_t port_mask); |
| 58 | |
Pratik Patel | fd6f56a | 2011-10-10 17:47:55 -0700 | [diff] [blame^] | 59 | #ifdef CONFIG_MSM_DEBUG_ACROSS_PC |
| 60 | extern void msm_save_jtag_debug(void); |
| 61 | extern void msm_restore_jtag_debug(void); |
| 62 | #else |
| 63 | static inline void msm_save_jtag_debug(void) {} |
| 64 | static inline void msm_restore_jtag_debug(void) {} |
| 65 | #endif |
Pratik Patel | e577179 | 2011-09-17 18:33:54 -0700 | [diff] [blame] | 66 | #ifdef CONFIG_MSM_TRACE_ACROSS_PC |
| 67 | extern void etm_save_reg_check(void); |
| 68 | extern void etm_restore_reg_check(void); |
| 69 | #else |
| 70 | static inline void etm_save_reg_check(void) {} |
| 71 | static inline void etm_restore_reg_check(void) {} |
| 72 | #endif |
| 73 | |
Pratik Patel | 7831c08 | 2011-06-08 21:44:37 -0700 | [diff] [blame] | 74 | #endif |