summaryrefslogtreecommitdiffstats
path: root/spec/build/bsps
diff options
context:
space:
mode:
authorKarel Gardas <karel@functional.vision>2023-04-16 23:01:58 +0200
committerKarel Gardas <karel@functional.vision>2023-04-29 20:41:23 +0200
commitbf53ff2de2c2dab5b3e2186eac5310e78b38e413 (patch)
tree2655fff7f0369e59e0474b155de28f647b0b5c56 /spec/build/bsps
parentbsps/amd64: increase CPU alignment to 16 (diff)
downloadrtems-bf53ff2de2c2dab5b3e2186eac5310e78b38e413.tar.bz2
bsps/amd64: add a new EFI-based variant of AMD64 BSP
The new amd64efi BSP supports: - multiboot2 boot format. Runs well with GRUB. - console based on either EFI simple text output or GOP-based framebuffer - clock based on EFI event/timer API - early console using either hard-wired PC-AT serial or just memory buffer - with EFI support disabled the BSP is more or less equivalent to amd64 BSP with multiboot2 support
Diffstat (limited to 'spec/build/bsps')
-rw-r--r--spec/build/bsps/objefi.yml17
-rw-r--r--spec/build/bsps/optefibs.yml18
-rw-r--r--spec/build/bsps/opteficonsole.yml29
-rw-r--r--spec/build/bsps/optefiearlyconsole.yml27
-rw-r--r--spec/build/bsps/optefigopm.yml20
-rw-r--r--spec/build/bsps/optefimmapprint.yml18
-rw-r--r--spec/build/bsps/optefistom.yml21
-rw-r--r--spec/build/bsps/optmultiboot.yml18
-rw-r--r--spec/build/bsps/x86_64/amd64/bspamd64efi.yml84
-rw-r--r--spec/build/bsps/x86_64/amd64/efiabi.yml23
-rw-r--r--spec/build/bsps/x86_64/amd64/optldpagesize.yml25
11 files changed, 300 insertions, 0 deletions
diff --git a/spec/build/bsps/objefi.yml b/spec/build/bsps/objefi.yml
new file mode 100644
index 0000000000..63f522c8b0
--- /dev/null
+++ b/spec/build/bsps/objefi.yml
@@ -0,0 +1,17 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: objects
+cflags: []
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+cppflags: []
+cxxflags: []
+enabled-by: true
+includes:
+- bsps/shared/freebsd/stand/efi/include
+- bsps/shared/freebsd/stand/efi/include/amd64
+install: []
+links: []
+source:
+- bsps/shared/freebsd/stand/efi/libefi/libefi.c
+- bsps/shared/freebsd/stand/efi/libefi/wchar.c
+type: build
diff --git a/spec/build/bsps/optefibs.yml b/spec/build/bsps/optefibs.yml
new file mode 100644
index 0000000000..ba7900f9ce
--- /dev/null
+++ b/spec/build/bsps/optefibs.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-boolean: null
+- env-assign: null
+- define-condition: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: true
+description: |
+ Enable use of EFI boot services.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_USE_EFI_BOOT_SERVICES
+type: build
diff --git a/spec/build/bsps/opteficonsole.yml b/spec/build/bsps/opteficonsole.yml
new file mode 100644
index 0000000000..5a6ab676cc
--- /dev/null
+++ b/spec/build/bsps/opteficonsole.yml
@@ -0,0 +1,29 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-string: null
+- define: null
+- script: |
+ kinds = ["TEXT", "GRAPHIC", "BOTH", "AUTO"]
+ if value not in kinds:
+ conf.fatal("Preferred EFI console '{}' is not one of {}".format(value, kinds))
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: AUTO
+description: |
+ Select preferred EFI console. Possible values are TEXT, GRAPHIC, BOTH and AUTO. The TEXT here will instruct RTEMS to use EFI simple text output protocol. By default
+ EFI also forwards such text output to configured serial port. Details depends on the target platform EFI configuration.
+ The GRAPHIC instructs RTEMS to use EFI graphics output protocol. Advantage of it
+ in comparison with TEXT is that it is available also in the time when boot services
+ are already finished. BOTH tells RTEMS to mirror its output to both TEXT and GRAPHIC. This only
+ applies to platforms where both options are supported. The option which is not supported
+ on target platform is ignored in the RTEMS runtime and only available option is used. Finally AUTO tells RTEMS to use output console
+ preferred by the target platform configuration. In case RTEMS is not able to retrieve EFI console control protocol interface, then BOTH
+ is used instead of AUTO.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_EFI_CONSOLE_KIND
+type: build
diff --git a/spec/build/bsps/optefiearlyconsole.yml b/spec/build/bsps/optefiearlyconsole.yml
new file mode 100644
index 0000000000..274e7eab05
--- /dev/null
+++ b/spec/build/bsps/optefiearlyconsole.yml
@@ -0,0 +1,27 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-string: null
+- script: |
+ kinds = ["SERIAL", "BUFFER"]
+ if value not in kinds:
+ conf.fatal("Preferred EFI early console '{}' is not one of {}".format(value, kinds))
+ conf.define("BUFFER", "1", False)
+ conf.define("SERIAL", "2", False)
+- define-unquoted: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: BUFFER
+description: |
+ Select preferred EFI early printout console. Possible values here
+ are SERIAL and BUFFER. In case of SERIAL, the tty0/com1 will be used
+ for early printout. In case of BUFFER, all prints will be buffered
+ and once real EFI console is initialized, then whole buffer will be
+ copied to it.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_EFI_EARLY_CONSOLE_KIND
+type: build
diff --git a/spec/build/bsps/optefigopm.yml b/spec/build/bsps/optefigopm.yml
new file mode 100644
index 0000000000..845447234a
--- /dev/null
+++ b/spec/build/bsps/optefigopm.yml
@@ -0,0 +1,20 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-string: null
+- define: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: AUTO
+description: |
+ Define EFI graphics output protocol mode value. Use MAX to select maximum
+ available mode or AUTO to allow automatic selection based on the platform
+ preference. Otherwise use positive integer number to select desired graphics
+ protocol mode which you can get from graphics protocol mode list.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_EFI_GRAPHICS_OUTPUT_MODE_VALUE
+type: build
diff --git a/spec/build/bsps/optefimmapprint.yml b/spec/build/bsps/optefimmapprint.yml
new file mode 100644
index 0000000000..b7ef7fcdd2
--- /dev/null
+++ b/spec/build/bsps/optefimmapprint.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-boolean: null
+- env-assign: null
+- define-condition: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: false
+description: |
+ Print EFI memory map on boot.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_EFI_MMAP_PRINTOUT
+type: build
diff --git a/spec/build/bsps/optefistom.yml b/spec/build/bsps/optefistom.yml
new file mode 100644
index 0000000000..c98a5172ef
--- /dev/null
+++ b/spec/build/bsps/optefistom.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-string: null
+- define: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: AUTO
+description: |
+ Define EFI simple text output protocol mode value. Use MAX to select maximum
+ available mode or AUTO to allow automatic selection based on the platform
+ preference. Otherwise use positive integer number to select desired simple
+ text output protocol mode which you can get from simple text protocol mode
+ list.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_EFI_SIMPLE_TEXT_OUTPUT_MODE_VALUE
+type: build
diff --git a/spec/build/bsps/optmultiboot.yml b/spec/build/bsps/optmultiboot.yml
new file mode 100644
index 0000000000..369804b591
--- /dev/null
+++ b/spec/build/bsps/optmultiboot.yml
@@ -0,0 +1,18 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-boolean: null
+- env-assign: null
+- define-condition: null
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: true
+description: |
+ Enable multiboot2 support in the startup assembly.
+enabled-by: true
+format: '{}'
+links: []
+name: BSP_MULTIBOOT_SUPPORT
+type: build
diff --git a/spec/build/bsps/x86_64/amd64/bspamd64efi.yml b/spec/build/bsps/x86_64/amd64/bspamd64efi.yml
new file mode 100644
index 0000000000..4fcfb5d8e1
--- /dev/null
+++ b/spec/build/bsps/x86_64/amd64/bspamd64efi.yml
@@ -0,0 +1,84 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+arch: x86_64
+bsp: amd64efi
+build-type: bsp
+cflags: []
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+enabled-by: true
+family: amd64
+includes:
+- bsps/shared/freebsd/stand/efi/include
+- bsps/shared/freebsd/stand/efi/include/amd64
+install:
+- destination: ${BSP_INCLUDEDIR}
+ source:
+ - bsps/x86_64/amd64/include/apic.h
+ - bsps/x86_64/amd64/include/bsp.h
+ - bsps/x86_64/amd64/include/clock.h
+ - bsps/x86_64/amd64/include/pic.h
+ - bsps/x86_64/amd64/include/start.h
+- destination: ${BSP_LIBDIR}
+ source:
+ - bsps/x86_64/amd64/start/linkcmds
+links:
+- role: build-dependency
+ uid: ../../obj
+- role: build-dependency
+ uid: ../../objirq
+- role: build-dependency
+ uid: ../../objmem
+- role: build-dependency
+ uid: ../../opto2
+- role: build-dependency
+ uid: efiabi
+- role: build-dependency
+ uid: start
+- role: build-dependency
+ uid: ../grp
+- role: build-dependency
+ uid: ../../optmultiboot
+- role: build-dependency
+ uid: ../../opteficonsole
+- role: build-dependency
+ uid: ../../optefiearlyconsole
+- role: build-dependency
+ uid: ../../optefistom
+- role: build-dependency
+ uid: ../../optefigopm
+- role: build-dependency
+ uid: ../../optefimmapprint
+- role: build-dependency
+ uid: ../../optefibs
+- role: build-dependency
+ uid: ../../bspopts
+- role: build-dependency
+ uid: optldpagesize
+- role: build-dependency
+ uid: ../../objefi
+source:
+- bsps/shared/cache/nocache.c
+- bsps/shared/dev/btimer/btimer-cpucounter.c
+- bsps/shared/dev/getentropy/getentropy-cpucounter.c
+- bsps/shared/dev/serial/console-termios-init.c
+- bsps/shared/dev/serial/console-termios.c
+- bsps/shared/irq/irq-default-handler.c
+- bsps/shared/start/bspfatal-default.c
+- bsps/shared/start/bspreset-empty.c
+- bsps/shared/start/gettargethash-default.c
+- bsps/shared/start/sbrk.c
+- bsps/x86_64/amd64/clock/eficlock.c
+- bsps/x86_64/amd64/console/eficonsole.c
+- bsps/x86_64/amd64/console/efistop.c
+- bsps/x86_64/amd64/console/efigop.c
+- bsps/x86_64/amd64/console/outch.c
+- bsps/x86_64/amd64/console/console.c
+- bsps/x86_64/amd64/interrupts/idt.c
+- bsps/x86_64/amd64/interrupts/isr_handler.S
+- bsps/x86_64/amd64/interrupts/pic.c
+- bsps/x86_64/amd64/start/bspstart.c
+- bsps/x86_64/amd64/start/multiboot2.c
+- bsps/x86_64/amd64/start/efimem.c
+- bsps/x86_64/amd64/start/page.c
+type: build
diff --git a/spec/build/bsps/x86_64/amd64/efiabi.yml b/spec/build/bsps/x86_64/amd64/efiabi.yml
new file mode 100644
index 0000000000..ccf1260879
--- /dev/null
+++ b/spec/build/bsps/x86_64/amd64/efiabi.yml
@@ -0,0 +1,23 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-string: null
+- split: null
+- env-append: null
+build-type: option
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+default:
+- enabled-by: true
+ value:
+ - -fshort-wchar
+ - -maccumulate-outgoing-args
+ - -fno-stack-protector
+ - -fno-stack-check
+ - -mno-red-zone
+ - -mcmodel=large
+description: |
+ ABI flags
+enabled-by: true
+links: []
+name: ABI_FLAGS
+type: build
diff --git a/spec/build/bsps/x86_64/amd64/optldpagesize.yml b/spec/build/bsps/x86_64/amd64/optldpagesize.yml
new file mode 100644
index 0000000000..f445eae606
--- /dev/null
+++ b/spec/build/bsps/x86_64/amd64/optldpagesize.yml
@@ -0,0 +1,25 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+actions:
+- get-integer: null
+- assert-uint32: null
+- env-assign: null
+- set-value: -Wl,-z,max-page-size=${LD_MAX_PAGE_SIZE:#010x}
+- substitute: null
+- env-append: LDFLAGS
+- env-append: PKGCONFIG_LDFLAGS
+build-type: option
+copyrights:
+- Copyright (C) 2023 Karel Gardas
+default:
+- enabled-by: true
+ value: 4096
+description: |
+ Set the value of max-page-size parameter for the GNU linker.
+ By default on x86_64 the linker is using 2MB page size which is
+ too big for creating correctly formed and later recognized multiboot2
+ binaries. Default value 4k used here is working well for the purpose.
+enabled-by: true
+format: '{:#010x}'
+links: []
+name: LD_MAX_PAGE_SIZE
+type: build