Tag Archives: u-boot

U-Boot/Linux and HYP mode on ARMv7

The newer ARMv7 Cortex-A class cores such Cortex-A7, A15 and A17 come with a virtualization extensions which allow to use KVM (kernel virtual machine). The NXP i.MX 7Dual SoC which I worked with lately includes the ARM Cortex-A7 CPU. I went ahead and tried to bring up KVM on i.MX 7. I was not really familiar with the ARMv7 virtualization architecture, so I had to read up on some concepts. This post summarizes what I learned and gives a big picture of software support.

The Hypervisor mode

To provide hardware support for full CPU virtualization an additional privilege level is required. User-space (PL0) uses the SVC (Supervisor) instruction to switch to kernel-space (PL1, SVC mode). A similar separation between Kernel and hypervisor is required. The ARMv7 architecture with virtualization extension calls this privilege level PL2 or HYP mode.

Linux with KVM for ARM uses this mode to provide CPU virtualization. The CPU needs to be in HYP mode when Linux is booting so KVM can make use of the extension. How KVM uses the HYP mode in detail is explained in this excellent LWN article. After building a kernel with KVM support, I encountered this problem first: By default, the system did boot in SVC mode.

Brought up 2 CPUs
CPU: All CPU(s) started in SVC mode.
kvm [1]: HYP mode not available

Secure and Non-Secure world

ARMv7 privilege levels

ARMv7 privilege levels

To understand how to switch into Hypervisor mode, one needs to understand the whole privilege level architecture first. Notable here is that on ARMv7 CPU’s the HYP mode is only available in non-secure mode, by design. Any hypervisor needs to operate in non-secure mode, there is no virtualization extension in secure mode. Read more »

Vybrid Cortex-M4 Linux support – Status update

Vybrid Cortex-M4 Linux boot log

Vybrid Cortex-M4 Linux boot log

This is a status update about my work on Linux for Cortex-M4 inside Freescale Vybrid SoC’s. While I managed to boot Linux on the M4 core since fall last year, several improvements have been made since then.

MSCM interrupt router driver

Peripheral interrupts need to be routed to the core requiring them. The routing is done by the interrupt router inside MSCM (Miscellaneous System Control Module). So far, the boot loader (U-Boot) configured all interrupts to the primary core. A proper driver for the interrupt router was missing, hence to get Linux running on the secondary core, manual fiddling of the interrupt router registers was needed. Read more »

Arch Linux on BeagleBone Black from USB-Stick

This guide shows how to install Arch Linux using a USB-Stick. A running U-Boot installation is required, in my case this was U-Boot 2013.04 which came with the original image. Next, I created a memory stick. I followed the documentation of Arch Linux ARM, I just used a USB stick instead of a Micro SD-Card. Now, plug the USB stick into your Beagle Bone Black and press a key to get the U-Boot prompt. U-Boot has the ability to boot from a USB stick, but some custom commands are required. First you need to scan the USB bus system.

U-Boot# usb reset
(Re)start USB...
USB0: scanning bus 0 for devices... 1 USB Device(s) found
 scanning usb for storage devices... 1 Storage Device(s) found

Read more »