From patchwork Thu Nov 27 17:56:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 41641 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C468C244C2 for ; Thu, 27 Nov 2014 17:56:20 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf3472465eek.4 for ; Thu, 27 Nov 2014 09:56:19 -0800 (PST) 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=vcNNMQOq4KLQo+086AQ6ecljGZGtZUJR69fxn3bVEZ0=; b=FrZhFeyFKrfk8uF7UPo7uJftjs6tW4CPugwW7R7Ki2AiJkoYaTU0WBpCtVUEq7LGw1 yDbw6uSAUmM27JD04b3tVCJ9Ed45J1dgKvM3s2XCCTJCTuAhaut/ix1Wy7UWFPCKwtW6 0kXsO5GYlEu+T/39CxsS09TW8q2ZuIts3tv70M5MODE65ld1naIth7gKnrdKMg0CSswW 9SUKDy1ZnIFmxUIwmXL3dszexydgSTsHrdaLqzUyvn9mX2Ta6rnmfLmlr4wHZzh0wDQ9 rdxxqVdj1EowbO0dwj9UkzLxP4Ggoj0+wHnyUkbn25jTHKFaM3uZWoiiCZPfU9cynaNA oTBw== X-Gm-Message-State: ALoCoQnFNjkH92OR1NIKQQ2nQwKrKJGVXBUcusW06hfSGmH/VrhVfRTFk7sDgVBp6kO0ufO2RFRY X-Received: by 10.112.125.6 with SMTP id mm6mr10899349lbb.8.1417110979896; Thu, 27 Nov 2014 09:56:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.100 with SMTP id 4ls641613lal.89.gmail; Thu, 27 Nov 2014 09:56:19 -0800 (PST) X-Received: by 10.152.1.130 with SMTP id 2mr39148474lam.89.1417110979371; Thu, 27 Nov 2014 09:56:19 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id wg10si7864593lbb.118.2014.11.27.09.56.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Nov 2014 09:56:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so4560771lab.32 for ; Thu, 27 Nov 2014 09:56:19 -0800 (PST) X-Received: by 10.112.38.4 with SMTP id c4mr24508394lbk.46.1417110979184; Thu, 27 Nov 2014 09:56:19 -0800 (PST) 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.112.184.201 with SMTP id ew9csp833076lbc; Thu, 27 Nov 2014 09:56:18 -0800 (PST) X-Received: by 10.68.106.2 with SMTP id gq2mr46061124pbb.46.1417110977521; Thu, 27 Nov 2014 09:56:17 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iu1si12479273pbb.216.2014.11.27.09.56.16 for ; Thu, 27 Nov 2014 09:56:17 -0800 (PST) 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 S1751575AbaK0R4N (ORCPT + 26 others); Thu, 27 Nov 2014 12:56:13 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:52328 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbaK0Rzx (ORCPT ); Thu, 27 Nov 2014 12:55:53 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so16498850wiw.8 for ; Thu, 27 Nov 2014 09:55:52 -0800 (PST) X-Received: by 10.180.198.164 with SMTP id jd4mr52519571wic.42.1417110952656; Thu, 27 Nov 2014 09:55:52 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id nj9sm12404437wic.10.2014.11.27.09.55.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 09:55:52 -0800 (PST) From: Leif Lindholm To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, grant.likely@linaro.org, robh+dt@kernel.org, plagnioj@jcrosoft.com, ijc@debian.org, andrew@lunn.ch, s.hauer@pengutronix.de Subject: [PATCH v3 3/3] of: support passing console options with stdout-path Date: Thu, 27 Nov 2014 17:56:07 +0000 Message-Id: <1417110967-16284-4-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417110967-16284-1-git-send-email-leif.lindholm@linaro.org> References: <1417110967-16284-1-git-send-email-leif.lindholm@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: leif.lindholm@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.215.45 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: , Support specifying console options (like with console=ttyXN,) by appending them to the stdout-path property after a separating ':'. Example: stdout-path = "uart0:115200"; Signed-off-by: Leif Lindholm --- drivers/of/base.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 7f0e5f7..6d2d45e 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -37,6 +37,7 @@ EXPORT_SYMBOL(of_allnodes); struct device_node *of_chosen; struct device_node *of_aliases; struct device_node *of_stdout; +static const char *of_stdout_options; struct kset *of_kset; @@ -1844,7 +1845,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) if (IS_ENABLED(CONFIG_PPC) && !name) name = of_get_property(of_aliases, "stdout", NULL); if (name) - of_stdout = of_find_node_by_path(name); + of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); } if (!of_aliases) @@ -1968,9 +1969,13 @@ EXPORT_SYMBOL_GPL(of_prop_next_string); */ bool of_console_check(struct device_node *dn, char *name, int index) { + char *console_options; + if (!dn || dn != of_stdout || console_set_on_cmdline) return false; - return !add_preferred_console(name, index, NULL); + + console_options = kstrdup(of_stdout_options, GFP_KERNEL); + return !add_preferred_console(name, index, console_options); } EXPORT_SYMBOL_GPL(of_console_check);