Received: by 10.223.185.116 with SMTP id b49csp7771788wrg; Thu, 1 Mar 2018 10:49:16 -0800 (PST) X-Google-Smtp-Source: AG47ELtnKaOJkQSGbGZyTffhA7A0we4750j45/YWChBZVMZepT2KB3usC6UsKTJOdEB0U77YlsbI X-Received: by 10.99.180.77 with SMTP id n13mr2286786pgu.361.1519930156476; Thu, 01 Mar 2018 10:49:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519930156; cv=none; d=google.com; s=arc-20160816; b=kIvqgivhkHPoIzyCv1Dlf2nU+8I8d32hrOJW7qdwWrFOFcb0Q2f5lsHYxxdNJEZed3 +kJOOAQ+9d5gKCZUIp7jglMTT2qOpYEg6fgsQ09FT4F5fNhBrp2hh8TsxUsy5Z3iymSR dSwaJPqx0u4GO7CjD7s1ow5VM4J4CmgQUFq2Bbf753FmPLOHwt02nwHwpR7T0WXxvAt4 HIaaEmJaHPgCa7Qr1Vq/1dHrJiIvZOUDVUaAnv/BNaJa/Ek2SUOSkibWePHLw3Kjq4hm GErzkOSy6YbGGtRPu3qlKLoHp4Lp9MYN5E0HqZ1FK6BD1ImkNm1xv6g0G9uX35vJwd9U kEog== 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=L7LI7IpLCjvN2rImBDu75OZ+r3r+LTwphHw2A72CNHQ=; b=xjUv/Mp6Y1/L3e/L847FD4UG+efdIkFQChBvCUrStwTXy+/DClrlx3Mn+79PLqVjnE YD/yqu+rBDKomBJfNYBhuttdps2SyyWN9y7/PjSAmJTqR05dY4VS97K9aHFVwLVFCmbj S4Hhy0ZO890+xiqkitjOBZ8rgKzsUnjZJSsq3IFJcmHy35x7bnvJI2ngR4fR9ujrwKLa LDycbRDvjiUovRYpyQXxh5m7gRRLeVqKccoV3lHKH3NdbHiXX0CkkznzFjWJp8efeWzr 7zjYZtIpwUQEauGbJEKZMVhXJTMOvxP8GnDD0nupL+OawmIgGm0LD4X8Mgo9XPbxR/8Y LyjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ANt7Qxa5; 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 v11-v6si1749355plz.386.2018.03.01.10.49.01; Thu, 01 Mar 2018 10:49:16 -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=ANt7Qxa5; 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 S1161059AbeCASqk (ORCPT + 99 others); Thu, 1 Mar 2018 13:46:40 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45909 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034089AbeCASqg (ORCPT ); Thu, 1 Mar 2018 13:46:36 -0500 Received: by mail-qt0-f193.google.com with SMTP id v90so8812445qte.12; Thu, 01 Mar 2018 10:46:36 -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=L7LI7IpLCjvN2rImBDu75OZ+r3r+LTwphHw2A72CNHQ=; b=ANt7Qxa5H+OGuMzigWc5BB48M7bqsvTeDXoc/Msthm1xH4LeWd1Timw7SuPsb0IWUU DwDNxNjDRBvfJlU7OjhL0myj4bIPmyc/PLfdv5QN23EdcoV46DJ80fM+AvJTLIU1zwMI Qen8UoewlVPGNzozbQ1ifbq/Su9zPY5XroePIX+xRTP3TDH7nISsDElfvxGjB1iM0ulg A2PCpK1dV0euvNwYkD1LbEYQH5+HzSNTtmHikOJdl6y1VNsM8R4R7Ej0bgRetwLxPEs8 BtCSBFM2VUa0mCU+jpdzNyaB/uqVpiK0y/GRIofzmk9/XjaCmz5/VsNfaPpcRqC+6rus 5oKQ== 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=L7LI7IpLCjvN2rImBDu75OZ+r3r+LTwphHw2A72CNHQ=; b=qOI8Ufw17B2C9NODki+G7g4p4o+Fb5h5x/ZwN7PS5XuUu552FWXMRnN58uKCWrCh01 2bNOiaMXwmoNSKJQd6YnRHwfb/AdmXbcNOduPOLvcQ0xzZLySyipV0WxnkqqSzICimWB UJiOiTa3S65KqaP9qUWZCIEQ+rR0zGRq52ovBCHnsxrw6tIQnLugEicsQIRlMKMkoghv sczbLTr3WQSqew09lF90oGstxXZqxlSSOjeixLPsj/M+nlxM7yIbcbC6Qk3q8Rpw6Jgc xjhMtykuLcsT0dHNzEdM88kT4dMiZFyfd5caaS+NLWM09jcyEFbjYulVDFy8JBGu3W2K C4Fw== X-Gm-Message-State: AElRT7G9zFVndWithoEai9Fs2YS3s5YH+diA9sY76AxUkX9ZTq8mP37y B0RL6CbeHPGJkvmUlub2GSve4k0/6fjdGeQBans= X-Received: by 10.237.61.145 with SMTP id i17mr4259554qtf.293.1519929995687; Thu, 01 Mar 2018 10:46:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Thu, 1 Mar 2018 10:46:34 -0800 (PST) In-Reply-To: <20180301182028.237856-1-djkurtz@chromium.org> References: <20180301182028.237856-1-djkurtz@chromium.org> From: Andy Shevchenko Date: Thu, 1 Mar 2018 20:46:34 +0200 Message-ID: Subject: Re: [PATCH] earlycon: Allow specifying a uartclk in options To: Daniel Kurtz Cc: adurbin@chromium.org, Brian Norris , Greg Kroah-Hartman , Jiri Slaby , "open list:SERIAL DRIVERS" , open list 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 8:20 PM, Daniel Kurtz wrote: > Currently when an earlycon is registered, the uartclk is assumed to be > BASE_BAUD * 16 = 1843200. If a baud rate is specified in the earlycon > options, then 8250_early's init_port will program the UART clock divider > registers based on this assumed uartclk. > > However, not all uarts have a UART clock of 1843200. For example, the > 8250_dw uart in AMD's CZ/ST uses a fixed 48 MHz clock (as specified in > cz_uart_desc in acpi_apd.c). Thus, specifying a baud when using earlycon > on such a device will result in incorrect divider values and a wrong UART > clock. > > Fix this by extending the earlycon options parameter to allow specification > of a uartclk, like so: > > earlycon=uart,mmio32,0xfedc6000,115200,48000000 > > If none is specified, fall-back to prior behavior - 1843200. It needs to be discussed. First of all, if you are going to do this you need to add a parse of human readable formats (IIRC kernel has helpers), i.e. "48M", "38.4M" and so on. Next, I was under impression that purpose of earlycon (in difference to earlyprintk) is to re-use existing drivers as fully as possible. So, what exactly happens in your case? Are your driver lacks of properly set clock? Or earlycon does simple not utilizing this information? -- With Best Regards, Andy Shevchenko