cma: Change to reserve-contiguous-region

Currently, devices are associated with CMA regions via phandle to the
CMA region. The phandle name 'linux,contiguous-region' is the same as
that which is used to designate a CMA region. This can lead to issues
of trying to treat a device only using a CMA region as an actual CMA
region. Rather than continuing to rely on this handle and the depth
to differentiate CMA regions, just create separate DT binding
linux,reserve-contiguous-region to indicate that the node is
an actual CMA node for reserving rather than a client referencing
via phandle.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/boot/dts/msm8974.dtsi
ARM: dts: msm: Move audio heaps over to use reserved CMA
 regions

Carveout regions are being deprecated. Convert the audio heaps over
to use a reserved CMA region instead of a carveout. At a later time,
the audio regions may be converted over to a fully functional CMA region.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[neo: Use increased ion heap size for better 5.1 AAC playback]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/boot/dts/msm8974-ion.dtsi
ARM: dts: msm: Migrate 8x74 memory regions to CMA adapt to LG.

CMA now fully supports removing regions from memory. Since CMA
is the preferred method for tracking these regions as well, migrate
all removed regions over to use CMA and CMA derivatives.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[neo: This patch is modified to skip external_image_mem
 region which I am really not sure where it is used.]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/boot/dts/msm8974-ion.dtsi
	arch/arm/boot/dts/msm8974.dtsi
cma: Delay non-placed memblocks until after all allocations

CMA is now responsible for almost all memory reservation/removal.
Some regions are at fixed locations, some are placed dynamically.
We need to place all fixed regions first before trying to place
dynamic regions to avoid overlap. Additionally, allow an
architectural callback after all removals/fixed location has
happened to potentially update any relevant limits.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Call dma_contiguous_early_fixup after allocation

Commit (cma: Delay non-placed memblocks until after all allocations)
delayed calling memblock_alloc until later but didn't move the
fixup. Make sure to call the fixup after allocation of the
memblock.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Add support for different size_cells and address_cells

Currently, the CMA flat device tree code does not take into account
targets that may specify size_cells and address_cells > 1. This will
lead to unsuccessful parsing. Add support for taking into account
nodes that may specify size_cells and address_cells explicitly.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
drivers: dma-contiguous: Don't redefine SZ_1M

Use the definition from linux/sizes.h instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Add support for status in DT nodes

CMA scans the flattened devicetree to reserve memory early. Check
for the status of a DT node to possibly skip initialization.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: use be32_to_cpup for devicetree conversion

The value returned by of_get_flat_dt_prop is a pointer. Use
be32_to_cpup which properly type checks against pointers.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cma: Cleanup code style

* Sync with msm-3.10

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>