linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS
@ 2015-08-08 10:11 Alexandre Belloni
  2015-09-18 14:48 ` Nicolas Ferre
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2015-08-08 10:11 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
	linux-arm-kernel, linux-kernel, Alexandre Belloni

Instead of having to add a new configuration option each time support for
new SoC is added, use CONFIG_DEBUG_UART_PHYS. For now,
CONFIG_DEBUG_UART_VIRT is automatically computed.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/Kconfig.debug        | 41 ++++++++++++++++-------------------------
 arch/arm/include/debug/at91.S | 18 ++++--------------
 2 files changed, 20 insertions(+), 39 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 946c8c0fa1fb..3ba23d0f5c55 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -123,29 +123,23 @@ choice
 		    0x80020000      | 0xf0020000     | UART8
 		    0x80024000      | 0xf0024000     | UART9
 
-	config AT91_DEBUG_LL_DBGU0
-		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
-		select DEBUG_AT91_UART
+	config DEBUG_AT91_UART
+		bool "Kernel low-level debugging on Atmel SoCs"
 		depends on ARCH_AT91
-		depends on SOC_AT91RM9200 || SOC_AT91SAM9
+		help
+		  Say Y here if you want the debug print routines to direct
+		  their output to the serial port on atmel devices.
 
-	config AT91_DEBUG_LL_DBGU1
-		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
-		select DEBUG_AT91_UART
-		depends on ARCH_AT91
-		depends on SOC_AT91SAM9 || SOC_SAMA5
+		  SOC                  DEBUG_UART_PHYS   DEBUG_UART_VIRT  PORT
+		  rm9200, 9260/9g20,   0xfffff200        0xfefff200       DBGU
+		  9261/9g10, 9rl
+		  9263, 9g45, sama5d3  0xffffee00        0xfeffee00       DBGU
+		  sama5d4              0xfc00c000        0xfb00c000       USART3
+		  sama5d4              0xfc069000        0xfb069000       DBGU
+		  sama5d2              0xf8020000        0xf7020000       UART1
 
-	config AT91_DEBUG_LL_DBGU2
-		bool "Kernel low-level debugging on sama5d4"
-		select DEBUG_AT91_UART
-		depends on ARCH_AT91
-		depends on SOC_SAMA5
-
-	config AT91_DEBUG_LL_DBGU3
-		bool "Kernel low-level debugging on sama5d2"
-		select DEBUG_AT91_UART
-		depends on ARCH_AT91
-		depends on SOC_SAMA5
+		  Please adjust DEBUG_UART_PHYS configuration options based on
+		  your needs.
 
 	config DEBUG_BCM2835
 		bool "Kernel low-level debugging on BCM2835 PL011 UART"
@@ -1242,10 +1236,6 @@ choice
 
 endchoice
 
-config DEBUG_AT91_UART
-	bool
-	depends on ARCH_AT91
-
 config DEBUG_EXYNOS_UART
 	bool
 
@@ -1476,7 +1466,8 @@ config DEBUG_UART_PHYS
 		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
 		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
 		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
-		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
+		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
+		DEBUG_AT91_UART
 
 config DEBUG_UART_VIRT
 	hex "Virtual base address of debug UART"
diff --git a/arch/arm/include/debug/at91.S b/arch/arm/include/debug/at91.S
index 2556a8801c8c..43243be94cfc 100644
--- a/arch/arm/include/debug/at91.S
+++ b/arch/arm/include/debug/at91.S
@@ -9,32 +9,22 @@
  *
 */
 
-#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
-#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
-#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
-#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
-#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
-/* On sama5d4, use USART3 as low level serial console */
-#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
-#else
-/* On sama5d2, use UART1 as low level serial console */
-#define AT91_DBGU 0xf8020000
-#endif
-
 #ifdef CONFIG_MMU
 #define AT91_IO_P2V(x) ((x) - 0x01000000)
 #else
 #define AT91_IO_P2V(x) (x)
 #endif
 
+#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
+
 #define AT91_DBGU_SR		(0x14)	/* Status Register */
 #define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
 #define AT91_DBGU_TXRDY		(1 << 1)	/* Transmitter Ready */
 #define AT91_DBGU_TXEMPTY	(1 << 9)	/* Transmitter Empty */
 
 	.macro	addruart, rp, rv, tmp
-	ldr	\rp, =AT91_DBGU				@ System peripherals (phys address)
-	ldr	\rv, =AT91_IO_P2V(AT91_DBGU)		@ System peripherals (virt address)
+	ldr	\rp, =CONFIG_DEBUG_UART_PHYS		@ System peripherals (phys address)
+	ldr	\rv, =CONFIG_DEBUG_UART_VIRT		@ System peripherals (virt address)
 	.endm
 
 	.macro	senduart,rd,rx
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS
  2015-08-08 10:11 [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS Alexandre Belloni
@ 2015-09-18 14:48 ` Nicolas Ferre
  2015-09-18 22:13   ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Ferre @ 2015-09-18 14:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
	linux-arm-kernel, linux-kernel

