iommu: msm: Add standalone support for secure SMMU

Add a configuration option that allows for testing of systems without
a secure environment. When turning on this option all the IOMMUs will
be programmed by the kernel regardless of whether the IOMMU is secure
or not. This allows for early testing during bringup.

Change-Id: I34fde3ba74a69a1d3fb3e5efba3e02cbcc9272d4
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
iommu: msm: Add cache maintenance for calls into TZ

The scm_call API is no longer providing implicit cache maintenance for
shared buffers. Add cache flushing for buffers heading towards TZ and
cache invalidation for buffers coming from TZ.

Change-Id: I21a60f912bf73daeaa9ade99c3af755db9665e25
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
iommu: msm: don't rely on structure format coming from TZ

The format of the secure fault register dump structure in TZ could
change over time. However, it should always adhere to the following
format (each row is 4 bytes wide):

    |-----------|
    | dump_size |
    | reg1_addr |
    | reg1_val  |
    | ...       |
    | regn_addr |
    | regn_val  |
    |-----------|

Rather than relying on the format of the structure, iterate over
the (addr, value) pairs.

Change-Id: I811c7781d6db11ef1eb07c0c1608b8db6978a758
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
iommu: msm: Only flush the exact list size

Before giving a list of memory chunks to trustzone, the list needs
to be flushed. The list is simply an array of physical addresses.
The current flush routine takes into account the size of the memory
chunk which is incorrect. The memory chunk size is not used in
calculating the list length since the list is a list of pointers.
Adjust the cache flushing routine to flush the actual size of the
list: size of each entry times the number of entries.

Change-Id: I3fbc7cb7e6c823823481b5fb205a1414e76150c9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
iommu: msm: Refactor printing of page fault

Refactor the code that reads the registers during an IOMMU
page fault to make the code more maintainable and make it
easier to add support for new registers.

Change-Id: I6437754ee372a03344b307554e1e3a51dc810ddb
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>