20250927让荣品RD-RK3588-MID开发板的Android13系统在uboot下关闭背光充电
20250927让荣品RD-RK3588-MID开发板的Android13系统在uboot下关闭背光充电
2025/9/27 18:20
缘起:搞不定在关机充电的时候:在uboot状态下显示电量的百分比。PM要求直接关闭LCD屏的电量显示图片。
我们有电量指示灯带的!这个功能以后再解决了!
不过现在还是有一个小瑕疵:插+12V适配器充电的时候,背光会闪一下:亮一下就关闭了!
如果要彻底彻底,还是有一点点工作量的!
在RD-RK3588-MID开发板中 充电的时候 有充电图标。没有电量 百分比?
请帮忙加一下 充电百分比 ?@权
在设置 电池 百分比显示
这个是 关机充电的时候。
现在 只有 图标。没有百分比!
关机后充电显示吗?这种加不了实时数字,只能加图片。你们可以根据自己的需求进行开发
PRO-RK3566+buildroot
我司 吊舱 和 竞品 在实现同样的功能 ,但是我司产品 在3.3V下电流高1A。功耗大很多。
该从哪里分析问题?比如 CPU/GPU/NPU占用率?
请提供查看占用率的方法??@陈威
Y:\RK3588_android13-20250818\u-boot\drivers\power\charge_animation.c
Z:\rk-android13-20250818RD-RK3588-MID\u-boot\drivers\power\charge_animation.c
static void autowake_timer_handler(int irq, void *data)
{
struct udevice *dev = data;
struct charge_animation_priv *priv = dev_get_priv(dev);
static long long count;
printf("**** wyb 2025/9/27 10:09 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
writel(TIMER_CLR_INT, TIMER_BASE + TIMER_INTSTATUS);
priv->auto_wakeup_key_state = KEY_PRESS_DOWN;
printf("auto wakeup count: %lld\n", ++count);
}
#include <drm/drm_mipi_dsi.h>
#include <config.h>
#include <common.h>
#include <errno.h>
#include <malloc.h>
#include <video.h>
#include <backlight.h>
#include <spi.h>
#include <asm/gpio.h>
#include <dm/device.h>
#include <dm/read.h>
#include <dm/uclass.h>
#include <dm/uclass-id.h>
#include <linux/media-bus-format.h>
#include <power/regulator.h>
static void autowakeup_timer_init(struct udevice *dev, uint32_t seconds)
{
uint64_t period = 24000000ULL * seconds;
printf("**** wyb 2025/9/27 10:09 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
//GPIO4A0 BackLight 4*32+0*8+0=128 //LCD BACKLIGHT
gpio_request(128, "GPIO128");
gpio_direction_output(128, 0);
//gpio_direction_output(128, 1); //open backlight
mdelay(10);
gpio_free(128);
mdelay(10);
/* Disable before conifg */
writel(0, TIMER_BASE + TIMER_CTRL);
/* Config */
writel((uint32_t)period, TIMER_BASE + TIMER_LOAD_COUNT0);
writel((uint32_t)(period >> 32), TIMER_BASE + TIMER_LOAD_COUNT1);
writel(TIMER_CLR_INT, TIMER_BASE + TIMER_INTSTATUS);
writel(TIMER_EN | TIMER_INT_EN, TIMER_BASE + TIMER_CTRL);
/* IRQ */
irq_install_handler(TIMER_IRQ, autowake_timer_handler, dev);
irq_handler_enable(TIMER_IRQ);
}
static void autowakeup_timer_uninit(void)
{
printf("**** wyb 2025/9/27 10:09 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
writel(0, TIMER_BASE + TIMER_CTRL);
irq_handler_disable(TIMER_IRQ);
irq_free_handler(TIMER_IRQ);
}
#endif
LOG记录:
vconn is already Off
Start toggling
fusb302 start drp toggling
fusb302@22: init finished
CC connected in CC2 as UFP
vconn is already Off
PD chip enter low power mode
bq25703_charger_current_init pd charge input vol:5000000uv current:1500000ua
cw2017_get_vol voltage=8446
cw2017_get_vol voltage=8446
cw2017_get_soc soc 69
vol: 8446, soc: 69
cw2017_get_soc soc 69
plug-det-gpio not configured, using backup method
Enable charge animation display
**** wyb 2025/9/27 10:09 drivers/power/charge-display-uclass.c charge_display_show 16
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c charge_animation_show 660
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c charge_extrem_low_power 573
cw2017_get_vol voltage=8446
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c autowakeup_timer_uninit 434
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c fg_charger_get_chrg_online 513
cw2017_get_vol voltage=8446
Auto wakeup: 15S
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c autowakeup_timer_init 416
Enter U-Boot charging mode
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c fg_charger_get_chrg_online 513
cw2017_get_soc soc 69
cw2017_get_vol voltage=7906
soc(69%) exit charge animation...
**** wyb 2025/9/27 10:09 drivers/power/charge_animation.c charge_show_bmp 446
Rockchip UBOOT DRM driver version: v1.0.1
vp0 have layer nr:2[0 2 ], primary plane: 2
vp1 have layer nr:2[1 3 ], primary plane: 3
vp2 have layer nr:2[6 8 ], primary plane: 8
vp3 have layer nr:2[7 9 ], primary plane: 9
【不要在这里关闭背光!这里关闭背光之后,uboot阶段就不出图了!】
Y:\RK3588_android13-20250818\u-boot\drivers\power\charge-display-uclass.c
Z:\rk-android13-20250818RD-RK3588-MID\u-boot\drivers\power\charge-display-uclass.c
/*
* (C) Copyright 2017 Rockchip Electronics Co., Ltd
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <command.h>
#include <common.h>
#include <dm.h>
#include <power/charge_display.h>
int charge_display_show(struct udevice *dev)
{
const struct dm_charge_display_ops *ops = dev_get_driver_ops(dev);
printf("**** wyb 2025/9/27 10:09 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
if (!ops || !ops->show)
return -ENOSYS;
return ops->show(dev);
}
//#include <drm/drm_mipi_dsi.h>
//
//#include <config.h>
//#include <common.h>
//#include <errno.h>
//#include <malloc.h>
//#include <video.h>
//#include <backlight.h>
//#include <spi.h>
//#include <asm/gpio.h>
//#include <dm/device.h>
//#include <dm/read.h>
//#include <dm/uclass.h>
//#include <dm/uclass-id.h>
//#include <linux/media-bus-format.h>
//#include <power/regulator.h>
int charge_display(void)
{
struct udevice *dev;
int ret;
printf("**** wyb 2025/9/27 10:09 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
// //GPIO4A0 BackLight 4*32+0*8+0=128 //LCD BACKLIGHT
// gpio_request(128, "GPIO128");
// gpio_direction_output(128, 0);
// //gpio_direction_output(128, 1); //open backlight
// mdelay(10);
// gpio_free(128);
// mdelay(10);
ret = uclass_get_device(UCLASS_CHARGE_DISPLAY, 0, &dev);
if (ret) {
debug("Get charge display failed, ret=%d\n", ret);
return ret;
}
return charge_display_show(dev);
}
UCLASS_DRIVER(charge_display) = {
.id = UCLASS_CHARGE_DISPLAY,
.name = "charge_display",
};