staging: ion: msm: Only parse available dt nodes

ION is currently ignoring the status property of device tree
heap nodes. Make ION aware of the status of the ION heap nodes making
it possible to disable certain heaps.

Change-Id: I96e6af97df6bbd1c24ace9aa476baae28409ea96
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ion: secure_buffer: fix iteration of sg_table

We're currently re-using the `i' loop counter to iterate over the chunk
list within our iteration of the secure sg_table. This causes the
iteration of the sg_table to get all messed up and results in crashes
when we walk off the end of the list. Fix it.

Change-Id: I09c84015f8c3cbcb2cea60886241457bb829003c
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ion: cma_secure_heap: validate buffer length

The secure CMA heap only supports buffers lengths that are multiples of
1MB. Currently, we simply crash if a bad length is requested. Rather
than crashing, log an error and return a failure.

Change-Id: I0387ee9f2900e44c817d3a7497e9b0528dd8c33b
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
ion: fix remaining instances of sg_dma_len

Recently, [ec6c8a8f443: "ion: convert sg_dma_len(sg) to sg->length"]
moved Ion away from using sg_dma_len. However, a few instances were left
over from MSM-specific code. Fix these instances so that we're using
sg->length everywhere.

Change-Id: I76b07f5589ba3867e1584b129a0ccd9f3ef00ad7
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: Dan Trifan <jimsth@gmail.com>