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

Re: [PATCH v3 19/24] xen/8250-uart: add missing definitions


  • To: <dmukhin@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 28 Jan 2025 17:34:56 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ford.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kjREZM+WkORLLCFukDoPY3JgX+OtpvlTGAO9r4XIFo0=; b=keWZ7KOqni0HIMBBN09LhzWmWL9m6nNr8f7PEZuKPFM/uOiFzVqtTwrIw5GQ8BGkWB34kxsmW+DCsgW5Ceim9/WU1JrnHTl+t9x1hGrMT8wk0hMTgzpdqhCJwplhBH0yM//PUrIEu3qorsuJ5mCzwiKaHrTxxIrILbXd0MJguYigqOLz+j1hUkRyqOeQURqy2JFmzO5yfLX5r2hJgwBsZBQeaaD2KNp7IDh8m9N1qsWCAplpFNeRVf/PRtk0QWcQUwOQRktMLWJ7NkdNcp0vQhwzEVFIZs0krwjfi+pzyERgpTmM5aoh0ZaMtGUDEWIPjQQkgibYJse6BgH8JKR+WA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NxdgHDd4R3LzGBjfVMj6KguK+og0kLJp2h0ym5ZcyrzzmHT4HHKCUOiU9g2IpqfDMaLdXY31eHsQjsP8uGj5cl8T9KT8Hbhx2+w80XxuG+Q2jF9A+ANvUQxub9JZu9Ut3Rt8lTWZsyaE8KtBmb7Go53WZBi22n8ZAGQkTmaYZn37i90KcR2IhyNL864T3RFZ4lhxZo+PrlFES4jza/Nx7hkDrevz8IyryhHRP57bt9qEs7GYrfD91Z7uBdiZdoACmhqp54cETzTOVTlM+TYZ12Z9MZ09OsBZKzLALrNin3ZHhHBiJ/nrT2JtCvXMai8vzx7IHFYqFy1/8tFekEzfAQ==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 28 Jan 2025 22:35:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-01-03 20:58, Denis Mukhin via B4 Relay wrote:
From: Denis Mukhin <dmukhin@xxxxxxxx>

Added missing definitions needed for NS8250 UART emulator.

Re-used newly introduced MSR definitions in the existing ns16550 driver.

Also, fixed indentation in a comment for FCR register.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
  xen/drivers/char/ns16550.c  |  6 ++--
  xen/include/xen/8250-uart.h | 78 +++++++++++++++++++++++++++++++++------------
  2 files changed, 60 insertions(+), 24 deletions(-)


diff --git a/xen/include/xen/8250-uart.h b/xen/include/xen/8250-uart.h
index 
d13352940c13c50bac17d4cdf2f3bf584380776a..6d1af31d582a3dd674a401d7f649e28c889cdc3e
 100644
--- a/xen/include/xen/8250-uart.h
+++ b/xen/include/xen/8250-uart.h

@@ -51,12 +54,19 @@
  #define UART_IIR_THR      0x02    /*  - tx reg. empty     */
  #define UART_IIR_MSI      0x00    /*  - MODEM status      */
  #define UART_IIR_BSY      0x07    /*  - busy detect (DW) */
+#define UART_IIR_FE       0xC0    /* FIFO enabled (2 bits) */
/* FIFO Control Register */
-#define UART_FCR_ENABLE   0x01    /* enable FIFO          */
-#define UART_FCR_CLRX     0x02    /* clear Rx FIFO        */
-#define UART_FCR_CLTX     0x04    /* clear Tx FIFO        */
-#define UART_FCR_DMA      0x10    /* enter DMA mode       */

0x10 is bit 4...

+#define UART_FCR_ENABLE     BIT(0, U)   /* enable FIFO          */
+#define UART_FCR_CLRX       BIT(1, U)   /* clear Rx FIFO        */
+#define UART_FCR_CLTX       BIT(2, U)   /* clear Tx FIFO        */
+#define UART_FCR_DMA        BIT(3, U)   /* enter DMA mode       */

Now it's 0x08.  Is this a bug fix?  Looks like UART_FCR_DMA is unused.

Regards,
Jason

+#define UART_FCR_RESERVED0  BIT(4, U)   /* reserved; always 0   */
+#define UART_FCR_RESERVED1  BIT(5, U)   /* reserved; always 0   */
+#define UART_FCR_RTB0       BIT(6, U)   /* receiver trigger bit #0 */
+#define UART_FCR_RTB1       BIT(7, U)   /* receiver trigger bit #1 */
+#define UART_FCR_TRG_MASK   (UART_FCR_RTB0 | UART_FCR_RTB1)
+
  #define UART_FCR_TRG1     0x00    /* Rx FIFO trig lev 1   */
  #define UART_FCR_TRG4     0x40    /* Rx FIFO trig lev 4   */
  #define UART_FCR_TRG8     0x80    /* Rx FIFO trig lev 8   */




 


Rackspace

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