Skip to contentSkip to conversation

ARM: debug: add support for Palmchip BK-310x UART

PATCH RESEND Superseded Marc Gonzalez 3 participants 6 messages Jan 18, 2016 – Jan 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout. While this UART has previously only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
arch/arm/Kconfig.debug +9 -0
index 259c0ca9c99a..708aa9150c00 100644
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP
 	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
 	default "debug/at91.S" if DEBUG_AT91_UART
 	default "debug/asm9260.S" if DEBUG_ASM9260_UART
@@ -1588,6 +1589,14 @@ config DEBUG_UART_8250_WORD
 		DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2 || \
 		DEBUG_BRCMSTB_UART
 
+config DEBUG_UART_8250_PALMCHIP
+	bool "8250 UART is Palmchip BK-310x"
+	depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
+	help
+	  Palmchip provides a UART implementation compatible with 16550
+	  except for having a different register layout.  Say Y here if
+	  the debug UART is of this type.
+
 config DEBUG_UART_8250_FLOW_CONTROL
 	bool "Enable flow control for 8250 UART"
 	depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
arch/arm/include/debug/palmchip.S new file +11 -0
new file mode 100644
index 000000000000..6824b2d1c38e
@@ -0,0 +1,11 @@
+#include <linux/serial_reg.h>
+
+#undef UART_TX
+#undef UART_LSR
+#undef UART_MSR
+
+#define UART_TX 1
+#define UART_LSR 7
+#define UART_MSR 8
+
+#include <debug/8250.S>
#1 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

Quoted 4 lines · Marc Gonzalez

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout.

... because UART register layout is where we really need innovation. ;)

Quoted 8 lines

While this UART has previously
only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

It appears this was previously acked by Arnd also? https://lkml.org/lkml/2015/11/9/116

Quoted 14 lines

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
arch/arm/Kconfig.debug +0 -0
index 259c0ca9c99a..708aa9150c00 100644

arch/arm/Kconfig.debug config DEBUG_SIRFSOC_UART · line 1307

Quoted 4 lines
arch/arm/Kconfig.debug +1 -0
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP

minor nit: We're trying (not always with great success) to keep various parts of this file sorted alphanumerically. Can you please insert the new entries accordingly?

Otherwise looks good to me,

Kevin

#2 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

Quoted 30 lines · Kevin Hilman
Quoted 4 lines · Marc Gonzalez

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout.

... because UART register layout is where we really need innovation. ;)

Quoted 8 lines

While this UART has previously
only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

It appears this was previously acked by Arnd also?
https://lkml.org/lkml/2015/11/9/116

Quoted 9 lines

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
Quoted 13 lines

arch/arm/Kconfig.debug config DEBUG_SIRFSOC_UART · line 1307

Quoted 9 lines
arch/arm/Kconfig.debug +1 -0
index 259c0ca9c99a..708aa9150c00 100644
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP

minor nit: We're trying (not always with great success) to keep various parts of this file sorted alphanumerically. Can you please insert the new entries accordingly?

It has to precede the regular 8250 entry so as to take precedence over that.

Quoted 5 lines

Otherwise looks good to me,

Kevin

Signature · 1 line
M?ns Rullg?rd
#3 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

Quoted 46 lines · M?ns Rullg?rd
Quoted 30 lines · Kevin Hilman
Quoted 4 lines · Marc Gonzalez

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout.

... because UART register layout is where we really need innovation. ;)

Quoted 8 lines

While this UART has previously
only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

It appears this was previously acked by Arnd also?
https://lkml.org/lkml/2015/11/9/116

Quoted 9 lines

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
Quoted 13 lines

arch/arm/Kconfig.debug config DEBUG_SIRFSOC_UART · line 1307

Quoted 9 lines
arch/arm/Kconfig.debug +1 -0
index 259c0ca9c99a..708aa9150c00 100644
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP

minor nit: We're trying (not always with great success) to keep various parts of this file sorted alphanumerically. Can you please insert the new entries accordingly?

Quoted 2 lines

It has to precede the regular 8250 entry so as to take precedence over that.

<confused> Are you all talking about these 2 lines:

	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP
	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250

default "debug/palmchip.S" is supposed to come before default "debug/8250.S" ?

Because, in my config, there is no DEBUG_LL_UART_8250 to be seen, and # CONFIG_DEBUG_UART_8250 is not set

So I don't see how the order might cause a problem in that case?

Regards.

#4 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

Quoted 53 lines · Marc Gonzalez
Quoted 46 lines · M?ns Rullg?rd
Quoted 30 lines · Kevin Hilman
Quoted 4 lines · Marc Gonzalez

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout.

... because UART register layout is where we really need innovation. ;)

Quoted 8 lines

While this UART has previously
only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

It appears this was previously acked by Arnd also?
https://lkml.org/lkml/2015/11/9/116

Quoted 9 lines

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
Quoted 13 lines

arch/arm/Kconfig.debug config DEBUG_SIRFSOC_UART · line 1307

Quoted 9 lines
arch/arm/Kconfig.debug +1 -0
index 259c0ca9c99a..708aa9150c00 100644
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP

minor nit: We're trying (not always with great success) to keep various parts of this file sorted alphanumerically. Can you please insert the new entries accordingly?

Quoted 2 lines

It has to precede the regular 8250 entry so as to take precedence over that.

<confused> Are you all talking about these 2 lines:

Quoted 7 lines
	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP
	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250

default "debug/palmchip.S" is supposed to come before default "debug/8250.S" ?

Because, in my config, there is no DEBUG_LL_UART_8250 to be seen, and # CONFIG_DEBUG_UART_8250 is not set

CONFIG_DEBUG_LL_UART_8250=y here. In fact DEBUG_UART_8250_PALMCHIP depends on "DEBUG_LL_UART_8250 || DEBUG_UART_8250" so one of those *must* be set for any of this to matter.

Signature · 1 line
M?ns Rullg?rd
#5 lore raw

PATCH RESEND v2 1/1 ARM: debug: add support for Palmchip BK-310x UART

Quoted 58 lines · M?ns Rullg?rd
Quoted 56 lines · Marc Gonzalez
Quoted 46 lines · M?ns Rullg?rd
Quoted 30 lines · Kevin Hilman
Quoted 4 lines · Marc Gonzalez

From: Mans Rullgard <[email protected]>

Some SoCs use a Palmchip BK-310x UART which is mostly 16550 compatible but with a different register layout.

... because UART register layout is where we really need innovation. ;)

Quoted 8 lines

While this UART has previously
only been supported in MIPS based chips (Alchemy, Ralink), the ARM based SMP87xx series from Sigma Designs also uses it.

This patch allows the debug console to work with this type of UART.

It appears this was previously acked by Arnd also?
https://lkml.org/lkml/2015/11/9/116

Quoted 9 lines

---
Peter, this is the patch I've been using on Tango for earlyprintk support. arm-soc, this is just the Nov 8 patch with my Signed-off-by tag.

---
 arch/arm/Kconfig.debug            |  9 +++++++++
 arch/arm/include/debug/palmchip.S | 11 +++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 arch/arm/include/debug/palmchip.S
Quoted 13 lines

arch/arm/Kconfig.debug config DEBUG_SIRFSOC_UART · line 1307

Quoted 9 lines
arch/arm/Kconfig.debug +1 -0
index 259c0ca9c99a..708aa9150c00 100644
@@ -1304,6 +1304,7 @@ config DEBUG_SIRFSOC_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/sa1100.S" if DEBUG_SA1100
+	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP

minor nit: We're trying (not always with great success) to keep various parts of this file sorted alphanumerically. Can you please insert the new entries accordingly?

Quoted 2 lines

It has to precede the regular 8250 entry so as to take precedence over that.

<confused> Are you all talking about these 2 lines:

	default "debug/palmchip.S" if DEBUG_UART_8250_PALMCHIP
	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
Quoted 8 lines
Quoted 4 lines

default "debug/palmchip.S" is supposed to come before default "debug/8250.S" ?

Because, in my config, there is no DEBUG_LL_UART_8250 to be seen, and # CONFIG_DEBUG_UART_8250 is not set

CONFIG_DEBUG_LL_UART_8250=y here. In fact DEBUG_UART_8250_PALMCHIP depends on "DEBUG_LL_UART_8250 || DEBUG_UART_8250" so one of those *must* be set for any of this to matter.

Doh! I was looking at a config where earlyprintk isn't enabled... o_O

config DEBUG_UART_8250_PALMCHIP

	bool "8250 UART is Palmchip BK-310x"
	depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250

OK, I understand now. Thanks.

Regards.