[DRIVERS] sp804_timer: Minor fix in sp804_clockchip_init()

This patch fixes sp804_clockchip_init() to free-up resources correctly
when any failure is detected.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Ensure that we are in SVC mode before turning-on MMU

Latest ARMv7 bootloaders will enter Xvisor in HYP-mode if
Virtualization extenstions are available in underlying host HW
as-per Linux ARM32 booting protocol.

This mean if we try to boot Xvisor ARM32 (without virtualization)
on host HW having virtualization extension then bootloader will
jump into Xvisor in HYP-mode. To tackel this, we force-fully switch
to SVC mode before enabling MMU on each host CPU.

Signed-off-by: Anup Patel <anup@brainfault.org>
[DOCS] Remove NON_SECURE_SVC_BOOT option from ARM Fast Model bootwrapper

The NON_SECURE_SVC_BOOT option was added in ARM Fast Model bootwrapper
to boot Xvisor ARM32 (without virtualization extensions) on VExpress-A15
emulated by ARM Fast Models.

Recent patch "[ARM] arm32: Ensure that we are in SVC mode before
turning-on MMU" makes Xvisor ARM32 to switch to SVC mode hence the
NON_SECURE_SVC_BOOT option in bootwrapper is now redundant.

This patch removes NON_SECURE_SVC_BOOT option from ARM Fast Model
bootwrapper.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32: Update cpu_proc_v7.S for Cortex-A15

For running Xvisor ARM32 on VExpress-A15 we should be able to
do CPU specific settings in proc_setup() and proc_setup_smp_id()
hence this patch updates this fucntions for cortex-A15.

Signed-off-by: Anup Patel <anup@brainfault.org>
[CORE] Add "bound_on" field for each vmm_clockchip

We need to track the host CPU to which a vmm_clockchip is bound
and we also need to ensure that a vmm_clockchip delivers interrupts
to host CPU it is bound to.

To achieve this we introduce "bound_on" field in vmm_clockchip
to represent host CPU bound to vmm_clockchip. When vmm_clockchip
is new or not bound to any host CPU, the "bound_on" is set to
UINT_MAX.

We also remove vmm_clockchip_find_best() API and instead introduce
two new APIs: vmm_clockchip_bind_best() and vmm_clockchip_unbind().

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: Don't include VExpress-A15 guest template in vexpress-a15-nove.dtsi

We don't have generic timers and VGIC for Xvisor ARM32 running on VExpress-A15
host hence we cannot prove VExpress-A15 guest on Xvisor ARM32.

For VExpress-A15 guest we will have to used Xvisor ARM32ve or Xvisor ARM64.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6
[CORE] vmm_devtree: Store attribute values in big-endian format

Currently, we store attribute values in native-endian format. The idea
behind doing so was to avoid unnecassary endian swapping when reading
or writing attribute values. The Linux OF framework on the other-hand
keeps attribute values as big-endian because FDT is big-endian.

This patch updates vmm_devtree to store attribute values in big-endian
format. This will help us as follows:
1. Make vmm_devtree more Linux compatible
2. Ease driver porting from Linux because lot of Linux drivers
directly access attribute values assuming big-endian format
3. No need for endian related swaping of literal values when
populating device tree from FDT

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6
[DRIVERS] gpio: Get ARCH_NR_GPIOS value using config option

This patch adds menuconfig option CONFIG_ARCH_NR_GPIO to set value of
system's max number of GPIO chips.
Default is 1024.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] pinctrl: Adding new sunxi pinctrl driver.

This driver has been ported from linux's pinctrl-sunxi driver.
This is compilable version but not fully tested.
Will add subsequent fixme patches for bugs found during further testing.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[CORE] vmm_devtree: Fixing vmm_devtree_next_string() and other misc.

This patch fixes:

vmm_devtree_next_string() function:
This function had a issue with returning wrong non null value even if
last string is already read.
This used to affect behavior of_property_for_each_string()

Fixes vmm_devtree_regsize(), vmm_devtree_regaddr() functions.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[DRIVERS] net: pinctrl: Minor fix in few debug prints

This patch adds __func__ in few debugs prints in these drivers.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[ARM] generic: sun4i: Adding pinctrl nodes for cubieboard and hackberry.

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
Merge remote-tracking branch 'upstream/master' into imx6
[DRIVERS] pinctrl: Sunxi: Fix wring interrupt modes set.

This patch fixes wrong irq mode set in the code in function
sunxi_pinctrl_irq_set_type()

Signed-off-by: Pranavkumar Sawargaonkar <pranav.sawargaonkar@gmail.com>
[ARM] arm32ve: Fix HTCR_T0SZ_MASK define

The T0SZ field of HTCR register is 3bits wide and not 2bits wides
hence this patch fixes the related field mask.

With this patch we have Xvisor ARM32ve booting reliably on Cubieboard2.

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] generic: sun7i: Fix generic timer frequency

The generic timer frequency on Sun7i (particularly Cubieboard2) is
24Mhz and not 100Mhz hence this patch fixes sun7i-a20.dtsi

Signed-off-by: Anup Patel <anup@brainfault.org>
[ARM] arm32ve: Implement arch_delay_loop_cycles() in assembly

The delay loop count to machine cycle count conversion for
Cortex-A7 is very different from Cortex-A15 (emulated by
ARM Fast Models) hence we implement arch_delay_loop_cycles()
in assembly so that we can incorporate CPU specific calculation
for Cortex-A7.

Signed-off-by: Anup Patel <anup@brainfault.org>
Merge remote-tracking branch 'upstream/master' into imx6