drivers: of: of_reserved_mem: fixup the alignment with CMA setup
drivers: of: of_reserved_mem: fixup the alignment with CMA setup

There is an alignment mismatch issue between the of_reserved_mem and
the CMA setup requirement. The of_reserved_mem will try to get the
alignment value from the DTS and pass it to __memblock_alloc_base to
do the memory block base allocation, but the alignment value specified
in the DTS may not satisfy the CAM setup requirement since CMA setup
required the alignment as the following in the code:

align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);

The sanity check in the function of rmem_cma_setup will fail if the
alignment does not setup correctly and thus CMA will fail to setup.

This patch is to fixup the alignment to meet the CMA setup required.

Mailing-list-thread: https://lkml.org/lkml/2015/11/9/138
Signed-off-by: Jason Liu <ae261831a533d622d82a4034a6bd07f8558fae3c@freescale.com>
Acked-by: Marek Szyprowski <2a0259761cc3e88db42be5300c1579a67c77e65e@samsung.com>
Cc: Grant Likely <9069e6f5a2b566e2674a0ba1e2bf39c12c195fad@linaro.org>
Cc: Rob Herring <988782c95b9025801edfc9a5b1fd5a8e93699e07@kernel.org>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Rob Herring <fbb37eacae100e13076d5c4b46f06cfa4d6fa9f8@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs