* [PATCH 1/2] riscv: xip_fixup.h: fix comment typo and whitespace issue
@ 2026-02-13 9:52 Kunwu Chan
2026-02-13 9:52 ` [PATCH 2/2] riscv: head.S: fix typo and wrong #endif comment Kunwu Chan
0 siblings, 1 reply; 2+ messages in thread
From: Kunwu Chan @ 2026-02-13 9:52 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: Alexandre Ghiti, Anup Patel, Atish Patra, Zong Li, Deepak Gupta,
zhouzhouyi, linux-riscv, linux-kernel, Kunwu Chan
Fix two minor issues in XIP_FIXUP_OFFSET macro:
- The comment describes the fixup formula as
"reg += CONFIG_PHYS_RAM_BASE - _start", but the actual assembly
code subtracts _sdata, not _start. Fix the comment to match.
- Replace spaces with a tab for the "add" instruction to keep
consistent indentation with surrounding lines.
Reviewed-by: zhouzhouyi <zhouzhouyi@gmail.com>
Signed-off-by: Kunwu Chan <kunwu.chan@linux.dev>
---
arch/riscv/include/asm/xip_fixup.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/include/asm/xip_fixup.h b/arch/riscv/include/asm/xip_fixup.h
index f3d56299bc22..56db595b0e14 100644
--- a/arch/riscv/include/asm/xip_fixup.h
+++ b/arch/riscv/include/asm/xip_fixup.h
@@ -16,10 +16,10 @@
*
* The start of data in Flash is _sdata and the start of data in RAM is
* CONFIG_PHYS_RAM_BASE. So this fix-up essentially does this:
- * reg += CONFIG_PHYS_RAM_BASE - _start
+ * reg += CONFIG_PHYS_RAM_BASE - _sdata
*/
li t0, CONFIG_PHYS_RAM_BASE
- add \reg, \reg, t0
+ add \reg, \reg, t0
la t0, _sdata
sub \reg, \reg, t0
.endm
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] riscv: head.S: fix typo and wrong #endif comment
2026-02-13 9:52 [PATCH 1/2] riscv: xip_fixup.h: fix comment typo and whitespace issue Kunwu Chan
@ 2026-02-13 9:52 ` Kunwu Chan
0 siblings, 0 replies; 2+ messages in thread
From: Kunwu Chan @ 2026-02-13 9:52 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: Alexandre Ghiti, Anup Patel, Atish Patra, Zong Li, Deepak Gupta,
zhouzhouyi, linux-riscv, linux-kernel, Kunwu Chan
- Fix spelling: "intruction" -> "instruction".
- Fix #endif comment: the matching #ifdef is CONFIG_XIP_KERNEL,
not CONFIG_XIP.
Reviewed-by: zhouzhouyi <zhouzhouyi@gmail.com>
Signed-off-by: Kunwu Chan <kunwu.chan@linux.dev>
---
arch/riscv/kernel/head.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 9c99c5ad6fe8..1618d2cb91b3 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -81,7 +81,7 @@ relocate_enable_mmu:
sub a1, a1, a2
add ra, ra, a1
- /* Point stvec to virtual address of intruction after satp write */
+ /* Point stvec to virtual address of instruction after satp write */
la a2, 1f
add a2, a2, a1
csrw CSR_TVEC, a2
@@ -287,7 +287,7 @@ SYM_CODE_START(_start_kernel)
/* first time here if hart_lottery in RAM is not set */
beq t0, t1, .Lsecondary_start
-#endif /* CONFIG_XIP */
+#endif /* CONFIG_XIP_KERNEL */
#endif /* CONFIG_RISCV_BOOT_SPINWAIT */
#ifdef CONFIG_XIP_KERNEL
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-13 9:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 9:52 [PATCH 1/2] riscv: xip_fixup.h: fix comment typo and whitespace issue Kunwu Chan
2026-02-13 9:52 ` [PATCH 2/2] riscv: head.S: fix typo and wrong #endif comment Kunwu Chan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox