Commit eea63e05d0b7f54e7aa39725015483972c71cb3c
Committed by
Wolfgang Denk
1 parent
f5437ad141
Exists in
master
and in
54 other branches
fdt: ARM: Add fdtcontroladdr to set device tree address in environment
This adds support for a new environment variable called 'fdtcontroladdr'. If defined, the hex address is used as the address of the control fdt for U-Boot. Note: I have not changed CONFIG_PRAM section as I already have an outstanding patch on that. Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 3 changed files with 19 additions and 0 deletions Side-by-side Diff
README
... | ... | @@ -3499,6 +3499,10 @@ |
3499 | 3499 | add the information it needs into it, and the memory |
3500 | 3500 | must be accessible by the kernel. |
3501 | 3501 | |
3502 | + fdtcontroladdr- if set this is the address of the control flattened | |
3503 | + device tree used by U-Boot when CONFIG_OF_CONTROL is | |
3504 | + defined. | |
3505 | + | |
3502 | 3506 | i2cfast - (PPC405GP|PPC405EP only) |
3503 | 3507 | if set to 'y' configures Linux I2C driver for fast |
3504 | 3508 | mode (400kHZ). This environment variable is used in |
arch/arm/lib/board.c
... | ... | @@ -286,6 +286,9 @@ |
286 | 286 | /* FDT is at end of image */ |
287 | 287 | gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE); |
288 | 288 | #endif |
289 | + /* Allow the early environment to override the fdt address */ | |
290 | + gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, | |
291 | + (uintptr_t)gd->fdt_blob); | |
289 | 292 | |
290 | 293 | for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { |
291 | 294 | if ((*init_fnc_ptr)() != 0) { |
doc/README.fdt-control
... | ... | @@ -144,6 +144,18 @@ |
144 | 144 | |
145 | 145 | You cannot use both of these options at the same time. |
146 | 146 | |
147 | +If you wish to put the fdt at a different address in memory, you can | |
148 | +define the "fdtcontroladdr" environment variable. This is the hex | |
149 | +address of the fdt binary blob, and will override either of the options. | |
150 | +Be aware that this environment variable is checked prior to relocation, | |
151 | +when only the compiled-in environment is available. Therefore it is not | |
152 | +possible to define this variable in the saved SPI/NAND flash | |
153 | +environment, for example (it will be ignored). | |
154 | + | |
155 | +To use this, put something like this in your board header file: | |
156 | + | |
157 | +#define CONFIG_EXTRA_ENV_SETTINGS "fdtcontroladdr=10000\0" | |
158 | + | |
147 | 159 | |
148 | 160 | Limitations |
149 | 161 | ----------- |