1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
6 #ifndef _CORESIGHT_CORESIGHT_TPDM_H
7 #define _CORESIGHT_CORESIGHT_TPDM_H
9 /* The max number of the datasets that TPDM supports */
10 #define TPDM_DATASETS 7
12 /* DSB Subunit Registers */
13 #define TPDM_DSB_CR (0x780)
14 #define TPDM_DSB_TIER (0x784)
16 /* Enable bit for DSB subunit */
17 #define TPDM_DSB_CR_ENA BIT(0)
18 /* Enable bit for DSB subunit perfmance mode */
19 #define TPDM_DSB_CR_MODE BIT(1)
20 /* Enable bit for DSB subunit trigger type */
21 #define TPDM_DSB_CR_TRIG_TYPE BIT(12)
22 /* Data bits for DSB high performace mode */
23 #define TPDM_DSB_CR_HPSEL GENMASK(6, 2)
24 /* Data bits for DSB test mode */
25 #define TPDM_DSB_CR_TEST_MODE GENMASK(10, 9)
27 /* Enable bit for DSB subunit trigger timestamp */
28 #define TPDM_DSB_TIER_XTRIG_TSENAB BIT(1)
30 /* DSB programming modes */
31 /* DSB mode bits mask */
32 #define TPDM_DSB_MODE_MASK GENMASK(8, 0)
33 /* Test mode control bit*/
34 #define TPDM_DSB_MODE_TEST(val) (val & GENMASK(1, 0))
35 /* Performance mode */
36 #define TPDM_DSB_MODE_PERF BIT(3)
37 /* High performance mode */
38 #define TPDM_DSB_MODE_HPBYTESEL(val) (val & GENMASK(8, 4))
40 /* TPDM integration test registers */
41 #define TPDM_ITATBCNTRL (0xEF0)
42 #define TPDM_ITCNTRL (0xF00)
44 /* Register value for integration test */
45 #define ATBCNTRL_VAL_32 0xC00F1409
46 #define ATBCNTRL_VAL_64 0xC01F1409
49 * Number of cycles to write value when
52 #define INTEGRATION_TEST_CYCLE 10
55 * The bits of PERIPHIDR0 register.
56 * The fields [6:0] of PERIPHIDR0 are used to determine what
57 * interfaces and subunits are present on a given TPDM.
59 * PERIPHIDR0[0] : Fix to 1 if ImplDef subunit present, else 0
60 * PERIPHIDR0[1] : Fix to 1 if DSB subunit present, else 0
63 #define TPDM_PIDR0_DS_IMPDEF BIT(0)
64 #define TPDM_PIDR0_DS_DSB BIT(1)
67 * struct dsb_dataset - specifics associated to dsb dataset
68 * @mode: DSB programming mode
69 * @trig_ts: Enable/Disable trigger timestamp.
70 * @trig_type: Enable/Disable trigger type.
79 * struct tpdm_drvdata - specifics associated to an TPDM component
80 * @base: memory mapped base address for this component.
81 * @dev: The device entity associated to this component.
82 * @csdev: component vitals needed by the framework.
83 * @spinlock: lock for the drvdata value.
84 * @enable: enable status of the component.
85 * @datasets: The datasets types present of the TPDM.
86 * @dsb Specifics associated to TPDM DSB.
92 struct coresight_device *csdev;
95 unsigned long datasets;
96 struct dsb_dataset *dsb;
99 #endif /* _CORESIGHT_CORESIGHT_TPDM_H */