mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-21 22:23:05 +00:00
kboot: Expose ADT in phram MTD reserved memory node
Requires CONFIG_MTD_PHRAM in Linux. Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
parent
d76dd3a16e
commit
1d5556ccf3
1 changed files with 19 additions and 0 deletions
19
src/kboot.c
19
src/kboot.c
|
@ -2265,6 +2265,23 @@ int kboot_set_chosen(const char *name, const char *value)
|
|||
return i;
|
||||
}
|
||||
|
||||
static int dt_setup_mtd_phram(void)
|
||||
{
|
||||
char node_name[64];
|
||||
snprintf(node_name, sizeof(node_name), "flash@%lx", (u64)adt);
|
||||
|
||||
int node = dt_get_or_add_reserved_mem(node_name, "phram", false, (u64)adt,
|
||||
ALIGN_UP(cur_boot_args.devtree_size, SZ_16K));
|
||||
|
||||
if (node > 0) {
|
||||
int ret = fdt_setprop_string(dt, node, "label", "adt");
|
||||
if (ret)
|
||||
bail("FDT: failed to setup ADT MTD phram label\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int kboot_prepare_dt(void *fdt)
|
||||
{
|
||||
if (dt) {
|
||||
|
@ -2290,6 +2307,8 @@ int kboot_prepare_dt(void *fdt)
|
|||
if (fdt_add_mem_rsv(dt, (u64)_base, ((u64)_end) - ((u64)_base)))
|
||||
bail("FDT: couldn't add reservation for m1n1\n");
|
||||
|
||||
dt_setup_mtd_phram();
|
||||
|
||||
if (dt_set_chosen())
|
||||
return -1;
|
||||
if (dt_set_serial_number())
|
||||
|
|
Loading…
Reference in a new issue