lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180307232410.248434-2-djkurtz@chromium.org>
Date:   Wed,  7 Mar 2018 16:24:09 -0700
From:   Daniel Kurtz <djkurtz@...omium.org>
To:     unlisted-recipients:; (no To-header on input)
Cc:     adurbin@...omium.org, Daniel Kurtz <djkurtz@...omium.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Philippe Ombredanne <pombredanne@...b.com>,
        linux-kernel@...r.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND
        64-BIT))
Subject: [PATCH 1/2] x86/Kconfig: Add config for specifying BASE_BAUD

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 <djkurtz@...omium.org>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