Merge git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / include / da9030.h
1 /*
2  * (C) Copyright 2006 DENX Software Engineering
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 /* DA9030 register definitions */
8 #define CID                     0x00
9 #define EVENT_A                 0x01
10 #define EVENT_B                 0x02
11 #define EVENT_C                 0x03
12 #define STATUS                  0x04
13 #define IRQ_MASK_A              0x05
14 #define IRQ_MASK_B              0x06
15 #define IRQ_MASK_C              0x07
16 #define SYS_CONTROL_A           0x08
17 #define SYS_CONTROL_B           0x09
18 #define FAULT_LOG               0x0A
19 #define LDO_10_11               0x10
20 #define LDO_15                  0x11
21 #define LDO_14_16               0x12
22 #define LDO_18_19               0x13
23 #define LDO_17_SIMCP0           0x14
24 #define BUCK2_DVC1              0x15
25 #define BUCK2_DVC2              0x16
26 #define REG_CONTROL_1_17        0x17
27 #define REG_CONTROL_2_18        0x18
28 #define USBPUMP                 0x19
29 #define SLEEP_CONTROL           0x1A
30 #define STARTUP_CONTROL         0x1B
31 #define LED1_CONTROL            0x20
32 #define LED2_CONTROL            0x21
33 #define LED3_CONTROL            0x22
34 #define LED4_CONTROL            0x23
35 #define LEDPC_CONTROL           0x24
36 #define WLED_CONTROL            0x25
37 #define MISC_CONTROLA           0x26
38 #define MISC_CONTROLB           0x27
39 #define CHARGE_CONTROL          0x28
40 #define CCTR_CONTROL            0x29
41 #define TCTR_CONTROL            0x2A
42 #define CHARGE_PULSE            0x2B
43
44 /* ... some missing ...*/
45
46 #define LDO1                    0x90
47 #define LDO2_3                  0x91
48 #define LDO4_5                  0x92
49 #define LDO6_SIMCP              0x93
50 #define LDO7_8                  0x94
51 #define LDO9_12                 0x95
52 #define BUCK                    0x96
53 #define REG_CONTROL_1_97        0x97
54 #define REG_CONTROL_2_98        0x98
55 #define REG_SLEEP_CONTROL1      0x99
56 #define REG_SLEEP_CONTROL2      0x9A
57 #define REG_SLEEP_CONTROL3      0x9B
58 #define ADC_MAN_CONTROL         0xA0
59 #define ADC_AUTO_CONTROL        0xA1
60 #define VBATMON                 0xA2
61 #define VBATMONTXMON            0xA3
62 #define TBATHIGHP               0xA4
63 #define TBATHIGHN               0xA5
64 #define TBATLOW                 0xA6
65 #define MAN_RES                 0xB0
66 #define VBAT_RES                0xB1
67 #define VBATMIN_RES             0xB2
68 #define VBATMINTXON_RES         0xB3
69 #define ICHMAX_RES              0xB4
70 #define ICHMIN_RES              0xB5
71 #define ICHAVERAGE_RES          0xB6
72 #define VCHMAX_RES              0xB7
73 #define VCHMIN_RES              0xB8
74 #define TBAT_RES                0xB9
75 #define ADC_IN4_RES             0xBA
76
77 #define STATUS_ONKEY_N          0x1     /* current ONKEY_N value */
78 #define STATUS_PWREN1           (1<<1)  /* PWREN1 value */
79 #define STATUS_EXTON            (1<<2)  /* EXTON value */
80 #define STATUS_CHDET            (1<<3)  /* Charger detection status */
81 #define STATUS_TBAT             (1<<4)  /* Battery over/under temperature status */
82 #define STATUS_VBATMON          (1<<5)  /* VBATMON comparison status */
83 #define STATUS_VBATMONTXON      (1<<6)  /* VBATMONTXON comparison status */
84 #define STATUS_CHIOVER          (1<<7)  /* Charge overcurrent */
85
86 #define SYS_CONTROL_A_SLEEP_N_PIN_ENABLE        0x1
87 #define SYS_CONTROL_A_SHUT_DOWN                 (1<<1)
88 #define SYS_CONTROL_A_HWRES_ENABLE              (1<<2)
89 #define SYS_CONTROL_A_WDOG_ACTION               (1<<3)
90 #define SYS_CONTROL_A_WATCHDOG                  (1<<7)
91
92 #define MISC_CONTROLB_USB_INT_RISING            (1<<2)
93 #define MISC_CONTROLB_SESSION_VALID_EN          (1<<3)
94
95 #define USB_PUMP_USBVE                          (1<<0)
96 #define USB_PUMP_USBVEP                         (1<<1)
97 #define USB_PUMP_SRP_DETECT                     (1<<2)
98 #define USB_PUMP_SESSION_VALID                  (1<<3)
99 #define USB_PUMP_VBUS_VALID_4_0                 (1<<4)
100 #define USB_PUMP_VBUS_VALID_4_4                 (1<<5)
101 #define USB_PUMP_EN_USBVE                       (1<<6)
102 #define USB_PUMP_EN_USBVEP                      (1<<7)