Received: by 10.213.65.68 with SMTP id h4csp164617imn; Mon, 12 Mar 2018 09:56:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELtA39xxP2bnwtUyIePDRBk6wB156g+XZRP1fp1Usr2dsmkliCakjfVpiNjLCr9hYu668DMR X-Received: by 2002:a17:902:24:: with SMTP id 33-v6mr334210pla.341.1520873763054; Mon, 12 Mar 2018 09:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520873763; cv=none; d=google.com; s=arc-20160816; b=rcbQfM0MKCoN9wePa4/PkCv8RsF48fYoUrg2iAdwTZZC2E3nEGoZ4QzJXfsPnJG9jV JARBRBc00y1gaFonTpYyztcsC63o/jVe/WoCOc3tIPa+irqPknM+kjQokXjjS27bWwRK RkJ4fiYpvbYrFx4H6FbZWhANEsY5ZdtRE64to33otxApjLbbwDu5P+QN+3uqEUyB++RU BiXnjrv8neigFaPi4R9kKcN2kDlOA9yESc2crnrfKvKQewlMS5r6D8c1rX3EDwCAoVLM og2pdB7Jal+eE10xTlFIkvpridoOfCPUbyCkGfRyAeuDxU29ELkCZxKcfI+NF9HP1/tl VpZg== 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=1edbKa8/TabGss2P5eSdHEBuzTUCUP5fvRrjTR7ozEM=; b=SHhaCNlOW6b7vxZNK20Ka+5Ex0NPtvKnQBBYi0/FtEu1a6SIT8BkPuLe9317JTmk3c yMLt2930MYDqnZ3UnxwGBjnHAEJqcvF8zATmPVVDMpDDIefGlv7p7aCPtomD+Tbh1ibn Y94AcUH4AT1Usc0VMi0/oAF2pm4p7UFyKZ7JNE7ppcke3H3+dzqs21Ft9XyQGiQspgGR X2CSjz8yXvVETi8RYOgpzUys908HnOvIx3ynSOHhlwJBBWKAlrscdtIU4hPTHTfw7YI9 eSj4LCtD3382i4C7cM9QMfGfbGSXtf2D0MqnrG6tFE8HcWeQZh7tKu9QIYBUqLoxyq6d t05w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gi92PFAh; 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 z3si5257982pgr.744.2018.03.12.09.55.48; Mon, 12 Mar 2018 09:56:03 -0700 (PDT) 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=Gi92PFAh; 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 S1752092AbeCLQyU (ORCPT + 99 others); Mon, 12 Mar 2018 12:54:20 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45164 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbeCLQyS (ORCPT ); Mon, 12 Mar 2018 12:54:18 -0400 Received: by mail-qt0-f193.google.com with SMTP id v90so19519535qte.12 for ; Mon, 12 Mar 2018 09:54:18 -0700 (PDT) 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=1edbKa8/TabGss2P5eSdHEBuzTUCUP5fvRrjTR7ozEM=; b=Gi92PFAhXNsYK1qTLQunW+dInIoHMPF+C/JkeaFdIL6dvKODm6TEr389eAQVw2o5W4 D6lbXqHa0xsYEo9G68OCPOp5qEHWynq0f6vBD/5yCYmtDm04u/jokvKJv2+AEbG055/7 /LQ1f29k8v5b2HSAE0dY/jJAWR18eH6dpTheZb8N0NBO72XiQ4oEHB6QlpZPBLXOMccw T0c0LXbsQ+TBgJtj0V4zUJaPhqdNHGj/ZI/Fn60q8W7nnfWOxOVzkIykdx3QGI8fhHxU 336kZ8VEtoPQtCKKQH1W51NaZCw+w/S4h1aCfp6xoz+Ewz0F1GvamAkB68XNtxXewqyl pK0w== 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=1edbKa8/TabGss2P5eSdHEBuzTUCUP5fvRrjTR7ozEM=; b=sWzqzDW3sY176MBgrkJQFglSSIkYjiDxHR+lsu8LD2vPnFRKTdXMj1Lv359Qy8cixa dhdoDfCpanuL/gntmvpduq1O3bDZfIQFmIYqJjeRRI9d4Vh3aG05LVxUtJtTSf4BD+t/ bYM/X+ZEq3oW8pCrMGE95RntofCZTT5cR9+semw0LKeErc1hxKuez+r/lRD7L6droosQ TNtH3UYEHv1tgNIYYum62XHS3Vp5NI0zXQ/3TZ/yZM9BGsPjpVt597LEzXojEkBqnZgX NeTl5VHVDBjTBXTy6xh+UDjzXrJ2m1uUo9i6GRRGuGw5ZEnIBriP/gSQi+9llXPJoHSx EqdQ== X-Gm-Message-State: AElRT7EvJpyWAZTsAikY4NnJpUuzz/84TQEAjbXAsq1Iz886RJ7+yTYl EH2cVZzVl97VkUG79oBfTdXaFiU7lnphIz6R0OM= X-Received: by 10.237.59.253 with SMTP id s58mr717013qte.83.1520873657999; Mon, 12 Mar 2018 09:54:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Mon, 12 Mar 2018 09:54:16 -0700 (PDT) In-Reply-To: <20180307232410.248434-2-djkurtz@chromium.org> References: <20180307232410.248434-1-djkurtz@chromium.org> <20180307232410.248434-2-djkurtz@chromium.org> From: Andy Shevchenko Date: Mon, 12 Mar 2018 18:54:16 +0200 Message-ID: Subject: Re: [PATCH 1/2] x86/Kconfig: Add config for specifying BASE_BAUD To: Daniel Kurtz Cc: Aaron Durbin , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 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 8, 2018 at 1:24 AM, Daniel Kurtz wrote: > Not all x86 CPUs have UARTs that use a baud reference clock (BASE_BAUD) of > 115200 = 1843200 / 16. For example, the UARTs on AMD Carrizo and later > use a fixed input clock of 48000000, and hence require BASE_BAUD=3000000. > > The BASE_BAUD value is used by the generic earlycon driver to compute the > UART clock used early in boot before the real serial drivers have a > chance to load and read their input clock configuration from ACPI. > > Add a Kconfig option to override this default hard coded value. This makes a deviation that prevents to have less kernels to cover most of x86 cases. Now we have the following: - x86-32 (covers i686) - x86-64 (covers x86_64) - quark (covers 1 core i586 TSC type of platforms) In almost all above cases the 1843200 is used as UART clock. (Exceptions are some of Intel MID devices) Besides that I told you already the alternatives to mitigate the issue (in order from preferable to non-preferable): - since it's ACPI based platform, provide an SPCR table (problem solved!) - fix your crap firmware to be compatible (even DT drivers are using the same clock rate!) - add a specific ->setup() callback for your crap hardware (see drivers/tty/serial/amba-pl011.c as an example) NAK. > > Signed-off-by: Daniel Kurtz > --- > arch/x86/Kconfig | 9 +++++++++ > arch/x86/include/asm/serial.h | 4 ++++ > 2 files changed, 13 insertions(+) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index eb7f43f23521..0a258bb30159 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -454,6 +454,15 @@ config INTEL_RDT > > Say N if unsure. > > +config X86_SERIAL_BASE_BAUD > + int "UART input clock for platform 8250/16550 serial ports" > + default "115200" > + help > + This specifies the default frequency for the reference clock of the > + serial ports. For many systems this is 1843200 / 16, which is the > + default, but may need to be changed to get earlycon to work on > + some hardware, such as those that use AMD Carrizo or later SoCs. > + > if X86_32 > config X86_BIGSMP > bool "Support for big SMP systems with more than 8 CPUs" > diff --git a/arch/x86/include/asm/serial.h b/arch/x86/include/asm/serial.h > index ece8299d2695..c28151090b51 100644 > --- a/arch/x86/include/asm/serial.h > +++ b/arch/x86/include/asm/serial.h > @@ -9,7 +9,11 @@ > * clock, since the 16550A is capable of handling a top speed of 1.5 > * megabits/second; but this requires a faster clock. > */ > +#ifdef CONFIG_X86_SERIAL_BASE_BAUD > +#define BASE_BAUD CONFIG_X86_SERIAL_BASE_BAUD > +#else > #define BASE_BAUD (1843200/16) > +#endif > > /* Standard COM flags (except for COM4, because of the 8514 problem) */ > #ifdef CONFIG_SERIAL_8250_DETECT_IRQ > -- > 2.16.2.395.g2e18187dfd-goog > -- With Best Regards, Andy Shevchenko