1 /*
2  * Copyright (c) 2023 ENE Technology Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ENE_KB1200_GCFG_H
8 #define ENE_KB1200_GCFG_H
9 
10 /**
11  *  Structure type to access General Configuration (GCFG).
12  */
13 struct gcfg_regs {
14 	volatile uint8_t IDV;            /*Version ID Register */
15 	volatile uint8_t Reserved0;      /*Reserved */
16 	volatile uint16_t IDC;           /*Chip ID Register */
17 	volatile uint32_t FWID;          /*Firmware ID Register */
18 	volatile uint32_t MCURST;        /*MCU Reset Control Register */
19 	volatile uint32_t RSTFLAG;       /*Reset Pending Flag Register */
20 	volatile uint32_t GPIOALT;       /*GPIO Alternate Register */
21 	volatile uint8_t VCCSTA;         /*VCC Status Register */
22 	volatile uint8_t Reserved1[3];   /*Reserved */
23 	volatile uint16_t GPIOMUX;       /*GPIO MUX Control Register */
24 	volatile uint16_t Reserved2;     /*Reserved */
25 	volatile uint16_t I2CSPMS;       /*I2CS Pin Map Selection Register */
26 	volatile uint16_t Reserved3;     /*Reserved */
27 	volatile uint8_t CLKCFG;         /*Clock Configuration Register */
28 	volatile uint8_t Reserved4[3];   /*Reserved */
29 	volatile uint32_t DPLLFREQ;      /*DPLL Frequency Register */
30 	volatile uint32_t Reserved5;     /*Reserved */
31 	volatile uint32_t GCFGMISC;      /*Misc. Register */
32 	volatile uint8_t EXTIE;          /*Extended Command Interrupt Enable Register */
33 	volatile uint8_t Reserved6[3];   /*Reserved */
34 	volatile uint8_t EXTPF;          /*Extended Command Pending Flag Register */
35 	volatile uint8_t Reserved7[3];   /*Reserved */
36 	volatile uint32_t EXTARG;        /*Extended Command Argument0/1/2 Register */
37 	volatile uint8_t EXTCMD;         /*Extended Command Port Register */
38 	volatile uint8_t Reserved8[3];   /*Reserved */
39 	volatile uint32_t ADCOTR;        /*ADCO Register */
40 	volatile uint32_t IDSR;          /*IDSR Register */
41 	volatile uint32_t Reserved9[14]; /*Reserved */
42 	volatile uint32_t TRAPMODE;
43 	volatile uint32_t CLK1UCFG;
44 	volatile uint32_t LDO15TRIM;
45 	volatile uint32_t Reserved10;
46 	volatile uint32_t WWTR;
47 	volatile uint32_t ECMISC2;
48 	volatile uint32_t DPLLCTRL;
49 };
50 
51 #define GCFG_CLKCFG_96M 0x00000004
52 #define GCFG_CLKCFG_48M 0x00000014
53 #define GCFG_CLKCFG_24M 0x00000024
54 
55 #endif /* ENE_KB1200_GCFG_H */
56