1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

board: pinephone-pro: Wait for the battery to get some charge [TODO]

We need to wait for the battery voltage to raise above some safe level
before proceeding with boot.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
Ondrej Jirman
2023-05-25 15:19:55 +02:00
parent d48e2cfbe0
commit c8ed6152f1
3 changed files with 16 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#include <asm/arch-rockchip/hardware.h> #include <asm/arch-rockchip/hardware.h>
#include <asm/arch-rockchip/misc.h> #include <asm/arch-rockchip/misc.h>
#include <power/regulator.h> #include <power/regulator.h>
#include <linux/delay.h>
#include <power/rk8xx_pmic.h> #include <power/rk8xx_pmic.h>
#define GRF_IO_VSEL_BT565_GPIO2AB 1 #define GRF_IO_VSEL_BT565_GPIO2AB 1
@@ -62,6 +63,8 @@ static void pinephone_pro_init(void)
struct udevice *pmic; struct udevice *pmic;
int ret; int ret;
printf("Initializing Pinephone Pro charger\n");
ret = uclass_first_device_err(UCLASS_PMIC, &pmic); ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
if (ret) { if (ret) {
printf("ERROR: PMIC not found! (%d)\n", ret); printf("ERROR: PMIC not found! (%d)\n", ret);
@@ -80,6 +83,12 @@ static void pinephone_pro_init(void)
* Close charger when USB lower then 3.26V * Close charger when USB lower then 3.26V
*/ */
rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000); rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
/*
* Check battery voltage and wait until it's in bootable state.
*/
//TODO:
rk818_wait_battery(pmic);
} }
void pmic_setup(void) void pmic_setup(void)

View File

@@ -129,6 +129,11 @@ static int rk8xx_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
return 0; return 0;
} }
int rk818_wait_battery(struct udevice *dev)
{
return 0;
}
#if CONFIG_IS_ENABLED(PMIC_CHILDREN) #if CONFIG_IS_ENABLED(PMIC_CHILDREN)
static int rk8xx_bind(struct udevice *dev) static int rk8xx_bind(struct udevice *dev)
{ {

View File

@@ -236,4 +236,6 @@ int rk8xx_spl_configure_buck(struct udevice *pmic, int buck, int uvolt);
int rk818_spl_configure_usb_input_current(struct udevice *pmic, int current_ma); int rk818_spl_configure_usb_input_current(struct udevice *pmic, int current_ma);
int rk818_spl_configure_usb_chrg_shutdown(struct udevice *pmic, int uvolt); int rk818_spl_configure_usb_chrg_shutdown(struct udevice *pmic, int uvolt);
int rk818_wait_battery(struct udevice *dev);
#endif #endif