Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp702579imm; Fri, 21 Sep 2018 07:00:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTcb7wJFk54Rm1TnE9ibwOfQqKmyHp0q7OJ+FZoy/lqUPVSIe+S02Jy16z1M7P2zlwBjgd X-Received: by 2002:a65:5c83:: with SMTP id a3-v6mr42302011pgt.164.1537538403509; Fri, 21 Sep 2018 07:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537538403; cv=none; d=google.com; s=arc-20160816; b=TarCOtLopYFKTPQcctHcm6L2eVrAojTc0wgcAAcaWfwIqN5i2a9alJdIfjalFpXiFl o7ohknMFrax2HeWFvv5CI0Ff2ltIexAoO/2uK1Uy4L2KMpAfObjs5L6LnwsXYvcX86ui 7tmIClvz0Vf8WNWzmC0TBOhcYPRem6zNNaj3tC1lhLQpa/nxwBy+dSYaTXWW6MGhT5d9 G/Doue05pDe2udmjabBOMEj3P7v6M2BKDQfTGNVrLhsD4pYTNiNyGMZ9mJYkCG/uZX8T vf31acEOIGmhQCYYjlgu5B34SPoNSMNyJ0ujtA02MeD+yVdGsbNtP189TPQTN7fuRiBj 7cLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5uaSylfbfLi6kI0jHSRGFH9EWLBbXQcBFY+uD4X453Q=; b=tvZwPmOVyz3tNXyWAybY5GCM85ujIZZiFY1p0dJ27pzSsel08Hr37xW0pRHRZjOGj+ 7sJbJNIakBm+zUAsuDaBvR4a21gNdzUj5RNeZqOBIZjdL2Ifg774C0cvq3Wjt91pUAeB cc/tNtBm6+iBMfQK/at5o01O12AItajT14XZopk6MbW7v6bQoKy7KnPqbUfW/iOzhZtc 0BBqnPSit1FZrb+V3rE+1NLbbuDELIezImofM0CROxZiIoePHQDEzSQlmYT5tqks1Eo3 d7Um9wtpoORDgfn6ghJgcsAQLKHlvI7iyLCBTrp3n/ItTSrOHYGUmv5Fr1b2esLkVhDI ZPnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=iBLegTX2; 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=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6-v6si26066154plk.255.2018.09.21.06.59.42; Fri, 21 Sep 2018 07:00:03 -0700 (PDT) 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=@armlinux.org.uk header.s=pandora-2014 header.b=iBLegTX2; 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=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389686AbeIUTsf (ORCPT + 99 others); Fri, 21 Sep 2018 15:48:35 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:54280 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728098AbeIUTse (ORCPT ); Fri, 21 Sep 2018 15:48:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5uaSylfbfLi6kI0jHSRGFH9EWLBbXQcBFY+uD4X453Q=; b=iBLegTX2NS/pqE3tyUZ/nv2Bb VmYMPYJzbcUzxTXB6TJ0oGIv/tXWpe7xKF+AeZQ6VSaXC7ux4dGKZx2/uqVTxIXqR2lpPQQZ9ILnJ xz9EYTnL4+x/dzNdoUuEayW0cB8XnAHS37niXvkxtLuIabIiRU8J0Q2620ZIYnFELz7+U=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:49226) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1g3Lxq-0001Bm-PT; Fri, 21 Sep 2018 14:59:22 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1g3Lxl-0001SX-KI; Fri, 21 Sep 2018 14:59:18 +0100 Date: Fri, 21 Sep 2018 14:59:14 +0100 From: Russell King - ARM Linux To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Eugeniy Paltsev , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Hauke Mehrtens , bcm-kernel-feedback-list , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH] ARM: add serial.h and set BASE_BAUD to 0 Message-ID: <20180921135913.GM30658@n2100.armlinux.org.uk> References: <20180920201357.16426-1-zajec5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180920201357.16426-1-zajec5@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 20, 2018 at 10:13:57PM +0200, Rafał Miłecki wrote: > 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 This goes back a long way. The BASE_BAUD definition is the base baud for 8250 compatible UARTs _only_, no others. However, as of 182ead3e418a ("earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon"), port->uartclk is no longer initialised using BASE_BAUD. As acknowledged in 814453adea7d ("earlycon: Initialize port->uartclk based on clock-frequency property") the initialisation using BASE_BAUD was bogus, and there is now the clock-frequency DT property which should be present to set this up. Now, setting BASE_BAUD to zero as per your patch will break the 8250 serial driver - this relies on BASE_BAUD being set to the current value, and yes, ARM hardware that uses this will break. So this is not a solution. The only solution is that BASE_BAUD must not be abused - it must not be used by non-8250 hardware, and thankfully there are already solutions in the kernel (such as clock-frequency) to allow the clock rate to be specified. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up According to speedtest.net: 13Mbps down 490kbps up