xref: /aosp_15_r20/external/coreboot/src/soc/qualcomm/ipq806x/include/soc/gsbi.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: ISC */
2 
3 #ifndef __GSBI_H_
4 #define __GSBI_H_
5 
6 /* GSBI Registers */
7 #define GSBI_CTRL_REG(base)        ((base) + 0x0)
8 
9 #define GSBI_CTRL_REG_PROTOCOL_CODE_S   4
10 #define GSBI_PROTOCOL_CODE_I2C          0x2
11 #define GSBI_PROTOCOL_CODE_SPI          0x3
12 #define GSBI_PROTOCOL_CODE_UART_FLOW    0x4
13 #define GSBI_PROTOCOL_CODE_I2C_UART     0x6
14 
15 #define GSBI_HCLK_CTL_S                 4
16 #define GSBI_HCLK_CTL_CLK_ENA           0x1
17 
18 typedef enum {
19 	GSBI_ID_1 = 1,
20 	GSBI_ID_2,
21 	GSBI_ID_3,
22 	GSBI_ID_4,
23 	GSBI_ID_5,
24 	GSBI_ID_6,
25 	GSBI_ID_7,
26 } gsbi_id_t;
27 
28 typedef enum {
29 	GSBI_SUCCESS = 0,
30 	GSBI_ID_ERROR,
31 	GSBI_ERROR,
32 	GSBI_UNSUPPORTED
33 } gsbi_return_t;
34 
35 typedef enum {
36 	GSBI_PROTO_I2C_UIM = 1,
37 	GSBI_PROTO_I2C_ONLY,
38 	GSBI_PROTO_SPI_ONLY,
39 	GSBI_PROTO_UART_FLOW_CTL,
40 	GSBI_PROTO_UIM,
41 	GSBI_PROTO_I2C_UART,
42 } gsbi_protocol_t;
43 
44 gsbi_return_t gsbi_init(gsbi_id_t gsbi_id, gsbi_protocol_t protocol);
45 int gsbi_init_board(gsbi_id_t gsbi_id);
46 
47 #endif
48