mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
cmd: fdt: add fdt overlay application subcommand
The device tree overlays are a good way to deal with user-modifyable boards or boards with some kind of an expansion mechanism where we can easily plug new board in (like the BBB or the raspberry pi). However, so far, the usual mechanism to deal with it was to have in Linux some driver detecting the expansion boards plugged in and then request these overlays using the firmware interface. That works in most cases, but in some cases, you might want to have the overlays applied before the userspace comes in. Either because the new board requires some kind of an early initialization, or because your root filesystem is accessed through that expansion board. The easiest solution in such a case is to simply have the component before Linux applying that overlay, removing all these drawbacks. Reviewed-by: Stefan Agner <stefan@agner.ch> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
This commit is contained in:
@ -142,10 +142,10 @@ static int overlay_update_local_node_references(void *fdto,
|
||||
adj_val += delta;
|
||||
adj_val = cpu_to_fdt32(adj_val);
|
||||
|
||||
ret = fdt_setprop_inplace_namelen_by_index(fdto, tree_node,
|
||||
name, strlen(name),
|
||||
index, &adj_val,
|
||||
sizeof(adj_val));
|
||||
ret = fdt_setprop_inplace_namelen_partial(fdto, tree_node,
|
||||
name, strlen(name),
|
||||
index, &adj_val,
|
||||
sizeof(adj_val));
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
@ -220,9 +220,9 @@ static int overlay_fixup_one_phandle(void *fdt, void *fdto,
|
||||
return fixup_off;
|
||||
|
||||
phandle = cpu_to_fdt32(phandle);
|
||||
return fdt_setprop_inplace_namelen_by_index(fdto, fixup_off,
|
||||
name, name_len, index,
|
||||
&phandle, sizeof(phandle));
|
||||
return fdt_setprop_inplace_namelen_partial(fdto, fixup_off,
|
||||
name, name_len, index,
|
||||
&phandle, sizeof(phandle));
|
||||
};
|
||||
|
||||
static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
|
||||
|
Reference in New Issue
Block a user