1 /*
2  * Copyright (c) 2021 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_DRIVERS_PCIE_HOST_PTM_H_
8 #define ZEPHYR_DRIVERS_PCIE_HOST_PTM_H_
9 
10 #include <zephyr/drivers/pcie/pcie.h>
11 #include <zephyr/drivers/pcie/cap.h>
12 
13 #define PTM_CAP_REG_OFFSET 0x04U
14 
15 union ptm_cap_reg {
16 	struct {
17 		uint32_t requester               : 1;
18 		uint32_t responder               : 1;
19 		uint32_t root                    : 1;
20 		uint32_t _reserved1              : 5;
21 		uint32_t local_clock_granularity : 8;
22 		uint32_t _reserved2              : 16;
23 	};
24 	uint32_t raw;
25 };
26 
27 #define PTM_CTRL_REG_OFFSET 0x08U
28 
29 union ptm_ctrl_reg {
30 	struct {
31 		uint32_t ptm_enable            : 1;
32 		uint32_t root_select           : 1;
33 		uint32_t _reserved1            : 6;
34 		uint32_t effective_granularity : 8;
35 		uint32_t _reserved2            : 16;
36 	};
37 	uint32_t raw;
38 };
39 
40 struct pcie_ptm_root_config {
41 	struct pcie_dev *pcie;
42 };
43 
44 #endif /* ZEPHYR_DRIVERS_PCIE_HOST_PTM_H_ */
45