Received: by 10.223.185.116 with SMTP id b49csp7912926wrg; Thu, 1 Mar 2018 13:26:35 -0800 (PST) X-Google-Smtp-Source: AG47ELv+krpkpqZ15t05hBBvrVP4RMAW41c3GBrBkXDFrRUC9k+mdoL00p0hpb2NIOUd8G5Bcet1 X-Received: by 10.101.65.71 with SMTP id x7mr2660534pgp.203.1519939595764; Thu, 01 Mar 2018 13:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519939595; cv=none; d=google.com; s=arc-20160816; b=Gfnakz4FBNfi3HfdC47LHbedYgObV9l4cV2PwQUp5rRDopYAfJSeBFXX9zoGLLLsr1 Hs3OWBvOIrk9l52V72o9bJfjGI+73QNAYUFyUMwnsQ96svnrqTzChn8ApEyhuQ7AzqiO 27nxmY7wZgj7WsAbuCyfrd+gTKrKoFRjZjkSmrRQQHPZaODlgHcetq8QSsx8D+yx8W1I o2iKrTq35BWFUix4MvvO5UBZ3t7cHLgF0TxCruFjooqPmRZU8zbBw9yJgGclECtBTS21 u4PNkgzyCFlEvELNsbnpGBk010NX6vg1y+yonK+niMrMxwX4NDGJQ99xvVCO480gI+1/ Uhyg== 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:dkim-signature :arc-authentication-results; bh=6Feh5M0NXp0+mWVaYKxpjQSE+w8KrZs9lmeEI6DIBqE=; b=tIo+kjNz1U7eOeKLDoJQHCJqL31KSEoGixzoPUehxMOXbX7mX7v82/iaX3TIQJpHxH xbjw66JLOI63+0mJiXTLz0veDifmsHXpaPIGO8Kf42aVjGnCdpoa1roxJsFIDt/kaUFf VDrg3TqpUuh0B6sRf3vQvbH5x0ZDlka8vvf/s4myrFfna7HNK8+CRrhXWwgYrBK725W0 aBZEGzNYlVUk7iAt/CupO5i7cR2zmVPUGVZxOd1cbt+5Ty0yowFY2ig8JhOigxpFhb7d rPiNlONg+2c6WWE9MV+Bd4lSoxBL5x0Xm8vgBIohIoTV94xC5OXhv7pS2y+FdB3D6anl hPqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=QLccx/Tq; dkim=fail header.i=@chromium.org header.s=google header.b=K2vkhuCH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f29si3561109pff.364.2018.03.01.13.26.21; Thu, 01 Mar 2018 13:26:35 -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=fail header.i=@google.com header.s=20161025 header.b=QLccx/Tq; dkim=fail header.i=@chromium.org header.s=google header.b=K2vkhuCH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162020AbeCAVYN (ORCPT + 99 others); Thu, 1 Mar 2018 16:24:13 -0500 Received: from mail-yb0-f174.google.com ([209.85.213.174]:46669 "EHLO mail-yb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161479AbeCAVYK (ORCPT ); Thu, 1 Mar 2018 16:24:10 -0500 Received: by mail-yb0-f174.google.com with SMTP id e142-v6so2688399ybc.13 for ; Thu, 01 Mar 2018 13:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6Feh5M0NXp0+mWVaYKxpjQSE+w8KrZs9lmeEI6DIBqE=; b=QLccx/Tq9nnXknPUY3ONxaAUjwZ5bjLdOaCwCsqTWlcqQ0FKOt3rVIdUOpV+ROy+Pu Y17jMbD5L0/vb9rgHCaiCBH4DMurUlEHO2KPBRe7Z++z6CF5WjU2le+gqo96VsNskzUU LLa1OcKCFmPLVylT21Zkd23itz5uzehsmk8JbjhhV0ANvldr7y72AOfuOTSZhl2FZYnC qg3pGxk0FuzSt1FEhfyz6whjHPpInyc5DmN3twAJ0nZamhCIpbBufa11TmolxhbR1pYl fvXAzmZOSbx9l/ee/s3M1UDIGa2LXLjB/yiUMv4680Y1PsyauFfXupEUws91wHHauGRM meOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6Feh5M0NXp0+mWVaYKxpjQSE+w8KrZs9lmeEI6DIBqE=; b=K2vkhuCH+SwX4lsdxlxrUb9W5RDOHQp4eZdUFezyFq+3GzNK8UtkrSTsj8tGoxsCwA rGaEkoZ6QqYB4Sr6iNFl8wcrJkNkoDdEdGF9uYON0ke7YjB7dNZzZbuK33nmYyHlXtrR El7OHyecQmvKpJi1PIcCQfns33pWdhwRtbkCE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6Feh5M0NXp0+mWVaYKxpjQSE+w8KrZs9lmeEI6DIBqE=; b=TxlqSKW2KauaqfgVSXVO9od+xFlD2u6AT30PxD7p3tq5ycsKMm4jDp8ugx8ZRapHXL jV+hEA+nrd0kQ+go3M/pVfHa3dEIAQJIavoUvFMe0FxULl+I4x7Bh1in5MivNwmuxRJ6 2jueSmcjbGqyRAorb4y1Zlrf7Lg1tqY2PjYZRgwwTZmzdeiqycR0F+rl6xzAXyVA3KI7 iez1kKPNoaOxUNQxA8LNigwXRgn7rZUPMDeh/Evkcq+95vmvqOtBWpmSpu6oB3kGNu+O bpLwCxH2i0kHf4DTqUcQwj8Ho9G6OkmRgHv0Jyc+dhNc4ePaPRlN9DI3vHv4RHkcnXfw z/Sw== X-Gm-Message-State: AElRT7GDmJszyZcdohVjb2y8gDGF54mNRo80vRzbAef+zsq1nUjiuxcg SQpDV7za/0LKCvKEVOj51IGHw9fXawl3/AIKJHjYCg== X-Received: by 2002:a25:bd42:: with SMTP id p2-v6mr2308923ybm.214.1519939449043; Thu, 01 Mar 2018 13:24:09 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:f81e:0:0:0:0:0 with HTTP; Thu, 1 Mar 2018 13:24:08 -0800 (PST) In-Reply-To: References: <20180301184335.248378-1-djkurtz@chromium.org> From: Aaron Durbin Date: Thu, 1 Mar 2018 14:24:08 -0700 X-Google-Sender-Auth: JN3mM_pz1HSb1QoFAIcxnScaKeM Message-ID: Subject: Re: [PATCH v2] earlycon: Allow specifying a uartclk in options To: Andy Shevchenko Cc: Daniel Kurtz , Aaron Durbin , 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 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 would look to this later. It's late here. I need to do a bit of > research for the answer. > >> I see that support was also added recently to earlycon to let it use ACPI >> SPCR to choose a console and configure its parameters... but AFAICT, this >> path also doesn't allow specifying the uart clock. > > Fix your firmware then. It should set console to 115200 like (almost) > everyone does. It's not a firmware problem. Its the driver's problem in that it assumes an input clock to the uart block that does not reflect reality. > 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. > > -- > With Best Regards, > Andy Shevchenko