aboutsummaryrefslogtreecommitdiff
path: root/include/power
diff options
context:
space:
mode:
authorQuentin Schulz2024-03-14 10:36:18 +0100
committerKever Yang2024-03-14 18:19:44 +0800
commitf172575d92cdb53b0f7b99bc76d9d6d09dbbbb8b (patch)
treeb6c9a7870f92869f6beeb3e766dbb342019b08a5 /include/power
parentf047e4ab97629848963c6266bd8d3437491c651d (diff)
power: rk8xx: add support for RK806
This adds support for RK806, only the SPI variant has been tested. The communication "protocol" over SPI is the following: - write three bytes: - 1 byte: [0:3] length of the payload, [6] Enable CRC, [7] Write - 1 byte: LSB register address - 1 byte: MSB register address - write/read length of payload The CRC is always disabled for now. The RK806 technically supports I2C as well, and this should be able to support it without any change, but it wasn't tested. The DT node name prefix for the buck converters has changed in the Device Tree and is now dcdc-reg. The logic for buck converters is however manageable within the current logic inside the rk8xx regulator driver. The same cannot be said for the NLDO and PLDO. Because pmic_bind_children() parses the DT nodes and extracts the LDO index from the DT node name, NLDO and PLDO will have overlapping indices. Therefore, we need a separate logic from the already-existing ldo callbacks. Let's reuse as much as possible though. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'include/power')
-rw-r--r--include/power/rk8xx_pmic.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/power/rk8xx_pmic.h b/include/power/rk8xx_pmic.h
index 0db82419d4f..31221aa46b6 100644
--- a/include/power/rk8xx_pmic.h
+++ b/include/power/rk8xx_pmic.h
@@ -183,7 +183,18 @@ enum {
};
enum {
+ RK806_POWER_SLP_EN0 = 0x06,
+ RK806_POWER_SLP_EN1,
+ RK806_POWER_SLP_EN2,
+ RK806_REG_SYS_CFG3 = 0x72,
+ RK806_WDT_REG,
+ RK806_ON_SOURCE,
+ RK806_OFF_SOURCE
+};
+
+enum {
RK805_ID = 0x8050,
+ RK806_ID = 0x8060,
RK808_ID = 0x0000,
RK809_ID = 0x8090,
RK816_ID = 0x8160,
@@ -201,6 +212,14 @@ enum {
#define RK817_POWER_EN_SAVE0 0x99
#define RK817_POWER_EN_SAVE1 0xa4
+#define RK806_POWER_EN(x) (0x00 + (x))
+/* POWER_ENx register lower 4 bits are write-protected unless the associated top bit is set */
+#define RK806_POWER_EN_CLRSETBITS(bit, val) (((val) << (bit)) | (1 << ((bit) + 4)))
+
+#define RK806_POWER_SLP_EN(x) (0x06 + (x))
+
+#define RK806_ID_MSB 0x5a
+#define RK806_ID_LSB 0x5b
#define RK817_ID_MSB 0xed
#define RK817_ID_LSB 0xee
#define RK8XX_ID_MSK 0xfff0