From: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx> currently, the only difference is the end if entry function. Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx> --- arch/mips/include/asm/asm.h | 15 +++++++++++++++ arch/mips/lib/Makefile | 1 + arch/mips/lib/end.S | 16 ++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 arch/mips/lib/end.S diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 7a23f4ed82..4260ea4503 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -105,6 +105,21 @@ __error: \ b __error; \ nop; +/* + * ENTRY_FUNCTION_SRAM_END - mark end of sram entry function + */ +#define ENTRY_FUNCTION_SRAM_END \ + /* trigger a soft breakpoint for OpenOCD */ \ + SDBBP; \ + /* position independent variant of dead loop */ \ + __error: \ + b __error; \ + nop; \ + /* call some code from .text section */ \ + la v0, mips_dead_end; \ + jal v0; \ + nop; + /* * FEXPORT - export definition of a function symbol */ diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 1a049c7914..7372e8dc27 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -1,6 +1,7 @@ extra-$(CONFIG_GENERIC_LINKER_SCRIPT) += barebox.lds obj-$(CONFIG_CSRC_R4K_LIB) += csrc-r4k.o obj-y += cpu-probe.o +lwl-y += end.o obj-y += traps.o obj-y += genex.o obj-y += shutdown.o diff --git a/arch/mips/lib/end.S b/arch/mips/lib/end.S new file mode 100644 index 0000000000..78bd15ec17 --- /dev/null +++ b/arch/mips/lib/end.S @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2018 Oleksij Rempel <linux@xxxxxxxxxxxxxxxx> + */ + +#include <asm/asm.h> +#include <asm/regdef.h> + + .text + .set noreorder +LEAF(mips_dead_end) +__error: + b __error; + nop; + + END(mips_dead_end) -- 2.20.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox