ARM: debug: add support for Palmchip 16550-like UART
Subsystems (2)
PATCH RESEND 1/1 ARM: debug: add support for Palmchip 16550-like UART
Some SoCs have a Palmchip UART with a non-standard register layout. This allows the debug console to work with these.
--- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/8250.S | 12 ++++++++++++ 2 files changed, 20 insertions(+)
arch/arm/Kconfig.debug +8 -0
@@ -1597,6 +1597,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 variant" + 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/8250.S +12 -0
@@ -9,6 +9,18 @@ */ #include <linux/serial_reg.h> +#ifdef CONFIG_DEBUG_UART_8250_PALMCHIP + +#undef UART_TX +#undef UART_LSR +#undef UART_MSR + +#define UART_TX 1 +#define UART_LSR 7 +#define UART_MSR 8 + +#endif + .macro addruart, rp, rv, tmp ldr \rp, =CONFIG_DEBUG_UART_PHYS ldr \rv, =CONFIG_DEBUG_UART_VIRT
Signature · 1 line
2.6.2
PATCH RESEND 1/1 ARM: debug: add support for Palmchip 16550-like UART
Quoted 14 lines · Mans Rullgard
Some SoCs have a Palmchip UART with a non-standard register layout. This allows the debug console to work with these.
Signed-off-by Mans Rullgard <[email protected]>--- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/8250.S | 12 ++++++++++++ 2 files changed, 20 insertions(+)arch/arm/Kconfig.debug +0
-0
arch/arm/Kconfig.debug config DEBUG_UART_8250_WORD · line 1602
Quoted 6 lines
arch/arm/Kconfig.debug +3
-0@@ -1597,6 +1597,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 variant" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
I am 100% clueless about the UART sequence in Linux.
There's earlyprintk, the boot console (polled?), the "full-blown" console (with IRQs)...
If I want earlyprintk, I have to enable DEBUG_LL (?) so I'll have DEBUG_LL_UART_8250, right? There's no way to pick DEBUG_UART_8250 in menuconfig, is there?
So I picked the following options:
CONFIG_DEBUG_LL=y
# CONFIG_DEBUG_ICEDCC is not set
# CONFIG_DEBUG_SEMIHOSTING is not setCONFIG_DEBUG_LL_UART_8250=y
# CONFIG_DEBUG_LL_UART_PL01X is not setCONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
# CONFIG_DEBUG_UART_8250 is not set
# CONFIG_DEBUG_UART_BCM63XX is not setCONFIG_DEBUG_UART_PHYS=0x10700CONFIG_DEBUG_UART_VIRT=0xf0010700CONFIG_DEBUG_UART_8250_SHIFT=2CONFIG_DEBUG_UART_8250_WORD=yCONFIG_DEBUG_UART_8250_PALMCHIP=y
# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not setCONFIG_DEBUG_UNCOMPRESS=yCONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"CONFIG_EARLY_PRINTK=y
I suppose I have to provide DEBUG_UART_PHYS because it needs the address before it can parse the DT? But how am I supposed to know the virtual address? Isn't that from iomap(UART_PHYS)?
'make' wouldn't let me proceed unless I gave something...
Then I have to add earlyprintk to my boot command line, right? Do I need to specify more than that?
According to the documentation,
earlyprintk= [X86,SH,BLACKFIN,ARM,M68k] earlyprintk=vga earlyprintk=efi earlyprintk=xen earlyprintk=serial[,ttySn[,baudrate]] earlyprintk=serial[,0x...[,baudrate]] earlyprintk=ttySn[,baudrate] earlyprintk=dbgp[debugController#] earlyprintk=pciserial,bus:device.function[,baudrate]
Quoted 22 lines
arch/arm/Kconfig.debug +5
-0+ 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_8250arch/arm/include/debug/8250.S +5
-0@@ -9,6 +9,18 @@ */ #include <linux/serial_reg.h> +#ifdef CONFIG_DEBUG_UART_8250_PALMCHIP + +#undef UART_TX +#undef UART_LSR +#undef UART_MSR
arch/arm/include/debug/8250.S line 26
Quoted 10 lines
arch/arm/include/debug/8250.S +7
-0+ +#define UART_TX 1 +#define UART_LSR 7 +#define UART_MSR 8 + +#endif + .macro addruart, rp, rv, tmp ldr \rp, =CONFIG_DEBUG_UART_PHYS ldr \rv, =CONFIG_DEBUG_UART_VIRT
Regards.
PATCH RESEND 1/1 ARM: debug: add support for Palmchip 16550-like UART
Quoted 43 lines · Mason
Quoted 14 lines · Mans Rullgard
Some SoCs have a Palmchip UART with a non-standard register layout. This allows the debug console to work with these.
Signed-off-by Mans Rullgard <[email protected]>--- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/8250.S | 12 ++++++++++++ 2 files changed, 20 insertions(+)arch/arm/Kconfig.debug +0
-0arch/arm/Kconfig.debug config DEBUG_UART_8250_WORD · line 1602
Quoted 6 lines
arch/arm/Kconfig.debug +3
-0@@ -1597,6 +1597,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 variant" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250I am 100% clueless about the UART sequence in Linux.
There's earlyprintk, the boot console (polled?), the "full-blown" console (with IRQs)...
If I want earlyprintk, I have to enable
DEBUG_LL(?) so I'll haveDEBUG_LL_UART_8250, right? There's no way to pickDEBUG_UART_8250in menuconfig, is there?So I picked the following options:
CONFIG_DEBUG_LL=y
#CONFIG_DEBUG_ICEDCCis not set
#CONFIG_DEBUG_SEMIHOSTINGis not setCONFIG_DEBUG_LL_UART_8250=y
#CONFIG_DEBUG_LL_UART_PL01Xis not setCONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
#CONFIG_DEBUG_UART_8250is not set
#CONFIG_DEBUG_UART_BCM63XXis not setCONFIG_DEBUG_UART_PHYS=0x10700
Quoted 8 lines
CONFIG_DEBUG_UART_VIRT=0xf0010700CONFIG_DEBUG_UART_8250_SHIFT=2CONFIG_DEBUG_UART_8250_WORD=yCONFIG_DEBUG_UART_8250_PALMCHIP=y
#CONFIG_DEBUG_UART_8250_FLOW_CONTROLis not setCONFIG_DEBUG_UNCOMPRESS=yCONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"CONFIG_EARLY_PRINTK=y
Those are the settings I use.
Quoted 3 lines
I suppose I have to provide
DEBUG_UART_PHYSbecause it needs the address before it can parse the DT? But how am I supposed to know the virtual address? Isn't that fromiomap(UART_PHYS)?
The decompression code and early setup don't have that luxury.
Quoted 4 lines
'make' wouldn't let me proceed unless I gave something...
Then I have to add earlyprintk to my boot command line, right? Do I need to specify more than that?
Just earlyprintk without any parameters works.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
PATCH RESEND 1/1 ARM: debug: add support for Palmchip 16550-like UART
Quoted 54 lines · M?ns Rullg?rd
Quoted 43 lines · Mason
Quoted 14 lines · Mans Rullgard
Some SoCs have a Palmchip UART with a non-standard register layout. This allows the debug console to work with these.
Signed-off-by Mans Rullgard <[email protected]>--- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/8250.S | 12 ++++++++++++ 2 files changed, 20 insertions(+)arch/arm/Kconfig.debug +0
-0arch/arm/Kconfig.debug config DEBUG_UART_8250_WORD · line 1602
Quoted 6 lines
arch/arm/Kconfig.debug +3
-0@@ -1597,6 +1597,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 variant" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250I am 100% clueless about the UART sequence in Linux.
There's earlyprintk, the boot console (polled?), the "full-blown" console (with IRQs)...
If I want earlyprintk, I have to enable
DEBUG_LL(?) so I'll haveDEBUG_LL_UART_8250, right? There's no way to pickDEBUG_UART_8250in menuconfig, is there?So I picked the following options:
CONFIG_DEBUG_LL=y
#CONFIG_DEBUG_ICEDCCis not set
#CONFIG_DEBUG_SEMIHOSTINGis not setCONFIG_DEBUG_LL_UART_8250=y
#CONFIG_DEBUG_LL_UART_PL01Xis not setCONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
#CONFIG_DEBUG_UART_8250is not set
#CONFIG_DEBUG_UART_BCM63XXis not setCONFIG_DEBUG_UART_PHYS=0x10700Quoted 8 lines
CONFIG_DEBUG_UART_VIRT=0xf0010700CONFIG_DEBUG_UART_8250_SHIFT=2CONFIG_DEBUG_UART_8250_WORD=yCONFIG_DEBUG_UART_8250_PALMCHIP=y
#CONFIG_DEBUG_UART_8250_FLOW_CONTROLis not setCONFIG_DEBUG_UNCOMPRESS=yCONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"CONFIG_EARLY_PRINTK=y
Quoted 7 lines
Those are the settings I use.
Quoted 3 lines
I suppose I have to provide
DEBUG_UART_PHYSbecause it needs the address before it can parse the DT? But how am I supposed to know the virtual address? Isn't that fromiomap(UART_PHYS)?The decompression code and early setup don't have that luxury.
But how am I supposed to compute the virtual address? Can I set DEBUG_UART_VIRT to 0xdeadbeef? :-)
Also is it expected that setting DEBUG_LL forces make to recompile every source file in the source tree?
Regards.
PATCH RESEND 1/1 ARM: debug: add support for Palmchip 16550-like UART
Quoted 58 lines · Mason
Quoted 56 lines · M?ns Rullg?rd
Quoted 43 lines · Mason
Quoted 14 lines · Mans Rullgard
Some SoCs have a Palmchip UART with a non-standard register layout. This allows the debug console to work with these.
Signed-off-by Mans Rullgard <[email protected]>--- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/8250.S | 12 ++++++++++++ 2 files changed, 20 insertions(+)arch/arm/Kconfig.debug +0
-0arch/arm/Kconfig.debug config DEBUG_UART_8250_WORD · line 1602
Quoted 6 lines
arch/arm/Kconfig.debug +3
-0@@ -1597,6 +1597,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 variant" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250I am 100% clueless about the UART sequence in Linux.
There's earlyprintk, the boot console (polled?), the "full-blown" console (with IRQs)...
If I want earlyprintk, I have to enable
DEBUG_LL(?) so I'll haveDEBUG_LL_UART_8250, right? There's no way to pickDEBUG_UART_8250in menuconfig, is there?So I picked the following options:
CONFIG_DEBUG_LL=y
#CONFIG_DEBUG_ICEDCCis not set
#CONFIG_DEBUG_SEMIHOSTINGis not setCONFIG_DEBUG_LL_UART_8250=y
#CONFIG_DEBUG_LL_UART_PL01Xis not setCONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
#CONFIG_DEBUG_UART_8250is not set
#CONFIG_DEBUG_UART_BCM63XXis not setCONFIG_DEBUG_UART_PHYS=0x10700Quoted 8 lines
CONFIG_DEBUG_UART_VIRT=0xf0010700CONFIG_DEBUG_UART_8250_SHIFT=2CONFIG_DEBUG_UART_8250_WORD=yCONFIG_DEBUG_UART_8250_PALMCHIP=y
#CONFIG_DEBUG_UART_8250_FLOW_CONTROLis not setCONFIG_DEBUG_UNCOMPRESS=yCONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"CONFIG_EARLY_PRINTK=yThose are the settings I use.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
I suppose I have to provide
DEBUG_UART_PHYSbecause it needs the address before it can parse the DT? But how am I supposed to know the virtual address? Isn't that fromiomap(UART_PHYS)?The decompression code and early setup don't have that luxury.
But how am I supposed to compute the virtual address? Can I set
DEBUG_UART_VIRTto0xdeadbeef? :-)
Add 0xf0000000.
Quoted 2 lines
Also is it expected that setting
DEBUG_LLforces make to recompile every source file in the source tree?
Apparently. :)
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com
Quoted 8 lines · On Tuesday 27 October 2015 12:57:57 Mans Rullgard wrote:
arch/arm/include/debug/8250.S +2
-0@@ -9,6 +9,18 @@ */ #include <linux/serial_reg.h> +#ifdef CONFIG_DEBUG_UART_8250_PALMCHIP +
arch/arm/include/debug/8250.S line 23
Quoted 10 lines
arch/arm/include/debug/8250.S +9
-0+#undef UART_TX +#undef UART_LSR +#undef UART_MSR + +#define UART_TX 1 +#define UART_LSR 7 +#define UART_MSR 8 + +#endif
Maybe use a separate file instead of an #ifdef?
Something like
arch/arm/include/debug/8250-palmchip.S:
#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 "8250.S"
Arnd
Quoted 32 lines · Arnd Bergmann
Quoted 8 lines · On Tuesday 27 October 2015 12:57:57 Mans Rullgard wrote:
arch/arm/include/debug/8250.S +2
-0@@ -9,6 +9,18 @@ */ #include <linux/serial_reg.h> +#ifdef CONFIG_DEBUG_UART_8250_PALMCHIP +arch/arm/include/debug/8250.S line 23
Quoted 10 lines
arch/arm/include/debug/8250.S +9
-0+#undef UART_TX +#undef UART_LSR +#undef UART_MSR + +#define UART_TX 1 +#define UART_LSR 7 +#define UART_MSR 8 + +#endifMaybe use a separate file instead of an #ifdef?
Something like
arch/arm/include/debug/8250-palmchip.S:#include <
linux/serial_reg.h>#undef
UART_TX
#undefUART_LSR
#undefUART_MSR
Quoted 5 lines
#define
UART_TX1
#defineUART_LSR7
#defineUART_MSR8#include "8250.S"
Good idea. I'll make a new patch.
Signature · 2 lines
M?ns Rullg?rd mans at mansr.com