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

Re: [PATCH] ns16550: add support for WCH CH382 serial adapters


  • To: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 8 May 2026 09:36:26 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) 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=ZIGg5HbFp6sGmdutasWExpocmgrEWJPzfspOR1qS70A=; b=WrUbHp1vZuORQBO612m3e6hBoZJ2Qu2L/IVk4yWFjCJbKO9xaay9g+xy4fvwFExNsG0T9EybzLuT8Gv7pjXMUrdTgdmbf2LH3Zmzgvyb4vSYl4eFQcTOVwOtnwoZBUEUKKCqZnVKTpbEPF+Ciz03nXpfHCsYoxeVl83TVV4p6fFlOcIOCjMQnSIhRIQMgumWoE07yC/7Phnx7zWDyExTF9Juj7IugnOBw9V9BeQYAf3mCaSNY8KyA9vqJ6L8oa5LilnaSwKB/WP8fgxMN5Gbb/F3VRMaFXbT/ERDaJAaHrKqiiUtyOT8DpKZHiuwzZKQUl09noxRXuptKrd1kPcf4Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LVhUWRRhabKqXm8WkSSheJ70s3ruEIHG9C73phFMtSZbGohDSQzqfGl6VntvGwuXjucPCT4sg5DEl90bGuI9AhX0awdLW3zOo646Oe81M+/bX3qc/AF5UvKaAHN6e7N8vmJt3ImVQefy1PoxB5IkQgorYfiOUJTASQ9gLnGJgCPNHc2khsD8WOh1rA6KOycr42zmkQ2yfkctEc+AcQ1SjSt0Sf/kTjNDIbkQgImSI8NOEoN0DkPzNhyicLwwLZxg6mXVG1PcsTWdjsOWXCDkk/uVCXpb/d2dxtZZlkkXvNHQY/Gq6j+fWak9AI9KCBpMd1S2AUMW8+BK09694/WtRg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc: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-Type: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-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 08 May 2026 16:36:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Fri, May 08, 2026 at 05:28:13PM +0800, Jiaqing Zhao wrote:
> Add support for the WCH (Nanjing Qinheng Microelectronics Co., Ltd.)
> CH382 PCIe dual port serial adapter. The CH382 is available in two
> variants:
>  - CH382 2S   [1c00:3253]: 2 serial ports
>  - CH382 2S1P [1c00:3250]: 2 serial ports + 1 parallel port
> 
> This chip uses IO BAR0, base baud rate 115200, ports starting at offset
> 0xc0 and spaced 8 bytes apart, and a 256-byte FIFO. [1]
> 
> [1] https://www.wch-ic.com/downloads/CH382DS1_PDF.html
> 
> Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>
> ---
>  xen/drivers/char/ns16550.c | 23 +++++++++++++++++++++++
>  xen/include/xen/pci_ids.h  |  2 ++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
> index 878da27f2e..106ef56316 100644
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -95,6 +95,7 @@ struct ns16550_config {
>          param_exar_xr17v354,
>          param_exar_xr17v358,
>          param_intel_lpss,
> +        param_wch_ch382,
>      } param;
>  };
>  
> @@ -861,6 +862,16 @@ static const struct ns16550_config_param __initconst 
> uart_param[] = {
>          .mmio = 1,
>          .max_ports = 1,
>      },
> +    [param_wch_ch382] = {
> +        .base_baud = 115200,
> +        .first_offset = 0xc0,
> +        .uart_offset = 8,
> +        .reg_width = 1,
> +        .fifo_size = 256,
> +        .lsr_mask = UART_LSR_THRE,
> +        .bar0 = 1,
> +        .max_ports = 2,
> +    },
>  };
>  
>  static const struct ns16550_config __initconst uart_config[] =
> @@ -1189,6 +1200,18 @@ static const struct ns16550_config __initconst 
> uart_config[] =
>          .dev_id = 0x7adc,
>          .param = param_intel_lpss
>      },
> +    /* WCH CH382 2S */
> +    {
> +        .vendor_id = PCI_VENDOR_ID_WCH,
> +        .dev_id = 0x3253,
> +        .param = param_wch_ch382
> +    },
> +    /* WCH CH382 2S1P */
> +    {
> +        .vendor_id = PCI_VENDOR_ID_WCH,
> +        .dev_id = 0x3250,
> +        .param = param_wch_ch382
> +    },

Suggest to keep the records sorted by .dev_id field.

With that:

Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx> 



 


Rackspace

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