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

Re: [PATCH V5 2/2] xen/arm: Add i.MX lpuart early printk support


  • To: "Peng Fan (OSS)" <peng.fan@xxxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 14 Apr 2022 13:03:02 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oUdA959nXskSGsrMqif2eNyPZW+CXka7xyoOctDgAh0=; b=LvKX2B69wWDbLcGXRu2+vzhy7LhOCK/y6vs2QXryRZf4g8C8K2zkleYp3J/0TySg3Mx3pFf88W5/3T/P5QOTbl4YUXI/oX9B/WcrtHiTtYUzbk7mF/Z6yOVRxpJhHY+8DY8lOQJdq0VbyI0bDuz5Q9qg/qDLDZFzjUEYAlSJK+L4okGQnPyZrx+hSbOsZqkg9iZx9tI3Kh4cJLnPHUjlMs0vCaibJMsjapWqihq2RfzQYS1ShHn2xoMV5EqXmnqrbXG33nX+P4arLi6srzl8Yontvj9TMsioAecCApJDJlJo0B9j0kdy2Lw9LoF5SHwb3h7+LM46h8fqxaiwYfv8zA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rxk/dCDqyg/PIiq0jMgWQJwxnJcADml8s33yw6TfTFfHOI958jhOEdH8vzRF+R5F1YZNjY/cQC42noAr/FSqPyEkaCQ3epZjt1mpgQwk9+5P/KwG36d8yigaJiXX+kjN3uGUiENFCyIOy3ItA3QtIxOqlLQteP0J609WDTHr06b6v7U3BVg586qpBsiYkNVzAzA6/ObHvz9ZkjCdUZNfQvSpNn+2HXpuHiBnzG1JqiB2Bau4c33CKyqbyAFt18cde/GN5rYNFetyOe8GuCr5aIFl2b9iyo49Ej/r92xh0sPdIBfLZCUNAGtumC9rKKIHn2L2B6b0UP8JNuU8YP1Heg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "van.freenix@xxxxxxxxx" <van.freenix@xxxxxxxxx>, Michal Orzel <Michal.Orzel@xxxxxxx>, Peng Fan <peng.fan@xxxxxxx>
  • Delivery-date: Thu, 14 Apr 2022 13:03:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYT83RPYD4QIXhgkG5U0C1k6a0XqzvYFWA
  • Thread-topic: [PATCH V5 2/2] xen/arm: Add i.MX lpuart early printk support

Hi Peng,

> On 14 Apr 2022, at 08:44, Peng Fan (OSS) <peng.fan@xxxxxxxxxxx> wrote:
> 
> From: Peng Fan <peng.fan@xxxxxxx>
> 
> Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
Acked-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/Kconfig.debug              | 14 ++++++++
> xen/arch/arm/arm64/debug-imx-lpuart.inc | 48 +++++++++++++++++++++++++
> 2 files changed, 62 insertions(+)
> create mode 100644 xen/arch/arm/arm64/debug-imx-lpuart.inc
> 
> diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug
> index 35ccd13273..842d768280 100644
> --- a/xen/arch/arm/Kconfig.debug
> +++ b/xen/arch/arm/Kconfig.debug
> @@ -58,6 +58,16 @@ choice
>                       This option is preferred over the platform specific
>                       options; the platform specific options are deprecated
>                       and will soon be removed.
> +     config EARLY_UART_CHOICE_IMX_LPUART
> +             select EARLY_UART_IMX_LPUART
> +             depends on ARM_64
> +             bool "Early printk via i.MX LPUART"
> +             help
> +                     Say Y here if you wish the early printk to direct their
> +                     output to a i.MX LPUART. You can use this option to
> +                     provide the parameters for the i.MX LPUART rather than
> +                     selecting one of the platform specific options below if
> +                     you know the parameters for the port.
>       config EARLY_UART_CHOICE_MESON
>               select EARLY_UART_MESON
>               depends on ARM_64
> @@ -186,6 +196,9 @@ config EARLY_UART_CADENCE
> config EARLY_UART_EXYNOS4210
>       select EARLY_PRINTK
>       bool
> +config EARLY_UART_IMX_LPUART
> +     select EARLY_PRINTK
> +     bool
> config EARLY_UART_MESON
>       select EARLY_PRINTK
>       bool
> @@ -283,6 +296,7 @@ config EARLY_PRINTK_INC
>       default "debug-8250.inc" if EARLY_UART_8250
>       default "debug-cadence.inc" if EARLY_UART_CADENCE
>       default "debug-exynos4210.inc" if EARLY_UART_EXYNOS4210
> +     default "debug-imx-lpuart.inc" if EARLY_UART_IMX_LPUART
>       default "debug-meson.inc" if EARLY_UART_MESON
>       default "debug-mvebu.inc" if EARLY_UART_MVEBU
>       default "debug-pl011.inc" if EARLY_UART_PL011
> diff --git a/xen/arch/arm/arm64/debug-imx-lpuart.inc 
> b/xen/arch/arm/arm64/debug-imx-lpuart.inc
> new file mode 100644
> index 0000000000..b169332932
> --- /dev/null
> +++ b/xen/arch/arm/arm64/debug-imx-lpuart.inc
> @@ -0,0 +1,48 @@
> +/*
> + * xen/arch/arm/arm64/debug-imx-lpuart.inc
> + *
> + * i.MX8QM specific debug code
> + *
> + * Peng Fan <peng.fan@xxxxxxx>
> + * Copyright 2022 NXP
> + *
> + * 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 <asm/imx-lpuart.h>
> +
> +/*
> + * Wait LPUART to be ready to transmit
> + * rb: register which contains the UART base address
> + * rc: scratch register
> + */
> +.macro early_uart_ready xb, c
> +1:
> +        ldr   w\c, [\xb, #UARTSTAT]   /* <- Flag register */
> +        tst   w\c, #UARTSTAT_TDRE     /* Check FIFO EMPTY bit */
> +        beq   1b                      /* Wait for the UART to be ready */
> +.endm
> +
> +/*
> + * LPUART transmit character
> + * rb: register which contains the UART base address
> + * rt: register which contains the character to transmit
> + */
> +.macro early_uart_transmit xb, wt
> +        str   \wt, [\xb, #UARTDATA]  /* -> Data Register */
> +.endm
> +
> +/*
> + * Local variables:
> + * mode: ASM
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 2.35.1
> 




 


Rackspace

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