mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
Merge "arm: dts: ipq5332: Append rdp477 and rdp 478 name in config"
This commit is contained in:
commit
9c9cbfa2eb
1 changed files with 25 additions and 8 deletions
|
|
@ -38,6 +38,7 @@
|
|||
#include <usb.h>
|
||||
#endif
|
||||
|
||||
#define CONFIG_NAME_MAX_LEN 128
|
||||
#define FLASH_SEL_BIT 7
|
||||
#define LINUX_NAND_DTS "/soc/nand@79b0000/"
|
||||
#define LINUX6_1_NAND_DTS "/soc@0/nand@79b0000/"
|
||||
|
|
@ -833,32 +834,48 @@ unsigned int get_dts_machid(unsigned int machid)
|
|||
|
||||
void ipq_uboot_fdt_fixup(void)
|
||||
{
|
||||
int ret, len;
|
||||
char *config = NULL;
|
||||
int ret, len = 0, config_nos = 0;
|
||||
char config[CONFIG_NAME_MAX_LEN];
|
||||
char *config_list[6] = { NULL };
|
||||
|
||||
switch (gd->bd->bi_arch_number)
|
||||
{
|
||||
case MACH_TYPE_IPQ5332_AP_MI01_3_C2:
|
||||
config = "config@mi01.3-c2";
|
||||
config_list[config_nos++] = "config@mi01.3-c2";
|
||||
config_list[config_nos++] = "config@rdp477";
|
||||
config_list[config_nos++] = "config-rdp477";
|
||||
break;
|
||||
case MACH_TYPE_IPQ5332_AP_MI04_1_C2:
|
||||
config = "config@mi04.1-c2";
|
||||
config_list[config_nos++] = "config@mi04.1-c2";
|
||||
config_list[config_nos++] = "config@rdp478";
|
||||
config_list[config_nos++] = "config-rdp478";
|
||||
break;
|
||||
}
|
||||
|
||||
if (config != NULL)
|
||||
if (config_nos)
|
||||
{
|
||||
len = fdt_totalsize(gd->fdt_blob) + strlen(config) + 1;
|
||||
while (config_nos--) {
|
||||
strlcpy(&config[len], config_list[config_nos],
|
||||
CONFIG_NAME_MAX_LEN - len);
|
||||
len += strnlen(config_list[config_nos],
|
||||
CONFIG_NAME_MAX_LEN) + 1;
|
||||
if (len > CONFIG_NAME_MAX_LEN) {
|
||||
printf("skipping uboot fdt fixup err: "
|
||||
"config name len-overflow\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open in place with a new length.
|
||||
*/
|
||||
ret = fdt_open_into(gd->fdt_blob, (void *)gd->fdt_blob, len);
|
||||
ret = fdt_open_into(gd->fdt_blob, (void *)gd->fdt_blob,
|
||||
fdt_totalsize(gd->fdt_blob) + len);
|
||||
if (ret)
|
||||
printf("uboot-fdt-fixup: Cannot expand FDT: %s\n", fdt_strerror(ret));
|
||||
|
||||
ret = fdt_setprop((void *)gd->fdt_blob, 0, "config_name",
|
||||
config, (strlen(config)+1));
|
||||
config, len);
|
||||
if (ret)
|
||||
printf("uboot-fdt-fixup: unable to set config_name(%d)\n", ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue