From patchwork Thu Sep 20 20:13:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10608703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CEDC913 for ; Thu, 20 Sep 2018 20:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FE782E000 for ; Thu, 20 Sep 2018 20:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02A742E029; Thu, 20 Sep 2018 20:14:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9EBE92E000 for ; Thu, 20 Sep 2018 20:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=f4Ad8EmruyumXa0EkE54ESuKyIURkxT/viGr1bosqWI=; b=m5U4Q697qaYq37 3FG752vz+ifVVGZhz0FuxMW6w13M0HP6/lFTl86Agaw4RtMewns3RVsLNknl+t8sq9I+4pKUq0ryi NlAzKWi3FtBMNBXcClssLmblt5Xf5oA9L651WNDo83ZQwQ+8MaBmm0OdugGqsnwdJcg+ejTj6T2tQ Xg7+vp/mTac0VGtDx1meyFPsVtTrP9CnnTQLgs54UxTTE3WD1WgMKpxHNpyn3X2Ca/kJ0+lCA40PS HQ64eWRg8lJJzgXznrUqYfC9OcHyXSvoIbUXMMLrm/F/vi4MV5CSOQ51sPL9LuVVdrKR0Qu1wzMJw ZCy/mBkV9K1dHBZ/+FcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g35LG-00023S-V5; Thu, 20 Sep 2018 20:14:27 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g35LD-00020a-53 for linux-arm-kernel@lists.infradead.org; Thu, 20 Sep 2018 20:14:24 +0000 Received: by mail-lj1-x241.google.com with SMTP id l15-v6so9591089lji.6 for ; Thu, 20 Sep 2018 13:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dlfs8K54P3Vti/yQHi04L9XCI4qztXUSQnOLgzOvccs=; b=asO4VPsfa5uLNKssvb4Sz7vGg6vX/Is7UiwsFLW6myMBeJausjMkT9n2OUOL6BxzGc 8JaynRAKJVcTQS04h7Phw/Vep1Sek2K5Wow/3lOGsUmr4T4pMlp6uwWDrgd/6j64Gp5B NHoAeCD4DJFE6ZieHoyNNrBXA83FrDhssnWL4euHKGAgrv7Sg6J4IdTX4eif+bbG5Rke Fb5FNWJUw84DlZllrmDc3cLdyy3K/fnx8EaxPbJGoUOlStKN6381+bBt27LHyk8+CNUr c3GYWDMhmK5Gq0jL3d7rEZgW16QcxIXA8EwPtN0019u9yicknnOd8FkbVUq0zHzn8mKT 5IMg== 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:mime-version :content-transfer-encoding; bh=dlfs8K54P3Vti/yQHi04L9XCI4qztXUSQnOLgzOvccs=; b=syl5mgcAQMBoxdLLRmQZ2HVtCLhKGsbhFG/x7IJlHnfyE5qVA+k9/PAIUOxvuGgImH 2dqubk1BR90fLec0UDIWZTbtkn8mvFOtafrnC8dzKHGtFv51UNgH3z2pnR26uvCOdqS9 EwsZf8QAiESD9X1tX16in9HTArvJfSopEuZtQ1Yrq1U5Nyj6p6reBLVZilk2FrKKvppn 3YVoNjOqpXcdq9kXrqQMiD839qaV3xoLEgnb43YcZP+G4/k+OPBeoYQ5YTCDMt0asCRO r8p8K9e78EcROK7+2khYraraH7uXDgToYp6uQx8Jd1FujZlCRONxziEJChENwdEnpFD2 lHew== X-Gm-Message-State: APzg51DmW4rsc9U2xyg2brp1tly3OgnPX5LoDT1Fjw1gu9FKW19ghOUh vdz/9AlxxDU7cydS34s5ml4= X-Google-Smtp-Source: ANB0VdYIsLOGW6cFduubAEXfIqDvHzm7WDoEmrmhwIqCqx4ShvWMk8KnfXRqcGAoG0mS2Zv2Y7utUQ== X-Received: by 2002:a2e:954e:: with SMTP id t14-v6mr26380765ljh.68.1537474450345; Thu, 20 Sep 2018 13:14:10 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id s133-v6sm452873lja.3.2018.09.20.13.14.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 13:14:09 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Russell King Subject: [PATCH] ARM: add serial.h and set BASE_BAUD to 0 Date: Thu, 20 Sep 2018 22:13:57 +0200 Message-Id: <20180920201357.16426-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180920_131423_199765_5DD1F230 X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list , linux-serial@vger.kernel.org, Jiri Slaby , =?utf-8?b?UmFm?= =?utf-8?b?YcWCIE1pxYJlY2tp?= , Eugeniy Paltsev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki For years arm has been using serial.h from asm-generic which sets BASE_BAUD value to the (1843200 / 16). This is incorrect as: 1) This value obviously isn't correct for all devices 2) There are no device specific serial.h with CONFIG_ARCH_MULTIPLATFORM That value breaks early serial console e.g. on Broadcom Northstar boards (CONFIG_ARCH_BCM_5301X) which need BASE_BAUD = (99532800 / 16). The problem remained unnoticed until 4.14 and the commit 31cb9a8575ca0 ("earlycon: initialise baud field of earlycon device structure"). Above commit started filling "baud" in the "struct earlycon_device" (it seems to be a correct behavior) and changed behavior of the 8250/16550 early console driver. Starting with 4.14 kernel's 8250_early.c sets UART divisor if both: "uartclk" and "baud" are set. Having wrong value for BASE_BAUD (and so "uartclk") results in broken console setup. Solution to that has been introduced in commit 0ff3ab701963 ("serial: 8250_early: Only set divisor if valid clk & baud") and requires setting BASE_BAUD (and so "uartclk") to 0. A change similar to this action has been pushed for MIPS in the commit c8ec2041f549 ("MIPS: Add custom serial.h with BASE_BAUD override for generic kernel"). Another platform using 0 for BASE_BAUD is s390. Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Rafał Miłecki --- This problem has been originally reported by me in the e-mail: ns16550 earlycon baud broken on BCM5301X since commit 31cb9a8575ca0 ("earlycon: initialise baud field of earlycon device structure") https://www.spinics.net/lists/arm-kernel/msg644295.html --- arch/arm/include/asm/serial.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 arch/arm/include/asm/serial.h diff --git a/arch/arm/include/asm/serial.h b/arch/arm/include/asm/serial.h new file mode 100644 index 000000000000..e12f262290ad --- /dev/null +++ b/arch/arm/include/asm/serial.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_ARM_SERIAL_H +#define _ASM_ARM_SERIAL_H + +/* ARM kernels support multiple devices so there isn't a single valid value. */ +#define BASE_BAUD 0 + +#endif /* _ASM_ARM_SERIAL_H */