diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-11-25 17:10:40 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-07 15:03:31 +0100 |
commit | 8f47e2ef573f61539b5994b6c52e0c953774a85c (patch) | |
tree | 47f871219604c8cb4c0bc2b40969a361c34daae7 /arch | |
parent | d1785c8a68e47900569ff18389426f53c841f38c (diff) | |
download | barebox-8f47e2ef573f61539b5994b6c52e0c953774a85c.tar.gz barebox-8f47e2ef573f61539b5994b6c52e0c953774a85c.tar.xz |
ARM: qemu: move board code to central location
The state/environment overlay applied on top of QEMU is applicable to
other virt platforms as well, like RISC-V. In preparation for sharing
code across architectures, add a new common/boards and move the board
code there.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211125161042.3829996-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/boards/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boards/qemu-virt/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boards/qemu-virt/board.c | 52 | ||||
-rw-r--r-- | arch/arm/boards/qemu-virt/overlay-of-flash.dts | 97 |
5 files changed, 1 insertions, 151 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 14aa7e26af..b532d3fe2f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -308,6 +308,7 @@ source "arch/arm/mach-zynqmp/Kconfig" config BOARD_ARM_VIRT bool select BOARD_ARM_GENERIC_DT + select BOARD_QEMU_VIRT select OF_OVERLAY config BOARD_ARM_GENERIC_DT diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile index b3d4917709..d7460142bb 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -167,7 +167,6 @@ obj-$(CONFIG_MACH_ZEDBOARD) += avnet-zedboard/ obj-$(CONFIG_MACH_ZYLONITE) += zylonite/ obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/ obj-$(CONFIG_MACH_VSCOM_BALTOS) += vscom-baltos/ -obj-$(CONFIG_BOARD_ARM_VIRT) += qemu-virt/ obj-$(CONFIG_MACH_WARP7) += element14-warp7/ obj-$(CONFIG_MACH_WEBASTO_CCBV2) += webasto-ccbv2/ obj-$(CONFIG_MACH_VF610_TWR) += freescale-vf610-twr/ diff --git a/arch/arm/boards/qemu-virt/Makefile b/arch/arm/boards/qemu-virt/Makefile index 8451c7832d..dcfc2937d3 100644 --- a/arch/arm/boards/qemu-virt/Makefile +++ b/arch/arm/boards/qemu-virt/Makefile @@ -1,2 +1 @@ obj-y += board.o -obj-y += overlay-of-flash.dtb.o diff --git a/arch/arm/boards/qemu-virt/board.c b/arch/arm/boards/qemu-virt/board.c deleted file mode 100644 index 1333687918..0000000000 --- a/arch/arm/boards/qemu-virt/board.c +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2020 Pengutronix e.K. - * - */ -#include <common.h> -#include <init.h> -#include <of.h> -#include <deep-probe.h> -#include <asm/system_info.h> - -#ifdef CONFIG_64BIT -#define MACHINE "virt64" -#else -#define MACHINE "virt" -#endif - -extern char __dtb_overlay_of_flash_start[]; - -static int virt_probe(struct device_d *dev) -{ - const char *hostname = MACHINE; - struct device_node *overlay; - - if (cpu_is_cortex_a7()) - hostname = "virt-a7"; - else if (cpu_is_cortex_a15()) - hostname = "virt-a15"; - - barebox_set_model("ARM QEMU " MACHINE); - barebox_set_hostname(hostname); - - overlay = of_unflatten_dtb(__dtb_overlay_of_flash_start, INT_MAX); - of_overlay_apply_tree(dev->device_node, overlay); - /* of_probe() will happen later at of_populate_initcall */ - - return 0; -} - -static const struct of_device_id virt_of_match[] = { - { .compatible = "linux,dummy-virt" }, - { /* Sentinel */}, -}; -BAREBOX_DEEP_PROBE_ENABLE(virt_of_match); - -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); diff --git a/arch/arm/boards/qemu-virt/overlay-of-flash.dts b/arch/arm/boards/qemu-virt/overlay-of-flash.dts deleted file mode 100644 index e00dc5d7e2..0000000000 --- a/arch/arm/boards/qemu-virt/overlay-of-flash.dts +++ /dev/null @@ -1,97 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - fragment@0 { - target-path = "/flash@0"; - __overlay__ { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "initramfs"; - reg = <0x0 0x3c00000>; - }; - - environment_flash: partition@3c00000 { - label = "barebox-environment"; - reg = <0x3c00000 0x200000>; - }; - - backend_state_flash: partition@3e00000 { - label = "barebox-state"; - reg = <0x3e00000 0x200000>; - }; - }; - }; - }; - fragment@1 { - target-path="/"; - __overlay__ { - chosen { - environment { - compatible = "barebox,environment"; - device-path = "/flash@0/partitions/partition@3c00000"; - }; - }; - aliases { - state = "/state"; - }; - - state { - #address-cells = <1>; - #size-cells = <1>; - compatible = "barebox,state"; - magic = <0x290cf8c6>; - backend-type = "raw"; - backend = < &backend_state_flash >; - backend-stridesize = <0x200>; - - bootstate { - #address-cells = <1>; - #size-cells = <1>; - - system0 { - #address-cells = <1>; - #size-cells = <1>; - - remaining_attempts@0 { - reg = <0x0 0x4>; - type = "uint32"; - default = <3>; - }; - - priority@4 { - reg = <0x4 0x4>; - type = "uint32"; - default = <20>; - }; - }; - - system1 { - #address-cells = <1>; - #size-cells = <1>; - - remaining_attempts@8 { - reg = <0x8 0x4>; - type = "uint32"; - default = <3>; - }; - - priority@c { - reg = <0xc 0x4>; - type = "uint32"; - default = <21>; - }; - }; - - last_chosen@10 { - reg = <0x10 0x4>; - type = "uint32"; - }; - }; - }; - }; - }; -}; |