RISC-V: resurrect nmon
Subsystems (2)
cover RISC-V: resurrect nmon
After migrating to PBL we can't use nmon assembler macro in C code anymore. This series adds necessary wrapper for invoking nmon from PBL C code.
Antony Pavlov (3):
RISC-V: make it possible to run nmon from PBL C code
RISC-V: boards: erizo: make it possible to use nmon
RISC-V: boards: beaglev: make it possible to use nmon
arch/riscv/Kconfig.socs | 1 + arch/riscv/boards/beaglev/lowlevel.c | 2 ++ arch/riscv/boards/erizo/lowlevel.c | 2 ++ arch/riscv/boot/Makefile | 1 + arch/riscv/boot/nmon_entry.S | 13 ++++++++ arch/riscv/include/asm/riscv_nmon.h | 49 ++++++++++++++++++---------- 6 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 arch/riscv/boot/nmon_entry.S
Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/3 RISC-V: make it possible to run nmon from PBL C code
After migrating to PBL we can't use nmon assembler macro in C code anymore. Some changes are introduced to invoke nmon from PBL C code:
* use 'lla' macro instruction instead of 'la';
* don't touch the 'ra' register, use 'a2' instead;
* add wrapper C function for nmon.
--- arch/riscv/boot/Makefile | 1 + arch/riscv/boot/nmon_entry.S | 13 ++++++++ arch/riscv/include/asm/riscv_nmon.h | 49 +++++++++++++++++++---------- 3 files changed, 46 insertions(+), 17 deletions(-)
arch/riscv/boot/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 obj-y += start.o pbl-y += entry.o uncompress.o +pbl-y += nmon_entry.o pbl-$(CONFIG_BOARD_GENERIC_DT) += board-dt-2nd.o
arch/riscv/boot/nmon_entry.S new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include <linux/linkage.h> +#include <asm/sections.h> + +#include "asm/debug_ll.h" +#include "asm/riscv_nmon.h" + +.section .text_bare_init + +ENTRY(__barebox_nmon_entry) + riscv_nmon + ret +ENDPROC(__barebox_nmon_entry)
arch/riscv/include/asm/riscv_nmon.h +32 -17
110 lines not on this page · raw message
Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 RISC-V: boards: erizo: make it possible to use nmon
In reply to Antony Pavlov--- arch/riscv/boards/erizo/lowlevel.c | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/boards/erizo/lowlevel.c +2 -0
@@ -3,6 +3,7 @@#include <common.h> #include <asm/barebox-riscv.h> #include <debug_ll.h> +#include <asm/riscv_nmon.h> ENTRY_FUNCTION(start_erizo_generic, a0, a1, a2) {
@@ -10,6 +11,7 @@ ENTRY_FUNCTION(start_erizo_generic, a0, a1, a2)void *fdt;debug_ll_init (); +barebox_nmon_entry ();putc_ll ('>' );/* On POR, we are running from read-only memory here. */
Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 RISC-V: boards: beaglev: make it possible to use nmon
In reply to Antony Pavlov--- arch/riscv/Kconfig.socs | 1 + arch/riscv/boards/beaglev/lowlevel.c | 2 ++ 2 files changed, 3 insertions(+)
arch/riscv/Kconfig.socs +1 -0
@@ -52,6 +52,7 @@ config SOC_STARFIVE select ARCH_HAS_RESET_CONTROLLER select RISCV_S_MODE select HAS_ASM_DEBUG_LL + select HAS_NMON help This enables support for SiFive SoC platform hardware.
arch/riscv/boards/beaglev/lowlevel.c +2 -0
@@ -3,6 +3,7 @@#include <common.h> #include <debug_ll.h> #include <asm/barebox-riscv.h> +#include <asm/riscv_nmon.h> ENTRY_FUNCTION(start_beaglev_starlight, a0, a1, a2) {
@@ -10,6 +11,7 @@ ENTRY_FUNCTION(start_beaglev_starlight, a0, a1, a2)void *fdt;debug_ll_init (); +barebox_nmon_entry ();putc_ll ('>' ); fdt = __dtb_z_jh7100_beaglev_starlight_start +get_runtime_offset ();
Signature · 7 lines
2.32.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 8 lines · Antony Pavlov
After migrating to PBL we can't use nmon assembler macro in C code anymore. This series adds necessary wrapper for invoking nmon from PBL C code.
Antony Pavlov (3):
RISC-V: make it possible to run nmon from PBL C code
RISC-V: boards: erizo: make it possible to use nmon
RISC-V: boards: beaglev: make it possible to use nmon
Applied, thanks
Sascha
Quoted 14 lines
arch/riscv/Kconfig.socs | 1 + arch/riscv/boards/beaglev/lowlevel.c | 2 ++ arch/riscv/boards/erizo/lowlevel.c | 2 ++ arch/riscv/boot/Makefile | 1 + arch/riscv/boot/nmon_entry.S | 13 ++++++++ arch/riscv/include/asm/riscv_nmon.h | 49 ++++++++++++++++++---------- 6 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 arch/riscv/boot/nmon_entry.SSignature · 1 line
2.32.0
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox