ARM: cti: fix manipulation of debug lock registers

The LOCKSTATUS register for memory-mapped coresight devices indicates
whether or not the device in question implements hardware locking. If
not, locking is not present (i.e. LSR.SLI == 0) and LAR is write-ignore,
so software doesn't actually need to check the status register at all.

This patch removes the broken LSR checks.

Cc: Ming Lei <ming.lei@canonical.com>
Reported-by: Mike Williams <michael.williams@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
ARM: CORESIGHT: Add generic lock/unlock helpers

The Cross Trigger Interface (CTI) helpers in cti.h include definitions
for the Coresight Lock Access Register (LAR) and Lock Status Register
(LSR). These registers are already defined in coresight.h and so rather
than having multiple definitions, just use the definitions from
coresight.h.

Add the following coresight macros ...
- coresight_locked() --> Indicates whether coresight module is locked
- coresight_unlock() --> Unlocks coresight module
- coresight_lock()   --> Locks coresight module

Use the above macros for ETB, ETM and CTI.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
ARM: dts: Add Cross Trigger Interface binding

Adds a device-tree binding for the ARM Cross Trigger Interface (CTI).
The ARM Cross Trigger Interface provides a way to route events between
processor modules. For example, on OMAP4430 we use the CTI module to
route PMU events to the GIC interrupt module.

The binding defines interrupts as optional as it could be possible that
the CTI outputs are not connected to any interrupt modules.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
ARM: CTI: Convert CTI helpers to AMBA bus driver

Convert the Cross Trigger Interface (CTI) helpers in cti.h into a
AMBA bus driver so that we can use device-tree to look-up the hardware
specific information such as base address and interrupt number during
the device probe. This also add APIs to request, cti_get() and release,
cti_put(), a CTI module so that drivers can allocate a module at
runtime.

Currently, the driver only supports looking-up the CTI hardware
information via device-tree, however, the driver could be extended to
support non-device-tree configurations if needed for a particular
architecture.

The CTI driver only currently supports CTI modules that have a single
CPU interrupt, however, could be extended in the future to support more
interrupts if a device requires this.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
ARM: dts: OMAP4: Add CTI nodes

Add device-tree nodes for the two Cross Trigger Interface (CTI) modules
in the OMAP4 devices.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
ARM: OMAP4: Add AMBA APB Clock

For OMAP4 devices, ARM AMBA peripherals such as program trace module
(PTM) or cross trigger interface (CTI) require that the DEBUG Sub-system
power and clock domain is turned on. Normally, the OMAP device and HMWOD
frameworks would be used to enable the power and clock domains, but
currently these frameworks only support platform devices and not AMBA
devices. Therefore, add a clock alias for the AMBA APB clock for OMAP4
devices to turn on the DEBUGSS power and clock domain.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>