Le 08/08/2015 12:11, Alexandre Belloni a écrit :
> Instead of having to add a new configuration option each time support for
> new SoC is added, use CONFIG_DEBUG_UART_PHYS. For now,
> CONFIG_DEBUG_UART_VIRT is automatically computed.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/Kconfig.debug        | 41 ++++++++++++++++-------------------------
>  arch/arm/include/debug/at91.S | 18 ++++--------------
>  2 files changed, 20 insertions(+), 39 deletions(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 946c8c0fa1fb..3ba23d0f5c55 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -123,29 +123,23 @@ choice
>  		    0x80020000      | 0xf0020000     | UART8
>  		    0x80024000      | 0xf0024000     | UART9
>  
> -	config AT91_DEBUG_LL_DBGU0
> -		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
> -		select DEBUG_AT91_UART
> +	config DEBUG_AT91_UART
> +		bool "Kernel low-level debugging on Atmel SoCs"
>  		depends on ARCH_AT91
> -		depends on SOC_AT91RM9200 || SOC_AT91SAM9
> +		help
> +		  Say Y here if you want the debug print routines to direct
> +		  their output to the serial port on atmel devices.
>  
> -	config AT91_DEBUG_LL_DBGU1
> -		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
> -		select DEBUG_AT91_UART
> -		depends on ARCH_AT91
> -		depends on SOC_AT91SAM9 || SOC_SAMA5
> +		  SOC                  DEBUG_UART_PHYS   DEBUG_UART_VIRT  PORT
> +		  rm9200, 9260/9g20,   0xfffff200        0xfefff200       DBGU
> +		  9261/9g10, 9rl
> +		  9263, 9g45, sama5d3  0xffffee00        0xfeffee00       DBGU
> +		  sama5d4              0xfc00c000        0xfb00c000       USART3
> +		  sama5d4              0xfc069000        0xfb069000       DBGU

This last one must be sama5d3, mustn't it?

Otherwise I'm okay:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> +		  sama5d2              0xf8020000        0xf7020000       UART1
>  
> -	config AT91_DEBUG_LL_DBGU2
> -		bool "Kernel low-level debugging on sama5d4"
> -		select DEBUG_AT91_UART
> -		depends on ARCH_AT91
> -		depends on SOC_SAMA5
> -
> -	config AT91_DEBUG_LL_DBGU3
> -		bool "Kernel low-level debugging on sama5d2"
> -		select DEBUG_AT91_UART
> -		depends on ARCH_AT91
> -		depends on SOC_SAMA5
> +		  Please adjust DEBUG_UART_PHYS configuration options based on
> +		  your needs.
>  
>  	config DEBUG_BCM2835
>  		bool "Kernel low-level debugging on BCM2835 PL011 UART"
> @@ -1242,10 +1236,6 @@ choice
>  
>  endchoice
>  
> -config DEBUG_AT91_UART
> -	bool
> -	depends on ARCH_AT91
> -
>  config DEBUG_EXYNOS_UART
>  	bool
>  
> @@ -1476,7 +1466,8 @@ config DEBUG_UART_PHYS
>  		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
>  		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
>  		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
> -		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
> +		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
> +		DEBUG_AT91_UART
>  
>  config DEBUG_UART_VIRT
>  	hex "Virtual base address of debug UART"
> diff --git a/arch/arm/include/debug/at91.S b/arch/arm/include/debug/at91.S
> index 2556a8801c8c..43243be94cfc 100644
> --- a/arch/arm/include/debug/at91.S
> +++ b/arch/arm/include/debug/at91.S
> @@ -9,32 +9,22 @@
>   *
>  */
>  
> -#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
> -#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
> -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
> -#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
> -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
> -/* On sama5d4, use USART3 as low level serial console */
> -#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
> -#else
> -/* On sama5d2, use UART1 as low level serial console */
> -#define AT91_DBGU 0xf8020000
> -#endif
> -
>  #ifdef CONFIG_MMU
>  #define AT91_IO_P2V(x) ((x) - 0x01000000)
>  #else
>  #define AT91_IO_P2V(x) (x)
>  #endif
>  
> +#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
> +
>  #define AT91_DBGU_SR		(0x14)	/* Status Register */
>  #define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
>  #define AT91_DBGU_TXRDY		(1 << 1)	/* Transmitter Ready */
>  #define AT91_DBGU_TXEMPTY	(1 << 9)	/* Transmitter Empty */
>  
>  	.macro	addruart, rp, rv, tmp
> -	ldr	\rp, =AT91_DBGU				@ System peripherals (phys address)
> -	ldr	\rv, =AT91_IO_P2V(AT91_DBGU)		@ System peripherals (virt address)
> +	ldr	\rp, =CONFIG_DEBUG_UART_PHYS		@ System peripherals (phys address)
> +	ldr	\rv, =CONFIG_DEBUG_UART_VIRT		@ System peripherals (virt address)
>  	.endm
>  
>  	.macro	senduart,rd,rx
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS
  2015-09-18 14:48 ` Nicolas Ferre
@ 2015-09-18 22:13   ` Alexandre Belloni
  2015-09-21 14:22     ` Nicolas Ferre
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2015-09-18 22:13 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
	linux-arm-kernel, linux-kernel

Hi,

On 18/09/2015 at 16:48:43 +0200, Nicolas Ferre wrote :
> > -	config AT91_DEBUG_LL_DBGU1
> > -		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
> > -		select DEBUG_AT91_UART
> > -		depends on ARCH_AT91
> > -		depends on SOC_AT91SAM9 || SOC_SAMA5
> > +		  SOC                  DEBUG_UART_PHYS   DEBUG_UART_VIRT  PORT
> > +		  rm9200, 9260/9g20,   0xfffff200        0xfefff200       DBGU
> > +		  9261/9g10, 9rl
> > +		  9263, 9g45, sama5d3  0xffffee00        0xfeffee00       DBGU
> > +		  sama5d4              0xfc00c000        0xfb00c000       USART3
> > +		  sama5d4              0xfc069000        0xfb069000       DBGU
> 
> This last one must be sama5d3, mustn't it?
> 

No, that is the DBGU for sama5d4, sama5d3 is mentionned and is at
0xffffee00. I added it in case someone doesn't use USART3 for debugging
and wants to use the DBGU. I actually doubt it may happen but we never
now. I can remove it in a v2 if you prefer.

> Otherwise I'm okay:
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> > +		  sama5d2              0xf8020000        0xf7020000       UART1
> >  
> > -	config AT91_DEBUG_LL_DBGU2
> > -		bool "Kernel low-level debugging on sama5d4"
> > -		select DEBUG_AT91_UART
> > -		depends on ARCH_AT91
> > -		depends on SOC_SAMA5
> > -
> > -	config AT91_DEBUG_LL_DBGU3
> > -		bool "Kernel low-level debugging on sama5d2"
> > -		select DEBUG_AT91_UART
> > -		depends on ARCH_AT91
> > -		depends on SOC_SAMA5
> > +		  Please adjust DEBUG_UART_PHYS configuration options based on
> > +		  your needs.
> >  
> >  	config DEBUG_BCM2835
> >  		bool "Kernel low-level debugging on BCM2835 PL011 UART"
> > @@ -1242,10 +1236,6 @@ choice
> >  
> >  endchoice
> >  
> > -config DEBUG_AT91_UART
> > -	bool
> > -	depends on ARCH_AT91
> > -
> >  config DEBUG_EXYNOS_UART
> >  	bool
> >  
> > @@ -1476,7 +1466,8 @@ config DEBUG_UART_PHYS
> >  		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
> >  		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
> >  		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
> > -		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
> > +		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
> > +		DEBUG_AT91_UART
> >  
> >  config DEBUG_UART_VIRT
> >  	hex "Virtual base address of debug UART"
> > diff --git a/arch/arm/include/debug/at91.S b/arch/arm/include/debug/at91.S
> > index 2556a8801c8c..43243be94cfc 100644
> > --- a/arch/arm/include/debug/at91.S
> > +++ b/arch/arm/include/debug/at91.S
> > @@ -9,32 +9,22 @@
> >   *
> >  */
> >  
> > -#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
> > -#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
> > -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
> > -#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
> > -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
> > -/* On sama5d4, use USART3 as low level serial console */
> > -#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
> > -#else
> > -/* On sama5d2, use UART1 as low level serial console */
> > -#define AT91_DBGU 0xf8020000
> > -#endif
> > -
> >  #ifdef CONFIG_MMU
> >  #define AT91_IO_P2V(x) ((x) - 0x01000000)
> >  #else
> >  #define AT91_IO_P2V(x) (x)
> >  #endif
> >  
> > +#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
> > +
> >  #define AT91_DBGU_SR		(0x14)	/* Status Register */
> >  #define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
> >  #define AT91_DBGU_TXRDY		(1 << 1)	/* Transmitter Ready */
> >  #define AT91_DBGU_TXEMPTY	(1 << 9)	/* Transmitter Empty */
> >  
> >  	.macro	addruart, rp, rv, tmp
> > -	ldr	\rp, =AT91_DBGU				@ System peripherals (phys address)
> > -	ldr	\rv, =AT91_IO_P2V(AT91_DBGU)		@ System peripherals (virt address)
> > +	ldr	\rp, =CONFIG_DEBUG_UART_PHYS		@ System peripherals (phys address)
> > +	ldr	\rv, =CONFIG_DEBUG_UART_VIRT		@ System peripherals (virt address)
> >  	.endm
> >  
> >  	.macro	senduart,rd,rx
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS
  2015-09-18 22:13   ` Alexandre Belloni
@ 2015-09-21 14:22     ` Nicolas Ferre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2015-09-21 14:22 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Boris Brezillon, Jean-Christophe Plagniol-Villard,
	linux-arm-kernel, linux-kernel

Le 19/09/2015 00:13, Alexandre Belloni a écrit :
> Hi,
> 
> On 18/09/2015 at 16:48:43 +0200, Nicolas Ferre wrote :
>>> -	config AT91_DEBUG_LL_DBGU1
>>> -		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
>>> -		select DEBUG_AT91_UART
>>> -		depends on ARCH_AT91
>>> -		depends on SOC_AT91SAM9 || SOC_SAMA5
>>> +		  SOC                  DEBUG_UART_PHYS   DEBUG_UART_VIRT  PORT
>>> +		  rm9200, 9260/9g20,   0xfffff200        0xfefff200       DBGU
>>> +		  9261/9g10, 9rl
>>> +		  9263, 9g45, sama5d3  0xffffee00        0xfeffee00       DBGU
>>> +		  sama5d4              0xfc00c000        0xfb00c000       USART3
>>> +		  sama5d4              0xfc069000        0xfb069000       DBGU
>>
>> This last one must be sama5d3, mustn't it?
>>
> 
> No, that is the DBGU for sama5d4, sama5d3 is mentionned and is at
> 0xffffee00. I added it in case someone doesn't use USART3 for debugging
> and wants to use the DBGU. I actually doubt it may happen but we never
> now. I can remove it in a v2 if you prefer.

Ok, I understand now.

No need for a v2, I take this one in at91-4.4-soc branch.

Thanks, bye,


> 
>> Otherwise I'm okay:
>> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>>
>>> +		  sama5d2              0xf8020000        0xf7020000       UART1
>>>  
>>> -	config AT91_DEBUG_LL_DBGU2
>>> -		bool "Kernel low-level debugging on sama5d4"
>>> -		select DEBUG_AT91_UART
>>> -		depends on ARCH_AT91
>>> -		depends on SOC_SAMA5
>>> -
>>> -	config AT91_DEBUG_LL_DBGU3
>>> -		bool "Kernel low-level debugging on sama5d2"
>>> -		select DEBUG_AT91_UART
>>> -		depends on ARCH_AT91
>>> -		depends on SOC_SAMA5
>>> +		  Please adjust DEBUG_UART_PHYS configuration options based on
>>> +		  your needs.
>>>  
>>>  	config DEBUG_BCM2835
>>>  		bool "Kernel low-level debugging on BCM2835 PL011 UART"
>>> @@ -1242,10 +1236,6 @@ choice
>>>  
>>>  endchoice
>>>  
>>> -config DEBUG_AT91_UART
>>> -	bool
>>> -	depends on ARCH_AT91
>>> -
>>>  config DEBUG_EXYNOS_UART
>>>  	bool
>>>  
>>> @@ -1476,7 +1466,8 @@ config DEBUG_UART_PHYS
>>>  		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
>>>  		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
>>>  		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
>>> -		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
>>> +		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
>>> +		DEBUG_AT91_UART
>>>  
>>>  config DEBUG_UART_VIRT
>>>  	hex "Virtual base address of debug UART"
>>> diff --git a/arch/arm/include/debug/at91.S b/arch/arm/include/debug/at91.S
>>> index 2556a8801c8c..43243be94cfc 100644
>>> --- a/arch/arm/include/debug/at91.S
>>> +++ b/arch/arm/include/debug/at91.S
>>> @@ -9,32 +9,22 @@
>>>   *
>>>  */
>>>  
>>> -#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
>>> -#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
>>> -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
>>> -#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
>>> -#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
>>> -/* On sama5d4, use USART3 as low level serial console */
>>> -#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
>>> -#else
>>> -/* On sama5d2, use UART1 as low level serial console */
>>> -#define AT91_DBGU 0xf8020000
>>> -#endif
>>> -
>>>  #ifdef CONFIG_MMU
>>>  #define AT91_IO_P2V(x) ((x) - 0x01000000)
>>>  #else
>>>  #define AT91_IO_P2V(x) (x)
>>>  #endif
>>>  
>>> +#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
>>> +
>>>  #define AT91_DBGU_SR		(0x14)	/* Status Register */
>>>  #define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
>>>  #define AT91_DBGU_TXRDY		(1 << 1)	/* Transmitter Ready */
>>>  #define AT91_DBGU_TXEMPTY	(1 << 9)	/* Transmitter Empty */
>>>  
>>>  	.macro	addruart, rp, rv, tmp
>>> -	ldr	\rp, =AT91_DBGU				@ System peripherals (phys address)
>>> -	ldr	\rv, =AT91_IO_P2V(AT91_DBGU)		@ System peripherals (virt address)
>>> +	ldr	\rp, =CONFIG_DEBUG_UART_PHYS		@ System peripherals (phys address)
>>> +	ldr	\rv, =CONFIG_DEBUG_UART_VIRT		@ System peripherals (virt address)
>>>  	.endm
>>>  
>>>  	.macro	senduart,rd,rx
>>>
>>
>>
>> -- 
>> Nicolas Ferre
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-21 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-08 10:11 [PATCH] ARM: at91: debug: use DEBUG_UART_PHYS Alexandre Belloni
2015-09-18 14:48 ` Nicolas Ferre
2015-09-18 22:13   ` Alexandre Belloni
2015-09-21 14:22     ` Nicolas Ferre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).