Received: by 10.223.164.202 with SMTP id h10csp3187577wrb; Tue, 28 Nov 2017 07:29:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMbyh7+f0AGlKhayN4APf+ByJYiBiVIrOfvFyfWYVfz2xVROWm9WQdFhwzazGazNUy+2bZO5 X-Received: by 10.99.115.66 with SMTP id d2mr23502402pgn.34.1511882942341; Tue, 28 Nov 2017 07:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511882942; cv=none; d=google.com; s=arc-20160816; b=WHFdRLeHrIBs58sfbS/9V5IUhOnHPjKe+H7XYyodsmRMALtY3ri2YqTSufgL4BqJNU Tp38smWlB5BjGZyZAGcyALIoVrOeUpxC0V4mPZ4cD+tQfeMIH9muHsvHSwlsSFpLYHlw 8CBH1z2a0kkxXjqITZ7kvTk4mfj8z/OcKeoaTNX1te96aT3qgEca0GKbuGTmyPgmSwy6 se9WvhesLANilhBKLOytk5ftQaULIoHayavx2hhGjww8UhOeweYCmp/VEw9r8facfeFV ExBFXbac9ebYQQ/iyjVKihHvq4GcmizXNLKaK4qmAyloM2KWhl0DqEkVq9S8gZlm+N3C yqLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=lT9b7VPJuh0k3nTfb0uqsALCYxUMmolIBqqwwzat+mE=; b=JHIzgtk7100XGwxYZV+sGqjKYqahqFhj0750PVPEzr6KDwGbPBTvZQcRmywL4K29Mn 9FqGs55T0wHva9K6E21WndxXAAq1u+ZxwW8x+4XldQKf8dBqIWxtXXLuhW4RjvMG8I9G qoZYqsuQOeVBqFL8tkGfnmTOzvjXzQXqPWBwwTUN8Guu9hV7dFTlIXweZKNNZqEx62eb GqOYaJVRZnBaHYlF2jrrF+kZ7FLXYJW3lcwljB+MTxmPgTwu8SuQuA0g42WsPUpQloVc kwdhW2OfVoXjwKYHdNVikhQPXOEDuvLpt9CEQnWjK8mYgak/S7PM8U/agNQBYlArqSVx rXrg== 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 g9si5493474pfg.327.2017.11.28.07.28.49; Tue, 28 Nov 2017 07:29:02 -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 S1753391AbdK1P1B (ORCPT + 78 others); Tue, 28 Nov 2017 10:27:01 -0500 Received: from 9pmail.ess.barracuda.com ([64.235.154.210]:39403 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752332AbdK1P07 (ORCPT ); Tue, 28 Nov 2017 10:26:59 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx1402.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 28 Nov 2017 15:25:40 +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; Tue, 28 Nov 2017 07:22:29 -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 v2] MIPS: Add custom serial.h with BASE_BAUD override for generic kernel Date: Tue, 28 Nov 2017 15:22:20 +0000 Message-ID: <1511882540-25743-1-git-send-email-matt.redfearn@mips.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] X-BESS-ID: 1511882738-321458-29292-53256-7 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.187380 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 2.50 BSF_SC0_MV0249 META: Custom rule MV0249 0.60 MARKETING_SUBJECT HEADER: Subject contains popular marketing words X-BESS-Outbound-Spam-Status: SCORE=3.10 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, BSF_SC0_MV0249, MARKETING_SUBJECT 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 --- Changes in v2: GPL v2 arch/mips/include/asm/Kbuild | 1 - arch/mips/include/asm/serial.h | 22 ++++++++++++++++++++++ 2 files changed, 22 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..1d830c6666c2 --- /dev/null +++ b/arch/mips/include/asm/serial.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2017 MIPS Tech, LLC + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +#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 1585323906906132236@xxx Tue Nov 28 15:24:53 +0000 2017 X-GM-THRID: 1584759954610254092 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread