Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp64536ybm; Wed, 27 May 2020 19:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAMhRk8OUYAy3eFMDT6uR/BS69ffF/n6eJqar4XMHPW2nA6DX0pXfB/hTdYmbHzoNnrBzM X-Received: by 2002:a17:906:1dd1:: with SMTP id v17mr1038110ejh.395.1590632821337; Wed, 27 May 2020 19:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590632821; cv=none; d=google.com; s=arc-20160816; b=tB0T2KM9eKxHSm5Q9PTNE4JOVzT/0Q8jyaAXrwSxiF5q2EnMfbcy/FFUxmH4Etz1Jv VVOSXbk4mkqsbEber5sOkNGPs47GZUjZRPpYWQodiRS6SRSFl6n/+R657edRRFdv5Rbh BX0Xwf3lk1zIIDgQRBt3lVqY6I3Gq6PAcYRVdSI+dp0XYgcuoFuUTchGdgqx6sSRY22/ FA+wMiATS6PEhEumkv2HBe3nUKl4shGwc9Cx5nMu5fIB8UcV0eIJNsfjLceLIIoVM9eO FwjV/7+A1Fuvb7+RBOy/9B2AG+DTQNwt0dmSm9n4jxypUnOG3CdY/TTMJ2L5nJIVjEUT Q5qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=kG9QF8UOVZAbX8uqsWrlEl3h/AG9SuRQ3+J+hENs33Y=; b=X7JOboa87y1MrKzmxoh+JJTmoK1ky6t8Tsjfn0ZMIS0Jw9H83khcd4/os3R9CjeSar X3P8JFXizcxjRynixu4D8nokOGMSORmC9YSbaxKpjuV5YCVoCF+tIyEv7kSg60vfIbx2 gECf78aJxYgoPWsEugcQLe0+scQvswGY7JvJlBOR+1q0VnZcklTxZF6fT5T1aWIjN3Xn AOwm50bapest/5i/v/I3v7MQt1dqhR8vO7tM6S0yxr7VAZBGg+7A/WxQzAP7tSdjKrS9 JXkR6A/eOVFs4jCN39j5CXv67b2utD12tC8PlLZ1BUxgNxJa9+adJO6wfCVV9cWe/+Bz qK6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DzXAAMH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si2620397edq.543.2020.05.27.19.26.38; Wed, 27 May 2020 19:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DzXAAMH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgE1CYq (ORCPT + 99 others); Wed, 27 May 2020 22:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725849AbgE1CYq (ORCPT ); Wed, 27 May 2020 22:24:46 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BE2FC05BD1E; Wed, 27 May 2020 19:24:46 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 124so6500312pgi.9; Wed, 27 May 2020 19:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kG9QF8UOVZAbX8uqsWrlEl3h/AG9SuRQ3+J+hENs33Y=; b=DzXAAMH0ncxzEdIhGCaGhBkVKMyPjK1AiOoJNV0elT/GXe3o8sq/htXuaPcTFDsEIX ru5S9BpkOXHDghusOYCXuVWL2pnNWx5u8uwWzVAnLo9klFdchSUHQYpLbFvBuuef49T3 xocVJ+g1QeFVtdAsLecTbLTOcae4hkh449FdLsEvPcEJTJ8OzRGVHWAWcEIAT7poqp0j feBZhJ2Ok55Ae3b0q3NhQPYsdGDPX6a1SgjMfjDZnjpreOSWN1pVYzSRJFLSJ31JJrAF /DFIjCqMZtfd91ZMbmZ3mvwx1949uOjuIBTfoFbMN6/2VIMFqvcUxVEm26U/A50zQivL 4x1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kG9QF8UOVZAbX8uqsWrlEl3h/AG9SuRQ3+J+hENs33Y=; b=AEG98YAQtIB3HF9uZyDFyEYsGDXJz3jaK16M8+a8GZhfg2+jhSv5kHnmh9vXD9VgdI 81qMBIfTOOmmZLRBu3vghtbzutyNHlTZilanQKa9LhNyVcTPJfpYAl7qtSPCifPktr44 3lxbX+pIEq9hj0h3u988gVivhWsnS13h3krWDJsTgae1eq+DcJ+T9KCeDICTZ6g8jf8g 62FE1CW8RdSVz3BkjBq0k+gJtn1b/ggSekm4AELgAqp9BPQHfMsuxFrh2Q416o0oZ8Sd xGVbZ/L4CcZlOdNoxAZXbaiul3QzsrTkmsp09Vj2M8eLJMcP9iqTpF/xNn9nqdY+JWnV /06Q== X-Gm-Message-State: AOAM530DNxDF8gtUmeWV/i71sHjs4shM2c6YIldah/zJXa5LlK3Y/3ne 0i2EbkfCz4OaNAQ3WycN2NI= X-Received: by 2002:a63:214d:: with SMTP id s13mr685317pgm.277.1590632685685; Wed, 27 May 2020 19:24:45 -0700 (PDT) Received: from localhost (59-120-186-245.HINET-IP.hinet.net. [59.120.186.245]) by smtp.gmail.com with ESMTPSA id v17sm3041414pfg.164.2020.05.27.19.24.44 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 May 2020 19:24:44 -0700 (PDT) From: "Ji-Ze Hong (Peter Hong)" X-Google-Original-From: "Ji-Ze Hong (Peter Hong)" To: gregkh@linuxfoundation.org, jslaby@suse.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Ji-Ze Hong (Peter Hong)" , Ji-Ze Hong Subject: [PATCH V1 1/1] serial: 8250_fintek: Add F81966 Support Date: Thu, 28 May 2020 10:24:29 +0800 Message-Id: <20200528022429.32078-1-hpeter+linux_kernel@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fintek F81966 is a LPC/eSPI to 6 UARTs SuperIO. It has fully compatible with F81866. It's also need check the IRQ mode with system assigned. F81966 IRQ Mode setting: 0xf0 Bit1: IRQ_MODE0 Bit0: Share mode (always on) 0xf6 Bit3: IRQ_MODE1 Level/Low: IRQ_MODE0:0, IRQ_MODE1:0 Edge/High: IRQ_MODE0:1, IRQ_MODE1:0 Signed-off-by: Ji-Ze Hong (Peter Hong) Cc: Ji-Ze Hong (Peter Hong) --- drivers/tty/serial/8250/8250_fintek.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index 31c91c2f8c6e..d1d253c4b518 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -19,6 +19,7 @@ #define CHIP_ID2 0x21 #define CHIP_ID_F81865 0x0407 #define CHIP_ID_F81866 0x1010 +#define CHIP_ID_F81966 0x0215 #define CHIP_ID_F81216AD 0x1602 #define CHIP_ID_F81216H 0x0501 #define CHIP_ID_F81216 0x0802 @@ -62,9 +63,9 @@ #define F81216_LDN_HIGH 0x4 /* - * F81866 registers + * F81866/966 registers * - * The IRQ setting mode of F81866 is not the same with F81216 series. + * The IRQ setting mode of F81866/966 is not the same with F81216 series. * Level/Low: IRQ_MODE0:0, IRQ_MODE1:0 * Edge/High: IRQ_MODE0:1, IRQ_MODE1:0 * @@ -155,6 +156,7 @@ static int fintek_8250_check_id(struct fintek_8250 *pdata) switch (chip) { case CHIP_ID_F81865: case CHIP_ID_F81866: + case CHIP_ID_F81966: case CHIP_ID_F81216AD: case CHIP_ID_F81216H: case CHIP_ID_F81216: @@ -171,6 +173,7 @@ static int fintek_8250_get_ldn_range(struct fintek_8250 *pdata, int *min, int *max) { switch (pdata->pid) { + case CHIP_ID_F81966: case CHIP_ID_F81865: case CHIP_ID_F81866: *min = F81866_LDN_LOW; @@ -248,6 +251,7 @@ static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool is_level) sio_write_reg(pdata, LDN, pdata->index); switch (pdata->pid) { + case CHIP_ID_F81966: case CHIP_ID_F81866: sio_write_mask_reg(pdata, F81866_FIFO_CTRL, F81866_IRQ_MODE1, 0); @@ -274,6 +278,7 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata) { switch (pdata->pid) { case CHIP_ID_F81216H: /* 128Bytes FIFO */ + case CHIP_ID_F81966: case CHIP_ID_F81866: sio_write_mask_reg(pdata, FIFO_CTRL, FIFO_MODE_MASK | RXFTHR_MODE_MASK, @@ -291,6 +296,7 @@ static void fintek_8250_goto_highspeed(struct uart_8250_port *uart, sio_write_reg(pdata, LDN, pdata->index); switch (pdata->pid) { + case CHIP_ID_F81966: case CHIP_ID_F81866: /* set uart clock for high speed serial mode */ sio_write_mask_reg(pdata, F81866_UART_CLK, F81866_UART_CLK_MASK, @@ -327,6 +333,7 @@ static void fintek_8250_set_termios(struct uart_port *port, case CHIP_ID_F81216H: reg = RS485; break; + case CHIP_ID_F81966: case CHIP_ID_F81866: reg = F81866_UART_CLK; break; @@ -373,6 +380,7 @@ static void fintek_8250_set_termios_handler(struct uart_8250_port *uart) switch (pdata->pid) { case CHIP_ID_F81216H: + case CHIP_ID_F81966: case CHIP_ID_F81866: uart->port.set_termios = fintek_8250_set_termios; break; @@ -443,6 +451,7 @@ static void fintek_8250_set_rs485_handler(struct uart_8250_port *uart) switch (pdata->pid) { case CHIP_ID_F81216AD: case CHIP_ID_F81216H: + case CHIP_ID_F81966: case CHIP_ID_F81866: case CHIP_ID_F81865: uart->port.rs485_config = fintek_8250_rs485_config; -- 2.17.1