mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH 3/5] MIPS: add ENTRY_FUNCTION_SRAM_END define
Date: Sat, 19 Jan 2019 17:36:45 +0100	[thread overview]
Message-ID: <20190119163647.9119-3-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20190119163647.9119-1-o.rempel@pengutronix.de>

From: Oleksij Rempel <linux@rempel-privat.de>

currently, the only difference is the end if entry function.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 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@rempel-privat.de>
+ */
+
+#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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-01-19 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-19 16:36 [PATCH 1/5] MIPS: tplink-mr3020: use ar9331_pbl_generic_start Oleksij Rempel
2019-01-19 16:36 ` [PATCH 2/5] MIPS: black-swift: " Oleksij Rempel
2019-01-19 16:36 ` Oleksij Rempel [this message]
2019-01-19 16:36 ` [PATCH 4/5] MIPS: ath79: add spi trap Oleksij Rempel
2019-01-19 16:36 ` [PATCH 5/5] MIPS: ath79: add SRAM support Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190119163647.9119-3-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox