[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/4] xen/arm: add OMAP5432 UART support for early_printk



On 07/19/2013 01:57 PM, Chen Baozi wrote:
> 
> Signed-off-by: Chen Baozi <baozich@xxxxxxxxx>
> ---
>  docs/misc/arm/early-printk.txt    |  1 +
>  xen/arch/arm/Rules.mk             |  4 ++++
>  xen/arch/arm/arm32/debug-8250.inc | 48 
> +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 53 insertions(+)
>  create mode 100644 xen/arch/arm/arm32/debug-8250.inc
> 
> diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt
> index fbc3208..874488f 100644
> --- a/docs/misc/arm/early-printk.txt
> +++ b/docs/misc/arm/early-printk.txt
> @@ -13,6 +13,7 @@ where mach is the name of the machine:
>    - exynos5250: printk with the second UART
>    - midway: printk with the pl011 on Calxeda Midway processors
>    - fastmodel: printk on ARM Fastmodel software emulators
> +  - omap5432: printk with UART3 on TI OMAP5432 processors
>  
>  The base address and baud rate is hardcoded in xen/arch/arm/Rules.mk,
>  see there when adding support for new machines.
> diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
> index 422ed04..eaa03fb 100644
> --- a/xen/arch/arm/Rules.mk
> +++ b/xen/arch/arm/Rules.mk
> @@ -64,6 +64,10 @@ EARLY_PRINTK_INC := pl011
>  EARLY_PRINTK_BAUD := 115200
>  EARLY_UART_BASE_ADDRESS := 0xfff36000
>  endif
> +ifeq ($(CONFIG_EARLY_PRINTK), omap5432)
> +EARLY_PRINTK_INC := 8250
> +EARLY_UART_BASE_ADDRESS := 0x48020000
> +endif
>  
>  ifneq ($(EARLY_PRINTK_INC),)
>  EARLY_PRINTK := y
> diff --git a/xen/arch/arm/arm32/debug-8250.inc 
> b/xen/arch/arm/arm32/debug-8250.inc
> new file mode 100644
> index 0000000..cbb63ca
> --- /dev/null
> +++ b/xen/arch/arm/arm32/debug-8250.inc
> @@ -0,0 +1,48 @@
> +/*
> + * xen/arch/arm/arm32/debug-8250.inc
> + *
> + * 8250 specific debug code
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <xen/8250.h>
> +
> +/* OMAP UART initialization
> + * rb: register which contains the UART base address
> + * rc: scratch register 1
> + * rd: scratch register 2 */
> +.macro early_uart_init rb rc rd
> +.endm

You don't need to define early_uart_init. The debug code will not use it
if EARLY_PRINTK_INIT_UART is not enabled.

> +
> +/* OMAP UART wait UART to be ready to transmit
> + * rb: register which contains the UART base address
> + * rc: scratch register */
> +.macro early_uart_ready rb rc
> +1:
> +     ldr     \rc, [\rb, #(UART_LSR<<2)] /* Read line status register */

Where does "<<2" come from?

> +     tst     \rc, #UART_LSR_THRE   /* Check Xmit holding register flag */
> +     beq     1b                    /* Wait for the UART to be ready */
> +.endm
> +
> +/* OMAP UART transmit character
> + * rb: register which contains the UART base address
> + * rt: register which contains the character to transmit */
> +.macro early_uart_transmit rb rt
> +        str   \rt, [\rb, #UART_THR]      /* Write Transmit buffer */
> +.endm
> +
> +/*
> + * Local variables:
> + * mode: ASM
> + * indent-tabs-mode: nil
> + * End:
> + */
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.