From patchwork Wed Jun 18 20:54:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 32158 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D764206A0 for ; Wed, 18 Jun 2014 20:55:23 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf4230444pde.3 for ; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=rILx/pNgoPxInBZmDK4zStr54x9g13hTXMmOoggR87s=; b=ZsSYIUkEpe+5dq6AVXO5pFw4Npl5sdZjGPEWc8y2l1xVAD8ZSM4QJflr1ZpqOoM9KC vZGMkLsgknz6Po1c8+JUMANEXBYYDp//S9Ab47spoAyu/NjAAnw5J8xWAG/pSPsZ86Ks L9Q+kaFN2BtccmKlYsxbgjdrJZba27+UaC4ItoF6ejt0+67mElnXhDsAXs6I/tFulcAt /bbE8imZFCbOgBljdETYz/DoN/xJtGy/WRNBmWpS/6iN81HXaaAgMvaySpWsmMuk91De JJAW2yHDp0vrvYXLk/JVEcrYpVp0R6igEUX2976RqjxLCpScuDdaYaBGuSu2M72V19zM RAJg== X-Gm-Message-State: ALoCoQm1a6C4aoiKwgAtCaYyIjgRKy2GoIQ861glmrglU0h2rIFUqYCDt175b5Jfi6aPG7x0OrAY X-Received: by 10.66.169.79 with SMTP id ac15mr344709pac.48.1403124922869; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.178 with SMTP id f47ls277405qgd.95.gmail; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) X-Received: by 10.220.163.3 with SMTP id y3mr285519vcx.7.1403124922677; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id yf19si537557vdb.30.2014.06.18.13.55.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Jun 2014 13:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id i13so1445028veh.1 for ; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) X-Received: by 10.220.174.137 with SMTP id t9mr361960vcz.12.1403124922592; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp312774vcb; Wed, 18 Jun 2014 13:55:22 -0700 (PDT) X-Received: by 10.68.106.194 with SMTP id gw2mr466248pbb.85.1403124921888; Wed, 18 Jun 2014 13:55:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id im8si3346880pbc.133.2014.06.18.13.55.21; Wed, 18 Jun 2014 13:55:21 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755869AbaFRUzF (ORCPT + 6 others); Wed, 18 Jun 2014 16:55:05 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:48774 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754954AbaFRUzA (ORCPT ); Wed, 18 Jun 2014 16:55:00 -0400 Received: by mail-we0-f173.google.com with SMTP id t60so1453430wes.32 for ; Wed, 18 Jun 2014 13:54:59 -0700 (PDT) X-Received: by 10.194.86.42 with SMTP id m10mr170874wjz.132.1403124899416; Wed, 18 Jun 2014 13:54:59 -0700 (PDT) Received: from trevor.secretlab.ca (host31-50-107-191.range31-50.btcentralplus.com. [31.50.107.191]) by mx.google.com with ESMTPSA id i4sm7672990eeg.28.2014.06.18.13.54.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jun 2014 13:54:58 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id 72FC3C40D86; Wed, 18 Jun 2014 21:54:47 +0100 (BST) From: Grant Likely To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, olof@lixom.net, benh@kernel.crashing.org Cc: Grant Likely Subject: [PATCH 2/4] of: Enable console on serial ports specified by /chosen/stdout-path Date: Wed, 18 Jun 2014 21:54:32 +0100 Message-Id: <1403124874-19929-3-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1403124874-19929-1-git-send-email-grant.likely@linaro.org> References: <1403124874-19929-1-git-send-email-grant.likely@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If the devicetree specifies a serial port as a stdout device, then the kernel can use it as the default console if nothing else was selected on the command line. For any serial port that uses the uart_add_one_port() feature, the uart_add_one_port() has all the information needed to automatically enable the console device, which is what this patch does. With this change applied, a device tree platform can be booted without any console= parameters on the command line and the kernel will still be able to determine its console. Tested on QEMU Versatile model and i.MX Signed-off-by: Grant Likely Tested-by: Sascha Hauer --- drivers/tty/serial/serial_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index fbf6c5ad222f..3ce68f962c92 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -2615,6 +2616,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) spin_lock_init(&uport->lock); lockdep_set_class(&uport->lock, &port_lock_key); } + if (uport->cons && uport->dev) + of_console_check(uport->dev->of_node, uport->cons->name, uport->line); uart_configure_port(drv, state, uport);