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 | |
| 16 | /* Coresight management registers (0xF00-0xFCC) */ |
| 17 | #define CS_ITCTRL (0xF00) |
| 18 | #define CS_CLAIMSET (0xFA0) |
| 19 | #define CS_CLAIMCLR (0xFA4) |
| 20 | #define CS_LAR (0xFB0) |
| 21 | #define CS_LSR (0xFB4) |
| 22 | #define CS_AUTHSTATUS (0xFB8) |
| 23 | #define CS_DEVID (0xFC8) |
| 24 | #define CS_DEVTYPE (0xFCC) |
| 25 | /* Peripheral id registers (0xFD0-0xFEC) */ |
| 26 | #define CS_PIDR4 (0xFD0) |
| 27 | #define CS_PIDR5 (0xFD4) |
| 28 | #define CS_PIDR6 (0xFD8) |
| 29 | #define CS_PIDR7 (0xFDC) |
| 30 | #define CS_PIDR0 (0xFE0) |
| 31 | #define CS_PIDR1 (0xFE4) |
| 32 | #define CS_PIDR2 (0xFE8) |
| 33 | #define CS_PIDR3 (0xFEC) |
| 34 | /* Component id registers (0xFF0-0xFFC) */ |
| 35 | #define CS_CIDR0 (0xFF0) |
| 36 | #define CS_CIDR1 (0xFF4) |
| 37 | #define CS_CIDR2 (0xFF8) |
| 38 | #define CS_CIDR3 (0xFFC) |
| 39 | |
| 40 | |
| 41 | #define TIMEOUT_US 100 |
| 42 | #define MAGIC1 0xC5ACCE55 |
| 43 | #define MAGIC2 0x0 |
| 44 | |
| 45 | #define BM(lsb, msb) ((BIT(msb) - BIT(lsb)) + BIT(msb)) |
| 46 | #define BMVAL(val, lsb, msb) ((val & BM(lsb, msb)) >> lsb) |
| 47 | #define BVAL(val, n) ((val & BIT(n)) >> n) |
| 48 | |
| 49 | /* TODO: clean this up */ |
| 50 | void etb_enable(void); |
| 51 | void etb_disable(void); |
| 52 | void etb_dump(void); |
| 53 | void tpiu_disable(void); |
| 54 | void funnel_enable(uint8_t id, uint32_t port_mask); |
| 55 | void funnel_disable(uint8_t id, uint32_t port_mask); |
| 56 | |
| 57 | #endif |