Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1283353rwi; Mon, 10 Oct 2022 14:05:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nGlXpKDhQQRAbW6IN0CJbMh64ndfclZinLuTwzo2EUL+s6VCcT6Pw1TfyXzEtp73nWsZ2 X-Received: by 2002:a17:902:ed97:b0:17f:7ad0:16cb with SMTP id e23-20020a170902ed9700b0017f7ad016cbmr20949721plj.97.1665435900358; Mon, 10 Oct 2022 14:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665435900; cv=none; d=google.com; s=arc-20160816; b=uVXw4UgSM8I9q/WNm+Jwrbuns3Z5clesfGe8OiN4FBZxIj4S7eGPtyDlZhKJNV3+pc cWnYTplqQS4htR93cIG8J90y46vFE1SbvD8f//Af7PNDepzJDnrCScg0QlA3D8hZdU7Z uvAHDP3QwCmK8BSiP0DIcPh79JOjl4vsT2WF5rnH/CeBvYUJPMbnX5oTrUImsLHqWYoQ wPLbHTLRnR+OnHLC9S3fbmf9aUK4/iDORtuZue6ui3vdXYCowJeym1h7MBsbosG1SCfc wyEyM15TegUfWPkBdzkbqzV9loItjD+BQm5vvbibDEQhkyl7vH+PCJuQC1QVsgNsNYG9 jAWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xBMwCyz7PtXkcg5mVfEE1bKjMCpvLzWf/0ZjXItivLo=; b=bPa8uwwUz8eeA05nPqGsfcoDelRNdmpl9lNNWMWOa94FG9dQ73DKsjmDlubvaJuiBt H9Gg2W2xfSEOZuvTtl/znTqLXJNVvV0C5O2wO24PSrUAMNGCdWUaQTbP9nwArFLx9tjU f6NZn84TAhI6/Ce11MFpTR7S7e5E5CnuD6PQ9kJ3esVhlI+bo0aXiRmIwRPFHN/0HeVP TixaoAY+TrHZKeW5TyMJ7PXEYNAh0XKd0GI69SCjnHb4u4znf3u+ap2yigJRYMrtob+h AMFFPVyAY72RBj+/tqogS4iAZLvGNLd+A2niltNFYCSAoUB9szWd0RQykUliZ+a7lT+u hLkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qiu6R90b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a6557c7000000b00415ff45dce3si14422726pgr.839.2022.10.10.14.04.39; Mon, 10 Oct 2022 14:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qiu6R90b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229731AbiJJUZF (ORCPT + 99 others); Mon, 10 Oct 2022 16:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbiJJUXn (ORCPT ); Mon, 10 Oct 2022 16:23:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DC924B0DD; Mon, 10 Oct 2022 13:22:40 -0700 (PDT) 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 661D6B810B5; Mon, 10 Oct 2022 20:20:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EF38C433D7; Mon, 10 Oct 2022 20:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665433216; bh=DMGjMyu5C0L96dKcCyOonQyj8xCaUAQ7WEcc6TEXH5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qiu6R90bakIk/iJ69oJSphwso4hq3oylnE8JPy4FzBMLuPLVxDjMzbolb73W4P0Th 75g30LacqQg7PWYK6RqRqrTxFWW5Vz953YRzSlxZAv0pmWhUldY8xX79qCLpWJg1gg pzGMGMbuR0de/qwxZ3kGhC8SZrDFIy75K6/L1rtw= Date: Mon, 10 Oct 2022 22:20:59 +0200 From: Greg Kroah-Hartman To: Siarhei Volkau Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Vinod Koul , Paul Cercueil , Thomas Bogendoerfer , Linus Walleij , Jiri Slaby , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-serial@vger.kernel.org, linux-mips@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH 7/8] serial: 8250/ingenic: Add support for the JZ4750/JZ4755 SoCs Message-ID: References: <20221009181338.2896660-1-lis8215@gmail.com> <20221009181338.2896660-8-lis8215@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221009181338.2896660-8-lis8215@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Sun, Oct 09, 2022 at 09:13:36PM +0300, Siarhei Volkau wrote: > These SoCs are close to others but they have a clock divisor /2 for low > clock peripherals, thus to set up a proper baud rate we need to take > this into account. > > The divisor bit is located in CGU area, unfortunately the clk framework > can't be used at early boot steps, so it's checked by direct readl() > call. > > Signed-off-by: Siarhei Volkau > --- > drivers/tty/serial/8250/8250_ingenic.c | 39 ++++++++++++++++++++++---- > 1 file changed, 34 insertions(+), 5 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c > index 2b2f5d8d2..f2662720d 100644 > --- a/drivers/tty/serial/8250/8250_ingenic.c > +++ b/drivers/tty/serial/8250/8250_ingenic.c > @@ -70,7 +70,8 @@ static void ingenic_early_console_write(struct console *console, > ingenic_early_console_putc); > } > > -static void __init ingenic_early_console_setup_clock(struct earlycon_device *dev) > +static void __init ingenic_early_console_setup_clock(struct earlycon_device *dev, > + int clkdiv) What does "clkdiv" mean here? And this function is rough, adding a random integer to a function requires you to look it up every time you see this call. If you only have 1 or 2 as an option, just have 2 functions instead please. thanks, greg k-h