Browse Source

env: export fdt_blob to the environment variable

Export fdt_blob to the environment variable. So that we may
use it to boot Linux.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
Thomas Chou 9 năm trước cách đây
mục cha
commit
545dfd1014
2 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 3 0
      common/board_r.c
  2. 4 1
      doc/README.fdt-control

+ 3 - 0
common/board_r.c

@@ -446,6 +446,9 @@ static int initr_env(void)
 		env_relocate();
 		env_relocate();
 	else
 	else
 		set_default_env(NULL);
 		set_default_env(NULL);
+#ifdef CONFIG_OF_CONTROL
+	setenv_addr("fdtcontroladdr", gd->fdt_blob);
+#endif
 
 
 	/* Initialize from environment */
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);

+ 4 - 1
doc/README.fdt-control

@@ -156,7 +156,10 @@ address of the fdt binary blob, and will override either of the options.
 Be aware that this environment variable is checked prior to relocation,
 Be aware that this environment variable is checked prior to relocation,
 when only the compiled-in environment is available. Therefore it is not
 when only the compiled-in environment is available. Therefore it is not
 possible to define this variable in the saved SPI/NAND flash
 possible to define this variable in the saved SPI/NAND flash
-environment, for example (it will be ignored).
+environment, for example (it will be ignored). After relocation, this
+variable will be set to the address of the newly relocated fdt blob.
+It is read-only and cannot be changed. It can optionally be used to
+control the boot process of Linux with bootm/bootz commands.
 
 
 To use this, put something like this in your board header file:
 To use this, put something like this in your board header file: