summaryrefslogtreecommitdiff
path: root/rsp/rsp2elf.s
diff options
context:
space:
mode:
authorTharo <tharo10600@gmail.com>2026-08-02 15:27:33 +0100
committerGitHub <noreply@github.com>2026-08-02 16:27:33 +0200
commitda4a1f661cc87c8a31b65310f8940a5c5f0927d6 (patch)
tree3ec5f051015b043c943f47736c37aaf1476fc522 /rsp/rsp2elf.s
parent32b88f90a86a024dae0af0dc28a2c5e023fd193a (diff)
[rsp] Introduce microcode build process, disassemble and build both rspboot versions (#2764)HEADmain
* [rsp] Introduce microcode build process, disassemble and build both rspboot versions * Suggested changes * Check-in tool for generating armips.cpp from upstream sources, regen armips.cpp against a newer commit * License armips_gen.py, add notice that armips.cpp is automatically generated * Qualify comment with X105 * Clarify the assumed purpose of rspboot releasing SP_SEMAPHORE
Diffstat (limited to 'rsp/rsp2elf.s')
-rw-r--r--rsp/rsp2elf.s47
1 files changed, 47 insertions, 0 deletions
diff --git a/rsp/rsp2elf.s b/rsp/rsp2elf.s
new file mode 100644
index 000000000..db3618854
--- /dev/null
+++ b/rsp/rsp2elf.s
@@ -0,0 +1,47 @@
+/**
+ * @file rsp2elf.s
+ *
+ * This file converts binaries output from armips into a suitable elf file to be linked into the project.
+ * It requires the following preprocessor definitions to be provided when assembled:
+ * UC_NAME : The microcode name, used to generate symbol names for text and data
+ * UC_TEXT_SECTION : The program section to place the microcode text into, usually .text
+ * UC_DATA_SECTION : The program section to place the microcode data into, usually .rodata
+ * UC_TEXT_BIN_PATH : The path to the microcode text binary
+ * UC_DATA_BIN_PATH : The path to the microcode data binary
+ */
+
+/* Preprocessor macros */
+
+#define GLUE(a,b) a##b
+#define SYM_NAME(a,b) GLUE(a,b)
+
+#define STR(x) #x
+#define BIN_PATH(x) STR(x)
+
+/* Microcode text */
+
+.section UC_TEXT_SECTION
+
+.global SYM_NAME(UC_NAME,TextStart)
+SYM_NAME(UC_NAME,TextStart):
+
+ .incbin BIN_PATH(UC_TEXT_BIN_PATH)
+
+.global SYM_NAME(UC_NAME,TextEnd)
+SYM_NAME(UC_NAME,TextEnd):
+
+.size SYM_NAME(UC_NAME,TextStart), SYM_NAME(UC_NAME,TextEnd) - SYM_NAME(UC_NAME,TextStart)
+
+/* Microcode data */
+
+.section UC_DATA_SECTION
+
+.global SYM_NAME(UC_NAME,DataStart)
+SYM_NAME(UC_NAME,DataStart):
+
+ .incbin BIN_PATH(UC_DATA_BIN_PATH)
+
+.global SYM_NAME(UC_NAME,DataEnd)
+SYM_NAME(UC_NAME,DataEnd):
+
+.size SYM_NAME(UC_NAME,DataStart), SYM_NAME(UC_NAME,DataEnd) - SYM_NAME(UC_NAME,DataStart)