Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1925536rdh; Tue, 26 Sep 2023 07:31:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGUifl5n0nXgWbuk2zmdf9qjGRCD/j+DrDDBZzt8pnCLJLBDQtwpFpOlmd2JLcVsnWkGzy X-Received: by 2002:a17:90a:aa8b:b0:270:1611:484b with SMTP id l11-20020a17090aaa8b00b002701611484bmr7074485pjq.41.1695738709492; Tue, 26 Sep 2023 07:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695738709; cv=none; d=google.com; s=arc-20160816; b=xY6+SmrYQ9GaemRBmd/ePljXHfzAp6+IIzSG9H8Jbq/Ghvnv0J/pG/ZVy4tXCQqO3W jHsqeI5xlbiSq8u+NQgvNKhwi+E47Bra9aXiHdXXbjcNXbsTGpzP26AGvs06aQP1VWuO /Ax827z7k4Ozwl4n7pOxITNYv6Y8HH8ic/jSc2ixTJo6+E5A0rf/sy24f3bjjBpP+xvo R7r4Xb3o3f13/uU/owTDQnN/pI1VsitmOc6Ko5Ts8Dt5KNbOzZuJlYA1iNECjQlfAthz 6A6II/NaNOBMt3E7Qk5p9ZnwAKDBHxSEmYrOdQngU8hugczhCOatKbwMnWOKgXpt/Lqm 7nBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/27Fg5u72g9kvgafrBJAucjZrohxNI5dpw0DZZayMMA=; fh=jdwMtn7B41P6QY+/lM5vHD3byHZoKnfoH4N/kVKeZMM=; b=zQqk2XUZo6x9ApOFbCph7bkPhoxP78KZFzIPKcVk9zSb+k5MogUa8nTI8qkn6aHe/T 5peezyiZvrOM5/YCfXYIrWd34iFo+cEV3DaXiilpsJnXEujyHutgDH8JV1KjZ0lEkTmJ g8KTc7BLM3bxZIyx7Jp37YfH10tZAnjuNw2oLHw9MycQrur62/YZKEGmkhDDfyZ9W0mM 9b8vMGO0bL9vtSDHFQVARhMgSP8ZodR/EYQ6dYsPwMXVHyDAXWDCV40kasXdVu3Tl4q4 zlvvMZCkd3DhA02hSTQQ+Bbm/aXFep5f5LBLPjS6+z3nb3kfLQeje4CbG2xyv4QZ3LTQ xeDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VHvRx+Ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x18-20020a17090ab01200b00274cd766a42si6147620pjq.171.2023.09.26.07.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 07:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VHvRx+Ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ECE41801C02F; Tue, 26 Sep 2023 00:38:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233659AbjIZHik (ORCPT + 99 others); Tue, 26 Sep 2023 03:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232037AbjIZHij (ORCPT ); Tue, 26 Sep 2023 03:38:39 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB8AB92; Tue, 26 Sep 2023 00:38:32 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-65b0e623189so19459536d6.1; Tue, 26 Sep 2023 00:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695713912; x=1696318712; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/27Fg5u72g9kvgafrBJAucjZrohxNI5dpw0DZZayMMA=; b=VHvRx+AyXuNpp1KN3oi66AuitFW1PDwbLk00fl/o5fuv4uIM9pSeah2j3a2rT48O2U G9V6kcfl5kQ3P58fxAUqZrxatfVuhaXbBLfhtMbD/vvnJaUlnjaQYv1TT/g8XaLc3VuI 84fDhK+UbdvUOp/P3ylcUzXNj805bnfHd8LFPsfZ8fDg8NxS6b5BV3hqO1mqzUM1/n0+ M5y75joNP1bKCBcQBouQS9pSspzDWZEGV/uSwWIlbOaKFgK5xr++9uM3Wk/uyg4EV5ei v4cj2p8foQxiYRoZg5qADJrCs5UUP3k5dh9oajrTOroJ5yRGjQHN4WtEx5f4ncaunl93 26dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695713912; x=1696318712; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/27Fg5u72g9kvgafrBJAucjZrohxNI5dpw0DZZayMMA=; b=k+WxVo3DcV0qrlDGk3WVKBcesBy91HfyXaNM5LMKastxPTo/1IzIcWFlXcZbS8s08N PkDfn6wIX+FBeD3qXqo2G0g30pXKjqLYl30ep2mGCu2AgAm0RFqQ1VHDbLrcCT6MHoZP qUTiyaCXE5tXiHRE2bNW3Td7MUjwS66zPbw43ivZal96B1xGrAj/nnvV/nZrVJEQ5Cd0 PMhMhuk7aEm6mT1QcJJC3Wg1G6KnjlRER1oWcEulHsRS4lMddLtHsS4J/l52A3Rbeg6i PByogvlow5uCSKxVCI+uJWnuHJvICANGDOoUBfg8b/EFcJAXQ3TXJxx4NgUU+4ykiH9Y NX6Q== X-Gm-Message-State: AOJu0Yz1o1inVQ5z7/4TXm+ID0+xbaNZyM2291aWPVksdauzK9pfJN7Y f7qopVdNZcB/TXfaONT+U+BhByUsxCM55KltfVA= X-Received: by 2002:a0c:aa93:0:b0:653:583d:d400 with SMTP id f19-20020a0caa93000000b00653583dd400mr8098108qvb.52.1695713911865; Tue, 26 Sep 2023 00:38:31 -0700 (PDT) MIME-Version: 1.0 References: <888d57a2d5e62affb8e29e0098402e428facd969.1695189879.git.wangchen20@iscas.ac.cn> In-Reply-To: From: Chen Wang Date: Tue, 26 Sep 2023 15:38:19 +0800 Message-ID: Subject: Re: [PATCH v2 08/11] serial: 8250_dw: Add Sophgo SG2042 support To: Emil Renner Berthing Cc: Ben Dooks , aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org, devicetree@vger.kernel.org, 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, Chen Wang , haijiao.liu@sophgo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 00:38:47 -0700 (PDT) Emil Renner Berthing =E4=BA=8E2023=E5= =B9=B49=E6=9C=8822=E6=97=A5=E5=91=A8=E4=BA=94 18:40=E5=86=99=E9=81=93=EF=BC= =9A > > 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 Emil & Ben, After double-checking with Sophgo engineers and doing more investigation, we think the original changes(quirk to skip setting the input clock) on UART may not be required. Due to currently, the target of this patchset is just to enable a minimal system and no clock relateding changes are included yet. I will first remove this quirk change on UART and use the fixed frequence - 500M - and reply solely on the UART's internal divisor to work. We will re-evaluate this quirk change in next patchset when we involve clock related stuff. Looping Haijiao, engineer from Sophgo, who is working on clock on sg2042. Regards, Chen