|
@@ -1272,6 +1272,28 @@ static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
|
|
|
|
+/*
|
|
|
|
+ * For CONFIG_OF_SEPARATE, the board may optionally implement this to
|
|
|
|
+ * provide and/or fixup the fdt.
|
|
|
|
+ */
|
|
|
|
+__weak void *board_fdt_blob_setup(void)
|
|
|
|
+{
|
|
|
|
+ void *fdt_blob = NULL;
|
|
|
|
+#ifdef CONFIG_SPL_BUILD
|
|
|
|
+ /* FDT is at end of BSS unless it is in a different memory region */
|
|
|
|
+ if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
|
|
|
|
+ fdt_blob = (ulong *)&_image_binary_end;
|
|
|
|
+ else
|
|
|
|
+ fdt_blob = (ulong *)&__bss_end;
|
|
|
|
+#else
|
|
|
|
+ /* FDT is at end of image */
|
|
|
|
+ fdt_blob = (ulong *)&_end;
|
|
|
|
+#endif
|
|
|
|
+ return fdt_blob;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
int fdtdec_setup(void)
|
|
int fdtdec_setup(void)
|
|
{
|
|
{
|
|
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
|
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
|
@@ -1285,18 +1307,7 @@ int fdtdec_setup(void)
|
|
# else
|
|
# else
|
|
gd->fdt_blob = __dtb_dt_begin;
|
|
gd->fdt_blob = __dtb_dt_begin;
|
|
# endif
|
|
# endif
|
|
-# elif defined CONFIG_OF_SEPARATE
|
|
|
|
-# ifdef CONFIG_SPL_BUILD
|
|
|
|
- /* FDT is at end of BSS unless it is in a different memory region */
|
|
|
|
- if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
|
|
|
|
- gd->fdt_blob = (ulong *)&_image_binary_end;
|
|
|
|
- else
|
|
|
|
- gd->fdt_blob = (ulong *)&__bss_end;
|
|
|
|
-# else
|
|
|
|
- /* FDT is at end of image */
|
|
|
|
- gd->fdt_blob = (ulong *)&_end;
|
|
|
|
-# endif
|
|
|
|
-# elif defined(CONFIG_OF_BOARD)
|
|
|
|
|
|
+# elif defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE)
|
|
/* Allow the board to override the fdt address. */
|
|
/* Allow the board to override the fdt address. */
|
|
gd->fdt_blob = board_fdt_blob_setup();
|
|
gd->fdt_blob = board_fdt_blob_setup();
|
|
# elif defined(CONFIG_OF_HOSTFILE)
|
|
# elif defined(CONFIG_OF_HOSTFILE)
|