Debian Codegraph @

src/soc/intel/common/block/include/intelblocks/p2sb.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef SOC_INTEL_COMMON_BLOCK_P2SB_H
4 #define SOC_INTEL_COMMON_BLOCK_P2SB_H
5
6 #include <stddef.h>
7 #include <stdint.h>
8
9 #define PCH_P2SB_E0 0xe0
10 #define P2SB_E0_MASKLOCK (1 << 1)
11 #define PCH_P2SB_IBDF 0x6c
12 #define PCH_P2SB_HBDF 0x70
13
14 enum {
15 P2SB_EP_MASK_0_REG,
16 P2SB_EP_MASK_1_REG,
17 P2SB_EP_MASK_2_REG,
18 P2SB_EP_MASK_3_REG,
19 P2SB_EP_MASK_4_REG,
20 P2SB_EP_MASK_5_REG,
21 P2SB_EP_MASK_6_REG,
22 P2SB_EP_MASK_7_REG,
23 P2SB_EP_MASK_MAX_REG,
24 };
25
26 void p2sb_unhide(void);
27 void p2sb_hide(void);
28 void p2sb_disable_sideband_access(void);
29 void p2sb_enable_bar(void);
30 void p2sb_configure_hpet(void);
31
32 /*
33 * Functions to access IOE P2SB.
34 * pid argument: SBI port Id
35 */
36 void ioe_p2sb_enable_bar(void);
37 uint32_t ioe_p2sb_sbi_read(uint8_t pid, uint16_t reg);
38 void ioe_p2sb_sbi_write(uint8_t pid, uint16_t reg, uint32_t val);
39
40 /*
41 * Functions to access SoC P2SB2.
42 * pid argument: SBI port Id
43 */
44 void p2sb2_enable_bar(void);
45 uint32_t p2sb2_sbi_read(uint8_t pid, uint16_t reg);
46 void p2sb2_sbi_write(uint8_t pid, uint16_t reg, uint32_t val);
47
48 union p2sb_bdf {
49 struct {
50 uint16_t fn : 3;
51 uint16_t dev : 5;
52 uint16_t bus : 8;
53 };
54 uint16_t raw;
55 };
56
57 union p2sb_bdf p2sb_get_hpet_bdf(void);
58 void p2sb_set_hpet_bdf(union p2sb_bdf bdf);
59 union p2sb_bdf p2sb_get_ioapic_bdf(void);
60 void p2sb_set_ioapic_bdf(union p2sb_bdf bdf);
61
62 /* SOC overrides */
63 /*
64 * Each SoC should implement EP Mask register to disable SB access
65 * Input:
66 * ep_mask: An array to be filled by SoC code with EP mask register.
67 * count: number of element in EP mask array.
68 */
69 void p2sb_soc_get_sb_mask(uint32_t *ep_mask, size_t count);
70
71 #endif /* SOC_INTEL_COMMON_BLOCK_P2SB_H */