Received: by 10.223.164.202 with SMTP id h10csp6278548wrb; Wed, 22 Nov 2017 02:01:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMbbRaFra96h+QKR9PB2qV7exQ8k/cW/OG/r9ZKFC2Mbik+D1WkuKRp7vYyjbrc9RbkE93BG X-Received: by 10.101.86.133 with SMTP id v5mr19868304pgs.266.1511344866786; Wed, 22 Nov 2017 02:01:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511344866; cv=none; d=google.com; s=arc-20160816; b=e5B5mLZ1pIaF3Ai5fMhiqic/v25pC9KAt08ds+ORNgaQoTRkErxMd4kQ/y4evNOwtF mxS2Q/xpMUJ/nzuDNnznf49kJFzXrZJCcob5eUBfXuk8ukTVbRwZ9W3nhTV6x+8QqVEZ yPq7hGiO9Vj6BJvHCoXvfrnPIfDWZDPVYf+4tbdqaT0zjEc/U/6zujjj8Nx4fVUrTVoi HLig3IgB9BxyyWhnM+vrUPNKN6mTjLCLRc+66a7P/fcJ7pFJ60bve9TJI/nYf9gLQ4cd GBhWldcWWWEKDrhqPan2XGEdy+mrDHYr9OkwLWODAgo5rzElBg2EjlNhgH8fHwOHUmK4 FGxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ynxS66oMGIKBqkKBAOe0gyzA+vCQaORsAM+Bd1mUhS4=; b=zYgu4ahjnAsz7Lev2b/dNRQRYHQjSDaRCHjxVwxAOW7m5AP9m2LXs0bJkZQAzfxbGC o1Q/j26YMvq9XqnUWjl90L/P1k6bfWO+0e0kQH5eN1VxNkcGimpWiBfzOcu9uVhzd+av jlAuXpPIfW1HMs/PoCNUq20moGC4LHpgTXqha7Wr0zNIUkbq3iJJAwwPgbXu5sSQI/lA /dWyN21nJwr2VfUnCThCSTlcXx0Z/ZHw7IPnCcZo9m5ugLef0qGr4vFnRAmsYdEgYR30 Nu6XwnW6zHCOVICzDgmWiavhcDnBmS7zEk/dcRYBz7ZL+hr5015OiYwYrIkYoMsKbbJJ Sy6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si13297768plk.258.2017.11.22.02.00.55; Wed, 22 Nov 2017 02:01:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbdKVJ6s (ORCPT + 76 others); Wed, 22 Nov 2017 04:58:48 -0500 Received: from 19pmail.ess.barracuda.com ([64.235.150.245]:44476 "EHLO 19pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbdKVJ6p (ORCPT ); Wed, 22 Nov 2017 04:58:45 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx3.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 22 Nov 2017 09:58:38 +0000 Received: from mredfearn-linux.mipstec.com (10.150.130.83) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 22 Nov 2017 01:58:25 -0800 From: Matt Redfearn To: Greg Kroah-Hartman , Ralf Baechle , James Hogan CC: Eugeniy Paltsev , , , Matt Redfearn , "stable # 4 . 14" , , Paul Burton , "Ingo Molnar" , Frederic Weisbecker Subject: [PATCH 2/2] MIPS: Add custom serial.h with BASE_BAUD override for generic kernel Date: Wed, 22 Nov 2017 09:57:29 +0000 Message-ID: <1511344649-27612-2-git-send-email-matt.redfearn@mips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511344649-27612-1-git-send-email-matt.redfearn@mips.com> References: <1511344649-27612-1-git-send-email-matt.redfearn@mips.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] X-BESS-ID: 1511344716-298554-24820-337927-9 X-BESS-VER: 2017.14-r1710272128 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 3.10 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.187188 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 0.60 MARKETING_SUBJECT HEADER: Subject contains popular marketing words 2.50 BSF_SC0_MV0249 META: Custom rule MV0249 X-BESS-Outbound-Spam-Status: SCORE=3.10 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, MARKETING_SUBJECT, BSF_SC0_MV0249 X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a custom serial.h header for MIPS, allowing platforms to override the asm-generic version if required. The generic platform uses this header to set BASE_BAUD to 0. The generic platform supports multiple boards, which may have different UART clocks. Also one of the boards supported is the Boston FPGA board, where the UART clock depends on the loaded FPGA bitfile. As such there is no way that the generic kernel can set a compile time default BASE_BAUD. Commit 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") changed the behavior of of_setup_earlycon such that any baud rate set in the device tree is now set in the earlycon structure. The UART driver will then calculate a divisor based on BASE_BAUD and set it. With MIPS generic kernels this resulted in garbage output due to the incorrect uart clock rate being used to calculate a divisor. This commit, combined with "serial: 8250_early: Only set divisor if valid clk & baud" prevents the earlycon code setting a bad divisor and restores earlycon output. Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") Cc: stable # 4.14 Signed-off-by: Matt Redfearn --- arch/mips/include/asm/Kbuild | 1 - arch/mips/include/asm/serial.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 arch/mips/include/asm/serial.h diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 7c8aab23bce8..b1f66699677d 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -16,7 +16,6 @@ generic-y += qrwlock.h generic-y += qspinlock.h generic-y += sections.h generic-y += segment.h -generic-y += serial.h generic-y += trace_clock.h generic-y += unaligned.h generic-y += user.h diff --git a/arch/mips/include/asm/serial.h b/arch/mips/include/asm/serial.h new file mode 100644 index 000000000000..30be5cd8efdb --- /dev/null +++ b/arch/mips/include/asm/serial.h @@ -0,0 +1,21 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2017 MIPS Tech, LLC + */ +#ifndef __ASM__SERIAL_H +#define __ASM__SERIAL_H + +#ifdef CONFIG_MIPS_GENERIC +/* + * Generic kernels cannot know a correct value for all platforms at + * compile time. Set it to 0 to prevent 8250_early using it + */ +#define BASE_BAUD 0 +#else +#include +#endif + +#endif /* __ASM__SERIAL_H */ -- 2.7.4 From 1585326665777351546@xxx Tue Nov 28 16:08:44 +0000 2017 X-GM-THRID: 1585325875226909276 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread