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

[PATCH v8 12/26] emul/ns16x50: implement FCR register (write-only)


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Wed, 11 Nov 2026 11:47:46 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; 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=UIs++CYhWmZWAoIhqdpJNKQ5FrJCy/T6Euvx7t4l9F4=; b=v/uqpQmVyzP/wJ5vkvuNetJnMwUZfmUNUwgBeGSJ/rVSafVA/opqyhC9nHhtEvGb0PcYvg6OfWHVorRJo7pBTq9iQmw2O4oSqxwSSW9LEXQ/TaHRJYKEvGrtFNTcan8p0//eFK0MApkzc4WbKMEWpYAoQjSqpeiPtKvnLdxoIC43mtcsD72yEhvyXux8ItQxYaqGPRWhL4LAgnm3IOThsSyqFwYM64QVXGCcgWdnkn8v5pNwUO/Zi236L/Jt/zE0EMseQwjbJi7YXOknQXQmrXIfM7JVX2hrS+OTiC3f8SEn84OTQT4crlWwWbgK7LTpI/Ksrj/nsr/Z7567dAdq/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iKNFmXb2PWOTJJpco3q/cVRTaZpGlg/nOKk9ua5CuL0o218NQ2Wf6u0mUwXSUhVhfIzKJ0sCF0wt0iYfWq0TdEDETQXAvbrY+hPmwBF5yC0DopmwWWTbRPP+dFXe59XDPnxeYtnDLqP1yiZLCp5DKzl/cXSYAmjPKTaaI49rnYgbbgUjD0/w1IUdBabEXFBYKPwE/On76gnTJt8x7Vm7LSQ1tWwiVv7Kr68JM52uIOaDHLeVzqxB7LdDqd8BBUXeRpkOETFSbWtWsMR1g36O9YzM3aUvUm1z9aqBL1RFE01c9w+hL8szt/6gykisYWrBZMGRidOeskB3t8txjvj6lA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger@xxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, xakep.amatop@xxxxxxxxx, dmukhin@xxxxxxx, Denis Mukhin <dmukhin@xxxxxxxx>
  • Delivery-date: Wed, 11 Nov 2026 19:49:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx>

Add emulation logic for FCR register.

Note, that does not hook FIFO interrupt moderation to the FIFO
management code for simplicity.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
 xen/common/emul/vuart/ns16x50.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/xen/common/emul/vuart/ns16x50.c b/xen/common/emul/vuart/ns16x50.c
index 8d3845a8a4cd..404e12311090 100644
--- a/xen/common/emul/vuart/ns16x50.c
+++ b/xen/common/emul/vuart/ns16x50.c
@@ -436,6 +436,39 @@ static int ns16x50_io_write8(
         }
         break;
 
+    case UART_FCR: /* WO */
+        if ( val & UART_FCR_RSRVD0 )
+            ns16x50_warn(vdev, "FCR: attempt to set reserved bit: %x\n",
+                         UART_FCR_RSRVD0);
+
+        if ( val & UART_FCR_RSRVD1 )
+            ns16x50_warn(vdev, "FCR: attempt to set reserved bit: %x\n",
+                         UART_FCR_RSRVD1);
+
+        if ( val & UART_FCR_CLRX )
+        {
+            ns16x50_fifo_rx_reset(vdev);
+            regs[UART_LSR] &= ~UART_LSR_DR;
+        }
+
+        if ( val & UART_FCR_CLTX )
+        {
+            ns16x50_fifo_tx_reset(vdev);
+
+            regs[UART_LSR] |= UART_LSR_THRE | UART_LSR_TEMT;
+            vdev->thr_pending = true;
+        }
+
+        if ( val & UART_FCR_ENABLE )
+            val &= UART_FCR_ENABLE | UART_FCR_DMA |
+                   UART_FCR_RTB0 | UART_FCR_RTB1;
+        else
+            val = 0;
+
+        regs[UART_FCR] = val;
+
+        break;
+
     case UART_LCR:
         regs[UART_LCR] = val;
         break;
-- 
2.56.0




 


Rackspace

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