Hi Oleksii,
> 
> diff --git a/xen/common/device-tree/domain-build.c 
> b/xen/common/device-tree/domain-build.c
> index 774790aab3..6708c9dd66 100644
> --- a/xen/common/device-tree/domain-build.c
> +++ b/xen/common/device-tree/domain-build.c
> @@ -8,6 +8,7 @@
> #include <xen/mm.h>
> #include <xen/sched.h>
> #include <xen/sizes.h>
> +#include <xen/static-shmem.h>
> #include <xen/types.h>
> #include <xen/vmap.h>
> 
> @@ -451,6 +452,80 @@ int __init make_chosen_node(const struct kernel_info 
> *kinfo)
>    return res;
> }
> 
> +int __init make_memory_node(const struct kernel_info *kinfo, int addrcells,
> +                            int sizecells, const struct membanks *mem)
> +{
> +    void *fdt = kinfo->fdt;
> +    unsigned int i;
> +    int res, reg_size = addrcells + sizecells;
> +    int nr_cells = 0;
> +    __be32 reg[DT_MEM_NODE_REG_RANGE_SIZE];
> +    __be32 *cells;
> +
> +    if ( mem->nr_banks == 0 )
> +        return -ENOENT;
> +
> +    /* find the first memory range that is reserved for device (or firmware) 
> */
> +    for ( i = 0; i < mem->nr_banks &&
> +                 (mem->bank[i].type != MEMBANK_DEFAULT); i++ )
> +        ;

NIT: maybe we can fix the code style here, maintainers can give their opinion.

Changes looks good to me, I’ve also tested running on arm64 and arm32 FVP:

Reviewed-by: Luca Fancellu <[email protected]>
Tested-by: Luca Fancellu <[email protected]>

Cheers,
Luca


Reply via email to