From patchwork Tue Dec 6 17:58:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 86886 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp2146892qgi; Tue, 6 Dec 2016 09:59:12 -0800 (PST) X-Received: by 10.98.3.7 with SMTP id 7mr65099126pfd.9.1481047152841; Tue, 06 Dec 2016 09:59:12 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u90si20368463pfd.87.2016.12.06.09.59.12; Tue, 06 Dec 2016 09:59:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752871AbcLFR66 (ORCPT + 2 others); Tue, 6 Dec 2016 12:58:58 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37637 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbcLFR6z (ORCPT ); Tue, 6 Dec 2016 12:58:55 -0500 Received: by mail-wm0-f53.google.com with SMTP id t79so135267864wmt.0 for ; Tue, 06 Dec 2016 09:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cjt9x5/clq4kRm716PZzA6qyPyALwUe/tF3DqRA+cQg=; b=kcypTH3i490AAW7vVh+lK/oYMaqL8Pqz+C43rIfKoy/8NLT6f+RTUM/RxSBgdGBW7h M46FHxIS3m/GjUVMBb5CmZ2EAyHuxEjhai9gZcJQzWBpU4lKNsMK9J5X3/uMoY5HflnO 5u3S4lq4IUB4/L+hLOU602A3ZmmqcfG3HuRV8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Cjt9x5/clq4kRm716PZzA6qyPyALwUe/tF3DqRA+cQg=; b=Zs4UTNVaC0cRmaT/acvYxW34EgE6bWxnWF7UbVGmvxK/6n9BLnwIOFiJwsenkfHX2K hA3djs28QQWcIkIP1ndtxjKUsAZ6+M9MYauVG8qca0SVd4j28+rclx26uGW2u/tOTgfM 8cjkuCsPYF8RqgqalpsoFtBeJqM9eJK/Ct11+e/+PYZSOsFgz5LOTOFyHVZSU7rxUN65 oaPlhCNTlOXKFbOzNc/qdqF/YBIPPU+GHzQghHKYsfRkPVbPBUooy38Tq6qmt9yVEHUX ym6to3/1DxCDU6Cq3yyfXMurhnh2lyrXIg2Kl/XIzWvxvqD9oUY2rSu7m4SZmzRdSA3n 0tDg== X-Gm-Message-State: AKaTC03T3oFqGsy2FWxRa3Ii4p3Ga1E4Yxnzs5wjDsNSIsyjPF+vH9DR1vDBV8LpvbWeQGFg X-Received: by 10.46.77.9 with SMTP id a9mr30642938ljb.25.1481047134041; Tue, 06 Dec 2016 09:58:54 -0800 (PST) Received: from localhost.localdomain (host-95-189-166-46.pppoe.omsknet.ru. [95.189.166.46]) by smtp.gmail.com with ESMTPSA id y26sm3972918lja.22.2016.12.06.09.58.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 09:58:53 -0800 (PST) From: Aleksey Makarov To: "Rafael J . Wysocki" Cc: linux-acpi@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Russell King , Peter Hurley , Aleksey Makarov , Jon Masters , Mark Salter , Duc Dang , Rob Herring , Len Brown Subject: [RFC v2 2/4] ACPI: SPCR: don't initialize baud rate Date: Tue, 6 Dec 2016 23:58:27 +0600 Message-Id: <20161206175830.6989-3-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161206175830.6989-1-aleksey.makarov@linaro.org> References: <20161206175830.6989-1-aleksey.makarov@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org AppliedMicro X-Gene based boards don't use the "standard" 16550 clock rate so supplying a baud rate makes it change to a random baud rate. I suggest to introduce a new value '0' for the "Baud Rate" field of SPCR (now this value is reserved). This patch introduces a check for this value. In this case the code does not emit baud rate specification for initialization of the console. Signed-off-by: Aleksey Makarov --- drivers/acpi/spcr.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 6c6710b..2bf338c 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -37,7 +37,7 @@ int __init parse_spcr(bool earlycon) acpi_status status; char *uart; char *iotype; - int baud_rate; + char *baud_rate_string; int err; if (acpi_disabled) @@ -82,25 +82,33 @@ int __init parse_spcr(bool earlycon) } switch (table->baud_rate) { + case 0: + /* + * This value is not standaritzed by ACPI SPCR for now. + * It means that hardware should not be re-initialized with + * new speed. + */ + baud_rate_string = ""; + break; case 3: - baud_rate = 9600; + baud_rate_string = ",9600"; break; case 4: - baud_rate = 19200; + baud_rate_string = ",19200"; break; case 6: - baud_rate = 57600; + baud_rate_string = ",57600"; break; case 7: - baud_rate = 115200; + baud_rate_string = ",115200"; break; default: err = -ENOENT; goto done; } - snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, - table->serial_port.address, baud_rate); + snprintf(opts, sizeof(opts), "%s,%s,0x%llx%s", uart, iotype, + table->serial_port.address, baud_rate_string); pr_info("console: %s\n", opts);