Received: by 10.223.185.116 with SMTP id b49csp5631561wrg; Wed, 7 Mar 2018 15:25:59 -0800 (PST) X-Google-Smtp-Source: AG47ELucJPvLobA8Opxyp8mpWV96ab77BTahwDL0m5didLqbdUq7YQKvVwk7MzrSkWFv45U+ZRj9 X-Received: by 2002:a17:902:8215:: with SMTP id x21-v6mr22349733pln.164.1520465159006; Wed, 07 Mar 2018 15:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520465158; cv=none; d=google.com; s=arc-20160816; b=mmZPxG/E713osUypdJd+rI9u01rCVKYY/hqQaFWtjJHuyYi/KrTw06WuuBf/Ka2MiU yQf80NJSiVYURlRiiH4q3bSfSr994zMBeqhMnibdEOkqhia5kjYAqGLs0PQC0YlQhJpQ G0yCv1JzzSCHo+380nJ3gB7KA5yEEONZjkyfert7VDOhO4qvvvb1vuNIZCMxcnSevSAM BKkiAQe+bV9kqePqYHI2b3XdcdxlLeW6WpXTGJL+4bGnafDqdWLOf3XQY1FmQv5gJpgZ 9OolLAkZeO9JTWkGw6j0hETkj1jTxmj6AUSThxKzwp36WbhfXrJHMDjBfzxdcRlix1Z3 +o+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=V4jhfRjAq669UzzZjW1EncMUKEE934aU2Qy9E0+S6xw=; b=m3XR3CSjAzliAF4zsHObqy91GbUqa2JWcb0QPDnP6eOkm3BCtnOa15X9wtS8mkNqVU fv8VClPXA3pa/vAoN9UOwRkht6o8qHbucTvcSSzqEXT6RhaTfo7PRlpqzKbOTbHavn+u /p4hhbQFb1txRzVnV7O5gUYkzC9fhzXPr9zDs2zhyeWux7fGBvephiN53gZrATSqDsUb OrXpkHbnWFuDDn7C9oRWyeuDjgl7vFsdtLbtFWBp1TKue/kSWhJjLV/1sEdAw1Gl0oFE 0+Vn4Mf47ruYhNn3h/34J3Pj4BtF7otCTqMb21F4tcEgeyPeMLBWV1h0csl/5oQMJLAF Kgjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chromium.org header.s=google header.b=ZEEUEelX; 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 l36-v6si13993640plg.667.2018.03.07.15.25.44; Wed, 07 Mar 2018 15:25:58 -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=@chromium.org header.s=google header.b=ZEEUEelX; 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 S1754866AbeCGXYT (ORCPT + 99 others); Wed, 7 Mar 2018 18:24:19 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:33276 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754506AbeCGXYS (ORCPT ); Wed, 7 Mar 2018 18:24:18 -0500 Received: by mail-ot0-f194.google.com with SMTP id y11so3757639otg.0 for ; Wed, 07 Mar 2018 15:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V4jhfRjAq669UzzZjW1EncMUKEE934aU2Qy9E0+S6xw=; b=ZEEUEelXKSt4zYiZGrGcDlvwPcjIqLsZOXtlWf0T9j37TLmPAQe7LeAuoaUiA7kcJ5 pxDJzw1r6vmcfiygreOremYc/Js76gS9lzq1Q3mC/apE0l/LzEaBNPV3Bi5g/0zscqtn TiMBBr7fv+pwTEDgRfoMt4PEuUFM8q3n85NFw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V4jhfRjAq669UzzZjW1EncMUKEE934aU2Qy9E0+S6xw=; b=m70QVWtUeYQ5CDKaoMILsP1VPadTp+chG87uWO1SvSrdXZcFoaS7oGh0/h8XYCsF3q i0F+xqDgf7KycquxwRdAvuV63YZMSKumh70hcZ/1zLTepicbhZoKx+VJDHizKcHlkCPU kNTkq8zEcoJZaoY68hNyCR7Kw005YcWn8E0Ieme5lMc3tJiCtlXukKv60KaiZ4vB/9aJ s4vehwMCu+GqwCgQcfNbE0BGqLCjvpwJMgSUdkZf/8c9oUx1bSjUanGRem2iZMFsYf3q L6qtcke8zzVloqmnSP4alQ0udZ0Aq51f+rogfQnihvRFcN0jK9/C0kGRDRRRVvEaghwP TfuQ== X-Gm-Message-State: AElRT7GqU2JgNJiB9ux88U7SDwhE47YJVrvpc0I4q0zstUCcwCXr30Ur GCqLzZYSc4b0dKtubAJsdRoTMQ== X-Received: by 10.157.45.234 with SMTP id g97mr17699678otb.91.1520465057555; Wed, 07 Mar 2018 15:24:17 -0800 (PST) Received: from djkurtz2.bld.corp.google.com ([2620:15c:183:0:1cfd:61a5:7215:5f9c]) by smtp.gmail.com with ESMTPSA id o6sm2029794oif.32.2018.03.07.15.24.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 15:24:17 -0800 (PST) From: Daniel Kurtz Cc: adurbin@chromium.org, Daniel Kurtz , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH 1/2] x86/Kconfig: Add config for specifying BASE_BAUD Date: Wed, 7 Mar 2018 16:24:09 -0700 Message-Id: <20180307232410.248434-2-djkurtz@chromium.org> X-Mailer: git-send-email 2.16.2.395.g2e18187dfd-goog In-Reply-To: <20180307232410.248434-1-djkurtz@chromium.org> References: <20180307232410.248434-1-djkurtz@chromium.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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