Patchwork [U-Boot,01/11] arm: ks8695: use defined constants for UART

login
register
mail settings
Submitter Yann Vernier
Date Oct. 5, 2012, 12:09 p.m.
Message ID <1349438998-10954-2-git-send-email-yann.vernier@orsoc.se>
Download mbox | patch
Permalink /patch/189460/
State Accepted
Delegated to: Albert ARIBAUD
Headers show

Comments

Yann Vernier - Oct. 5, 2012, 12:09 p.m.
CONFIG_BAUDRATE and KS8695_UART_LINEC_WLEN8 used for UART registers
---
 arch/arm/cpu/arm920t/ks8695/lowlevel_init.S |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Albert ARIBAUD - Oct. 26, 2012, 9:34 p.m.
Hi Yann,

On Fri,  5 Oct 2012 14:09:48 +0200, Yann Vernier
<yann.vernier@orsoc.se> wrote:

> CONFIG_BAUDRATE and KS8695_UART_LINEC_WLEN8 used for UART registers
> ---
>  arch/arm/cpu/arm920t/ks8695/lowlevel_init.S |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> index e9f1227..1bba571 100644
> --- a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> +++ b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
> @@ -72,10 +72,10 @@ lowlevel_init:
>  	 * enable UART for early debug trace
>  	 */
>  	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_DIVISOR)
> -	mov	r2, #0xd9
> -	str	r2, [r1]		/* 115200 baud */
> +	mov	r2, #((25000000+CONFIG_BAUDRATE/2) / CONFIG_BAUDRATE)
> +	str	r2, [r1]
>  	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_LINE_CTRL)
> -	mov	r2, #0x03
> +	mov	r2, #KS8695_UART_LINEC_WLEN8
>  	str	r2, [r1]		/* 8 data bits, no parity, 1 stop */
>  	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_TX_HOLDING)
>  	mov	r2, #0x41

Applied to u-boot-arm/master, thanks!

Amicalement,

Patch

diff --git a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
index e9f1227..1bba571 100644
--- a/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
+++ b/arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
@@ -72,10 +72,10 @@  lowlevel_init:
 	 * enable UART for early debug trace
 	 */
 	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_DIVISOR)
-	mov	r2, #0xd9
-	str	r2, [r1]		/* 115200 baud */
+	mov	r2, #((25000000+CONFIG_BAUDRATE/2) / CONFIG_BAUDRATE)
+	str	r2, [r1]
 	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_LINE_CTRL)
-	mov	r2, #0x03
+	mov	r2, #KS8695_UART_LINEC_WLEN8
 	str	r2, [r1]		/* 8 data bits, no parity, 1 stop */
 	ldr	r1, =(KS8695_IO_BASE+KS8695_UART_TX_HOLDING)
 	mov	r2, #0x41