fdt: fixup: move board_fdt_fixup the earliest than others

If we update fdt by create or move operation, the fdt nodes offset are
changed, but device node of DM didn't update its offset linking with the
fdt node. This makes driver can't parse the right fdt node info.

This is a DM framework bug, we need this patch to workarund it.

Change-Id: I18ee427fe2457ae42e5c6d1dab3e365fe87e06e4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-07-31 22:01:50 +08:00 committed by Jianhong Chen
parent 7e02d185cc
commit 6bccab8707
2 changed files with 12 additions and 7 deletions

View File

@ -40,6 +40,11 @@ __weak int board_fdt_fixup(void *blob)
int arch_fixup_fdt(void *blob)
{
int ret = 0;
ret = board_fdt_fixup(blob);
if (ret)
return ret;
#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_OF_LIBFDT)
bd_t *bd = gd->bd;
int bank;
@ -80,9 +85,6 @@ int arch_fixup_fdt(void *blob)
return ret;
#endif
#endif
ret = board_fdt_fixup(blob);
if (ret)
return ret;
#ifdef CONFIG_FMAN_ENET
ret = fdt_update_ethernet_dt(blob);

View File

@ -562,6 +562,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
ulong *initrd_end = &images->initrd_end;
int ret = -EPERM;
int fdt_ret;
if (arch_fixup_fdt(blob) < 0) {
printf("ERROR: arch-specific fdt fixup failed\n");
goto err;
}
#if defined(CONFIG_PASS_DEVICE_SERIAL_BY_FDT)
if (fdt_root(blob) < 0) {
printf("ERROR: root node setup failed\n");
@ -572,10 +578,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
printf("ERROR: /chosen node create failed\n");
goto err;
}
if (arch_fixup_fdt(blob) < 0) {
printf("ERROR: arch-specific fdt fixup failed\n");
goto err;
}
/* Update ethernet nodes */
fdt_fixup_ethernet(blob);
if (IMAGE_OF_BOARD_SETUP) {