summaryrefslogtreecommitdiff
path: root/atos/arch
diff options
context:
space:
mode:
Diffstat (limited to 'atos/arch')
-rw-r--r--atos/arch/rv64/jh7110/Makefile28
-rw-r--r--atos/arch/rv64/jh7110/dev/link.ld32
-rw-r--r--atos/arch/rv64/jh7110/ke/head.S10
3 files changed, 70 insertions, 0 deletions
diff --git a/atos/arch/rv64/jh7110/Makefile b/atos/arch/rv64/jh7110/Makefile
new file mode 100644
index 0000000..2e9f989
--- /dev/null
+++ b/atos/arch/rv64/jh7110/Makefile
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2026, Apollo Telephone Laboratories.
+# Provided under the BSD-3 clause.
+#
+
+include ../../../../mk/atos.mk
+
+ASMFILES = $(shell find . -name "*.S")
+ASMOFILES = $(ASMFILES:.S=.S.o)
+MISC_OFILES = $(shell find $(GLOBAL_ROOT)/atos -name "*.o")
+CFLAGS = $(INTERNAL_CFLAGS)
+
+KERNEL_ELF_OUT = $(GLOBAL_ROOT)/out/atos.sys
+KERNEL_BIN_OUT = $(GLOBAL_ROOT)/out/atos.bin
+
+.PHONY: all
+all: $(KERNEL_ELF_OUT)
+ $(PROMPT) "OBJCOPY" $(KERNEL_BIN_OUT)
+ $(OBJCOPY) -O binary $(KERNEL_ELF_OUT) $(KERNEL_BIN_OUT)
+
+.PHONY: $(KERNEL_ELF_OUT)
+$(KERNEL_ELF_OUT): $(ASMOFILES)
+ $(PROMPT) "LD" $(KERNEL_ELF_OUT)
+ $(LD) -Tdev/link.ld $(MISC_OFILES) -o $(KERNEL_ELF_OUT)
+
+%.S.o: %.S
+ $(PROMPT) "CC" $<
+ $(CC) -c $< $(CFLAGS) -o $@
diff --git a/atos/arch/rv64/jh7110/dev/link.ld b/atos/arch/rv64/jh7110/dev/link.ld
new file mode 100644
index 0000000..c425651
--- /dev/null
+++ b/atos/arch/rv64/jh7110/dev/link.ld
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2026, Apollo Telephone Laboratories.
+ * Provided under the BSD-3 clause.
+ */
+
+ENTRY(MdHartEntry)
+
+SECTIONS {
+ . = 0x42200000;
+
+ .text : {
+ *(.text .text.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .rodata : {
+ *(.rodata .rodata.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .data : {
+ *(.data .data.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .bss : {
+ *(.bss .bss.*)
+ }
+}
diff --git a/atos/arch/rv64/jh7110/ke/head.S b/atos/arch/rv64/jh7110/ke/head.S
new file mode 100644
index 0000000..bc4a5ae
--- /dev/null
+++ b/atos/arch/rv64/jh7110/ke/head.S
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2026, Apollo Telephone Laboratories.
+ * Provided under the BSD-3 clause.
+ */
+
+ .text
+ .globl MdHartEntry
+MdHartEntry:
+1: wfi
+ j 1b