summaryrefslogtreecommitdiff
path: root/rtl/gfx/firmware/mod.mk
diff options
context:
space:
mode:
Diffstat (limited to 'rtl/gfx/firmware/mod.mk')
-rw-r--r--rtl/gfx/firmware/mod.mk20
1 files changed, 19 insertions, 1 deletions
diff --git a/rtl/gfx/firmware/mod.mk b/rtl/gfx/firmware/mod.mk
index 2a37a9c..087aadc 100644
--- a/rtl/gfx/firmware/mod.mk
+++ b/rtl/gfx/firmware/mod.mk
@@ -1,4 +1,4 @@
-cores := gfx_bootrom
+cores := gfx_bootrom gfx_firmware
define core/gfx_bootrom
$(this)/cross := riscv32-none-elf-
@@ -15,3 +15,21 @@ define core/gfx_bootrom
$(this)/makehex_src := gfx_bootrom.bin
$(this)/makehex_obj := gfx_bootrom.hex
endef
+
+define core/gfx_firmware
+ $(this)/cross := riscv32-none-elf-
+ $(this)/hooks := cc objcopy bin2rel obj
+
+ $(this)/obj_deps := /$(here)link.ld
+
+ $(this)/cc_files := start.S main.c
+ $(this)/cc_flags = -g -O3 -march=rv32imc -mabi=ilp32
+ $(this)/ld_flags := -nostartfiles -nostdlib -T$(here)link.ld
+ $(this)/ld_binary := gfx_fw
+
+ $(this)/objcopy_src := gfx_fw
+ $(this)/objcopy_obj := gfx_fw.bin
+
+ $(this)/bin2rel_src := gfx_fw.bin
+ $(this)/bin2rel_obj := gfx_fw_payload.o
+endef