lmb: Add support of flags for no-map properties
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 7 May 2021 12:50:29 +0000 (14:50 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 7 Jun 2021 14:48:40 +0000 (10:48 -0400)
commit59c0ea5df33fc4d9b62226d29e3b5c61d639303f
tree0e9a9f4f5036d537fa01ee598f49045ad50661ab
parente3b64beda5dd1a6b6bedfd1fe0e50be1ddea7044
lmb: Add support of flags for no-map properties

Add "flags" in lmb_property to save the "no-map" property of
reserved region and a new function lmb_reserve_flags() to check
this flag.

The default allocation use flags = LMB_NONE.

The adjacent reserved memory region are merged only when they have
the same flags value.

This patch is partially based on flags support done in Linux kernel
mm/memblock .c (previously lmb.c); it is why LMB_NOMAP = 0x4, it is
aligned with MEMBLOCK_NOMAP value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
include/lmb.h
lib/lmb.c