Pratik Patel | c35426a | 2012-03-17 12:02:53 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012, 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 | |
Pratik Patel | 43e47bd | 2012-05-19 18:10:55 -0700 | [diff] [blame^] | 13 | #ifndef _LINUX_CS_H |
| 14 | #define _LINUX_CS_H |
| 15 | |
| 16 | /* Peripheral id registers (0xFD0-0xFEC) */ |
| 17 | #define CS_PIDR4 (0xFD0) |
| 18 | #define CS_PIDR5 (0xFD4) |
| 19 | #define CS_PIDR6 (0xFD8) |
| 20 | #define CS_PIDR7 (0xFDC) |
| 21 | #define CS_PIDR0 (0xFE0) |
| 22 | #define CS_PIDR1 (0xFE4) |
| 23 | #define CS_PIDR2 (0xFE8) |
| 24 | #define CS_PIDR3 (0xFEC) |
| 25 | /* Component id registers (0xFF0-0xFFC) */ |
| 26 | #define CS_CIDR0 (0xFF0) |
| 27 | #define CS_CIDR1 (0xFF4) |
| 28 | #define CS_CIDR2 (0xFF8) |
| 29 | #define CS_CIDR3 (0xFFC) |
| 30 | |
| 31 | /* DBGv7 with baseline CP14 registers implemented */ |
| 32 | #define ARM_DEBUG_ARCH_V7B (0x3) |
| 33 | /* DBGv7 with all CP14 registers implemented */ |
| 34 | #define ARM_DEBUG_ARCH_V7 (0x4) |
| 35 | #define ARM_DEBUG_ARCH_V7_1 (0x5) |
| 36 | #define ETM_ARCH_V3_3 (0x23) |
| 37 | #define PFT_ARCH_V1_1 (0x31) |
Pratik Patel | c35426a | 2012-03-17 12:02:53 -0700 | [diff] [blame] | 38 | |
Pratik Patel | 1403f2a | 2012-03-21 10:10:00 -0700 | [diff] [blame] | 39 | struct qdss_source { |
| 40 | struct list_head link; |
| 41 | const char *name; |
| 42 | uint32_t fport_mask; |
| 43 | }; |
| 44 | |
| 45 | struct msm_qdss_platform_data { |
| 46 | struct qdss_source *src_table; |
| 47 | size_t size; |
| 48 | uint8_t afamily; |
| 49 | }; |
| 50 | |
Pratik Patel | bf3e7744 | 2012-03-18 18:30:43 -0700 | [diff] [blame] | 51 | #ifdef CONFIG_MSM_QDSS |
Pratik Patel | 1403f2a | 2012-03-21 10:10:00 -0700 | [diff] [blame] | 52 | extern struct qdss_source *qdss_get(const char *name); |
| 53 | extern void qdss_put(struct qdss_source *src); |
| 54 | extern int qdss_enable(struct qdss_source *src); |
| 55 | extern void qdss_disable(struct qdss_source *src); |
Pratik Patel | f3adf03 | 2012-05-03 12:50:21 -0700 | [diff] [blame] | 56 | extern void qdss_disable_sink(void); |
Pratik Patel | bf3e7744 | 2012-03-18 18:30:43 -0700 | [diff] [blame] | 57 | extern int qdss_clk_enable(void); |
| 58 | extern void qdss_clk_disable(void); |
| 59 | #else |
Pratik Patel | 1403f2a | 2012-03-21 10:10:00 -0700 | [diff] [blame] | 60 | static inline struct qdss_source *qdss_get(const char *name) { return NULL; } |
| 61 | static inline void qdss_put(struct qdss_source *src) {} |
| 62 | static inline int qdss_enable(struct qdss_source *src) { return -ENOSYS; } |
| 63 | static inline void qdss_disable(struct qdss_source *src) {} |
Pratik Patel | f3adf03 | 2012-05-03 12:50:21 -0700 | [diff] [blame] | 64 | static inline void qdss_disable_sink(void) {} |
Pratik Patel | bf3e7744 | 2012-03-18 18:30:43 -0700 | [diff] [blame] | 65 | static inline int qdss_clk_enable(void) { return -ENOSYS; } |
| 66 | static inline void qdss_clk_disable(void) {} |
| 67 | #endif |
| 68 | |
Pratik Patel | 606fb50 | 2012-03-17 22:11:03 -0700 | [diff] [blame] | 69 | #ifdef CONFIG_MSM_JTAG |
| 70 | extern void msm_jtag_save_state(void); |
| 71 | extern void msm_jtag_restore_state(void); |
| 72 | #else |
| 73 | static inline void msm_jtag_save_state(void) {} |
| 74 | static inline void msm_jtag_restore_state(void) {} |
| 75 | #endif |
| 76 | |
Pratik Patel | c35426a | 2012-03-17 12:02:53 -0700 | [diff] [blame] | 77 | #endif |