summaryrefslogtreecommitdiffstats
path: root/board/emulation
Commit message (Collapse)AuthorAgeFilesLines
* efi: qemu: arm64: Add efi_rng_protocol implementation for the platformSughosh Ganu2020-01-071-0/+42
| | | | | | | | | | | | | | | | | Add support for the EFI_RNG_PROTOCOL routines for the qemu arm64 platform. EFI_RNG_PROTOCOL is an uefi boottime service which is invoked by the efi stub in the kernel for getting random seed for kaslr. The routines are platform specific, and use the virtio-rng device on the platform to get random data. The feature can be enabled through the following config CONFIG_EFI_RNG_PROTOCOL Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Changed SPDX header to use /* instead of //. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* common: Move some board functions out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | A number of board function belong in init.h with the others. Move them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* riscv: qemu: Fix kconfig build warningBin Meng2019-08-261-0/+1
| | | | | | | | | | | | | When 'make qemu-riscv64_defconfig', there is a build warning: board/emulation/qemu-riscv/Kconfig:24: warning: config symbol defined without type Fix it by specifying the config symbol type to 'hex'. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* riscv: qemu: add SPL configurationLukas Auer2019-08-263-0/+29
| | | | | | | | | | | | | | | | | Add two new configurations (qemu-riscv{32,64}_spl_defconfig) with SPL enabled for RISC-V QEMU. QEMU does not require SPL to run U-Boot. The configurations are meant to help the development of SPL on RISC-V. The configurations enable RAM as the only SPL boot device. Images must be loaded at address 0x80200000. In the default boot flow, U-Boot SPL starts in machine mode, loads the OpenSBI FW_DYNAMIC firmware and U-Boot proper from the supplied FIT image, and starts OpenSBI. U-Boot proper is then started in supervisor mode by OpenSBI. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
* env: Move env_set_hex() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | | Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* qemu-riscv: enable VIRTIO_PCIDavid Abdurachmanov2019-07-181-0/+1
| | | | | | | | libvirt v.5.3.0 with QEMU 4.0.0 or above uses PCI automatically and thus devices (network, storage, etc) are connected via PCI. Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* riscv: qemu: Enable e1000 and nvme supportBin Meng2019-06-051-0/+2
| | | | | | | | | | Since we have added the PCI support to the 'virt' target, enable e1000 and NVME as alternate network and storage devices for these virtio based devices. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Tested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* riscv: qemu: Enable PCI host ECAM generic driverBin Meng2019-06-051-0/+4
| | | | | | | | | QEMU 4.0.0 'virt' target integrates a generic ECAM PCI host. Enable the driver for it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Tested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* riscv: qemu: Use correct SYS_TEXT_BASE for S-mode on 32bit systemAnup Patel2019-05-091-1/+2
| | | | | | | | | | | | | | | | | For 32bit system, the OpenSBI (or BBL) will jump to 0x80400000 address in S-mode whereas for 64bit system it will jump to 0x80200000 address in S-mode. Currently, the S-mode U-Boot sets SYS_TEXT_BASE to 0x80200000 for both 32bit and 64bit system. This breaks S-mode U-Boot for 32bit system. This patch sets different SYS_TEXT_BASE for 32bit and 64bit system so that S-mode U-Boot works fine for both. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Tested-by: Karsten Merker <merker@debian.org>
* riscv: qemu: enable SMPLukas Auer2019-04-081-0/+1
| | | | | | | Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* riscv: Rename cpu/qemu to cpu/genericAnup Patel2019-02-271-2/+2
| | | | | | | | | | | | | | | | | | The QEMU CPU support under arch/riscv is pretty much generic and works fine for SiFive Unleashed as well. In fact, there will be quite a few RISC-V SOCs for which QEMU CPU support will work fine. This patch renames cpu/qemu to cpu/generic to indicate the above fact. If there are SOC specific errata workarounds required in cpu/generic then those can be done at runtime in cpu/generic based on CPU vendor specific DT compatible string. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* riscv: qemu: Imply SIFIVE_SERIAL for emulationAnup Patel2018-12-181-0/+1
| | | | | | | | | This patch enables SiFive UART driver for QEMU RISC-V emulation by implying SIFIVE_SERIAL on BOARD_SPECIFIC_OPTIONS. Signed-off-by: Anup Patel <anup@brainfault.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* riscv: qemu: Add platform-specific Kconfig optionsBin Meng2018-12-181-0/+1
| | | | | | | | | Add the QEMU RISC-V platform-specific Kconfig options, to include CPU and timer drivers. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
* riscv: Add S-mode defconfigs for QEMU virt machineAnup Patel2018-12-051-0/+2
| | | | | | | | | | | This patch adds S-mode defconfigs for QEMU virt machine so that we can run u-boot in S-mode on QEMU using M-mode runtime firmware (BBL or equivalent). Signed-off-by: Anup Patel <anup@brainfault.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* riscv: qemu: Use different SYS_TEXT_BASE for S-modeAnup Patel2018-12-051-1/+2
| | | | | | | | | | | | | | | | When u-boot runs in S-mode, the M-mode runtime firmware (BBL or equivalent) uses memory range in 0x80000000 to 0x80200000. Due to this, we cannot use 0x80000000 as SYS_TEXT_BASE when running in S-mode. Instead for S-mode, we use 0x80200000 as SYS_TEXT_BASE. Even Linux RISC-V kernel ignores/reserves memory range 0x80000000 to 0x80200000 because it runs in S-mode. Signed-off-by: Anup Patel <anup@brainfault.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* riscv: qemu: clear kernel-start/-end in device tree as workaround for BBLLukas Auer2018-11-262-0/+40
| | | | | | | | | | | | | | QEMU specifies the location of Linux (supplied with the -kernel argument) in the device tree using the riscv,kernel-start and riscv,kernel-end properties. We currently rely on the SBI implementation of BBL to run Linux and therefore embed Linux as payload in BBL. This causes an issue, because BBL detects the kernel properties in the device tree and ignores the Linux payload as a result. Work around this issue by clearing the kernel properties in the device tree before booting Linux. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* riscv: qemu: detect and boot the kernel passed by QEMULukas Auer2018-11-262-0/+30
| | | | | | | | | | | | QEMU embeds the location of the kernel image in the device tree. Store this address in the environment as variable kernel_start. It is used in the board-local distro boot command QEMU to boot the kernel with the U-Boot device tree. The QEMU boot command is added as the first boot target device. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de>
* riscv: qemu: use device tree passed by prior boot stageLukas Auer2018-11-261-11/+0
| | | | | | | | | | | QEMU provides a device tree, which is passed to U-Boot using register a1. We are now able to directly select the device tree with the configuration CONFIG_OF_PRIOR_STAGE. Replace the hard-coded address in qemu-riscv with it. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
* x86: qemu: Imply virtio PCI transport and device driversBin Meng2018-11-141-0/+3
| | | | | | | Add virtio drivers for QEMU x86 targets. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* arm: qemu: Enumerate virtio bus during early bootBin Meng2018-11-142-0/+14
| | | | | | | | | Currently devices on the virtio bus is not automatically enumerated, which means peripherals on the virtio bus are not discovered by their drivers. This uses board_init() to do the virtio enumeration. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* arm: qemu: Add a Kconfig in the board directoryBin Meng2018-11-141-0/+9
| | | | | | | | This adds a Kconfig file in the board directory, so that some board-specific options can be specified there. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* riscv: qemu: Include some useful commandsBin Meng2018-11-141-0/+8
| | | | | | | | With the virtio net and blk drivers, we can do more stuff with some useful commands. Imply those in the board Kconfig. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* riscv: qemu: Enumerate virtio bus during early bootBin Meng2018-11-142-0/+12
| | | | | | | | | Currently devices on the virtio bus is not automatically enumerated, which means peripherals on the virtio bus are not discovered by their drivers. This uses board_init() to do the virtio enumeration. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* riscv: Add QEMU virt board supportBin Meng2018-10-034-0/+57
| | | | | | | | | | | | | | | | | | This adds QEMU RISC-V 'virt' board target support, with the hope of helping people easily test U-Boot on RISC-V. The QEMU virt machine models a generic RISC-V virtual machine with support for the VirtIO standard networking and block storage devices. It has CLINT, PLIC, 16550A UART devices in addition to VirtIO and it also uses device-tree to pass configuration information to guest software. It implements RISC-V privileged architecture spec v1.10. Both 32-bit and 64-bit builds are supported. Support is pretty much preliminary, only booting to U-Boot shell with the UART driver on a single core. Booting Linux is not supported yet. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* ARM: qemu-arm: Fix qemu_arm64_defconfig for QEMU 3.0Tuomas Tynkkynen2018-09-051-1/+17
| | | | | | | | | | | QEMU 3.0 introduced additional memory-mapped regions for PCI-E ECAM and MMIO. Thus we need to add them to our MMU map or U-Boot will crash with a Synchronous Abort during PCI-E probing when it tries to access the unmapped ECAM memory area. Reported-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Tested-by: Jonathan Gray <jsg@jsg.id.au>
* lib: fdtdec: Rename routine fdtdec_setup_memory_size()Siva Durga Prasad Paladugu2018-07-191-1/+1
| | | | | | | | | | | This patch renames the routine fdtdec_setup_memory_size() to fdtdec_setup_mem_size_base() as it now fills the mem base as well along with size. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* x86: Drop QEMU-specific EFI payload supportBin Meng2018-06-172-5/+3
| | | | | | | | Now that we have generic EFI payload support for all x86 boards, drop the QEMU-specific one. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* ARM: qemu-arm: Bump RAM size in AArch64 MMU tableTuomas Tynkkynen2018-05-261-1/+1
| | | | | | | | | Now that PCI devices work with highmem-enabled QEMU emulation, bump up the RAM size in the MMU tables to gain access to the full 255 GB of RAM potential instead of the puny 3 GB. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-075-13/+5
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* ARM: qemu-arm: Add support for AArch64Tuomas Tynkkynen2018-01-192-0/+36
| | | | | | | | | | This adds support for '-machine virt' on AArch64. This is rather simple: we just add TARGET_QEMU_ARM_xxBIT to select a few different Kconfig symbols, provide the ARMv8 memory map from the board file and add a new defconfig based on the 32-bit defconfig. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Tom Rini <trini@konsulko.com>
* ARM: Add a new arch + board for QEMU's 'virt' machineTuomas Tynkkynen2017-10-063-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This board builds an U-Boot binary that is bootable with QEMU's 'virt' machine on ARM. The minimal QEMU command line is: qemu-system-arm -machine virt,highmem=off -bios u-boot.bin (Note that the 'highmem=off' parameter to the 'virt' machine is required for PCI to work in U-Boot.) This command line enables the following: - u-boot.bin loaded and executing in the emulated flash at address 0x0 - A generated device tree blob placed at the start of RAM - A freely configurable amount of RAM, described by the DTB - A PL011 serial port, discoverable via the DTB - An ARMv7 architected timer - PSCI for rebooting the system - A generic ECAM-based PCI host controller, discoverable via the DTB Additionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus. The following ones are supported by both U-Boot and Linux: - To add a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.: -drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0 - To add an Intel E1000 network adapter, pass e.g.: -net nic,model=e1000 -net user - To add an EHCI-compliant USB host controller, pass e.g.: -device usb-ehci,id=ehci - To add a NVMe disk, pass e.g.: -drive if=none,file=disk.img,id=mydisk -device nvme,drive=mydisk,serial=foo Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
* x86: qemu: Add a config for 64-bit U-BootBin Meng2017-02-073-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new board config which uses 64-bit U-Boot. Supported features are the same as the other 64-bit board (Google Chromebook Link). It is a start for us to test 64-bit U-Boot easily without the need to access a real hardware. Note CONFIG_SPL_ENV_SUPPORT is required for QEMU 64-bit as without this the SPL build fails at the end. This is just a workaround as CONFIG_SPL_ENV_SUPPORT is not needed at all. common/built-in.o:(.data.env_htab+0xc): undefined reference to 'env_flags_validate' lib/built-in.o: In function `hsearch_r': lib/hashtable.c:380: undefined reference to 'env_callback_init' lib/hashtable.c:382: undefined reference to 'env_flags_init' make[1]: *** [spl/u-boot-spl] Error 1 Except those SPL options required by 64-bit, compared to 32-bit config, the following options are different: - CONFIG_SYS_MALLOC_F_LEN has to be increased to 0x1000 for SPL. - CONFIG_DEBUG_UART has to be included due to the weird issue. See TODO comments in arch/x86/cpu/x86_64/cpu.c:arch_setup_gd(). Once this issue gets fixed, debug uart can be optional. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Add a text base for 64-bit U-BootBin Meng2017-02-071-2/+2
| | | | | | | Set up the 64-bit U-Boot text base if building for that target. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: efi: Add two boards for EFI 32-bit and 64-bit payloadBin Meng2016-08-301-0/+2
| | | | | | | | | | | This introduces two board defconfig files for generating EFI 32-bit and 64-bit payloads, to run on QEMU x86 target. With these in place, hopefully buildman will catch any build error with EFI payload support on x86. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Convert to use driver model ethBin Meng2015-11-132-14/+1
| | | | | | | Move to driver model for ETH (e1000) on QEMU. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* x86: qemu: Support operation as an EFI payloadSimon Glass2015-08-051-2/+3
| | | | | | | | | Disable a few things which interfere with the EFI init. This allows QEMU to to boot into EFI, load a U-Boot payload then boot to the U-Boot prompt. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* x86: Support QEMU x86 targetsBin Meng2015-06-046-0/+84
This commit introduces the initial U-Boot support for QEMU x86 targets. U-Boot can boot from coreboot as a payload, or directly without coreboot. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Merged in patch 'x86: qemu: Add CMD_NET to qemu-x86_defconfig https://patchwork.ozlabs.org/patch/479745/