diff mbox

[5/6] ARM: add low level debug uart for rk1108

Message ID 1478176941-12188-1-git-send-email-andy.yan@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Yan Nov. 3, 2016, 12:42 p.m. UTC
RK1108 UARTs are Synopsis DesignWare 8250 compatible.
Only with different register addresses.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
---

 arch/arm/Kconfig.debug | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Heiko Stübner Nov. 4, 2016, 7:36 a.m. UTC | #1
Am Donnerstag, 3. November 2016, 20:42:21 CET schrieb Andy Yan:
> RK1108 UARTs are Synopsis DesignWare 8250 compatible.
> Only with different register addresses.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> ---
> 
>  arch/arm/Kconfig.debug | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index d83f7c3..408540f 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -776,6 +776,30 @@ choice
>  		  their output to the standard serial port on the RealView
>  		  PB1176 platform.
> 
> +	config DEBUG_RK1108_UART0
> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART0"
> +		depends on ARCH_ROCKCHIP
> +		select DEBUG_UART_8250
> +		help
> +		  Say Y here if you want kernel low-level debugging support
> +                  on Rockchip RK1108 based platforms.
> +
> +	config DEBUG_RK1108_UART1
> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART1"
> +		depends on ARCH_ROCKCHIP
> +		select DEBUG_UART_8250
> +		help
> +		  Say Y here if you want kernel low-level debugging support
> +		  on Rockchip RK1108 based platforms.
> +
> +	config DEBUG_RK1108_UART2
> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART2"
> +		depends on ARCH_ROCKCHIP
> +		select DEBUG_UART_8250
> +		help
> +		  Say Y here if you want kernel low-level debugging support
> +		  on Rockchip RK1108 based platforms.
> +

are you sure, you need all 3 of them?

I.e. most Rockchip SoCs so far had one uart somewhat designated as debug uart. 
Most likely due to it not having rts/cts and being used in reference 
schematics, but no one ever used another uart than uart2 on previous socs. So 
ideally we could check and only add uarts we actually need for now. More can 
be added later anyway once boards try to use them.


Heiko
Andy Yan Nov. 4, 2016, 7:58 a.m. UTC | #2
Hi Heiko:


On 2016年11月04日 15:36, Heiko Stuebner wrote:
> Am Donnerstag, 3. November 2016, 20:42:21 CET schrieb Andy Yan:
>> RK1108 UARTs are Synopsis DesignWare 8250 compatible.
>> Only with different register addresses.
>>
>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>> ---
>>
>>   arch/arm/Kconfig.debug | 30 ++++++++++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>
>> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
>> index d83f7c3..408540f 100644
>> --- a/arch/arm/Kconfig.debug
>> +++ b/arch/arm/Kconfig.debug
>> @@ -776,6 +776,30 @@ choice
>>   		  their output to the standard serial port on the RealView
>>   		  PB1176 platform.
>>
>> +	config DEBUG_RK1108_UART0
>> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART0"
>> +		depends on ARCH_ROCKCHIP
>> +		select DEBUG_UART_8250
>> +		help
>> +		  Say Y here if you want kernel low-level debugging support
>> +                  on Rockchip RK1108 based platforms.
>> +
>> +	config DEBUG_RK1108_UART1
>> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART1"
>> +		depends on ARCH_ROCKCHIP
>> +		select DEBUG_UART_8250
>> +		help
>> +		  Say Y here if you want kernel low-level debugging support
>> +		  on Rockchip RK1108 based platforms.
>> +
>> +	config DEBUG_RK1108_UART2
>> +		bool "Kernel low-level debugging messages via Rockchip RK1108 UART2"
>> +		depends on ARCH_ROCKCHIP
>> +		select DEBUG_UART_8250
>> +		help
>> +		  Say Y here if you want kernel low-level debugging support
>> +		  on Rockchip RK1108 based platforms.
>> +
> are you sure, you need all 3 of them?
>
> I.e. most Rockchip SoCs so far had one uart somewhat designated as debug uart.
> Most likely due to it not having rts/cts and being used in reference
> schematics, but no one ever used another uart than uart2 on previous socs. So
> ideally we could check and only add uarts we actually need for now. More can
> be added later anyway once boards try to use them.
>
>
> Heiko
>

     Actually, I have two boards on my hand, one uses uart0 as debug 
port and the another uses uart2, so I add all of them here.

    I have a question here, I not very clear how to get the 
