Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2789114rdb; Fri, 22 Sep 2023 08:25:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGNdkQ3+YKs3Xn7Vx23aeIeqRD7km3Fqcd3+aRKPF2VZiGsNaY3MWh8Bb3eFJGKJnZXj5I X-Received: by 2002:a05:6a21:6d85:b0:15d:a9aa:dbed with SMTP id wl5-20020a056a216d8500b0015da9aadbedmr2911657pzb.5.1695396314841; Fri, 22 Sep 2023 08:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695396314; cv=none; d=google.com; s=arc-20160816; b=esiQJvWVTCOkPXOSN6kpMDjjlPXa4Y6VHx4mBY0gIKalByDIvCVtx7R7CeWnCs9eXQ ilsf0gfoand6VE+9fhywQL0npEYvkc0Zl9+4DMDr9AFSP8hA2w/16fUOaaSZF+oWQU5A O+ly7G3UN4FyK8p8czJMyF6V1To0W/yzWIqA8goTTfDHfXXp2joGggl1jVG0njkWgYMJ Etk3kmjeDO8CUy4Gsk44hcPTK437qT+Fqb1rbdsENgrlxFg+rZEzO9C/b06kZZSFMgmT y1Zko5YlQQ9CX1NuU0hRZ5BHaEaHO4+VOPbAhTdsm9fDZltfI4PvhCVJ7m5hgTSErduw PGyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:mime-version :references:in-reply-to:from:dkim-signature; bh=M9atEZ8pv97FGsnY/ZWo7vn5sZBlwoU9NTKpTiNkhYY=; fh=wDq5SPOIJ4W1MxPc4j9R2irJqNcHmHb+BWtU+HrJ8Qc=; b=N0BwU6M5XlYYFPopuvOV1qdOFr2ilJSOWpOJDpyTKl6+QAcBuJj+Gg/j1VK98Nwng7 ESg9VXRv10EJny2rT8076m5oVCp3/K5ZJ42/WJHuFeeG0cQodpVPHUCknw00kePf70rt YdTzkJOg/tw9IkfWbZMPqrFBd42UCMpFRQ6Wg0Fe/gXKUvCF9NKXv+zaFHDl3xiBUhp7 vhBPnbojyD2oGKDtKCfpIFhCMIzQ5Sgjnv833tomrQK/QqDPpe4D15nQAQkkyWk3F1ah dXgecSnWLuem2z1Ss3dWhmML9ZNw1+1AGcVpTbiVCYzM/o69MaNoUiRQsGiqdIZc7vSF c02Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=QfaPhUyd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ch3-20020a056a00288300b00690d55d630dsi4001966pfb.274.2023.09.22.08.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=QfaPhUyd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7E1C582F0BCC; Fri, 22 Sep 2023 03:40:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbjIVKlB (ORCPT + 99 others); Fri, 22 Sep 2023 06:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjIVKk7 (ORCPT ); Fri, 22 Sep 2023 06:40:59 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 178D9AF for ; Fri, 22 Sep 2023 03:40:52 -0700 (PDT) Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 11F3541DB4 for ; Fri, 22 Sep 2023 10:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1695379251; bh=M9atEZ8pv97FGsnY/ZWo7vn5sZBlwoU9NTKpTiNkhYY=; h=From:In-Reply-To:References:Mime-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=QfaPhUydREmq4YdwmKCkJLfZN7K1udPKQrfT376W7C0lpcR0fJxdiCN04/2G0siTQ sAHj0fcZpKkt3UmuNZT7JyssfVlVU7+n9TVinKCpZn5oWszgbaN8fYYC/Y4KXvOKsm xJ8mKV9Q6ezbn6DDh+g6wA1qzzMr5LgD0p6GCWVerU+KCLAr8wQZ08X/XhJnYMIUtu UEYa6831+oZcy7D6pVjJ+JOwaAYuTXJ6GIBEhtBLx7OFWc4jR5nPvrGNTY7/vKgmPL BTkF+E+iq2q5gzLc0PP6yNt9vaRdqmWSIcgFV6BaTJWYf3891azn9d/u4gC/YQL1H5 QkhiYQpUujLew== Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-417f9e1def0so6611111cf.2 for ; Fri, 22 Sep 2023 03:40:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695379250; x=1695984050; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M9atEZ8pv97FGsnY/ZWo7vn5sZBlwoU9NTKpTiNkhYY=; b=l0+lL0Ced5Y0CMUPoEr+dDsue142SY+sicCSIgaROQ+3BDB+LWj3kOI0cmn2TvqfoL i/AdyNA7mDmorVvKkSMV7sUOgRtr+2LcuY2gdot4sblXBofg7qsrXv5YIt5vaTtBwziL ixTkep+lEyUsfFUKlTdmicr+y3tvDTlbNvK1T6+WoqPk4Q4X0oYnyC+Tt1OSd3JzsMfj D3l3Pb5nZsCqwa1AgoDfqFfdtbcee6hf4yKe6KOMB9EcAVVVfGn/Zi8QLelzyjANW2YS hfrsfzF8k85XYR26jPiBa799DQBwdPfXZrzvzgw8ZIYGkfgCGM+73240+QPLc0jrS56i /9ZQ== X-Gm-Message-State: AOJu0Yyrmvo6STZM90Dm9b63PjDKLaXh8jM6xlIBVXt/T7wI88X5MrVE 13DQ2se939/VVshkqnyuFp7PHpFzjOeWjA4epz9DTdGnQug4n56Yk26/tpOJf2Ysu+ELG8Nby6n awILthXd7KX0mOoJX5H/P2lx8rmI5nFpgUL8DTgQc44REfvOLt1e9lDWbrA== X-Received: by 2002:a05:622a:182:b0:417:a209:c250 with SMTP id s2-20020a05622a018200b00417a209c250mr8885221qtw.36.1695379250042; Fri, 22 Sep 2023 03:40:50 -0700 (PDT) X-Received: by 2002:a05:622a:182:b0:417:a209:c250 with SMTP id s2-20020a05622a018200b00417a209c250mr8885206qtw.36.1695379249804; Fri, 22 Sep 2023 03:40:49 -0700 (PDT) Received: from 348282803490 named unknown by gmailapi.google.com with HTTPREST; Fri, 22 Sep 2023 03:40:49 -0700 From: Emil Renner Berthing In-Reply-To: References: <888d57a2d5e62affb8e29e0098402e428facd969.1695189879.git.wangchen20@iscas.ac.cn> Mime-Version: 1.0 Date: Fri, 22 Sep 2023 03:40:49 -0700 Message-ID: Subject: Re: [PATCH v2 08/11] serial: 8250_dw: Add Sophgo SG2042 support To: Ben Dooks , Chen Wang , aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org, devicetree@vger.kernel.org, emil.renner.berthing@canonical.com, guoren@kernel.org, jszhang@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, paul.walmsley@sifive.com, robh+dt@kernel.org, xiaoguang.xing@sophgo.com Cc: Chen Wang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 03:40:59 -0700 (PDT) Ben Dooks wrote: > On 20/09/2023 07:40, Chen Wang wrote: > > From: Emil Renner Berthing > > > > Add quirk to skip setting the input clock rate for the uarts on the > > Sophgo SG2042 SoC similar to the StarFive JH7100. > > I'd love an actual explanation of why this is necessary here. Makes sense. For the JH7100 the commit message is: 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. @Chen Wang is this also true for the SG2042? /Emil