diff --git a/README.md b/README.md index 9141d2a8b..92f0f49eb 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,8 @@ LICENSE.md LICENSES/$licence.txt doc/ doc/microkit_user_manual.pdf +example/ +example/$example/ bin/ bin/microkit board/ diff --git a/build_sdk.py b/build_sdk.py index 0dfda7409..f63cbc4c7 100644 --- a/build_sdk.py +++ b/build_sdk.py @@ -73,7 +73,6 @@ class BoardInfo: gcc_cpu: Optional[str] loader_link_address: int kernel_options: KERNEL_OPTIONS - examples: Dict[str, Path] @dataclass @@ -96,9 +95,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "ethernet": Path("example/tqma8xqp1gb/ethernet") - } ), BoardInfo( name="zcu102", @@ -113,9 +109,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/zcu102/hello") - } ), BoardInfo( name="maaxboard", @@ -129,9 +122,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/maaxboard/hello") - } ), BoardInfo( name="imx8mm_evk", @@ -145,9 +135,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "passive_server": Path("example/imx8mm_evk/passive_server") - } ), BoardInfo( name="imx8mp_evk", @@ -161,9 +148,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/imx8mp_evk/hello") - } ), BoardInfo( name="imx8mq_evk", @@ -177,9 +161,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/imx8mq_evk/hello") - } ), BoardInfo( name="odroidc2", @@ -193,9 +174,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/odroidc2/hello") - } ), BoardInfo( name="odroidc4", @@ -209,9 +187,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "timer": Path("example/odroidc4/timer") - } ), BoardInfo( name="qemu_virt_aarch64", @@ -228,10 +203,6 @@ class ConfigInfo: "KernelArmExportPTMRUser": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/qemu_virt_aarch64/hello"), - "hierarchy": Path("example/qemu_virt_aarch64/hierarchy") - } ), BoardInfo( name="qemu_virt_riscv64", @@ -245,9 +216,6 @@ class ConfigInfo: "KernelRiscvExtD": True, "KernelRiscvExtF": True, }, - examples={ - "hello": Path("example/qemu_virt_riscv64/hello"), - } ), BoardInfo( name="rockpro64", @@ -261,9 +229,6 @@ class ConfigInfo: "KernelArmHypervisorSupport": True, "KernelArmVtimerUpdateVOffset": False, }, - examples={ - "hello": Path("example/rockpro64/hello") - } ), BoardInfo( name="star64", @@ -276,9 +241,6 @@ class ConfigInfo: "KernelRiscvExtD": True, "KernelRiscvExtF": True, }, - examples={ - "hello": Path("example/star64/hello") - } ), ) @@ -310,6 +272,15 @@ class ConfigInfo: ) +EXAMPLES = { + "hello": Path("example/hello"), + "ethernet": Path("example/ethernet"), + "passive_server": Path("example/passive_server"), + "hierarchy": Path("example/hierarchy"), + "timer": Path("example/timer"), +} + + def tar_filter(tarinfo: TarInfo) -> TarInfo: """This is used to change the tarinfo when created the .tar.gz archive. @@ -681,19 +652,20 @@ def main() -> None: build_elf_component("loader", root_dir, build_dir, board, config, loader_defines) build_elf_component("monitor", root_dir, build_dir, board, config, []) build_lib_component("libmicrokit", root_dir, build_dir, board, config) - # Setup the examples - for example, example_path in board.examples.items(): - include_dir = root_dir / "board" / board.name / "example" / example - source_dir = example_path - for p in source_dir.rglob("*"): - if not p.is_file(): - continue - rel = p.relative_to(source_dir) - dest = include_dir / rel - dest.parent.mkdir(exist_ok=True, parents=True) - dest.unlink(missing_ok=True) - copy(p, dest) - dest.chmod(0o744) + + # Setup the examples + for example, example_path in EXAMPLES.items(): + include_dir = root_dir / "example" / example + source_dir = example_path + for p in source_dir.rglob("*"): + if not p.is_file(): + continue + rel = p.relative_to(source_dir) + dest = include_dir / rel + dest.parent.mkdir(exist_ok=True, parents=True) + dest.unlink(missing_ok=True) + copy(p, dest) + dest.chmod(0o744) if not args.skip_tar: # At this point we create a tar.gz file diff --git a/dev_build.py b/dev_build.py index 28de9a04c..d6c15bf64 100644 --- a/dev_build.py +++ b/dev_build.py @@ -90,9 +90,9 @@ def main(): # Choose the makefile based on the `--example-from-sdk` command line flag makefile_directory = ( - f"{release}/board/{args.board}/example/{args.example}" + f"{release}/example/{args.example}" if args.example_from_sdk - else f"{CWD.absolute()}/example/{args.board}/{args.example}" + else f"{CWD.absolute()}/example/{args.example}" ) cmd = ["make", "-C", makefile_directory] diff --git a/docs/manual.md b/docs/manual.md index 0ec7ede63..2280d4a3e 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -331,7 +331,7 @@ Additionally, for each supported board configuration the following are provided: * `kernel.elf` * `monitor.elf` -For some boards there are also examples provided in the `examples` directory. +There are also examples provided in the `example` directory. The Microkit SDK does **not** provide, nor require, any specific build system. The user is free to build their system using whatever build system is deemed most appropriate for their specific use case. diff --git a/example/tqma8xqp1gb/ethernet/Makefile b/example/ethernet/Makefile similarity index 93% rename from example/tqma8xqp1gb/ethernet/Makefile rename to example/ethernet/Makefile index 2e8ebbf55..a1db90ba9 100644 --- a/example/tqma8xqp1gb/ethernet/Makefile +++ b/example/ethernet/Makefile @@ -19,6 +19,10 @@ ifeq ($(strip $(MICROKIT_CONFIG)),) $(error MICROKIT_CONFIG must be specified) endif +ifneq ($(MICROKIT_BOARD),tqma8xqp1gb) +$(error Unsupported MICROKIT_BOARD given, only tqma8xqp1gb supported) +endif + TOOLCHAIN := aarch64-none-elf CPU := cortex-a35 diff --git a/example/ethernet/README.md b/example/ethernet/README.md new file mode 100644 index 000000000..cb77b75db --- /dev/null +++ b/example/ethernet/README.md @@ -0,0 +1,19 @@ + +# Example - Ethernet + +This example shows an ethernet system for the TQMa8XQP platform. +It also includes a driver for the general purpose timer on the platform. + +## Building + +```sh +mkdir build +make BUILD_DIR=build MICROKIT_BOARD=tqma8xqp1gb MICROKIT_CONFIG= MICROKIT_SDK=/path/to/sdk +``` + +## Running + +See instructions for your board in the manual. diff --git a/example/tqma8xqp1gb/ethernet/eth.c b/example/ethernet/eth.c similarity index 100% rename from example/tqma8xqp1gb/ethernet/eth.c rename to example/ethernet/eth.c diff --git a/example/tqma8xqp1gb/ethernet/ethernet.system b/example/ethernet/ethernet.system similarity index 100% rename from example/tqma8xqp1gb/ethernet/ethernet.system rename to example/ethernet/ethernet.system diff --git a/example/tqma8xqp1gb/ethernet/foo.c b/example/ethernet/foo.c similarity index 100% rename from example/tqma8xqp1gb/ethernet/foo.c rename to example/ethernet/foo.c diff --git a/example/tqma8xqp1gb/ethernet/gpt.c b/example/ethernet/gpt.c similarity index 100% rename from example/tqma8xqp1gb/ethernet/gpt.c rename to example/ethernet/gpt.c diff --git a/example/tqma8xqp1gb/ethernet/pass.c b/example/ethernet/pass.c similarity index 100% rename from example/tqma8xqp1gb/ethernet/pass.c rename to example/ethernet/pass.c diff --git a/example/qemu_virt_riscv64/hello/Makefile b/example/hello/Makefile similarity index 74% rename from example/qemu_virt_riscv64/hello/Makefile rename to example/hello/Makefile index 6b67fc73e..c892a5598 100644 --- a/example/qemu_virt_riscv64/hello/Makefile +++ b/example/hello/Makefile @@ -19,7 +19,20 @@ ifeq ($(strip $(MICROKIT_CONFIG)),) $(error MICROKIT_CONFIG must be specified) endif -TOOLCHAIN := riscv64-unknown-elf +BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) + +ARCH := ${shell grep 'CONFIG_SEL4_ARCH ' $(BOARD_DIR)/include/kernel/gen_config.h | cut -d' ' -f4} + +ifeq ($(ARCH),aarch64) + TOOLCHAIN := aarch64-none-elf + # No specific AArch64 flags + CFLAGS_ARCH := +else ifeq ($(ARCH),riscv64) + TOOLCHAIN := riscv64-unknown-elf + CFLAGS_ARCH := -march=rv64imafdc_zicsr_zifencei -mabi=lp64d +else +$(error Unsupported ARCH) +endif CC := $(TOOLCHAIN)-gcc LD := $(TOOLCHAIN)-ld @@ -28,10 +41,8 @@ MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit HELLO_OBJS := hello.o -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - IMAGES := hello.elf -CFLAGS := -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -march=rv64imafdc_zicsr_zifencei -mabi=lp64d +CFLAGS := -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include $(CFLAGS_ARCH) LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld diff --git a/example/hello/README.md b/example/hello/README.md new file mode 100644 index 000000000..271e91801 --- /dev/null +++ b/example/hello/README.md @@ -0,0 +1,21 @@ + +# Example - Hello World + +This is a basic hello world example that has a single protection domain +that simply prints "hello, world!" upon initialisation. + +All supported platforms are supported in this example. + +## Building + +```sh +mkdir build +make BUILD_DIR=build MICROKIT_BOARD= MICROKIT_CONFIG= MICROKIT_SDK=/path/to/sdk +``` + +## Running + +See instructions for your board in the manual. diff --git a/example/imx8mp_evk/hello/hello.c b/example/hello/hello.c similarity index 100% rename from example/imx8mp_evk/hello/hello.c rename to example/hello/hello.c diff --git a/example/imx8mp_evk/hello/hello.system b/example/hello/hello.system similarity index 100% rename from example/imx8mp_evk/hello/hello.system rename to example/hello/hello.system diff --git a/example/qemu_virt_aarch64/hierarchy/Makefile b/example/hierarchy/Makefile similarity index 76% rename from example/qemu_virt_aarch64/hierarchy/Makefile rename to example/hierarchy/Makefile index a4c06cc4f..7349bbd3b 100644 --- a/example/qemu_virt_aarch64/hierarchy/Makefile +++ b/example/hierarchy/Makefile @@ -19,9 +19,20 @@ ifeq ($(strip $(MICROKIT_CONFIG)),) $(error MICROKIT_CONFIG must be specified) endif -TOOLCHAIN := aarch64-none-elf +BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) -CPU := cortex-a53 +ARCH := ${shell grep 'CONFIG_SEL4_ARCH ' $(BOARD_DIR)/include/kernel/gen_config.h | cut -d' ' -f4} + +ifeq ($(ARCH),aarch64) + TOOLCHAIN := aarch64-none-elf + # No specific AArch64 flags + CFLAGS_ARCH := +else ifeq ($(ARCH),riscv64) + TOOLCHAIN := riscv64-unknown-elf + CFLAGS_ARCH := -march=rv64imafdc_zicsr_zifencei -mabi=lp64d +else +$(error Unsupported ARCH) +endif CC := $(TOOLCHAIN)-gcc LD := $(TOOLCHAIN)-ld @@ -32,10 +43,8 @@ RESTARTER_OBJS := restarter.o CRASHER_OBJS := crasher.o HELLO_OBJS := hello.o -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - IMAGES := restarter.elf crasher.elf hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include $(CFLAGS_ARCH) LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld diff --git a/example/hierarchy/README.md b/example/hierarchy/README.md new file mode 100644 index 000000000..332ddc35c --- /dev/null +++ b/example/hierarchy/README.md @@ -0,0 +1,23 @@ + +# Example - Hierarchy + +This example shows off the parent/child PD concept in Microkit as +well as fault handling. The parent 'restarter' PD recieves faults +from the 'crasher' PD that is intentionally crashing and then +resets the crasher's program counter. + +All supported platforms are supported in this example. + +## Building + +```sh +mkdir build +make BUILD_DIR=build MICROKIT_BOARD= MICROKIT_CONFIG= MICROKIT_SDK=/path/to/sdk +``` + +## Running + +See instructions for your board in the manual. diff --git a/example/qemu_virt_aarch64/hierarchy/crasher.c b/example/hierarchy/crasher.c similarity index 100% rename from example/qemu_virt_aarch64/hierarchy/crasher.c rename to example/hierarchy/crasher.c diff --git a/example/imx8mp_evk/imx8mq_evk/hello/hello.c b/example/hierarchy/hello.c similarity index 100% rename from example/imx8mp_evk/imx8mq_evk/hello/hello.c rename to example/hierarchy/hello.c diff --git a/example/qemu_virt_aarch64/hierarchy/hierachy.system b/example/hierarchy/hierachy.system similarity index 100% rename from example/qemu_virt_aarch64/hierarchy/hierachy.system rename to example/hierarchy/hierachy.system diff --git a/example/qemu_virt_aarch64/hierarchy/restarter.c b/example/hierarchy/restarter.c similarity index 100% rename from example/qemu_virt_aarch64/hierarchy/restarter.c rename to example/hierarchy/restarter.c diff --git a/example/imx8mp_evk/hello/Makefile b/example/imx8mp_evk/hello/Makefile deleted file mode 100644 index b78ab030f..000000000 --- a/example/imx8mp_evk/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/imx8mp_evk/imx8mq_evk/hello/Makefile b/example/imx8mp_evk/imx8mq_evk/hello/Makefile deleted file mode 100644 index b78ab030f..000000000 --- a/example/imx8mp_evk/imx8mq_evk/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/imx8mp_evk/imx8mq_evk/hello/hello.system b/example/imx8mp_evk/imx8mq_evk/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/imx8mp_evk/imx8mq_evk/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/imx8mq_evk/hello/Makefile b/example/imx8mq_evk/hello/Makefile deleted file mode 100644 index b78ab030f..000000000 --- a/example/imx8mq_evk/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g3 -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/imx8mq_evk/hello/hello.c b/example/imx8mq_evk/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/imx8mq_evk/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/imx8mq_evk/hello/hello.system b/example/imx8mq_evk/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/imx8mq_evk/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/maaxboard/hello/Makefile b/example/maaxboard/hello/Makefile deleted file mode 100644 index e7bdffb04..000000000 --- a/example/maaxboard/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/maaxboard/hello/hello.c b/example/maaxboard/hello/hello.c deleted file mode 100644 index 9519a6cb1..000000000 --- a/example/maaxboard/hello/hello.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void -init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void -notified(microkit_channel ch) -{ -} \ No newline at end of file diff --git a/example/maaxboard/hello/hello.system b/example/maaxboard/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/maaxboard/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/odroidc2/hello/Makefile b/example/odroidc2/hello/Makefile deleted file mode 100644 index b71bb74ee..000000000 --- a/example/odroidc2/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a55 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/odroidc2/hello/hello.c b/example/odroidc2/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/odroidc2/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/odroidc2/hello/hello.system b/example/odroidc2/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/odroidc2/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/imx8mm_evk/passive_server/Makefile b/example/passive_server/Makefile similarity index 74% rename from example/imx8mm_evk/passive_server/Makefile rename to example/passive_server/Makefile index d1a0a486b..c144a0e89 100644 --- a/example/imx8mm_evk/passive_server/Makefile +++ b/example/passive_server/Makefile @@ -19,9 +19,20 @@ ifeq ($(strip $(MICROKIT_CONFIG)),) $(error MICROKIT_CONFIG must be specified) endif -TOOLCHAIN := aarch64-none-elf +BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) -CPU := cortex-a53 +ARCH := ${shell grep 'CONFIG_SEL4_ARCH ' $(BOARD_DIR)/include/kernel/gen_config.h | cut -d' ' -f4} + +ifeq ($(ARCH),aarch64) + TOOLCHAIN := aarch64-none-elf + # No specific AArch64 flags + CFLAGS_ARCH := +else ifeq ($(ARCH),riscv64) + TOOLCHAIN := riscv64-unknown-elf + CFLAGS_ARCH := -march=rv64imafdc_zicsr_zifencei -mabi=lp64d +else +$(error Unsupported ARCH) +endif CC := $(TOOLCHAIN)-gcc LD := $(TOOLCHAIN)-ld @@ -31,10 +42,8 @@ MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit SERVER_OBJS := server.o CLIENT_OBJS := client.o -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - IMAGES := server.elf client.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include +CFLAGS := -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include $(CFLAGS_ARCH) LDFLAGS := -L$(BOARD_DIR)/lib LIBS := -lmicrokit -Tmicrokit.ld diff --git a/example/passive_server/README.md b/example/passive_server/README.md new file mode 100644 index 000000000..c4c94d86c --- /dev/null +++ b/example/passive_server/README.md @@ -0,0 +1,26 @@ + +# Example - Passive Server + +This example shows a client and server PD communicating with each +other where the server does not have an active scheduling context +and is therefore a 'passive' server. + +When the client PPCs into the server, the server is executing on +the client's budget. See the manual for more details on passive +PDs. + +All supported platforms are supported in this example. + +## Building + +```sh +mkdir build +make BUILD_DIR=build MICROKIT_BOARD= MICROKIT_CONFIG= MICROKIT_SDK=/path/to/sdk +``` + +## Running + +See instructions for your board in the manual. diff --git a/example/imx8mm_evk/passive_server/client.c b/example/passive_server/client.c similarity index 100% rename from example/imx8mm_evk/passive_server/client.c rename to example/passive_server/client.c diff --git a/example/imx8mm_evk/passive_server/passive_server.system b/example/passive_server/passive_server.system similarity index 100% rename from example/imx8mm_evk/passive_server/passive_server.system rename to example/passive_server/passive_server.system diff --git a/example/imx8mm_evk/passive_server/server.c b/example/passive_server/server.c similarity index 100% rename from example/imx8mm_evk/passive_server/server.c rename to example/passive_server/server.c diff --git a/example/qemu_virt_aarch64/hello/Makefile b/example/qemu_virt_aarch64/hello/Makefile deleted file mode 100644 index e7bdffb04..000000000 --- a/example/qemu_virt_aarch64/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/qemu_virt_aarch64/hello/hello.c b/example/qemu_virt_aarch64/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/qemu_virt_aarch64/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/qemu_virt_aarch64/hello/hello.system b/example/qemu_virt_aarch64/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/qemu_virt_aarch64/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/qemu_virt_aarch64/hierarchy/hello.c b/example/qemu_virt_aarch64/hierarchy/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/qemu_virt_aarch64/hierarchy/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/qemu_virt_riscv64/hello/hello.c b/example/qemu_virt_riscv64/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/qemu_virt_riscv64/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/qemu_virt_riscv64/hello/hello.system b/example/qemu_virt_riscv64/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/qemu_virt_riscv64/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/rockpro64/hello/Makefile b/example/rockpro64/hello/Makefile deleted file mode 100644 index e7bdffb04..000000000 --- a/example/rockpro64/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/rockpro64/hello/hello.c b/example/rockpro64/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/rockpro64/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/rockpro64/hello/hello.system b/example/rockpro64/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/rockpro64/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/star64/hello/Makefile b/example/star64/hello/Makefile deleted file mode 100644 index 6b67fc73e..000000000 --- a/example/star64/hello/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := riscv64-unknown-elf - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -march=rv64imafdc_zicsr_zifencei -mabi=lp64d -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/star64/hello/hello.c b/example/star64/hello/hello.c deleted file mode 100644 index 493c95746..000000000 --- a/example/star64/hello/hello.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void notified(microkit_channel ch) -{ -} diff --git a/example/star64/hello/hello.system b/example/star64/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/star64/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/example/odroidc4/timer/Makefile b/example/timer/Makefile similarity index 92% rename from example/odroidc4/timer/Makefile rename to example/timer/Makefile index 1880f8da3..0a1bdbded 100644 --- a/example/odroidc4/timer/Makefile +++ b/example/timer/Makefile @@ -19,6 +19,10 @@ ifeq ($(strip $(MICROKIT_CONFIG)),) $(error MICROKIT_CONFIG must be specified) endif +ifneq ($(MICROKIT_BOARD),odroidc4) +$(error Unsupported MICROKIT_BOARD given, only odroidc4 supported) +endif + TOOLCHAIN := aarch64-none-elf CPU := cortex-a55 diff --git a/example/timer/README.md b/example/timer/README.md new file mode 100644 index 000000000..dc0b12b83 --- /dev/null +++ b/example/timer/README.md @@ -0,0 +1,21 @@ + +# Example - Timer + +This example shows a basic timer driver for the Odroid-C4 +platform. The timer driver initialises the device and then +sets a regular 1 second timeout and prints the current time +whenever the timeout expires. + +## Building + +```sh +mkdir build +make BUILD_DIR=build MICROKIT_BOARD=odroidc4 MICROKIT_CONFIG= MICROKIT_SDK=/path/to/sdk +``` + +## Running + +See instructions for your board in the manual. diff --git a/example/odroidc4/timer/timer.c b/example/timer/timer.c similarity index 100% rename from example/odroidc4/timer/timer.c rename to example/timer/timer.c diff --git a/example/odroidc4/timer/timer.system b/example/timer/timer.system similarity index 100% rename from example/odroidc4/timer/timer.system rename to example/timer/timer.system diff --git a/example/zcu102/hello/Makefile b/example/zcu102/hello/Makefile deleted file mode 100644 index e7bdffb04..000000000 --- a/example/zcu102/hello/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright 2021, Breakaway Consulting Pty. Ltd. -# -# SPDX-License-Identifier: BSD-2-Clause -# -ifeq ($(strip $(BUILD_DIR)),) -$(error BUILD_DIR must be specified) -endif - -ifeq ($(strip $(MICROKIT_SDK)),) -$(error MICROKIT_SDK must be specified) -endif - -ifeq ($(strip $(MICROKIT_BOARD)),) -$(error MICROKIT_BOARD must be specified) -endif - -ifeq ($(strip $(MICROKIT_CONFIG)),) -$(error MICROKIT_CONFIG must be specified) -endif - -TOOLCHAIN := aarch64-none-elf - -CPU := cortex-a53 - -CC := $(TOOLCHAIN)-gcc -LD := $(TOOLCHAIN)-ld -AS := $(TOOLCHAIN)-as -MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit - -HELLO_OBJS := hello.o - -BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) - -IMAGES := hello.elf -CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include -LDFLAGS := -L$(BOARD_DIR)/lib -LIBS := -lmicrokit -Tmicrokit.ld - -IMAGE_FILE = $(BUILD_DIR)/loader.img -REPORT_FILE = $(BUILD_DIR)/report.txt - -all: $(IMAGE_FILE) - -$(BUILD_DIR)/%.o: %.c Makefile - $(CC) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile - $(AS) -g -mcpu=$(CPU) $< -o $@ - -$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) - $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ - -$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system - $(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) diff --git a/example/zcu102/hello/hello.c b/example/zcu102/hello/hello.c deleted file mode 100644 index 9519a6cb1..000000000 --- a/example/zcu102/hello/hello.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021, Breakaway Consulting Pty. Ltd. - * - * SPDX-License-Identifier: BSD-2-Clause - */ -#include -#include - -void -init(void) -{ - microkit_dbg_puts("hello, world\n"); -} - -void -notified(microkit_channel ch) -{ -} \ No newline at end of file diff --git a/example/zcu102/hello/hello.system b/example/zcu102/hello/hello.system deleted file mode 100644 index 146da4bab..000000000 --- a/example/zcu102/hello/hello.system +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file