[CORE] vmm_devtree: Improve nodeid table APIs

This patch assigns shorter names to nodeid table APIs and adds
two new APIs (namely create_matches() and destroy_matches()).

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] First-cut implementation of common clocking framework

This patch implements linux-like device tree based clocking framework
to ease porting of clocking code of various SOCs.

Signed-off-by: Anup Patel <anup@brainfault.org>
[EMULATORS] net: Fix smc91c111_emulator_read()

The statement "*(u32 *)dst = 0x0;" in smc91c111_emulator_read() is
a bug because it will corrupt memory when dst_len = 1 or 2 hence
this patch fixes this bug.

Reported-by: Po-wen Cheng <sting.cheng@gmail.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Introduce low-level processor specific initialization

For arm32ve port (just like arm32 port), we need low-level processor
specific initialization routine which run on all cores of SMP host
and where we can implement processor specific quirks/work-arounds.

As per above, this patch adds cpu_proc.S for arm32ve which defines
proc_setup() routine for processor specific initialization.

This patch also fixes SMP initialization for Cortex-A15. On Cortex-A15
based SMP host we need to set ACTLR.SMP bit at boot time on all cores.
This will enable a Cortex-A15 core to receive instruction cache, BTB,
and TLB maintenance operations from other Cortex-A15 cores.
(Please refer page 125 of DDI0438C_cortex_a15_r2p0_trm.pdf)

Cc: Po-wen Cheng <sting.cheng@gmail.com>
Reported-by: Po-wen Cheng <sting.cheng@gmail.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Remove reference of Cortex-A15 from cpu_proc_v7.S

The arm32/cpu_proc_v7.S is only for ARMv7 processors without
virtualization extensions hence this patch removes reference of
Cortex-A15 from it.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Update vmm_limits.h with max values of integer types

Integer data types (i.e. short, int, unsigned int, unsigned long, ...)
are widely used everywhere in our code. Its good to know the max limits
of this integer data types hence this patch.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Add few more useful macros to vmm_macros.h

This patch adds ptr_align(), is_aligned(), and repeat_byte() macros
to vmm_macros.h

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] mathlib: Add rounded up division macros

This patch adds DIV_ROUND_UP() and DIV_ROUND_UP_ULL() marcos for
integer division with round-up of final result.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] Improve linux/kernel.h compatiblity header

We recently enhanced vmm_limits.h, vmm_macros.h, and libs/mathlib.h
to have more linux-like macros and defines hence improve linux/kernel.h.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Add standard clock implementations

This patch adds linux-like standard clocks such as gated, muxed,
divider, composite, fixed factor, and fixed rate for the common
device tree based clocking framework.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Clock drivers for ARM reference boards

This patch adds adapted version of clocking driver for ARM Ltd
reference boards (such as realview, integrator, vexpress, etc.)

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Add clocking driver for BCM2835 SOC

This patch adds BCM2835 SOC clocking driver (i.e. clocking
driver for Raspberry Pi).

Signed-off-by: Anup Patel <anup@brainfault.org>
[LIBS] Enrich bitops.h with additional APIs

This patch add rol64(), ror64() and for loop helper macros.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Add round_down() and round_up() helper macros

This patch add useful integer round_down() and round_up()
macros to vmm_macros.h

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Make data member of struct vmm_devtree_nodeid as const

The struct vmm_devtree_nodeid is Xvisor version of struct of_device_id
hence for portability reasons we make data member of this structure
as const just like struct of_device_id.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] Fix compile warning in common defterm implementation.

Recent changes in struct vmm_devtree_nodeid caused compile warning
in ARM common defterm implementation.

This patch fixes this warning.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Add Allwinner SunXi SOC clocking driver

This patch adds common clocking driver for Allwinner Sun4i, Sun5i,
Sun6i, and Sun7i SOCs.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] clk: Reduce duplicay in License headers

Most of the clocking driver and clocking framework code is
adapted from Linux source. We had tried to preserve original
license header is most of the adapted source files but this
resulted in duplicate GPL licenses in same source file hence
this patch fixes such source files.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Add VMM_EFAULT error code

The VMM_EFAULT had been missing in our error codes since long time.
This patch adds it.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] vmm_devtree: Improve nodeid table implementation

The current nodeid table implementation did not provide any mechanism
to distinguish nodeid table enteries.

In future, we might have multiple subsystems and frameworks using
nodeid table APIs. These subsystems and frameworks will be mostly
interested in nodeid table enteries belonging to themselves.

This patch adds support for distinguishing nodeid table enteries by
introducing subsystem name member in struct vmm_devtree_nidtbl_entry
and improving existing nodeid table APIs accordingly.

Signed-off-by: Anup Patel <anup@brainfault.org>