From patchwork Tue Jan 26 10:26:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 8119881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E70B9F859 for ; Tue, 26 Jan 2016 10:31:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8E97201FA for ; Tue, 26 Jan 2016 10:31:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD377201E4 for ; Tue, 26 Jan 2016 10:31:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aO0t7-0006i3-6m; Tue, 26 Jan 2016 10:30:17 +0000 Received: from eusmtp01.atmel.com ([212.144.249.242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aO0pP-0005ob-Ge for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2016 10:26:30 +0000 Received: from tenerife.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 26 Jan 2016 11:26:02 +0100 From: Nicolas Ferre To: Greg Kroah-Hartman , Subject: [PATCH v2 2/2] serial: atmel: add support for new UART version Date: Tue, 26 Jan 2016 11:26:15 +0100 Message-ID: X-Mailer: git-send-email 2.1.3 In-Reply-To: <198abfa682d5a39758599d34d1c5b9fd2858cedc.1453803763.git.nicolas.ferre@atmel.com> References: <198abfa682d5a39758599d34d1c5b9fd2858cedc.1453803763.git.nicolas.ferre@atmel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160126_022627_997253_1BA423C4 X-CRM114-Status: GOOD ( 11.19 ) X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: davidm@egauge.net, Nicolas Ferre , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, jslaby@suse.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Starting with sama5d2, the new UART revision has an hardware timer. So, add it to the IP detection code and set the "has_hw_timer" property for it. Signed-off-by: Nicolas Ferre Reported-by: David Mosberger --- v2: - add needed variable declaration drivers/tty/serial/atmel_serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index de5d32c31179..a4568b5ffe89 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1710,15 +1710,16 @@ static void atmel_get_ip_name(struct uart_port *port) struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); int name = atmel_uart_readl(port, ATMEL_US_NAME); u32 version; - u32 usart, dbgu_uart; + u32 usart, dbgu_uart, new_uart; /* ASCII decoding for IP version */ usart = 0x55534152; /* USAR(T) */ dbgu_uart = 0x44424755; /* DBGU */ + new_uart = 0x55415254; /* UART */ atmel_port->has_hw_timer = false; - if (name == usart) { - dev_dbg(port->dev, "Usart with hw timer\n"); + if (name == usart || name == new_uart) { + dev_dbg(port->dev, "Usart or uart with hw timer\n"); atmel_port->has_hw_timer = true; } else if (name == dbgu_uart) { dev_dbg(port->dev, "Dbgu or uart without hw timer\n");