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

Re: [PATCH] xen/arm: debug-pl011: Use 32-bit accessors for broader compatibility


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 1 Jun 2023 10:19:56 +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=qDSXjp4bSx13miiCTd8tWiHg6I++lq19hJ5GR3XBnQw=; b=l0xt3uKTrGzy8136nUcFWPoyfb9OiNnwSUifyy98WYkCwW77jw+zePfSAulSz5ruarghaNrW0ddcfiuTnCyc0ADP45H8HAP2cMWGdc5lCIDmv/b4s0/3Y6XvU5XQWQQo5yZzG8ZyVCKVAQrcQt8RJyx5mZ1H0h9nrxjdXBfYWsXAke1g8+RY+v/ieJS0ks21pWkO7ov2jiAfE1m2zTsXciGu/YtSs19ADhUsjNLE+xfYnq05/JO4GQhHA6bNCS5BpzyWG0+VI6pjZuhLWjDSKh/lj836H7gk97cwVfH+G02ssMnXtIdAQcEgVlOg1PAN276lN3aNn81sHgp6o7exvQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fXH0Ye/WY5bcJ8dlTSAL4YuhghqGS71V5/saXJ/gfGD5+7Kxpufxm2ycKL4m77clSQ1GhyF56Y097FxkzbqWobJQGBoUgC5uQt3juTSUcGfwNSPvBRAY51UyLknJpfeE/WyX1VlM59v2Qfs2nOwX80WhIvPontZd+d7aZ6QNEKtqko0lXXRoVsL/xcP83YVdCyzAOLNHhxImMccr9goltnMjtqnSUQUVvAu2bkOeyprSN05R4jrNUf2nFKyc0nZ9AkgszU/oWYGzQUyFkVuVYoLKAfdi2JtOZLXwBOKaV+8PKh2gq9+5lHq73DGkZYRn4O67Y1Pbkl6N0JMBZl03Fg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 01 Jun 2023 10:20:20 +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: AQHZlGYjy4NMkXD17k+UGeM9r1SDJq91vGMA
  • Thread-topic: [PATCH] xen/arm: debug-pl011: Use 32-bit accessors for broader compatibility

Hi Michal,

> On 1 Jun 2023, at 10:50, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> There are implementations of the PL011 that can only handle 32-bit
> accesses (i.e. no 16-bit or 8-bit), usually advertised by 'reg-io-width'
> dt property set to 4. On such UARTs, the current early printk code for
> arm64 does not work. To fix this issue, make all the accesses to be 32-bit
> by using ldr, str without a size field. This makes it possible to use
> early printk on such platforms, while all the other implementations should
> generally cope with 32-bit accesses. In case they do not, they would
> already fail as we explicitly use writel/readl in the runtime driver to
> maintain broader compatibility and to be SBSAv2 compliant. Therefore, this
> change makes the runtime/early handling consistent (also it matches the
> arm32 debug-pl011 code).
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> ---
> xen/arch/arm/arm64/debug-pl011.inc | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/debug-pl011.inc 
> b/xen/arch/arm/arm64/debug-pl011.inc
> index 6d60e78c8ba3..80eb8fdc1ec7 100644
> --- a/xen/arch/arm/arm64/debug-pl011.inc
> +++ b/xen/arch/arm/arm64/debug-pl011.inc
> @@ -25,9 +25,9 @@
>  */
> .macro early_uart_init xb, c
>         mov   x\c, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE % 16)
> -        strh  w\c, [\xb, #FBRD]      /* -> UARTFBRD (Baud divisor fraction) 
> */
> +        str   w\c, [\xb, #FBRD]      /* -> UARTFBRD (Baud divisor fraction) 
> */
>         mov   x\c, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE / 16)
> -        strh  w\c, [\xb, #IBRD]      /* -> UARTIBRD (Baud divisor integer) */
> +        str   w\c, [\xb, #IBRD]      /* -> UARTIBRD (Baud divisor integer) */
>         mov   x\c, #WLEN_8           /* 8n1 */
>         str   w\c, [\xb, #LCR_H]     /* -> UARTLCR_H (Line control) */
>         ldr   x\c, =(RXE | TXE | UARTEN)
> @@ -41,7 +41,7 @@
>  */
> .macro early_uart_ready xb, c
> 1:
> -        ldrh  w\c, [\xb, #FR]        /* <- UARTFR (Flag register) */
> +        ldr   w\c, [\xb, #FR]        /* <- UARTFR (Flag register) */
>         tst   w\c, #BUSY             /* Check BUSY bit */
>         b.ne  1b                     /* Wait for the UART to be ready */
> .endm
> @@ -52,7 +52,7 @@
>  * wt: register which contains the character to transmit
>  */
> .macro early_uart_transmit xb, wt
> -        strb  \wt, [\xb, #DR]        /* -> UARTDR (Data Register) */
> +        str   \wt, [\xb, #DR]        /* -> UARTDR (Data Register) */

Is it really ok to drop the 8bit access here ?

Regards
Bertrand

> .endm
> 
> /*
> -- 
> 2.25.1
> 




 


Rackspace

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