Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4725431rdb; Fri, 15 Sep 2023 10:17:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+PGSlKh+Zl3NiXxIAmOweY8MZMZcBEP7vT1kpFbyoDL/Cz1NhMxgx6JUSsSDPX7tE96hC X-Received: by 2002:a05:6a20:9192:b0:149:44d9:bbb0 with SMTP id v18-20020a056a20919200b0014944d9bbb0mr2383469pzd.43.1694798268492; Fri, 15 Sep 2023 10:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694798268; cv=none; d=google.com; s=arc-20160816; b=BpJ9V7UAbkR4gQMxVzPmMUBFdIvQcT0DA8nIBwV+wcdLsjABch347sRqaSy03UFULs C6WcJUS6nZW855JutUVkynCn8H1ef/T3dFulvJ8MVrZPSw17NGkk8zRMaFYVN4Zc04Ai nYoUw2y6+wGLCh8PzkKZlVBaLXNrd9FAL5bKgp6dL9Zrjudqwyyo3PCRCvkcCDu9r6rj y4MWvxpDQruwrYpjIsU9Ce7SgHJ8vH7chOFfk/h8RthDiEIozhb4ZilAusv0u80u7L4U 0cCXfNz7bGdDHlPD3FvosBN+DdN05Hf9CVH4slveFyjrKkSZrT7oWoWNgv1wGvDEiPko fFRA== 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=DVQzFwUpbsXuIGkXzoIV2yaJxsbZHyDDscyAWq7j40I=; fh=DFbgLr/ztI1xSubZnEmgRIbiv/WX0lcUr8wqCSTh8Q8=; b=MBn+nKj3X3JRdy2wkQWpfGYMu2CHITq4vBTryOsTEyoJRuzGSXdLpoNyS5gVqAjnVl PGBgRCRN6LP2lLFvCGUMvZ90UUmvS+7iTpLRaTel4LuQ7s/5GdNq7UGrCqH7uu9IMLlY eXhAgIE5JznU1A49tLgRWjqowagczrKcUOkrOTMw6v3meA1hZ2+hRnracbtaJDmYIfcF jci35GrWhyfnxmKCZHN8Re558tuz9S861hISt/YTnnHsLku+mf7R0VGD2LYIhIQUiEmZ bJQybkIvOBE0vSNcW63lr/3zswxZskcFb16/Kphr7WHG+wiGCrddDCE/2HBES3oOer54 n1tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=VLgLHZCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id cq8-20020a056a00330800b0068be9437c0esi3512446pfb.215.2023.09.15.10.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=VLgLHZCI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 6644983CEDC5; Fri, 15 Sep 2023 03:24:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234095AbjIOKYq (ORCPT + 99 others); Fri, 15 Sep 2023 06:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234325AbjIOKYo (ORCPT ); Fri, 15 Sep 2023 06:24:44 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC4C3C39 for ; Fri, 15 Sep 2023 03:23:40 -0700 (PDT) Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (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-0.canonical.com (Postfix) with ESMTPS id 91D9D3F683 for ; Fri, 15 Sep 2023 10:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1694773418; bh=DVQzFwUpbsXuIGkXzoIV2yaJxsbZHyDDscyAWq7j40I=; h=From:In-Reply-To:References:Mime-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=VLgLHZCIvZXavGmzi/VrC/fTASD5+EiT9GdMyP7mVN56CdeiRSdTCXcLgRkhUpmzJ FDt6MxjrACIt3BUN7g8SygpgHRa43QLRR47w54q5510QpyiN8a5qEewynhSwdPtyY2 +5IOkA0R+S4mbS782cwQe/nr1NHBgmD8RD8hRGqMbAL1ojctl+ZBzRlrf91A9DwiF7 +pzAOwwHRmxbe8i8TdMK02RyImOxlWmQGY0nJ2k2DehkxAJOw+toWCeD9jGIOZ17RV cbC3CN/xM5+a877Jp+O+w/6Z1+hHXmttX80fR9MJlDilrzNcy3xFpjZm9Fn328LZMg 31WnMvhILcSTA== Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-414bd030211so20701941cf.0 for ; Fri, 15 Sep 2023 03:23:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694773416; x=1695378216; 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=DVQzFwUpbsXuIGkXzoIV2yaJxsbZHyDDscyAWq7j40I=; b=P0en98f9hpuIiiAZ6YjuknhpSlv6OCo2+Sk9N4Sh0MPKncxjnEczE76wWB/pZ97GHP drPBRmnxr8xqOPCfMiL0U5jAYbc2ZAXRHBlVG1Ks2nipaPBk4e8CLUxkLZ0dmiFbl9Xy GF4Ew9OoE18YsgMC9Q7sC5GJj4xdafFL9KSK9LvAFhZnRbQuo1VHuIgHfU7Q5vVy1kIp hQ62uS47XYsRLhXgBrtYS3V6GMrlaedNBmwlTd/g13fFUsEuKX7/sJvF9S+vw7zuicNW pKRX3nUd17gJNUMloL55RZI6qEKiY7A3Nxd/CqZXum/UfaAxO3Txk52kFY5+NNnMumqi HpaA== X-Gm-Message-State: AOJu0YwiMFbn3c8zh9OPv9OPI0j3cxUGy1dfEPOuAIh0dCWpabTPNrdr kfA62obvoT0ULYtNASNK//KCPf6KlGKx5lzpSmJ9NvDoFsaat5CQ7rnr5NamPGOmZEEuJwC5Y22 8pJgJgOdH0wcSo8IJ1O7CqfbqgXWddLCIivU7O/j9xcNv7m8givJb6GTzC/wFKSuOZg== X-Received: by 2002:a05:622a:1492:b0:403:e1d1:8b91 with SMTP id t18-20020a05622a149200b00403e1d18b91mr1304337qtx.60.1694773416768; Fri, 15 Sep 2023 03:23:36 -0700 (PDT) X-Received: by 2002:a05:622a:1492:b0:403:e1d1:8b91 with SMTP id t18-20020a05622a149200b00403e1d18b91mr1304322qtx.60.1694773416535; Fri, 15 Sep 2023 03:23:36 -0700 (PDT) Received: from 348282803490 named unknown by gmailapi.google.com with HTTPREST; Fri, 15 Sep 2023 03:23:36 -0700 From: Emil Renner Berthing In-Reply-To: <862905cc-48c3-2dc9-6032-6ee189a629e6@linaro.org> References: <20230915072558.118325-1-wangchen20@iscas.ac.cn> <803daa8f-f4bd-34b7-f826-89e1db5f24f6@linaro.org> <862905cc-48c3-2dc9-6032-6ee189a629e6@linaro.org> Mime-Version: 1.0 Date: Fri, 15 Sep 2023 03:23:36 -0700 Message-ID: Subject: Re: [PATCH 10/12] serial: 8250_dw: Add Sophgo SG2042 support To: Krzysztof Kozlowski , Emil Renner Berthing , Wang Chen , linux-riscv@lists.infradead.org, conor@kernel.org, aou@eecs.berkeley.edu, krzysztof.kozlowski+dt@linaro.org, palmer@dabbelt.com, paul.walmsley@sifive.com, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, jszhang@kernel.org, guoren@kernel.org, chao.wei@sophgo.com, xiaoguang.xing@sophgo.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:24:52 -0700 (PDT) Krzysztof Kozlowski wrote: > On 15/09/2023 12:02, Emil Renner Berthing wrote: > > Krzysztof Kozlowski wrote: > >> On 15/09/2023 09:25, Wang Chen 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. > >>> > >>> Signed-off-by: Emil Renner Berthing > >> > >> Missing SoB. > >> > >>> --- > >>> drivers/tty/serial/8250/8250_dw.c | 5 +++-- > >>> 1 file changed, 3 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c > >>> index f4cafca1a7da..6c344877a07f 100644 > >>> --- a/drivers/tty/serial/8250/8250_dw.c > >>> +++ b/drivers/tty/serial/8250/8250_dw.c > >>> @@ -770,7 +770,7 @@ static const struct dw8250_platform_data dw8250_renesas_rzn1_data = { > >>> .quirks = DW_UART_QUIRK_IS_DMA_FC, > >>> }; > >>> > >>> -static const struct dw8250_platform_data dw8250_starfive_jh7100_data = { > >>> +static const struct dw8250_platform_data dw8250_skip_set_rate_data = { > >> > >> Why? What is wrong with old name? > >> > >>> .usr_reg = DW_UART_USR, > >>> .quirks = DW_UART_QUIRK_SKIP_SET_RATE, > >>> }; > >>> @@ -780,7 +780,8 @@ static const struct of_device_id dw8250_of_match[] = { > >>> { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, > >>> { .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data }, > >>> { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, > >>> - { .compatible = "starfive,jh7100-uart", .data = &dw8250_starfive_jh7100_data }, > >>> + { .compatible = "sophgo,sg2042-uart", .data = &dw8250_skip_set_rate_data }, > >>> + { .compatible = "starfive,jh7100-uart", .data = &dw8250_skip_set_rate_data }, > >> > >> So devices are fully compatible? Then use compatibility and drop this > >> patch entirely. > > > > I'm fine with this, but these are two different companies and SoCs that just > > happens to have both implemented the Designware UART with an inflexible input > > clock. So if fx. a real quirk is found on the JH7110 then we'd need to either > > change the compatible on an unrelated SoC or change compatible on the JH7110 to > > Wait, why? The compatible is still there, so you just add here proper > entry, if ever needed. Sorry, I messed up my example by writing JH7110 where I meant JH7100 > > something like "starfive,jh7100-uart-with-quirk" and "starfive,jh7100-uart" will > > forever be a quirky way to spell "dw8250 with inflexible input clock". > > Is that how device trees are supposed to work? > > I don't get this part. But anyway if the blocks are really designed or > done independently and there is no shared part, except the DWC block, > then indeed the compatibility might be just a coincidence... > It is. Sophgo and StarFive are not the same company. Sophgo are using RISC-V cores from T-Head and StarFive are using cores from SiFive. They just happen to both use the Designware UART in the same way. /Emil