[DRIVERS] Differentiate between memmaped & I/O Mapped device

Check the address_type field in DTS to differentiate between
memory mapped and IO mapped device. Then call the devtree
functions accordingly.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[x86] Add address type for 8250 type UART

Mark address type as IO.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
[DRIVERS] net: ethernet: Minor MAC address fixes in allwinner sun4i-emac

This patch adds Functions -
 eth_hw_addr_random() to generate random MAC addresses.
 print_mac_address_fmt() to print buffer in MAC format.

Fixes sun4i-emac.c to use above mentioned functions.
Also adds net_device name setting in sun4i-emac.c,
which was not getting set earlier resulting in garbage name display in
net ports command.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] include: linux: Add MISC linux-like API's

This patch adds:

In core/include/vmm_macros.h
  - Add linux-lke macro uninitialized_var(x)

In drivers/include/linux/of.h
 - Add linux-like of_phandle_xxx functionality.

In drivers/include/linux/of_address.h
 - Add of_iomap() function.

In drivers/include/linux/slab.h
 - Add placeholder macro for linux-like kmalloc_track_caller()

In drivers/include/linux/string.h
 - Add linux-like kstrdup(), kstrndup(), kmemdup() functions.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] include: linux: Add linux-like ioreadxx and iowritexx functionality.

This patch adds linux-like iowritexx and ioreadxx functions.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] include: linux: Add placeholder macro for mutex_destroy()

Add placeholder for linux-like mutex_destroy().

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] include: linux: Add placeholder for linux compiler.h and debugfs.h

This patch adds placeholder headers for linux/compiler.h and linux/debugfs.h

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[LIBS] Adding Radix Tree Implementation.

This patch adds Radix Tree Implementation ported from Linux.

Main differences from linux Radix-Tree Implementation are:
 a. This version of radix-tree does not support linux feature of
    tag in radix tree node. (Can be added/implemented later)
 b. Does not have linux feature of gfp_mask information.
 c. No RCU locks used, instead of that reader-writer locks are used.

This is still an experimental version and will be improved as we use and
test it more in future.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[LIBS] netstack: lwip: Fix compilation errors for size_t redefinitation.

Since now we have size_t in vmm_types.h there is no need to include stddef.h
to have size_t in lwip.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[CORE] Extend heap APIs to ease heap creation, and create DMA heap.

This patch modifies heap APIs to ease heap creation, and creates DMA heap in
addtion to normal heap. Now, drivers can allocate dmable memory using
vmm_dma_malloc, and free using vmm_dma_free.

Signed-off-by: Ankit Jindal <thatsjindal@gmail.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Make max L1TBL and L2TBL counts independent of VAPOOL size

Currently, maximum number of L1TBL is dependent on CONFIG_MAX_VCPU_COUNT
whereas maximum number of L2TBL is dependent on maximum number of L1TBL
and CONFIG_VAPOOL_SIZE_MB. This means if VAPOOL is very small then we
we might endup with very few L2TBLs.

Ideally, maximum number of L1TBL and L2TBL should only be related to the
CONFIG_MAX_VCPU_COUNT.

This patch update arm32 MMU as-per above and also force compile error if
sufficient space is not available for TTBL pool.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Reduce max VCPU count for ARMv5, ARMv6, and ARMv7

For processors without virtualization extensions our VAPOOL size
cannot be increased beyond 12 MB because Linux ARM has only 12 MB
of empty/unused/reserved virtual address space where Xvisor can run.

Having max VCPU count of 64 for ARMv5, ARMv6, and ARMv7 means TTBL
pool will consume 2 MB which is too much for 12 MB of VAPOOL.

This patch reduces max VCPU count to 48 in generic-v5-defconfig,
generic-v6-defconfig, and generic-v7-defconfig so that TTBL pool
burden on VAPOOL reduces.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Access ACTLR only after checking CPUID

Xvisor ARM32 is now multiplatform hence we should only access
CPU specific ACTLR register after ensuring appropriate CPUID
in proc_setup() at boot-time.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DRIVERS] irqchip: Add versatile fpga-based interrupt controller driver

The VersatilePB and VersatileAB platforms have nested PICs where the
primary PIC is PL190 (Vectored Interrupt Controller) and secondary
PIC is FPGA-based interrupt controller.

This patch adds driver for Versatile FPGA-based interrupt controller.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Enable FPGA-based secondary interrupt controller for versatile

This patch enables FPGA-based secondary interrupt controller, keyboard, and
mouse drivers for versatilepb platform.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Enable AMBA CLCD driver for ARMv5

We have AMBA CLCD device available on VersatilePB and VersatileAB
hence enable respective driver in generic-v5-defconfig.

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