All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jonas Bonn <jonas@southpole.se>,
	Openrisc <openrisc@lists.librecores.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH 03/13] openrisc: Add support for liteuart emergency printing
Date: Sun, 15 May 2022 21:41:48 +0900	[thread overview]
Message-ID: <20220515124158.3167452-4-shorne@gmail.com> (raw)
In-Reply-To: <20220515124158.3167452-1-shorne@gmail.com>

This patch adds support for sending emergency print output, such as
unhandled exception details, to a liteuart serial device.  This is the
default device available on litex platforms.

If a developer want to use this they should update UART_BASE_ADD
to the address of liteuart.

Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/kernel/head.S | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S
index b1f3a65c271c..21db50563f97 100644
--- a/arch/openrisc/kernel/head.S
+++ b/arch/openrisc/kernel/head.S
@@ -1555,6 +1555,17 @@ ENTRY(_emergency_putc)
 	l.movhi r4,hi(UART_BASE_ADD)
 	l.ori	r4,r4,lo(UART_BASE_ADD)
 
+#if defined(CONFIG_SERIAL_LITEUART)
+	/* Check OFF_TXFULL status */
+1:      l.lwz	r5,4(r4)
+	l.andi	r5,r5,0xff
+	l.sfnei	r5,0
+	l.bf	1b
+	 l.nop
+
+	/* Write character */
+	l.andi	r7,r7,0xff
+	l.sw	0(r4),r7
 #elif defined(CONFIG_SERIAL_8250)
 	/* Check UART LSR THRE (hold) bit */
 	l.addi  r6,r0,0x20
-- 
2.31.1


WARNING: multiple messages have this Message-ID (diff)
From: Stafford Horne <shorne@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Openrisc <openrisc@lists.librecores.org>,
	Stafford Horne <shorne@gmail.com>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH 03/13] openrisc: Add support for liteuart emergency printing
Date: Sun, 15 May 2022 21:41:48 +0900	[thread overview]
Message-ID: <20220515124158.3167452-4-shorne@gmail.com> (raw)
In-Reply-To: <20220515124158.3167452-1-shorne@gmail.com>

This patch adds support for sending emergency print output, such as
unhandled exception details, to a liteuart serial device.  This is the
default device available on litex platforms.

If a developer want to use this they should update UART_BASE_ADD
to the address of liteuart.

Signed-off-by: Stafford Horne <shorne@gmail.com>
---
 arch/openrisc/kernel/head.S | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/openrisc/kernel/head.S b/arch/openrisc/kernel/head.S
index b1f3a65c271c..21db50563f97 100644
--- a/arch/openrisc/kernel/head.S
+++ b/arch/openrisc/kernel/head.S
@@ -1555,6 +1555,17 @@ ENTRY(_emergency_putc)
 	l.movhi r4,hi(UART_BASE_ADD)
 	l.ori	r4,r4,lo(UART_BASE_ADD)
 
+#if defined(CONFIG_SERIAL_LITEUART)
+	/* Check OFF_TXFULL status */
+1:      l.lwz	r5,4(r4)
+	l.andi	r5,r5,0xff
+	l.sfnei	r5,0
+	l.bf	1b
+	 l.nop
+
+	/* Write character */
+	l.andi	r7,r7,0xff
+	l.sw	0(r4),r7
 #elif defined(CONFIG_SERIAL_8250)
 	/* Check UART LSR THRE (hold) bit */
 	l.addi  r6,r0,0x20
-- 
2.31.1


  parent reply	other threads:[~2022-05-15 12:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15 12:41 [PATCH 00/13] OpenIRSC misc cleanups for 5.19 Stafford Horne
2022-05-15 12:41 ` Stafford Horne
2022-05-15 12:41 ` [PATCH 01/13] openrisc: Add gcc machine instruction flag configuration Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 02/13] openrisc: Cleanup emergency print handling Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 16:03   ` Samuel Holland
2022-05-15 16:03     ` Samuel Holland
2022-05-15 21:36     ` Stafford Horne
2022-05-15 21:36       ` Stafford Horne
2022-05-15 12:41 ` Stafford Horne [this message]
2022-05-15 12:41   ` [PATCH 03/13] openrisc: Add support for liteuart emergency printing Stafford Horne
2022-05-15 12:41 ` [PATCH 04/13] openrisc: Add syscall details to emergency syscall debugging Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 05/13] openrisc: Pretty print show_registers memory dumps Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 06/13] openrisc: Update litex defconfig to support glibc userland Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 07/13] openrisc/traps: Declare file scope symbols as static Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 08/13] openrisc/traps: Remove die_if_kernel function Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 09/13] openrisc/traps: Declare unhandled_exception for asmlinkage Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 10/13] openrisc/time: Fix symbol scope warnings Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 11/13] openrisc/delay: Add include to fix symbol not declared warning Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 12/13] openrisc/fault: Fix symbol scope warnings Stafford Horne
2022-05-15 12:41   ` Stafford Horne
2022-05-15 12:41 ` [PATCH 13/13] openrisc: Remove unused IMMU tlb workardound Stafford Horne
2022-05-15 12:41   ` Stafford Horne

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=20220515124158.3167452-4-shorne@gmail.com \
    --to=shorne@gmail.com \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openrisc@lists.librecores.org \
    --cc=rdunlap@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.