diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-06-28 22:13:32 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-06-28 22:13:32 +0800 |
commit | 084eedbddaa526f53b20291ee7176be269620301 (patch) | |
tree | ffcc23dd6b939e1db3d7feb1bf561073165af6be /drivers | |
parent | 3e71247d343d3d9e4ff996255ac58b73dcf1ce27 (diff) | |
parent | 64e72fbc97b29298f7aa89c30fb221e1a9d02fed (diff) |
Merge branch 'lsk/kdump/for-v4.9' into linux-linaro-lsk-v4.9
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/efi/libstub/fdt.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c index 260c4b4b492e..82973b86efe4 100644 --- a/drivers/firmware/efi/libstub/fdt.c +++ b/drivers/firmware/efi/libstub/fdt.c @@ -16,6 +16,22 @@ #include "efistub.h" +#define EFI_DT_ADDR_CELLS_DEFAULT 2 +#define EFI_DT_SIZE_CELLS_DEFAULT 2 + +static void fdt_update_cell_size(efi_system_table_t *sys_table, void *fdt) +{ + int offset; + + offset = fdt_path_offset(fdt, "/"); + /* Set the #address-cells and #size-cells values for an empty tree */ + + fdt_setprop_u32(fdt, offset, "#address-cells", + EFI_DT_ADDR_CELLS_DEFAULT); + + fdt_setprop_u32(fdt, offset, "#size-cells", EFI_DT_SIZE_CELLS_DEFAULT); +} + static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long orig_fdt_size, void *fdt, int new_fdt_size, char *cmdline_ptr, @@ -42,10 +58,18 @@ static efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, } } - if (orig_fdt) + if (orig_fdt) { status = fdt_open_into(orig_fdt, fdt, new_fdt_size); - else + } else { status = fdt_create_empty_tree(fdt, new_fdt_size); + if (status == 0) { + /* + * Any failure from the following function is non + * critical + */ + fdt_update_cell_size(sys_table, fdt); + } + } if (status != 0) goto fdt_set_fail; |