diff options
author | Rouven Czerwinski <r.czerwinski@pengutronix.de> | 2020-11-09 14:44:29 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-11-12 11:44:43 +0100 |
commit | 2e0493a6f6d544770c6c8aa4bc13c7b88553557d (patch) | |
tree | 93eb2726075eeb73c19da6ca8ffa51ca099e3d50 /arch/arm/boards/qemu-virt | |
parent | 927360595da06dd88103ed8fb9733cea2451dc44 (diff) | |
download | barebox-2e0493a6f6d544770c6c8aa4bc13c7b88553557d.tar.gz barebox-2e0493a6f6d544770c6c8aa4bc13c7b88553557d.tar.xz |
ARM: qemu: add support for qemu virt platform
Necessary support to boot barebox on ARM qemu virt platforms.
No internal device tree, since it is passed by qemu. Therefore it
employs the generic 2nd stage image as the low level code and only adds
a virt specific board driver.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/qemu-virt')
-rw-r--r-- | arch/arm/boards/qemu-virt/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boards/qemu-virt/board.c | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/boards/qemu-virt/Makefile b/arch/arm/boards/qemu-virt/Makefile new file mode 100644 index 0000000000..dcfc2937d3 --- /dev/null +++ b/arch/arm/boards/qemu-virt/Makefile @@ -0,0 +1 @@ +obj-y += board.o diff --git a/arch/arm/boards/qemu-virt/board.c b/arch/arm/boards/qemu-virt/board.c new file mode 100644 index 0000000000..3aeea1a017 --- /dev/null +++ b/arch/arm/boards/qemu-virt/board.c @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2020 Pengutronix e.K. + * + */ +#include <common.h> +#include <init.h> +#include <asm/system_info.h> + +static int virt_probe(struct device_d *dev) +{ + char *hostname = "virt"; + + if (cpu_is_cortex_a7()) + hostname = "virt-a7"; + else if (cpu_is_cortex_a15()) + hostname = "virt-a15"; + + barebox_set_model("ARM QEMU virt"); + barebox_set_hostname(hostname); + + return 0; +} + +static const struct of_device_id virt_of_match[] = { + { .compatible = "linux,dummy-virt" }, + { /* Sentinel */}, +}; + +static struct driver_d virt_board_driver = { + .name = "board-qemu-virt", + .probe = virt_probe, + .of_compatible = virt_of_match, +}; + +postcore_platform_driver(virt_board_driver); |