base: remove SPEC variables of boards (fix #3971)

* Remove SPEC declarations from mk/spec
* Remove all board-specific REQUIRE declaratiions left
* Replace [have_spec <board>] run-script declarations with have_board where necessary
* Remove addition of BOARD variable to SPECS in toplevel Makefile
* Move board-specific directories in base-hw out of specs
This commit is contained in:
Stefan Kalkowski
2021-01-13 10:15:10 +01:00
committed by Norman Feske
parent 5a123e37c9
commit bdd923406f
236 changed files with 454 additions and 639 deletions

View File

@@ -89,9 +89,6 @@ export SHELL := $(shell which bash)
# Fetch SPECS configuration from all source repositories and the build directory
#
SPECS :=
ifneq ($(BOARD),)
SPECS += $(BOARD)
endif
-include $(foreach REP,$(REPOSITORIES),$(wildcard $(REP)/etc/specs.conf))
-include $(BUILD_BASE_DIR)/etc/specs.conf

View File

@@ -9,13 +9,13 @@ proc run_boot_string { } { return "\nL4 Bootstrapper" }
proc core_link_address { } {
if {[have_spec x86 ]} { return "0x01100000" }
if {[have_spec rpi ]} { return "0x00800000" }
if {[have_spec rpi3 ]} { return "0x02000000" }
if {[have_spec pbxa9 ]} { return "0x76000000" }
if {[have_spec imx53 ]} { return "0x70140000" }
if {[have_spec imx6q_sabrelite ]} { return "0x14000000" }
if {[have_spec imx7d_sabre ]} { return "0x91000000" }
if {[have_spec x86 ]} { return "0x01100000" }
if {[have_board rpi ]} { return "0x00800000" }
if {[have_board rpi3 ]} { return "0x02000000" }
if {[have_board pbxa9 ]} { return "0x76000000" }
if {[have_board imx53_qsb]} { return "0x70140000" }
if {[have_board imx6q_sabrelite ]} { return "0x14000000" }
if {[have_board imx7d_sabre ]} { return "0x91000000" }
puts stderr "Error: platform not supported, core link address unknown"
exit 1
@@ -37,7 +37,7 @@ proc reset_target { {spawn_id_arg -1} } {
}
proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc/[board]-build" }
proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc-[board]/build" }
proc kernel_binary { } { return "[pwd]/bin/foc-[board]" }
@@ -221,11 +221,11 @@ proc run_boot_dir {binaries} {
#
proc base_src { } {
if {[have_spec x86]} { return base-foc-pc }
if {[have_spec pbxa9]} { return base-foc-pbxa9 }
if {[have_spec rpi3]} { return base-foc-rpi3 }
if {[have_spec imx6q_sabrelite]} { return base-foc-imx6q_sabrelite }
if {[have_spec imx7d_sabre]} { return base-foc-imx7d_sabre }
if {[have_spec x86]} { return base-foc-pc }
if {[have_board pbxa9]} { return base-foc-pbxa9 }
if {[have_board rpi3]} { return base-foc-rpi3 }
if {[have_board imx6q_sabrelite]} { return base-foc-imx6q_sabrelite }
if {[have_board imx7d_sabre]} { return base-foc-imx7d_sabre }
global specs

View File

@@ -6,20 +6,22 @@ proc binary_name_timer { } { return "hw_timer_drv" }
proc run_boot_string { } { return "\nkernel initialized" }
proc bootstrap_link_address { } {
if {[have_spec "pbxa9"]} { return "0x70000000" }
if {[have_spec "usb_armory"]} { return "0x72000000" }
if {[have_spec "x86_64"]} { return "0x00200000" }
if {[have_spec "wand_quad"]} { return "0x10001000" }
if {[have_spec "imx6q_sabrelite"]} { return "0x10001000" }
if {[have_spec "imx53_qsb"]} { return "0x70010000" }
if {[have_spec "imx7d_sabre"]} { return "0x88000000" }
if {[have_spec "imx8q_evk"]} { return "0x40010000" }
if {[have_spec "zynq"]} { return "0x00100000" }
if {[have_spec "riscv"]} { return "0x81000000" }
if {[have_spec "rpi"]} { return "0x00800000" }
if {[have_spec "rpi3"]} { return "0x00800000" }
if {[have_spec "nit6_solox"]} { return "0x88000000" }
if {[have_spec "virt_qemu"]} { return "0x40000000" }
if {[have_board "pbxa9"]} { return "0x70000000" }
if {[have_board "usb_armory"]} { return "0x72000000" }
if {[have_board "pc"]} { return "0x00200000" }
if {[have_board "muen"]} { return "0x00200000" }
if {[have_board "wand_quad"]} { return "0x10001000" }
if {[have_board "imx6q_sabrelite"]} { return "0x10001000" }
if {[have_board "imx53_qsb"]} { return "0x70010000" }
if {[have_board "imx53_qsb_tz"]} { return "0x70010000" }
if {[have_board "imx7d_sabre"]} { return "0x88000000" }
if {[have_board "imx8q_evk"]} { return "0x40010000" }
if {[have_board "zynq_qemu"]} { return "0x00100000" }
if {[have_board "riscv"]} { return "0x81000000" }
if {[have_board "rpi"]} { return "0x00800000" }
if {[have_board "rpi3"]} { return "0x00800000" }
if {[have_board "nit6_solox"]} { return "0x88000000" }
if {[have_board "virt_qemu"]} { return "0x40000000" }
puts "unknown platform no linker address known"
exit -1
@@ -38,7 +40,7 @@ proc core_link_address { } {
proc run_boot_dir {binaries} {
# generate static ACPI report for platform driver on Muen
if {[have_spec "muen"]} {
if {[have_board "muen"]} {
set fh [open "bin/acpi" "WRONLY CREAT TRUNC"]
puts $fh "<acpi><bdf start=\"0\" count=\"16384\" base=\"0xf8000000\"/><drhd/></acpi>"
close $fh
@@ -172,7 +174,7 @@ proc run_boot_dir {binaries} {
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
if {[have_spec "muen"]} {
if {[have_board "muen"]} {
exec gzip [run_dir]/image.bin
puts $fh " exec /boot/unzip"
puts $fh " load /image.bin.gz"
@@ -192,7 +194,7 @@ proc run_boot_dir {binaries} {
set fh [open "[run_dir]/boot.cfg" "WRONLY CREAT TRUNC"]
puts $fh "#!ipxe"
if {[have_spec "muen"]} {
if {[have_board "muen"]} {
puts $fh "kernel image.bin"
} else {
install_pxe_bootloader_to_run_dir
@@ -212,19 +214,19 @@ proc run_boot_dir {binaries} {
#
proc base_src { } {
if {[have_spec x86_64] && ![have_spec muen]} { return base-hw-pc }
if {[have_spec x86_64] && [have_spec muen]} { return base-hw-muen }
if {[have_spec pbxa9]} { return base-hw-pbxa9 }
if {[have_spec rpi]} { return base-hw-rpi }
if {[have_spec rpi3]} { return base-hw-rpi3 }
if {[have_spec imx6q_sabrelite]} { return base-hw-imx6q_sabrelite }
if {[have_spec imx7d_sabre]} { return base-hw-imx7d_sabre }
if {[have_spec imx8q_evk]} { return base-hw-imx8q_evk }
if {[have_spec nit6_solox]} { return base-hw-nit6_solox }
if {[have_spec imx53_qsb] && ![have_spec trustzone]} { return base-hw-imx53_qsb }
if {[have_spec imx53_qsb] && [have_spec trustzone]} { return base-hw-imx53_qsb_tz }
if {[have_spec zynq_qemu]} { return base-hw-zynq_qemu }
if {[have_spec virt_qemu]} { return base-hw-virt_qemu }
if {[have_spec x86_64] && ![have_board muen]} { return base-hw-pc }
if {[have_spec x86_64] && [have_board muen]} { return base-hw-muen }
if {[have_board pbxa9]} { return base-hw-pbxa9 }
if {[have_board rpi]} { return base-hw-rpi }
if {[have_board rpi3]} { return base-hw-rpi3 }
if {[have_board imx6q_sabrelite]} { return base-hw-imx6q_sabrelite }
if {[have_board imx7d_sabre]} { return base-hw-imx7d_sabre }
if {[have_board imx8q_evk]} { return base-hw-imx8q_evk }
if {[have_board nit6_solox]} { return base-hw-nit6_solox }
if {[have_board imx53_qsb]} { return base-hw-imx53_qsb }
if {[have_board imx53_qsb_tz]} { return base-hw-imx53_qsb_tz }
if {[have_board zynq_qemu]} { return base-hw-zynq_qemu }
if {[have_board virt_qemu]} { return base-hw-virt_qemu }
global specs

View File

@@ -1,9 +1,9 @@
proc binary_name_ld_lib_so { } { return "ld-sel4.lib.so" }
proc binary_name_core_o { } { return "core-sel4.o" }
proc binary_name_timer { } {
if {[have_spec imx6]} { return "imx6_timer_drv" }
if {[have_spec imx7d_sabre]} { return "imx7_timer_drv" }
if {[have_spec x86]} { return "pit_timer_drv" }
if {[have_board imx6q_sabrelite]} { return "imx6_timer_drv" }
if {[have_board imx7d_sabre]} { return "imx7_timer_drv" }
if {[have_board pc]} { return "pit_timer_drv" }
puts "unknown platform - no timer driver"
exit -1
}
@@ -98,9 +98,9 @@ proc run_boot_dir {binaries} {
# Use seL4 elfloader tool to generate bootable image on ARM
#
if {[have_spec arm]} {
if {[have_spec imx6]} {
if {[have_board imx6q_sabrelite]} {
set ::env(PLAT) imx6
} elseif {[have_spec imx7d_sabre]} {
} elseif {[have_board imx7d_sabre]} {
set ::env(PLAT) imx7
} else {
puts "abort - unknown ARM board"
@@ -159,9 +159,9 @@ proc run_boot_dir {binaries} {
#
proc base_src { } {
if {[have_spec x86]} { return base-sel4-x86 }
if {[have_spec imx6q_sabrelite]} { return base-sel4-imx6q_sabrelite }
if {[have_spec imx7d_sabre]} { return base-sel4-imx7d_sabre }
if {[have_spec x86]} { return base-sel4-x86 }
if {[have_board imx6q_sabrelite]} { return base-sel4-imx6q_sabrelite }
if {[have_board imx7d_sabre]} { return base-sel4-imx7d_sabre }
global specs

View File

@@ -459,15 +459,16 @@ proc check_for_missing_depot_archives { } {
proc drivers_interactive_pkg { } {
if {[have_spec muen]} { return drivers_interactive-muen }
if {[have_spec linux]} { return drivers_interactive-linux }
if {[have_spec x86]} { return drivers_interactive-pc }
if {[have_spec pbxa9]} { return drivers_interactive-pbxa9 }
if {[have_spec imx53_qsb]} { return drivers_interactive-imx53_qsb }
if {[have_spec rpi]} { return drivers_interactive-rpi }
if {[have_spec imx8q_evk]} { return drivers_interactive-imx8q_evk }
if {[have_spec panda]} { return drivers_interactive-panda }
if {[have_spec arndale]} { return drivers_interactive-arndale }
if {[have_board muen]} { return drivers_interactive-muen }
if {[have_board linux]} { return drivers_interactive-linux }
if {[have_board pc]} { return drivers_interactive-pc }
if {[have_board pbxa9]} { return drivers_interactive-pbxa9 }
if {[have_board imx53_qsb]} { return drivers_interactive-imx53_qsb }
if {[have_board imx53_qsb_tz]} { return drivers_interactive-imx53_qsb }
if {[have_board rpi]} { return drivers_interactive-rpi }
if {[have_board imx8q_evk]} { return drivers_interactive-imx8q_evk }
if {[have_board panda]} { return drivers_interactive-panda }
if {[have_board arndale]} { return drivers_interactive-arndale }
puts stderr "drivers_interactive package undefined for this build configuration"
exit 1
@@ -476,18 +477,17 @@ proc drivers_interactive_pkg { } {
proc drivers_nic_pkg { } {
if {[have_spec x86] && ![have_spec muen] &&
![have_spec linux]} { return drivers_nic-pc }
if {[have_spec muen]} { return drivers_nic-muen }
if {[have_spec linux]} { return drivers_nic-linux }
if {[have_spec pbxa9]} { return drivers_nic-pbxa9 }
if {[have_spec rpi]} { return drivers_nic-rpi }
if {[have_spec zynq_qemu]} { return drivers_nic-zynq }
if {[have_spec imx53_qsb]} { return drivers_nic-imx53_qsb }
if {[have_spec imx6q_sabrelite]} { return drivers_nic-imx6q_sabrelite }
if {[have_spec imx7d_sabre]} { return drivers_nic-imx7d_sabre }
if {[have_spec imx8q_evk]} { return drivers_nic-imx8q_evk }
if {[have_spec virt_qemu]} { return drivers_nic-virt_qemu }
if {[have_board pc]} { return drivers_nic-pc }
if {[have_board muen]} { return drivers_nic-muen }
if {[have_board linux]} { return drivers_nic-linux }
if {[have_board pbxa9]} { return drivers_nic-pbxa9 }
if {[have_board rpi]} { return drivers_nic-rpi }
if {[have_board zynq_qemu]} { return drivers_nic-zynq }
if {[have_board imx53_qsb]} { return drivers_nic-imx53_qsb }
if {[have_board imx6q_sabrelite]} { return drivers_nic-imx6q_sabrelite }
if {[have_board imx7d_sabre]} { return drivers_nic-imx7d_sabre }
if {[have_board imx8q_evk]} { return drivers_nic-imx8q_evk }
if {[have_board virt_qemu]} { return drivers_nic-virt_qemu }
puts stderr "drivers_nic package undefined for this build configuration"
exit 1

View File

@@ -43,8 +43,8 @@ proc muen_spark_path { } {
# \param elf_img ELF binary of Genode subject
#
proc run_image {elf_img} {
if {![have_spec "muen"]} {
puts stderr "Error: Missing SPEC muen, unsupported platform"
if {![have_board "muen"]} {
puts stderr "You've to build for the BOARD=muen"
exit -1
}

View File

@@ -71,7 +71,7 @@ proc run_power_on { } {
# In the raspi3 model the first UART is never used as
# log output, but the second
#
if {[have_spec rpi3]} { append qemu_args " -serial null " }
if {[have_board rpi3]} { append qemu_args " -serial null " }
append qemu_args " -serial mon:stdio "
}
@@ -93,7 +93,7 @@ proc run_power_on { } {
}
# tweak emulated platform for specific platforms
if {[have_spec pbxa9]} {
if {[have_board pbxa9]} {
#
# For PBXA9 qemu adjusts provided RAM chips to the -m arg. Thus we
# filter user values and force value that enables all chips that Genode
@@ -103,11 +103,11 @@ proc run_power_on { } {
append qemu_args " -m 768"
append qemu_args " -M realview-pbx-a9"
}
if {[have_spec vpb926]} { append qemu_args " -M versatilepb -m 128 " }
if {[have_spec zynq_qemu]} { append qemu_args " -M xilinx-zynq-a9 -cpu cortex-a9 -m 256 " }
if {[have_spec rpi3]} { append qemu_args " -M raspi3 -m 512 " }
if {[have_board vpb926]} { append qemu_args " -M versatilepb -m 128 " }
if {[have_board zynq_qemu]} { append qemu_args " -M xilinx-zynq-a9 -cpu cortex-a9 -m 256 " }
if {[have_board rpi3]} { append qemu_args " -M raspi3 -m 512 " }
if {[have_spec virt_qemu]} {
if {[have_board virt_qemu]} {
append qemu_args " -M virt,virtualization=true"
if {[have_spec arm_v8a]} {
append qemu_args ",gic-version=3 -cpu cortex-a53 -smp 4"
@@ -119,7 +119,7 @@ proc run_power_on { } {
}
# on x86, we support booting via pxe or iso/disk image
if {[have_spec x86]} {
if {[have_board pc]} {
if {![regexp -- {-m} $qemu_args dummy]} {
if {[have_spec okl4]} {
# okl4 system integration specifies RAM from 32 to 800 MiB

View File

@@ -15,9 +15,9 @@ proc qemu_args { } {
}
proc qemu_nic_model {} {
if [have_spec lan9118] { return lan9118 }
if [have_spec zynq] { return cadence_gem }
if [have_spec x86] { return e1000 }
if [have_board pbxa9] { return lan9118 }
if [have_board zynq_qemu] { return cadence_gem }
if [have_board pc] { return e1000 }
return nic_model_missing
}
@@ -29,7 +29,7 @@ proc append_qemu_nic_args { { extra_netdev_args "" } } {
append qemu_args ",$extra_netdev_args"
}
if {[have_spec virt_qemu]} {
if {[have_board virt_qemu]} {
append qemu_args " -global virtio-mmio.force-legacy=false "
append qemu_args " -device virtio-net-device,bus=virtio-mmio-bus.0,netdev=net0 "
} else {