Received: by 10.223.185.116 with SMTP id b49csp794829wrg; Sat, 3 Mar 2018 07:39:43 -0800 (PST) X-Google-Smtp-Source: AG47ELtLC4aRdWq44rR4EmAHBkP1D3ycKTgMS4FV53cuGeRo0IpqbLTwne1OykvaH3uY3sdFKjZL X-Received: by 10.98.223.93 with SMTP id u90mr9446380pfg.13.1520091583290; Sat, 03 Mar 2018 07:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520091583; cv=none; d=google.com; s=arc-20160816; b=mBKmrAOQolWTg28eBA04KLrlWDjcZ1I9pf3Ro6lLIfT2z48lQcQVgStuLsvT5Wq5ct 7VjpPOGTSmJVrJncu5RvSmt0kEqu34epykV+7ag/N8G3+5T7eegruSPsEqgPmAkIRAfl iwRGtD4TPZC8SkMPLngiQAG6Hl2C8BDPdH8KdGTm4EMTuGAYCsJKtkLlcFGZqgbp+t0z kKVQISnBsbrDfAaeultc1dp6r3KXcY6rKbze1QUoAesO0krMJa1Pec9E2dxdDsB5/HiB jzLjuTfMy43AKwqYAShkqWN8nESwx4EEI9ZhOLol16F4/ElpIgfhnsDiirSKdJSnmmrV 3bSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=OhqI+ncdWMh3XI5dM3E+YX02o36cRbHV5wuOA7QlTmc=; b=v2XXkyW99nbMpbcdokHHwjBQOuTNB6pKJ2jop1iBXRPgFned/jzucZliKL5m3cF2Y5 rMa3KfUsx3NxU9zE8x8iqu8yXo5jaGvY6G3dTq6datxKLFEKgfEq8ohvwXMjN6q2T68g FXsRcMS/iNGf0VsI5gRt7BJUIb+9V3fODGVLU5fZc6xjA4U4OjocaLcYq/mt6kgyB92e LRCbtSmMVYa+C1yx6Q1sCQfA1AusY7/3HU/L97OUdjBc2YdsoNH9Zc5A+4MSOBQcQaVS UBBBqLLjjg+mJXckJlUXj1FSmGt5rWbGFgMkIFj5AyZYCWubA5QLCOP9USIOtrMt8YYu 1HeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GJy28f6Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c193si6832474pfc.356.2018.03.03.07.39.29; Sat, 03 Mar 2018 07:39:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GJy28f6Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152AbeCCPiq (ORCPT + 99 others); Sat, 3 Mar 2018 10:38:46 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:41383 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeCCPio (ORCPT ); Sat, 3 Mar 2018 10:38:44 -0500 Received: by mail-qt0-f181.google.com with SMTP id j4so15513120qth.8; Sat, 03 Mar 2018 07:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OhqI+ncdWMh3XI5dM3E+YX02o36cRbHV5wuOA7QlTmc=; b=GJy28f6Y/e0dYlEUpX75zEVZjXmwh4ROOTe+Q6E9BlUMVRWV6h1WIUihBz8an/cVA7 jCIZ8Esq+C6xecl05r7f5SAb6h1ZCpDLk6Cvy3xJsqMHTrAu82kz7v/En3nMHAzmMRVj XqJEGqp53FXq7l4SAtsVQGpd6+W8on5+myVoRK6m1gol93EIWInJgP8o1XTNJNYq+fUO IW4cAtj33zPVkzuWwepN8/xscag78I8fOcOn6gsF43ZqhgeLzTrOTnfElu8au7vL6JGV hyROkJ4H8Y8un+eErph2ECBTjdsCLWtCNJMD84TNency+Cq9uQSL+pbGgqYBDhgGNOlL UepA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OhqI+ncdWMh3XI5dM3E+YX02o36cRbHV5wuOA7QlTmc=; b=UwnSJ8mjsf/BdW4P4D/mvL5Zirvh8b+QdhLHrfxZ3I69dJkRtZDQz8PKR+CMC3u97S quqIxBvE3lzHsdFzDVqdVNfjfTiob2dxRaknfWJ4W0Cy5M0F6fduI6q4rrDfUbIyHu7t Ohf6Gk0gplGjt1kLioqu9YiXNSB8SjWmuIQdW2x3xfL2pahkUtBjiAjHPEq67ZcnwkxS CTkVHYoQO0RR3JLOttMXqJXiV+bEFfR4CHAE+YxFSmFhCPpUXR7++6SAzidUD6yCo0Z2 ZgStrfvUfDKnab8Ejj6V4HVGwErbcQ112qGbZRMId4nQwDt+UNnGeeuJS6tBbfcpTlt6 AGqQ== X-Gm-Message-State: AElRT7GLYtGpDk17MBaJkDcqjF+UEowhAOt65Nn5AuiFjaV1EC/zc/Dk gNr0gZgZcpx459QWf8KLcoSjLV7FQB2tDr2YkOk= X-Received: by 10.200.39.217 with SMTP id x25mr13630380qtx.266.1520091523613; Sat, 03 Mar 2018 07:38:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Sat, 3 Mar 2018 07:38:43 -0800 (PST) In-Reply-To: References: <20180301184335.248378-1-djkurtz@chromium.org> From: Andy Shevchenko Date: Sat, 3 Mar 2018 17:38:43 +0200 Message-ID: Subject: Re: [PATCH v2] earlycon: Allow specifying a uartclk in options To: Aaron Durbin Cc: Daniel Kurtz , Brian Norris , Jonathan Corbet , Greg Kroah-Hartman , Jiri Slaby , Ingo Molnar , Thomas Gleixner , Christoffer Dall , "Paul E. McKenney" , Marc Zyngier , Frederic Weisbecker , David Woodhouse , Tom Saeger , Mimi Zohar , "Levin, Alexander (Sasha Levin)" , Linux Documentation List , Linux Kernel Mailing List , "open list:SERIAL DRIVERS" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 1, 2018 at 11:24 PM, Aaron Durbin wrote: > On Thu, Mar 1, 2018 at 1:02 PM, Andy Shevchenko > wrote: >> On Thu, Mar 1, 2018 at 9:22 PM, Daniel Kurtz wrote: >>> On Thu, Mar 1, 2018 at 11:47 AM Andy Shevchenko >>> wrote: >> >>> "earlycon simply does not utilize the information". >>> >>> earlycon parses iotype, mapbase and baud (from options). However, it is >>> hard-coded to assume that the clock used to generate the UART bitclock is >>> always "BASE_BAUD * 16" (1843200). While this may be true for many UARTs, >>> it isn't true for AMD's CZ/ST which has a 8250_dw and uses a fixed 48 MHz >>> clock. The main 8250_dw driver uses devm_clk_get to get the "baudclk" and >>> uses its rate to initialize uartclk. For AMD CZ/ST, this "baudclk" is >>> actually a set up in acpi_apd.c when there is an acpi match for "AMD0020", >>> with a rate read from the .fixed_clk_rate param of the corresponding >>> apd_device_desc. >>> >>> This patch attempts to add a way to inform earlycon about this clock. As >>> noted above, the information is actually already in the kernel and used by >>> 8250_dw - I would happy be to hear recommendations for wiring this data >>> into earlycon that doesn't require adding another command line arg. >> >> And it should not require that for sure! > > But it does require that. There's an input clock to the uart ip block. > That is a design constraint by the hardware and is required to make > baud calculation work. I mean it should not be user's headache to provide this information to the system. > It's not a firmware problem. If it's ACPI, then it's definitely firmware issue, since SPCR provides a baudrate. > Its the driver's problem in that it > assumes an input clock to the uart block that does not reflect > reality. So, driver can't get this info from device tree or what? >> Okay, configures a necessary IPs to feed UART with expected 1.8432M clock. > > That's only possible if there is a clock divider on the front end of > the uart block. For this hardware that's not the case. I actually did > this very thing on intel chromebook devices, but it was only possible > because there was a hardware divider that could be tuned to reach the > assumed clock that the code currently assumes. OK. -- With Best Regards, Andy Shevchenko