Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3712422pxb; Mon, 24 Jan 2022 16:05:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyD+qYBGSGxuZs78TFKQRNi2Om0kx5S/AAdgzqTtneLTTQouX2IRAiS/uNGi4Y7SEteGONc X-Received: by 2002:a17:90b:249:: with SMTP id fz9mr674722pjb.99.1643069103762; Mon, 24 Jan 2022 16:05:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069103; cv=none; d=google.com; s=arc-20160816; b=wVL/E9pfpkhwP89+FtrxLP1pLf79Ily9HgCF8wMRoxpVpm270j30qK/pipoAGY/lfg kMYTxPWr7dyhiTkesB3Mulz56sidtCLN+rlD+p8gJwBIWqN/47stUVyh9+BsvlNFt0ui nI6iXqCvuXOMqWRXJyonIdZWCs3DiNwW2aU460+LhQq3U2C4+WuDBwQ9SJZPL1uSfkYP I0aLjZgwAd4SO8avbM/fmm/BZAuyxr1bagQ2yWdqVE6e1kgAmuZMUCPX6CeSxQMpye6m ER7PvXxRwq9VdmKqvv9ZpP7yX+unN0vLtrNiaWor8UB9gRD/RJInL+kb6SOuBB0ViwCT gwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=porURtwG4JNlVNcUAMr1hOIX025gEF++C0AkLeNTjWM=; b=HTgHRU0UxrDiRDGdlpJSQM8/NHMTfb1yOhtUsUO2LXTCm0nE8N9XooSMeZOZ3Pig78 mamX0GmuREZ0cSlkxBSDdero3sdvTHpSOjXtLRQijpuA4ur0sGa8YElV9muq6kloIFxi 4SJ3ni9Cff4dx8GnMIgxQPOKhSxqz+OA9n4i31xRGMwrRwdaCV/RjHgSLrGNWd7BIkBX h26ZZ3kUZwGfgD5ibhuGuIENlCgYfewAFFCta7hJYwywDJKKfWure7AO3/34hdaaJUBA vEw5K9up0f5qme3C3kulDxaa/9K6ID5+ZFLo5tyZs6d3GxWSsuL5ReIrAltRBhwverzd Oduw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IN3QVG7F; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng12si745012pjb.32.2022.01.24.16.04.51; Mon, 24 Jan 2022 16:05:03 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=IN3QVG7F; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2367924AbiAXX4v (ORCPT + 99 others); Mon, 24 Jan 2022 18:56:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846423AbiAXXPz (ORCPT ); Mon, 24 Jan 2022 18:15:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF966C0604D1; Mon, 24 Jan 2022 13:24:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6CB8EB8122A; Mon, 24 Jan 2022 21:24:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97129C340E4; Mon, 24 Jan 2022 21:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059462; bh=P0K1qFpXW6iZLb8fx18FKgzSyX5CF/f0E9RlLpHqlc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IN3QVG7F4Nqw5Kht3s/NXcgVqZI9JFeegJ5QCPt0DbXdCwaWjzCB0cu26YZT9vyym 6k/lfCtM2C/eSj5st1M5k0gx1tFjFxtL/hni1BmJB63dO4x0jw3Xbbbg9aYgm/B58S xoLSRqIqNSA3sW8E3rhJ3gpCr2jRWgQ81d1NjHfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emil Renner Berthing , Andy Shevchenko , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.16 0591/1039] serial: 8250_dw: Add StarFive JH7100 quirk Date: Mon, 24 Jan 2022 19:39:40 +0100 Message-Id: <20220124184145.197234693@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Emil Renner Berthing [ Upstream commit 57dcb6ec85d59e04285b7dcf10924bb819c8e46f ] On the StarFive JH7100 RISC-V SoC the UART core clocks can't be set to exactly 16 * 115200Hz and many other common bitrates. Trying this will only result in a higher input clock, but low enough that the UART's internal divisor can't come close enough to the baud rate target. So rather than try to set the input clock it's better to skip the clk_set_rate call and rely solely on the UART's internal divisor. Signed-off-by: Emil Renner Berthing Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211116150119.2171-15-kernel@esmil.dk Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_dw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 53f57c3b9f42c..1769808031c52 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -414,6 +414,8 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) if (of_device_is_compatible(np, "marvell,armada-38x-uart")) p->serial_out = dw8250_serial_out38x; + if (of_device_is_compatible(np, "starfive,jh7100-uart")) + p->set_termios = dw8250_do_set_termios; } else if (acpi_dev_present("APMC0D08", NULL, -1)) { p->iotype = UPIO_MEM32; @@ -696,6 +698,7 @@ static const struct of_device_id dw8250_of_match[] = { { .compatible = "cavium,octeon-3860-uart" }, { .compatible = "marvell,armada-38x-uart" }, { .compatible = "renesas,rzn1-uart" }, + { .compatible = "starfive,jh7100-uart" }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, dw8250_of_match); -- 2.34.1