|
|
@ -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"; |
|
|
|