mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq9574: Pass UUID of rootfs partion to kernel in bootargs
Change-Id: Iba346e7cb5b2e809b873a7f885ec0844e9b4e708 Signed-off-by: anusha <anusharao@codeaurora.org>
This commit is contained in:
parent
580d877a56
commit
aa77d3dc01
1 changed files with 49 additions and 0 deletions
|
|
@ -625,10 +625,59 @@ void disable_caches(void)
|
|||
/**
|
||||
* Set the uuid in bootargs variable for mounting rootfilesystem
|
||||
*/
|
||||
#ifdef CONFIG_QCA_MMC
|
||||
int set_uuid_bootargs(char *boot_args, char *part_name, int buflen, bool gpt_flag)
|
||||
{
|
||||
int ret, len;
|
||||
block_dev_desc_t *blk_dev;
|
||||
disk_partition_t disk_info;
|
||||
|
||||
blk_dev = mmc_get_dev(mmc_host.dev_num);
|
||||
if (!blk_dev) {
|
||||
printf("Invalid block device name\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (buflen <= 0 || buflen > MAX_BOOT_ARGS_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
#ifdef CONFIG_PARTITION_UUIDS
|
||||
ret = get_partition_info_efi_by_name(blk_dev,
|
||||
part_name, &disk_info);
|
||||
if (ret) {
|
||||
printf("bootipq: unsupported partition name %s\n",part_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((len = strlcpy(boot_args, "root=PARTUUID=", buflen)) >= buflen)
|
||||
return -EINVAL;
|
||||
#else
|
||||
if ((len = strlcpy(boot_args, "rootfsname=", buflen)) >= buflen)
|
||||
return -EINVAL;
|
||||
#endif
|
||||
boot_args += len;
|
||||
buflen -= len;
|
||||
|
||||
#ifdef CONFIG_PARTITION_UUIDS
|
||||
if ((len = strlcpy(boot_args, disk_info.uuid, buflen)) >= buflen)
|
||||
return -EINVAL;
|
||||
#else
|
||||
if ((len = strlcpy(boot_args, part_name, buflen)) >= buflen)
|
||||
return -EINVAL;
|
||||
#endif
|
||||
boot_args += len;
|
||||
buflen -= len;
|
||||
|
||||
if (gpt_flag && strlcpy(boot_args, " gpt", buflen) >= buflen)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int set_uuid_bootargs(char *boot_args, char *part_name, int buflen, bool gpt_flag)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_eth_init(bd_t *bis)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue