ARC: [Review/timers] Renames and other cosmetics

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [Review/timers] Revert back to jiffies based sched_clock()

Per tglx, the current getrawmonotic() based sched_clock() can livelock
if called from inside a write seqlocked section (e.g. tracer).

We need true 64bit monotonically increasing semantics which the 32bit
ARC timers (TIMER0/1) can't gaurantee - w/o a clone implementation of
clocksources code in ARCH code (to avoid locking)

Hence falling back to orig jiffie based implementation which despite
NOT being very granular - gaurantees above semantics.
This is already provided by generic code, so no need for arch variant.

This will improve once we have support for the newer 64bit RTSC insn.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Move timer high priority setting into common code

* No need to duplicate it in every arch
* If high priority interrupts enabled, timer HAS to be high priority.
* Makign serial high prioity doesn't make sense at all

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Move on-chip intc setting into common code

This reduces duplication in platforms which don't have external intc

Even if they have intc, not all IRQs are cascaded, so the internal ones
are taken care of by common ARC code

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: RTSC insn for true 64bit clocksource

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: RTSC insn for sched_clock()

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [Review] Use right APIs in cpu_idle()

Tracks
* 1268fbc746 "nohz: Remove tick_nohz_idle_enter_norcu()" and
* bd2f55361f "sched/rt: Use schedule_preempt_disabled()"

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Revert to using setup_irq() for TIMER0 Interrupt

In the good old days we had setup_irq(TIMER0)

With SMP, since the local timer setup was called by each CPU, the static
irqaction was not usable - so we resorted to using request_irq() - which
considered multiple calls for same device (from multiple cpus) as
multiple registrations from same cpu (IRQF_SHARED semantics) and failed
in absence thereof.

So the right APIs for job were request_percpu_irq()/enable_percpu_irq()
but these required an apriori irq_set_percpu_devid() to ensure that the
devid passed to these APIs was indeed percpu. This in turn had a
side-effect of setting IRQ_NOAUTOEN which had to be explicitly cleared.

This patch tries to remove all of the fixups since SMP.

We go back to calling setup_irq(), although this time, only on boot-cpu
and also make sure TIMER0 IRQ is explicitly unmasked per CPU.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [DeviceTree] Basic support

This is minimal infrastructure needed for devicetree work.
It uses an a sample "skeleton" devicetree - embedded in kernel image -
to print the board, manufacturer by parsing the top-level "compatible"
string.

As of now we don't need any additional "board" specific "machine_desc".

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Preparing to eliminate CONFIG_ARC_PLAT_SDRAM_SIZE

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [DeviceTree] mem size now runtime configured

Gets rid of CONFIG_ARC_PLAT_SDRAM_SIZE

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Preparing to eliminate CONFIG_ARC_PLAT_CLK

Abstracting references to core CPU clk to enable it runtime configurable

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
XXX: ide/emac to not use CONFIG_ARC_PLAT_CLK

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [DeviceTree] core cpu clk now runtime configured

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [DeviceTree] Allow dts to be user-defined

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [DeviceTree] unflatten blob for DT core

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga]: DeviceTree for Angel4 board

* DT contains the in-core intc and creation of corresponding irq-domain
  which is needed for interrupt requests by a DT probed device (e.g.
  arc-uart)
* This tree is still dormant, as we need the changes in arc-uart driver
  before populating it's nodes via DT

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
serial/arc-uart: Don't index with -ve platform_device->id

probe routine could index into port[] with -ve index. The check in
arc_uart_init_one() was too late.

This came to light when trying to port driver to CONFIG_OF, where
bydefault of-core code sets -ve platform dev id and in absence of
DT serial aliases, driver would use the -ve index.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
serial/arc-uart: split probe from probe_earlyprintk

This is in preparation for devicetree based probing, where earlyprintk
won't have access to DT serial aliases which the normal probe would
absolutely rely on.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
serial/arc-uart: platform_data order changed

* is_emulated is now 1st element, rather than last
* also tucked all platform data refs together

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