Received: by 10.223.185.116 with SMTP id b49csp5636705wrg; Wed, 7 Mar 2018 15:31:53 -0800 (PST) X-Google-Smtp-Source: AG47ELvDkS7mUA3fix2rqx+rXAMnOL6KJ2k8QlrDzCCDtKfycxS7M6rf1nk4NU5L6Qk79ti+vMmi X-Received: by 10.101.98.137 with SMTP id f9mr19006194pgv.6.1520465513439; Wed, 07 Mar 2018 15:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520465513; cv=none; d=google.com; s=arc-20160816; b=os0FunmC7MoNYw1+B6s5MHBbVCRElDgLg3qtguWQ1CxJGb/bP9LguefGHY83VuG11d gBOZY6M525bNpF8yAugbSQKl4gR/rXUKAbd9kHwcaRSrm3qCLxtrj5MCByxV9VH2MsUt e+rmI3PVvJaiIxNYTB9lC9AocxTOsJugkmOnQ2dPqcesay2AAaAkVvt3hlAk0zgJXPx5 PltUp2IxUSnz3UJvaW+eWqm2WKMYtKHPDA2ofCuBU/v1u1lxDxGZWedt81xzIQYxphq4 JrYVfd6xfJnd3FhYidRNRG/uo67BzkzsgXMbbkWM++6WoQupsdjq7ahPvCIIH29z7sjo jKLA== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=XhkNdTPQJ7jOTsYucJ+JjXhJsAXzYavXcJCPEJxd/Os=; b=Av+bzCNl1hlUA08UzhunakER7QVx4QudFq/krW5c2p45zm6ou4OrW+hblpIjt83l1B sqROGXOyFRiG21ho3YUO4/u+isH7tFDSYFHlM4VeVkibQvC7jKy2J7kZayJVwlie3FXS P6z+Bp0ccztfJktZ/P+zB4xfuUqePs7K4aKY7jjosYEQXy6CA51SSAQE81n/tH3HzTaS xBfofD3y+KWqnAi7zF3zoLadAGXc6EgHwNM45cIRv670cf+hOLTVw6o/NCRc41gjX2qH /gd5w/beDKy/dIum1AYkDRZrLAkNUUryPBoejpAEj8ieasZngN3baWH5gG5qWhAgqCgY WeLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ResTCU+Q; 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=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 t6-v6si13973064plj.126.2018.03.07.15.31.38; Wed, 07 Mar 2018 15:31:53 -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=@chromium.org header.s=google header.b=ResTCU+Q; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934375AbeCGXa2 (ORCPT + 99 others); Wed, 7 Mar 2018 18:30:28 -0500 Received: from mail-ua0-f196.google.com ([209.85.217.196]:33116 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934158AbeCGXaY (ORCPT ); Wed, 7 Mar 2018 18:30:24 -0500 Received: by mail-ua0-f196.google.com with SMTP id f6so2707832ual.0 for ; Wed, 07 Mar 2018 15:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XhkNdTPQJ7jOTsYucJ+JjXhJsAXzYavXcJCPEJxd/Os=; b=ResTCU+QACoAqffc7eZej9ySlbw4h1RDdovF+ROhLenqQEOASDZiujQUzzqxFCVIY+ ln4rfV0ej7zr3frk2uzh1im3f5Z3q9Os5gM1EubRgKV/2iSDrxwCo6WwAhhJH7RwJG8g Df246uGM6nUWNQstn7Ih9wF2rp6RL9VNZTH78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XhkNdTPQJ7jOTsYucJ+JjXhJsAXzYavXcJCPEJxd/Os=; b=TfqHePlelbsM2o17DRvUTarvAMEXSfFlFy9C8fbFxMvIay/uT43dg1rK/J9u6XA7lG 5u2xGI/m8OOzXjntbFFG50fV6sYTMfURkXOoUvq9TsYvfl0s0I/bbt3sAx3FJlQSPJwN eOjveTmjtpBeE7cpLUt2Ex7LPgxZvDcnFDEP097EZq3VB4GjexIEL7TEqPY54y+xXN9y LJeuAdu+1XbYZ7H8LVaSsYcI7jJC/2H2SzMpSRZ+lrzP24waFLjkA5ZWYBie+v2Lxjnf Zzv2Q83z77j23CFKqnDPrbtciA0GG0yCZ6ZwaOCx7sG53qzJ/1R+QadldfHuaYX3O87J WNaw== X-Gm-Message-State: APf1xPCxboGI+wheRrK11p0cnQHusLFYqLDJy8/UEtaKZlOU3wLvDmI5 HO2dPdoU/bQAtJC3magCBllT4Km74GlUgcZFfLCKmQ== X-Received: by 10.176.49.84 with SMTP id e20mr17472140uam.141.1520465422977; Wed, 07 Mar 2018 15:30:22 -0800 (PST) MIME-Version: 1.0 References: <20180301184335.248378-1-djkurtz@chromium.org> In-Reply-To: <20180301184335.248378-1-djkurtz@chromium.org> From: Daniel Kurtz Date: Wed, 07 Mar 2018 23:30:11 +0000 Message-ID: Subject: Re: [PATCH v2] earlycon: Allow specifying a uartclk in options To: Daniel Kurtz Cc: adurbin@chromium.org, Brian Norris , Jonathan Corbet , Greg Kroah-Hartman , jslaby@suse.com, mingo@kernel.org, Thomas Gleixner , Christoffer Dall , Paul McKenney , marc.zyngier@arm.com, frederic@kernel.org, dwmw@amazon.co.uk, tom.saeger@oracle.com, zohar@linux.vnet.ibm.com, alexander.levin@verizon.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org 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:43 AM 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. > Signed-off-by: Daniel Kurtz This general approach is facing resistance, so trying another more targeted approach to work around the "BASE_BAUD=115200" assumption in arch/x86: https://patchwork.kernel.org/patch/10265587/