msm: ocmem: Add macro and region size information to ocmem region

Some targets support half sized macros in the last region. Previously,
for these regions, only half the macros were turned on, and the clients
could not access memory. Read the hardware register to check if the
target supports half sized macros and update the calculation to switch
memory power states.

Change-Id: Idb6e6b8c11b42d3e0a72fa27bd8c63e48282af97
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: ocmem: Do not return error when debugfs is disabled

The ocmem driver probe fails, when debugfs is disabled,
as it cannot create a debugfs root node. Do not return
and error, so that ocmem driver can function even when
debugfs is disabled

CRs-Fixed: 548301
Change-Id: I9dca715e9317d481b0dee1c7275c86a10e3cdce1
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: ocmem: Do not use data mover for clearing ocmem memory

In the non secure environment the data mover is used to clear
the ocmem memory. The ocmem driver no longer uses the data
mover for this operation.

Change-Id: I2dc4f421b1a1a81d3205bd57fe66092512e287aa
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: ocmem: Serialize allocation requests only when necessary

Certain clients of ocmem always have exclusive regions set aside in
the OCMEM memory map. Allocation requests for such clients do not
have to wait for any pending evictions in progress to be completed
nor will trigger any new evictions and can be safely scheduled right
away.

CRs-Fixed: 599002
Change-Id: I54369bca9d26378a9aa70db83d35ab94866a3ff1
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: ocmem: Call restore_sec_config() after every power collapse

As the QRIB is enabled, after every power collapse of ocmem, the
QRIB is reset to the maximum security state. Due to this the apps
processor cannot access the ocmem register space.

The restore_sec_config() scm call needs to be called before any
register is accessed after a power collapse to ensure that the
security configuration is restored. The clocks need to be turned
on before every call that is made into TZ to ensure that there
is no power collapse.

CRs-Fixed: 651324, 660089
Change-Id: Ieb6b635142057e219de29e811c93749f6500cec5
Signed-off-by: Neeti Desai <neetid@codeaurora.org>