ARC: updated printks/comments

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: refactor: renamed internal routines in stacktracing

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Warnings when Cache configs disabled

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Build breakage in serial driver with CONFIG_CONSOLE_POLL

-STAR 9000553036

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
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: [plat-arcfpga] Decoupling console/uart driver from ARCH code

-No need to include plat/{irq|memmap}.h, uses platform_get_resource()
 with a corresponding platform_add_devices() in ARCH plat code.

-platform clk / baud also retrieved as platform data (vs. #defs)

-Uses the early_platform_xxx framework to register/probe early serial
 console as well.

-Now ready to be moved into drivers/tty/serial

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga] Supporting 2 UARTS

Also tested if console=ttyS1

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

On ARC700, top 256MB of address space (0xC000_0000 to 0xFFFF_FFFF) is
inherently uncached. Thus any ioremap_nocache() requests in that range
can simply return back the addr w/o need for any MMU mappings, reducing
pressure on TLB.

Also, the vanilla ioremap() now defaults to uncached semantics - this is
to workaround the braindead drivers which don't call the correct API.

The hooks for doing cached access are left in vanilla ioremap(), just in
case, but for now are effectively dead.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga] UART driver using ioremap_nocache()

Makes the driver even more "portable".

Although for ARC, it is effectively a NOP since ioremap_nocache() will
not generate V-P mappings as the UART memory mapped registers are in
addr range 0xC0FC_0000 which is inherently uncached.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga] UART driver cosmetics: checkpatch/Kconfig styling

A version similar to this (after adjustments for movement into
drivers/tty/serial) was sent to ThomasG for review

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: [plat-arcfpga] UART driver using readb/writeb for I/O

This alleviates the need for "volatile" in driver which was one of the
checkpatch warnings

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