msm: kgsl: split mh and mmu initialization

The MH block should be initialized even if the gpu mmu
is not enabled so that AXI error interrupts will still
be generated.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: add adreno225 support

The adreno220 specific registers and setting are all used
on adreno225.  Also there is a a225 specific setting setting
for REG_SQ_FLOW_CONTROl at startup to enable the larger
instruction store found on this gpu.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: shaders must be repartitioned during gmem save/restore

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Rearrange some drawctxt functions

Move some of the drawctxt functions that are common
to A2XX and A3XX back to the generic drawctxt code
and headers.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Use process specific pt_base in postmortem dump

When doing a look-up of the IB1 base address, use the pagetable
belonging to the respective process rather than the pagetable
belonging to the process in whose context the GPU hung.

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Rename PM4 to CP to better align with A3XX code

The A3XX code likes to use CP_ as a prefix for ringbuffer
commands rather then the legacy PM4 prefix.  Since it is more
correct, switch the A2XX code over now to make it easier to
integrate A3XX into the mix.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Fix build errors when CONFIG_MSM_KGSL_CFF_DUMP is on

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: add MEMORY_BASE and HANG packets

These are changes to the cffdump output format.
MEMORY_BASE reports the address range we're using at the start
of the dump, which helps the postprocessors validate memory
writes.

HANG is emitted at the start of kgsl_postmortem_dump(), and can
be used by the postprocessors to stop when the hang occurs.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: clean up adreno220 registers

There's not enough of these to justify a separate header.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Various cleanups

Remove some uneeded code and tighten things up in
anticipation of the A3XX device.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: switch sprintf calls to snprintf

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Consolidate and cleanup A2XX irq handlers

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Record missing memory writes to the cff dump

The buffers memstore and dummyspace were being memset
before memory for them was allocated and mapped.
kgsl_cff_parse_ibs should record the write instead
of returning upon encoutering a hostaddr with no
physical addr.
Writes to GMEM were not being recorded. Adding
the mem syncs for that

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: kgsl: Introduce Iommu Code

kgsl now supports the use of 2 types of MMU. One is
the GPU's internal MMU and the other is IOMMU. Both
MMU cannot be active at the same time. The MMU type
can be selected at compile time via config option.
A boot command line parameter can be used to override
the type of MMU selected at compile time.

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
drivers: iommu: Add flags to iommu_domain_alloc

Add the ability to pass flags into the iommu_domain_alloc
function to specify domain attributes.

Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>
msm: iommu: Add an empty stub for function msm_iommu_get_ctx

When IOMMU feature is turned off an empty stub for function
msm_iommu_get_ctx is required so that other modules using
this function may compile.

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Ronny Schmatzler <schmatzler@googlemail.com>