Browse Source

fix sysboot's dtb

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 3 months ago
parent
commit
02334e4f25
  1. 32
      arch/arm/mach-rockchip/boot_rkimg.c
  2. 2
      configs/sytc_defconfig

32
arch/arm/mach-rockchip/boot_rkimg.c

@ -462,6 +462,23 @@ static int fdt_check_hash(void *fdt_addr, u32 fdt_size,
#endif /* CONFIG_ROCKCHIP_DTB_VERIFY */
#if defined(CONFIG_ROCKCHIP_EARLY_DISTRO_DTB)
/* {{{ get bootpart */
static int get_boot_part_num(void)
{
int part_id;
disk_partition_t part;
struct blk_desc *blkdev;
blkdev = rockchip_get_bootdev();
if (blkdev) {
if ((part_id = part_get_info_by_name(blkdev, PART_BOOT, &part)) > 0) {
return part_id;
}
}
return -ENODEV;
}
/* }}} */
static int rockchip_read_distro_dtb(void *fdt_addr)
{
const char *cmd = "part list ${devtype} ${devnum} -bootable devplist";
@ -469,6 +486,7 @@ static int rockchip_read_distro_dtb(void *fdt_addr)
char devnum_part[12];
char fdt_hex_str[19];
char *fs_argv[5];
int part_id;
if (!rockchip_get_bootdev() || !fdt_addr)
return -ENODEV;
@ -478,13 +496,19 @@ static int rockchip_read_distro_dtb(void *fdt_addr)
return -EINVAL;
}
devplist = env_get("devplist");
if (!devplist)
devplist = "1";
part_id = get_boot_part_num();
if (part_id <= 0) {
devplist = env_get("devplist");
if (!devplist) {
part_id = 1;
} else {
part_id = strtoul(devplist, NULL, 16);
}
}
devtype = env_get("devtype");
devnum = env_get("devnum");
sprintf(devnum_part, "%s:%s", devnum, devplist);
sprintf(devnum_part, "%s:%d", devnum, part_id);
sprintf(fdt_hex_str, "0x%lx", (ulong)fdt_addr);
fs_argv[0] = "load";

2
configs/sytc_defconfig

@ -235,3 +235,5 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_OFFSET=0x400000
CONFIG_ENV_SIZE=0x100000
CONFIG_CMD_ENV_FLAGS=y
CONFIG_ROCKCHIP_EARLY_DISTRO_DTB=y
CONFIG_ROCKCHIP_EARLY_DISTRO_DTB_PATH="/rk3588-sytc.dtb"

Loading…
Cancel
Save