irqchip: crossbar: dont use '0' to mark reserved interrupts

Today '0' is actually reserved, but may not be the same in the future.

So, use a flag to mark the GIC interrupts that are reserved.

Signed-off-by: Nishanth Menon <nm@ti.com>
irqchip: crossbar: introduce option for a 'irqs-safe-map'

Since crossbar is s/w configurable, the initial settings of the
crossbar cannot be assumed to be sane. This implies that:
a) On initialization all un-reserved crossbars must be initialized to
   a known 'safe' value.
b) When unmapping the interrupt, the safe value must be written to
   ensure that the crossbar mapping matches with interrupt controller
   usage.

So provide a ti,irqs-safe-map property to map such an safe value if
'0' is not safe(reserved) for the platform and use it during init and
unmap.

Signed-off-by: Nishanth Menon <nm@ti.com>
irqchip: crossbar: check for premapped crossbar before allocating

If request_irq is executed twice, the same crossbar is mapped to two
different GIC interrupts. This is completely undesirable. Instead, check
if the requested crossbar event is pre-allocated and provide that GIC
mapping back to caller if already allocated.

Signed-off-by: Nishanth Menon <nm@ti.com>
irqchip: crossbar: create havoc by reversing search for free irqs

Reverse the search algorithm to ensure that address mapping and IRQ
allocation logics are proper. This opens up a whole new world of bugs
that is easily fixable rather than wait till allocation logic approaches
the limit to find new bugs.

Signed-off-by: Nishanth Menon <nm@ti.com>