lk uboot传参到Kernel

发布时间 2023-12-27 20:39:48作者: 陈昌雄

记录一下内核和uboot的传参

MTK传参
 
1. 在 app/mt_boot/mt_boot.c使用cmdline_append(buf);
 
snprintf(buf, 10,"vcom=%s", vcom_str);
pal_log_err("%s\n", buf);
cmdline_append(buf);

 

2. 在kernel中读取
br_ptr = strstr(saved_command_line, "vcom=");
 
直接从 saved_command_line中解析出来参数
 
RK传参
 
env_update("bootargs", vcom_args);
 
使用:
 
snprintf(vcom_args, strlen(vcom_str) + 15, "ebc_pmic.vcom=%s", vcom_str);
printf("eink update bootargs: %s\n", vcom_args);
env_update("bootargs", vcom_args);
 
 
 
参考
 
https://blog.csdn.net/wh_19910525/article/details/47442775