xxx ---------------------------------
ARC: [SMP] cpumask not needed in IPI send path

The current IPI sending callstack needlessly involves cpumask.

   arch_send_call_function_single_ipi(cpu) / smp_send_reschedule(cpu)
      ipi_send_msg(cpumask_of(cpu))
         plat_smp_ops.ipi_send(callmap)
            for_each_cpu(callmap)
               do_plat_specific_IPI_PER_CPU_IN_MASK

Given that current backends are not capable of 1:N IPIs, lets simplify
the interface for now, by keeping A cpu all along.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] IPI ACK interface doesn't need "self" cpu-id

The interface is confusing, it feels like we are getting "sender" info,
whereas it is the "receiver", which can very well be retrived by
smp_processor_id(), if need be.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] cpu halt interface doesn't need "self" cpu-id

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] simplify IPI code

* ipi_data is just a word, no need to keep it as struct

* find_next_bit() not needed to loop thru a 32bit word, ffs suffices

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] optimize IPI send and receive

* Don't send an IPI if receiver already has a pending IPI.
  Atomically piggyback the new msg with pending msg.

* IPI receiver looping on xchg() not required

References: https://lkml.org/lkml/2013/11/25/232
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [cmdline] uboot cmdline handling rework

* Moved cmdline copy from asm to "C" - allows for more robust checking
  of pointer validity etc.

* Remove the Kconfig option to do so, base it on a runtime value passed
  by u-boot

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [cmdline] support External Device Trees from u-boot

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [clockevent] can't be SoC specific

So no point keeping it weak

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [clockevent] simplify timer ISR

* Remove one liner IRQ ACK accessor, it was coming in the way of readability.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] General Fixes

-Pass the expected arg to non-boot park'ing routine
 (It worked so far because existing SMP backends don't use the arg)

-CONFIG_DEBUG_PREEMPT warning
ARC: [SMP] ISS SMP extension cleanups

* Don't use legacy ISS SMP extension by default
* Move relate code out of common SMP code

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: make start_thread() out-of-line

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [arcfpga] Get rid of legacy BVCI latency unit support

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Move cache disabling to early boot

If Linux configured to not use caches, disable them in early boot

Requested-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: optimize kernel bss clearing in early boot code

using ARC ZOL which reduces tot num of instructions by half

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] handle IPI like TIMER0

Use same irq-generic methods in both cases
Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [SMP] Enable icache coherency

__sync_icache_dcache() quirks:

* __sync_icache_dcache() -> __ic_line_inv_vaddr() now involves
  cross-core callscross cross calls to other cores, hence intr can't
  disabled in it.

| WARNING: CPU: 0 PID: 1 at kernel/smp.c:374
| smp_call_function_many+0x25a/0x2c4()
|
|  init_kprobes+0x90/0xc8
|     register_kprobe+0x1d6/0x510
|	__sync_icache_dcache+0x28/0x80
|
|	    DISABLE IRQ
|
|	    __ic_line_inv_vaddr
|		on_each_cpu
|		     smp_call_function_many+0x25a/0x2c4   --> WARN
|			__ic_line_inv_vaddr_local
|	    __dc_line_op

* dcache line flush now done earlier

* TODO: Needs to use mask of relevant CPUs to avoid broadcasting

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: switch to percpu IRQ requests

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: prevent booting if cache support enabled for non-existent caches

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>