Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3385491pxb; Mon, 17 Jan 2022 19:16:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6BYQdtMYS2xz2vbNkp6VOYDXqNb20Z1rQEcRdNY/Gyj1cyVTUxxwQLvMCtPLmo+Rd+OmL X-Received: by 2002:a17:90b:4c0f:: with SMTP id na15mr28257163pjb.21.1642475783111; Mon, 17 Jan 2022 19:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475783; cv=none; d=google.com; s=arc-20160816; b=Jsxo6UjhErF4b216H2G4cItqHxQRkzuE50nX+TNIgYNJDLxRp97M2+jBQM+O8wWAEj urwc+X7+sqC9fwxIuR4xlgHlgedPKzxmwHrXXqk9mJxp5To/EUklsP2ceTa86D3b2M4F KyN99t1g6IkVwJAB5HJpZhjGSJB1nMDGayPVEQwdBF6K2mgGim0ioyNq7JMdLXv7UxK1 hZprCXSAkF7yjd78Nd0T35cVN9Cla4pe3ssLvcodWmtksxKgry816uG7l/lwHKAVuDfC VoTedqyJc73eMY5n+sJLBH8bIYdWi488whFeeLZzJR81kjHEeBdkth65qf/vtcf7tSRl TwrA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=porURtwG4JNlVNcUAMr1hOIX025gEF++C0AkLeNTjWM=; b=RYjmoa+VfiyWg2VvjKTAGg5g8/+oxKRzECnUIRqsP1bnvvTE1Ah1EeupMaAn6K5T28 X0v0MIPQITV14kYatdE/o13Mp5GV6WJ6w1NDn2xkj0h6ag9nXfC1U/5BN13hQLG8F1E7 z+aDfk5WjpbqH1Vt9gDCvDiXOSpN6iLO7GhR2JK1yjSKUHu2GjBRt2TwYAITlIziQcp1 5g4ibgGePWo/zQR6vzvABuGmA89cRs1L8TsNm2sYhtOzYwFRX1Ejfhk2SvF4IaTdZOoE AvlpJuBAC1fWJREJOwUX6P32h7rpWGlDtmgBFNapI6jKVHr5A1o5Kd1hMlH9c8jmdnu9 DfrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jZkYDOM3; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si1115531pjt.38.2022.01.17.19.16.11; Mon, 17 Jan 2022 19:16:23 -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=@kernel.org header.s=k20201202 header.b=jZkYDOM3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244598AbiARCZg (ORCPT + 99 others); Mon, 17 Jan 2022 21:25:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245350AbiARCXk (ORCPT ); Mon, 17 Jan 2022 21:23:40 -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 54975C06175E; Mon, 17 Jan 2022 18:23:33 -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 15A43B8122C; Tue, 18 Jan 2022 02:23:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85947C36AE3; Tue, 18 Jan 2022 02:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472610; bh=P0K1qFpXW6iZLb8fx18FKgzSyX5CF/f0E9RlLpHqlc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZkYDOM3OCn1TkZesEC7cCdWVe38bJ4hXTreIM3uoTfgWhlFYHwEQmeTLWkZ9unkF 22Kf6gkxcigrJ31DhBzz1Tli0LstM3rK6tyf1+A3b2/SNn40vD98FClPeySjKdyoVt wVF6ANaRLIMqHjPI2OfFhI1VapYTBLpG1wYFclQoOC2HD6InCMgLVyUiuPKz4RZZQR u/MvAmq4kOTDl5etFyvhLgirGNJKMHBMXo/YMKe6rzO9SzC/qiPx/3lX0C92Da3G/Q u1PURoDXY2KD4cLmMFLdQD081gIYKblEHYO6AlPG0mjqNlQV1wg52T7qcVIUKwOPCk jCqck6JNj1jBQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Emil Renner Berthing , Andy Shevchenko , Geert Uytterhoeven , Greg Kroah-Hartman , Sasha Levin , jirislaby@kernel.org, andriy.shevchenko@linux.intel.com, johan@kernel.org, luzmaximilian@gmail.com, linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 069/217] serial: 8250_dw: Add StarFive JH7100 quirk Date: Mon, 17 Jan 2022 21:17:12 -0500 Message-Id: <20220118021940.1942199-69-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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