Re: FW: [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL console.

From: John Linn
Date: Thu Jul 05 2012 - 19:58:02 EST


On Thu, Jul 5, 2012 at 3:32 PM, John Linn <John.Linn@xxxxxxxxxx> wrote:
>
>
> -----Original Message-----
> From: Nick Bowler [mailto:nbowler@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, July 04, 2012 7:14 AM
> To: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: Russell King; John Linn
> Subject: [PATCH 1/3] ARM: zynq: Allow UART1 to be used as DEBUG_LL
> console.
>
> The main UART on the Xilinx ZC702 board is UART1, located at address
> e0001000. Add a Kconfig option to select this device as the low-level
> debugging port. This allows the really early boot printouts to reach
> the USB serial adaptor on this board.
>
> The board does not boot yet, but now it's actually possible to see error
> messages.
>
> For consistency's sake, add a choice entry for UART0 even though it is
> the the default if UART1 is not selected.
>
> Signed-off-by: Nick Bowler <nbowler@xxxxxxxxxxxxxxxx>
> Cc: John Linn <john.linn@xxxxxxxxxx>

Signed-off-by: John Linn <johnhlinn@xxxxxxxxx>

I tested it with the other patches and another small change on the 702 board.
Using my gmail account as I'm still fighting to get legal footers
turned off in Xilinx mail.

Thanks
John

>
> ---
> arch/arm/Kconfig.debug | 17 +++++++++++++++++
> arch/arm/mach-zynq/common.c | 4 ++--
> arch/arm/mach-zynq/include/mach/zynq_soc.h | 12 ++++++++++--
> 3 files changed, 29 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 01a1341..9abe3ad 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -132,6 +132,23 @@ choice
> their output to UART1 serial port on DaVinci TNETV107X
> devices.
>
> + config DEBUG_ZYNQ_UART0
> + bool "Kernel low-level debugging on Xilinx Zynq using
> UART0"
> + depends on ARCH_ZYNQ
> + help
> + Say Y here if you want the debug print routines to
> direct
> + their output to UART0 on the Zynq platform.
> +
> + config DEBUG_ZYNQ_UART1
> + bool "Kernel low-level debugging on Xilinx Zynq using
> UART1"
> + depends on ARCH_ZYNQ
> + help
> + Say Y here if you want the debug print routines to
> direct
> + their output to UART1 on the Zynq platform.
> +
> + If you have a ZC702 board and want early boot messages
> to
> + appear on the USB serial adaptor, select this option.
> +
> config DEBUG_DC21285_PORT
> bool "Kernel low-level debugging messages via footbridge
> serial port"
> depends on FOOTBRIDGE
> diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
> index ab5cfdd..12a2984 100644
> --- a/arch/arm/mach-zynq/common.c
> +++ b/arch/arm/mach-zynq/common.c
> @@ -87,8 +87,8 @@ static struct map_desc io_desc[] __initdata = {
>
> #ifdef CONFIG_DEBUG_LL
> {
> - .virtual = UART0_VIRT,
> - .pfn = __phys_to_pfn(UART0_PHYS),
> + .virtual = LL_UART_VADDR,
> + .pfn = __phys_to_pfn(LL_UART_PADDR),
> .length = SZ_4K,
> .type = MT_DEVICE,
> },
> diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h
> b/arch/arm/mach-zynq/include/mach/zynq_soc.h
> index d0d3f8f..6f83f1c 100644
> --- a/arch/arm/mach-zynq/include/mach/zynq_soc.h
> +++ b/arch/arm/mach-zynq/include/mach/zynq_soc.h
> @@ -22,6 +22,9 @@
> #define UART0_PHYS 0xE0000000
> #define UART0_VIRT UART0_PHYS
>
> +#define UART1_PHYS 0xE0001000
> +#define UART1_VIRT UART1_PHYS
> +
> #define TTC0_PHYS 0xF8001000
> #define TTC0_VIRT TTC0_PHYS
>
> @@ -42,7 +45,12 @@
> /*
> * Mandatory for CONFIG_LL_DEBUG, UART is mapped virtual = physical
> */
> -#define LL_UART_PADDR UART0_PHYS
> -#define LL_UART_VADDR UART0_VIRT
> +#ifdef CONFIG_DEBUG_ZYNQ_UART1
> +# define LL_UART_PADDR UART1_PHYS
> +# define LL_UART_VADDR UART1_VIRT
> +#else
> +# define LL_UART_PADDR UART0_PHYS
> +# define LL_UART_VADDR UART0_VIRT
> +#endif
>
> #endif
> --
> 1.7.8.6
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/