summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@chromium.org>2020-11-18 17:32:06 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-19 08:53:27 +0000
commitf4fb44573738fcbc393b5d16c90ccf9d570480b0 (patch)
tree4569594e129b450a817e4635f951261447bcfdf6
parent62f9993a24dd10eed9300f37c3f8070b6093a62f (diff)
downloadchrome-ec-f4fb44573738fcbc393b5d16c90ccf9d570480b0.tar.gz
core/riscv-rv32i: move essential code to ram_code only if supports
Commit "it83xx: pull more functions into __ram_code section" (https://crrev.com/c/2535899) breaks Asurada SCP. It moves some essential code to .ram_code section but only IT8XXX2 family includes .ram_code in linker script. Moves the context switch code to ram_code only if it supports. BRANCH=none BUG=none TEST=make BOARD=asurada_scp && make BOARD=asurada Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I8602f7ef0103282feeddbfe1757f7cf7fb5512dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2546722 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
-rw-r--r--chip/it83xx/registers.h3
-rw-r--r--core/riscv-rv32i/switch.S4
2 files changed, 5 insertions, 2 deletions
diff --git a/chip/it83xx/registers.h b/chip/it83xx/registers.h
index ea344b35ec..9c3583ca4e 100644
--- a/chip/it83xx/registers.h
+++ b/chip/it83xx/registers.h
@@ -11,7 +11,8 @@
#include "common.h"
#include "compile_time_macros.h"
-#define __ram_code __attribute__((section(".ram_code")))
+#define __RAM_CODE_SECTION_NAME ".ram_code"
+#define __ram_code __attribute__((section(__RAM_CODE_SECTION_NAME)))
/* IRQ numbers */
/* Group 0 */
diff --git a/core/riscv-rv32i/switch.S b/core/riscv-rv32i/switch.S
index b7750975fd..8760667c6b 100644
--- a/core/riscv-rv32i/switch.S
+++ b/core/riscv-rv32i/switch.S
@@ -8,7 +8,9 @@
#include "config.h"
#include "cpu.h"
-.section .ram_code
+#ifdef __RAM_CODE_SECTION_NAME
+.section __RAM_CODE_SECTION_NAME
+#endif
/**
* Task context switching