Received: by 10.223.185.116 with SMTP id b49csp1450855wrg; Wed, 14 Feb 2018 18:03:13 -0800 (PST) X-Google-Smtp-Source: AH8x225AaU8pZv7gUhdMbqW2d6i5PL2e+fTFHzCk5RHw151MWMbDxKg7lZIarlsnfcwri1HISCoL X-Received: by 10.98.71.3 with SMTP id u3mr1004292pfa.219.1518660193328; Wed, 14 Feb 2018 18:03:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518660193; cv=none; d=google.com; s=arc-20160816; b=uvaeoriaAWQOeFq+Dwa2w/rLuQOUH6Ftx/VcWLByuuuT1migh9LHytl5qMRq+Gqg8F N1Lp58F9591iDhI2boP/VQvne2/6JoM/05Z9MOLVQHBnTEVtUuLTFfh65cO6445mi8aK iOXo0F4b/4rvLw6pXvOZMXuwkFYUBHluG3X4q6zNgFsKGSrj2zSg3RSqQ8dOfcjF8CCS XNMjwqcSygO2nIZ5y5xhDdvxY5PJefj8tp0qHqO2er8mkiRyQggzVO43affvuc8wq8k/ yKShVn0kKxKqJBldB/LHGqNyKzk2XquWJmIjlcjJDjLfR1LikuDM3SdeSj1HzIiF5oM3 tKow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=v837bAs1NQwORLRlRi4quUbJ5MRo5HmKQwSdmzhsaBo=; b=N4tBm67VjUx0iEb1c6Ix9y9xSjd2DZpgoMz5z33VIN3xrd40++DOSyO5Iw9+KdeE40 1iPmpU9VVBF8wka68HbWpg9edDXvYpGRhq2cmEwOCoBiSB9GWlqdBeRjqI/4iB1x2f41 aiy5dpFKZqtK9r8wzvE7IxUg+6kBHt/9SPAf3DrzjyTCe/ellF8F2IQC9v535UFQrK1n xd/ocIHig1R1hBKslfcKq6YLpoDekqCOGdM7FVYLaMENwziMROEG+sRfudKSBKFCE5Go 7R/e+PXH16YDJHHzE4hMTFis+T9cZIrb4QgibJg/s5fOx+2Wd7BjjGjCS7twe6HOdaHZ vIkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kp+g2/2w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si514806pld.150.2018.02.14.18.02.15; Wed, 14 Feb 2018 18:03:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kp+g2/2w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032496AbeBOCAZ (ORCPT + 99 others); Wed, 14 Feb 2018 21:00:25 -0500 Received: from mail-qt0-f177.google.com ([209.85.216.177]:34615 "EHLO mail-qt0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032245AbeBOCAX (ORCPT ); Wed, 14 Feb 2018 21:00:23 -0500 Received: by mail-qt0-f177.google.com with SMTP id d14so10204965qtg.1; Wed, 14 Feb 2018 18:00:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=v837bAs1NQwORLRlRi4quUbJ5MRo5HmKQwSdmzhsaBo=; b=kp+g2/2wSL3rJBgGfssu4HafYX/A5kRwBC3zGMtSXabpQ0Jd7VCguN3sCNQPsu0Ypl Q2cVScjxogdwHhv5ReGV0im2O7RhDFMYF+csC0Mlzb3UxY5eU1qRrq4In00pERXSySMC mm4EpKf8f1wygs416UUF1/f1Mwdr5jpmkWc/5Vl+v4eOKUI0FUMflMpZ3nG45heGPt3H oS2cE8UyhAmnCbAB65jZnGRX7bF3vD0mPGXqh91yaAqhcuGV0go2StW/9/D0/uePmhQK WYNNT0Z+ZOid3oa7Hw+xbociWjiPd8I06L2euRPxxbCIoB6yiw9DJDKH0wgl6+Kgd8r4 QmRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=v837bAs1NQwORLRlRi4quUbJ5MRo5HmKQwSdmzhsaBo=; b=DiRWic+LNlS8fa8Avf45LuVpgCW9SS772zFfei2CeHaPpea4VCVeVD7eLlxegqlS49 hdTvoIjNZ9LlY5RjK4KL/GQ2rXtefZtZKF9WkxJu+C4zk63j026Lpvksr4nPN/ZWnZ41 8cYeMQva8w/MDjp01qPRrXCF0P79xEjxD0eDLgb+C30ZgjTvWGh59YCTTvFkFIj9VlgO 29SgzYSPC9NTYepVYia9zObWHpNACd9HyIF0F7K0NY2289pDFc6ApXXbZ+w4cpgxb5UQ qcyOY8P4hxHpzoKmecvaF70EdVAYRsO5thmj9WXXEafbrPCIwZyHs2ISQiTrL54iUFk+ Amtw== X-Gm-Message-State: APf1xPB1cWLYm27QaEkWO9W0NdWrolGR6Cf9uF1gRshZYMw6dazTsQzM O79GEprte6ZgIFFBHIrGlqPlBdNJ/cP8x2cX0A4= X-Received: by 10.237.50.162 with SMTP id z31mr1777054qtd.249.1518660022421; Wed, 14 Feb 2018 18:00:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.50.69 with HTTP; Wed, 14 Feb 2018 18:00:02 -0800 (PST) In-Reply-To: References: <20180212044810.23547-1-joel@jms.id.au> From: Joel Stanley Date: Thu, 15 Feb 2018 12:30:02 +1030 X-Google-Sender-Auth: Dpg5duO-TA1-b0WsGpELRvDalUg Message-ID: Subject: Re: [PATCH] serial: 8250: Add Nuvoton NPCM UART To: Andy Shevchenko Cc: Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-serial@vger.kernel.org, devicetree , Linux Kernel Mailing List , Tomer Maimon , Avi Fishman , Jeremy Kerr Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 3:22 AM, Andy Shevchenko wrote: > On Mon, Feb 12, 2018 at 6:48 AM, Joel Stanley wrote: >> The Nuvoton UART is almost compatible with the 8250 driver when probed >> via the 8250_of driver, however it requires some extra configuration >> at startup. > > >> + [PORT_NPCM] = { >> + .name = "Nuvoton 16550", >> + .fifo_size = 16, >> + .tx_loadsz = 16, >> + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 | >> + UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, >> + .rxtrig_bytes = {1, 4, 8, 14}, >> + .flags = UART_CAP_FIFO, > >> + > > Redundant. You are referring to the extra whitespace? >> + }, > >> + /* >> + * Nuvoton calls the scratch register 'UART_TOR' (timeout >> + * register). Enable it, and set TIOC (timeout interrupt >> + * comparator) to be 0x20 for correct operation. >> + */ >> + serial_port_out(port, UART_NPCM_TOR, UART_NPCM_TOIE | 0x20); > >> +/* Nuvoton NPCM UARTs have a custom divisor calculation */ >> + return DIV_ROUND_CLOSEST(port->uartclk, 16 * baud + 2) - 2; > > Is there any link to datasheet? I have a copy of the datasheet under NDA. The Nuvoton guys might be able to help you out. Avi? > >> +/* Nuvoton UART */ >> +#define PORT_NPCM 118 > > We have gaps there. #40 is perfect place for this one. Ok, I will move it up. Thanks for the review. Cheers, Joel