ARC: [plat-arcfpga]: BVCI latency unit programming thru Kconfig

-Added the units/latency programming as config options
-Done in "early" "platform" bootup (vs. "late" in "ARC-common" which was
 wrong on both fronts)

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Kconfig: Split 700 core config into 750/770

(1) Now the features are correctly tied to core version and release

-ARC 700 <= Rel 4.9  (Only 750D core available)
-ARC 700 >= Rel 4.10 (Introduced 770 core)
 =New Features exclusive to 770: MMU v3, LLOCK/SCOND insns
 =New Features common to 750/770: SWAPE and RTSC insns

(2) Default set
-core set to 770
-cache line set to 64

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Default cache line set to 64 (reflects in tlbex.S/fpga_defconfig)

Prev commit set line to 64 in Kconfig. However if cache not enabled, the
default (asm/cache.h) was still 32

Updated tlbex.S to use L1_CACHE_SHIFT

some other minor fixes/cleanups

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Makefile auditing (obj-y :=, +=, =)

Flagged by Noam Camus <noamc@ezchip.com>

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Plat/SoC/Board Framework #7: Kconfig based on plaform (vs. SoC)

There was a subtle issue with current plat Kconfig organization if a SoC
happens to be shared across platforms (Is that possible, yes in a weird
scenario)

The existing organization started with an SoC at a top,
CONFIG_ARC_SOC_xxx, defined in arch/arc/Kconfig, with platform Kconfig,
select ing them thus linking the two. This seemed ok since it keeps all
SoC items together - for menuconfig purposes and also potentially allows
multiple platforms to select the same SoC.

This worked so far unless I ran into a real situation of multiple
platforms based on same SoC.

The "legacy" ARC FPGA platforms (AA4/ML509) don't have a real SoC,
however to fit them in framework, we'd defined CONFIG_ARC_SOC_GENERIC.
So far so good. Synopsys has a bigger FPGA board, called HAPS which will
also support ARC Linux. The IP there (e.g. UART) is completely different
than that on "legacy" FPGA platforms, so it genuinely qualifies to be
a seperate plat-xxx. However being an FPGA, it will have to select
the existing CONFIG_ARC_SOC_GENERIC. The problem now is, that how do we
allow exclusive menu choice between AA4/ML509 and HAPS since both sets
are in different Kconfig files.

So we base things on platforms, and all CONFIG_ARC_PLAT_xxx entries are
unique and show up in arch/arc/Kconfig. They form the root option for
platform Kconfig, allowing it to do crazy things as needed.
The platform can internally define CONFIG_ARC_SOC_xxx to select the different
core configurations (CPU/MMU-ver/Cache-line/extensions/errata), but
arch/arc/Kconfig doesn't care.

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

Bulk of ARC Interrupt handling (registration/processing) replaced with
generic infrastructure. All we have now is low level machine handling and
a thin wrapper do_arch_IRQ to call generic handler.

The ARC IRQ routines (setup|enable|disable)_irq which needed to "nest"
corresponding platform routines (for any quirks) are now gone and thus
the platform API required by ARC is greatly simplified.

The only API platform code needs to implement is plat_init_IRQ to
register it's own "sturct irq_chip" depending on the model of Interrupt
Controller. If there's no off-chip controller, it needs to register a
simplistic one for the on-chip Timer IRQ of ARC700.

Note that this change only fixes the ARC platform agnostic part -
platform(s) to be converted next.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga] converted to accomodate CONFIG_GENERIC_IRQ

-struct irq_chip defined in platform code
-uart driver was incorrectly setting pulse triggering

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: DMA Mapping API caller Identification cleanups

The current DMA Mapping core, has a mechanism to identify the API
caller (for things like identifying unaligned mappings).
The mechanism is currently "disabled" but despite being so, it still
spews out debug garbage.

This commit fixes both the aspects.

Reported by Christian Ruppert <christian.ruppert@abilis.com>

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Using the right kernel APIs

get_task_comm() vs. directly accessing tsk->comm

in_atomic() vs. in_interrupt() in do_page_fault()

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Using generic multiply/shift helpers in timer subsystem

clocksource_register_hz() and clockevents_calc_mult_shift()

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

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Unused syscalls: old_(mmap|select), sig(return|suspend|sigaction)

-The OS ABI is still compatible since uClibc was not using them anyways

-Verified #1 by grepping in objdump of libuClibc-0.9.30.3.so for nuked
 syscall IDs:
 	"mov        r8,\<\(67\|72\|82\|90\|119\)\>"
 Only 119 (sys_sigreturn) found. Although the reference is only used
 if !__NR_rt_sigreturn, the defintion is not conditional. So it is
 needlessly linked in right now (not useD)

-Verfied #2 by running the updated kernel with stock uClibc (so any
 reliance on now unimpleted syscalls would have been visible)

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: micro-optim: using spinlock free ver of ext2 atomic ops

This is tracking upstream commit
--------------------->8--------------------------------
commit 148817ba092f9f6edd35bad3c6c6b8e8f90fe2ed
Author: Akinobu Mita <akinobu.mita@gmail.com>
Date:   Tue Jul 26 16:09:04 2011 -0700

    asm-generic: add another generic ext2 atomic bitops

    The majority of architectures implement ext2 atomic bitops as
    test_and_{set,clear}_bit() without spinlock.
--------------------->8--------------------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: micro-optim uaccess #1a: unaligned case handled inline

-move the logic os slowpath_copy(to|from)_user into uaccess.h itself
-delete the out-of-line calls

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: micro-optim uaccess #1b: inline asm constraints adjustment

-The constraints for @to and @from need to be adjusted since we are no
 longer in a standalone function
-gcc 4.4.7 is stricter about memory clobber

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: cleanup: ARC slow string rotuines no longer needed

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