20250620在荣品的PRO-RK3566开发板的Android13系统的uboot阶段就拉高GPIO2C6【driver模式】
20250620在荣品的PRO-RK3566开发板的Android13系统的uboot阶段就拉高GPIO2C6【driver模式】
2025/6/20 14:16
缘起:在荣品的PRO-RK3566开发板的Android13系统,需要给海罗的7寸屏供电/控制2路上电时序。
我司 LCD屏 有时序要求。
VDDI → AVDD/AVEE → RESX
VDDI受控于GPIO2C6,在DTS设备树中配置为uboot阶段上拉。 32*2+8*2+6=86
VDD/VEE受控于 GPIO0C0。 16
RESET受控于 GPIO0B7
在uboot中:
Z:\Android13.0\u-boot\drivers\video\drm\rockchip_panel.c
panel_simple_prepare函数中的
priv->power_supply
和
priv->enable_gpio
我希望 能够对应于 VDD/VEE。请问 该如何配置DTS?
让它们对应起来呢?
Z:\Android13.0\u-boot\drivers\video\drm\rockchip_panel.c
static int rockchip_panel_probe(struct udevice *dev)
{
struct rockchip_panel_priv *priv = dev_get_priv(dev);
struct rockchip_panel_plat *plat = dev_get_platdata(dev);
struct rockchip_panel *panel;
int ret;
const char *cmd_type;
//char VENA_PWR_EN[4] = "led";
//gpio_request( 63, VENA_PWR_EN );
//gpio_direction_output( 63, 0 );
//gpio_free( 63 );
printf("&&&& wyb 2025/6/20 9:15 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
gpio_request(16, "GPIO16");
gpio_direction_output(16, 1); // high GPIO0C0
mdelay(500);
gpio_direction_output(16, 0); // low
mdelay(500);
gpio_free(16);
printf("**** wyb 2025/6/20 9:15 %s %s %d 1\n", __FILE__, __FUNCTION__, __LINE__);
static int rockchip_panel_probe(struct udevice *dev)
{
struct rockchip_panel_priv *priv = dev_get_priv(dev);
struct rockchip_panel_plat *plat = dev_get_platdata(dev);
struct rockchip_panel *panel;
int ret;
const char *cmd_type;
//char VENA_PWR_EN[4] = "led";
//gpio_request( 63, VENA_PWR_EN );
//gpio_direction_output( 63, 0 );
//gpio_free( 63 );
printf("&&&& wyb 2025/6/20 11:51 %s %s %d\n", __FILE__, __FUNCTION__, __LINE__);
gpio_request(16, "GPIO16");
gpio_request(86, "GPIO86");
gpio_direction_output(16, 1); // high GPIO0C0 VDD/VEE
gpio_direction_output(86, 1); // high GPIO2C6 VDDI
mdelay(500);
gpio_direction_output(16, 0); // low
gpio_direction_output(86, 0);
mdelay(500);
gpio_direction_output(16, 0); // low
gpio_direction_output(86, 1);
mdelay(500);
gpio_direction_output(16, 1); // low
gpio_direction_output(86, 1);
gpio_free(16);
gpio_free(86);
printf("**** wyb 2025/6/20 9:15 %s %s %d 1\n", __FILE__, __FUNCTION__, __LINE__);
启动LOG:【有冲突/占用警示/提示?】
U-Boot 2017.09 (Jun 20 2025 - 11:52:32 +0800)
Model: Rockchip RK3568 Evaluation Board
MPIDR: 0x81000000
PreSerial: 2, raw, 0xfe660000
DRAM: 4 GiB
Sysmem: init
Relocation Offset: ed219000
Relocation fdt: eb9f89c8 - eb9fece0
CR: M/C/I
Using default environment
optee api revision: 2.0
dwmmc@fe2b0000: 1, dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Bootdev(atags): mmc 0
MMC0: HS200, 200Mhz
PartType: EFI
DM: v1
Android 13.0, Build 2023.8, v2
boot mode: None
RESC: 'boot', blk@0x0001da6c
Device is: UNLOCKED
DTB: rk-kernel.dtb
HASH(c): OK
ANDROID: fdt overlay OK
I2c0 speed: 100000Hz
PMIC: RK8090 (on=0x80, off=0x80)
vdd_logic init 950000 uV
vdd_gpu init 900000 uV
vdd_npu init 900000 uV
vsel-gpios- not found! Error: -2
vdd_cpu init 1000000 uV
io-domain: OK
INFO: ddr dmc_fsp already initialized in loader.
&&&& wyb 2025/6/20 11:51 drivers/video/drm/rockchip_panel.c rockchip_panel_probe 521
Device 'gpio@fdd60000': seq 0 is in use by 'gpio0@fdd60000'
Device 'gpio@fe740000': seq 1 is in use by 'gpio@fdd60000'
Device 'gpio@fe750000': seq 2 is in use by 'gpio2@fe750000'
**** wyb 2025/6/20 9:15 drivers/video/drm/rockchip_panel.c rockchip_panel_probe 544 1
Model: pro-rk3566
MPIDR: 0x81000000
ethaddr = 86:6b:99:de:01:29
eth1addr = fe:f9:92:b2:b3:d6
eth2addr = 4e:69:53:ae:cd:4a
eth3addr = ca:92:9e:a9:c9:8d
Rockchip UBOOT DRM driver version: v1.0.1
方法二:
Z:\Android13.0\kernel-5.10\arch\arm64\boot\dts\rockchip\rk356x\pro-rk3566.dts
gpiotest: gpiotest-regulator { //gpio power enable
compatible = "regulator-fixed";
regulator-name = "gpio_power";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
enable-active-high;
//gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
gpios = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&gpiopower>;
};
gpiopower:gpiopower-pwr{
rockchip,pin =
//<2 RK_PC5 &pcfg_pull_down>;
<2 RK_PC6 &pcfg_pull_down>;
};
在主dts文件rd-rk3588.dts的最后添加以下代码,
{
gpiotest: gpiotest-regulator { //gpio power enable
compatible = "regulator-fixed";
gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&gpiopower>;
regulator-name = "vcc_camear";
enable-active-high;
regulator-always-on;
regulator-boot-on;
};
}
&pinctrl {
gpiopower:gpiopower-pwr{
rockchip,pin =
<4 RK_PC6 &pcfg_pull_down>;
};
};
其中 箭头指向和数字标点的都可以更改 gpiotest 以及gpiotest-regulator 可以更改为你需要的名字,不重复即可
gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;&gpio4 RK_PC6 是根据GPI04_C6_d 修改; GPIO_ACTIVE_HIGH --->设置为高电平
pinctrl-0 = <&gpiopower>;&gpiopower----->为此截图中的&pinctrl4号标点
regulator-name = "vcc_camear";这个值可随意更改
4号 五号可以任意取名,6号需要和上面同步
参考资料:
CSDN:RK3566 uboot gpio
https://blog.csdn.net/qq_65999385/article/details/140373074?spm=1001.2101.3001.4242.1&utm_medium=distribute.wap_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-0-140373074-blog-147693092.237%5Ev3%5Ewap_relevant_t0_download&share_token=2f77aac8-f023-46c3-bd82-8cfb8d92954a
ITOP-RK3588 UBOOT下实现GPIO控制
https://blog.csdn.net/qq_65999385/article/details/140373074
https://bbs.elecfans.com/m/jishu_2312697_1_1.html?share_token=e9038dee-12a0-440b-941a-7b6fefcb16c0
[经验] RK3288w android9.0 uboot上拉双gpio写法简析
https://blog.csdn.net/weixin_68294039/article/details/125067260?share_token=7e04f4ad-ecef-4081-b77b-3c5a2f8a6811
在uboot中获取设备树的gpio属性并控制+屏幕初始化分析
https://blog.csdn.net/professionalmcu/article/details/129483178?ops_request_misc=&request_id=&biz_id=102&utm_term=RK3566%20uboot%20gpio&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-2-129483178.142^v102^pc_search_result_base6&spm=1018.2226.3001.4187
RK3566 uboot中初始化GPIO状态
https://blog.csdn.net/professionalmcu/article/details/129483178
这个rk_board.init()是没有被调用,是weak属性, 直接在调用rk_board.init()的前面执行GPIO操作就可以,
至少有三个人说您的方法不可用。
请问您用的是啥开发板,Android13/Buildroot的SDK。
我在荣品的PRO-RK3566开发板+Android13系统下不可用。不过加载LCD屏的probe函数中就正常了。
Z:\Android13.0\u-boot\drivers\video\drm\rockchip_panel.c