DEBUG_UART_VIRT value here,  I now set the value I got from uart driver 
and it works , is there some rule or  method to calculate this 
DEBUG_UART_VIRT value on different platform?
>
Heiko Stübner Nov. 4, 2016, 8:03 a.m. UTC | #3
Am Freitag, 4. November 2016, 15:58:35 CET schrieb Andy Yan:
> Hi Heiko:
> 
> On 2016年11月04日 15:36, Heiko Stuebner wrote:
> > Am Donnerstag, 3. November 2016, 20:42:21 CET schrieb Andy Yan:
> >> RK1108 UARTs are Synopsis DesignWare 8250 compatible.
> >> Only with different register addresses.
> >> 
> >> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> >> ---
> >> 
> >>   arch/arm/Kconfig.debug | 30 ++++++++++++++++++++++++++++++
> >>   1 file changed, 30 insertions(+)
> >> 
> >> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> >> index d83f7c3..408540f 100644
> >> --- a/arch/arm/Kconfig.debug
> >> +++ b/arch/arm/Kconfig.debug
> >> @@ -776,6 +776,30 @@ choice
> >> 
> >>   		  their output to the standard serial port on the RealView
> >>   		  PB1176 platform.
> >> 
> >> +	config DEBUG_RK1108_UART0
> >> +		bool "Kernel low-level debugging messages via Rockchip RK1108 
UART0"
> >> +		depends on ARCH_ROCKCHIP
> >> +		select DEBUG_UART_8250
> >> +		help
> >> +		  Say Y here if you want kernel low-level debugging support
> >> +                  on Rockchip RK1108 based platforms.
> >> +
> >> +	config DEBUG_RK1108_UART1
> >> +		bool "Kernel low-level debugging messages via Rockchip RK1108 
UART1"
> >> +		depends on ARCH_ROCKCHIP
> >> +		select DEBUG_UART_8250
> >> +		help
> >> +		  Say Y here if you want kernel low-level debugging support
> >> +		  on Rockchip RK1108 based platforms.
> >> +
> >> +	config DEBUG_RK1108_UART2
> >> +		bool "Kernel low-level debugging messages via Rockchip RK1108 
UART2"
> >> +		depends on ARCH_ROCKCHIP
> >> +		select DEBUG_UART_8250
> >> +		help
> >> +		  Say Y here if you want kernel low-level debugging support
> >> +		  on Rockchip RK1108 based platforms.
> >> +
> > 
> > are you sure, you need all 3 of them?
> > 
> > I.e. most Rockchip SoCs so far had one uart somewhat designated as debug
> > uart. Most likely due to it not having rts/cts and being used in
> > reference schematics, but no one ever used another uart than uart2 on
> > previous socs. So ideally we could check and only add uarts we actually
> > need for now. More can be added later anyway once boards try to use them.
> > 
> > 
> > Heiko
> 
>      Actually, I have two boards on my hand, one uses uart0 as debug
> port and the another uses uart2, so I add all of them here.

ok, then this is fine.

>     I have a question here, I not very clear how to get the
> DEBUG_UART_VIRT value here,  I now set the value I got from uart driver
> and it works , is there some rule or  method to calculate this
> DEBUG_UART_VIRT value on different platform?

I don't really know. When I added the old uarts, I always just took the value 
from the vendor-kernel :-) .

In any case, arm32 now also supports earlycon (like arm64) not needing the 
bootloader setup of the uart. The one thing debug_ll can do that earlycon 
cannot is outputting stuff from the kernel decompressor.


Heiko
diff mbox

Patch

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index d83f7c3..408540f 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -776,6 +776,30 @@  choice
 		  their output to the standard serial port on the RealView
 		  PB1176 platform.
 
+	config DEBUG_RK1108_UART0
+		bool "Kernel low-level debugging messages via Rockchip RK1108 UART0"
+		depends on ARCH_ROCKCHIP
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+                  on Rockchip RK1108 based platforms.
+
+	config DEBUG_RK1108_UART1
+		bool "Kernel low-level debugging messages via Rockchip RK1108 UART1"
+		depends on ARCH_ROCKCHIP
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on Rockchip RK1108 based platforms.
+
+	config DEBUG_RK1108_UART2
+		bool "Kernel low-level debugging messages via Rockchip RK1108 UART2"
+		depends on ARCH_ROCKCHIP
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on Rockchip RK1108 based platforms.
+
 	config DEBUG_RK29_UART0
 		bool "Kernel low-level debugging messages via Rockchip RK29 UART0"
 		depends on ARCH_ROCKCHIP
@@ -1465,6 +1489,9 @@  config DEBUG_UART_PHYS
 	default 0x10126000 if DEBUG_RK3X_UART1
 	default 0x101f1000 if DEBUG_VERSATILE
 	default 0x101fb000 if DEBUG_NOMADIK_UART
+	default 0x10210000 if DEBUG_RK1108_UART2
+	default 0x10220000 if DEBUG_RK1108_UART1
+	default 0x10230000 if DEBUG_RK1108_UART0
 	default 0x11002000 if DEBUG_MT8127_UART0
 	default 0x11006000 if DEBUG_MT6589_UART0
 	default 0x11009000 if DEBUG_MT8135_UART3
@@ -1563,6 +1590,9 @@  config DEBUG_UART_PHYS
 
 config DEBUG_UART_VIRT
 	hex "Virtual base address of debug UART"
+	default 0xc881f000 if DEBUG_RK1108_UART2
+	default 0xc8821000 if DEBUG_RK1108_UART1
+	default 0xc8912000 if DEBUG_RK1108_UART0
 	default 0xe0000a00 if DEBUG_NETX_UART
 	default 0xe0010fe0 if ARCH_RPC
 	default 0xf0000be0 if ARCH_EBSA110