From patchwork Fri Aug 16 21:05:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDA1425A1B for ; Fri, 16 Aug 2013 21:06:08 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf2624162ghb.10 for ; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=aDmrTTTCG4IW9XwJNZOcUuAS1ZVQG/E3ibhpnLNKNC4=; b=AdxNt02zxuWE012TYm4R6EO7fkm4tx8YgifBcMdBMALOY3VVTrUDT+mFY3tFVs7eBH PpDBost11TbMG0j0p+l1NgrAMDBahWg87+OMAhvgJ5qb/UbYz2kjOxmRV1qoc1vWV8xZ V4UHwB8nvbmuXJ30cPHpekuNUSrxePuejkMqVv/fSFMfzw+U6xDGF75GJn6Vo3euctRs 96hu0h8gpjJBQwRooR3PHY+jdtSJugjpjWoHOfaKC1eu3SeSjM22PyIQv/Na4gt28Rt3 fpsH3u7HcAnPL8ytITewQvPUziX+xWwBpLlD9nI5A+55KkgqfW/8yHjTIalAwQ4Xd+s1 zyoA== X-Received: by 10.236.180.104 with SMTP id i68mr1294243yhm.11.1376687168523; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.234 with SMTP id o10ls918596qev.24.gmail; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) X-Received: by 10.58.154.34 with SMTP id vl2mr18410veb.35.1376687168380; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id vf5si777516vdc.83.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id d10so1672847vea.5 for ; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) X-Gm-Message-State: ALoCoQl7AURFZuzYGMu/7tF/RfedDTyuPDBSvDgNzuckG5qxUnTPPWeqKQbYIUeGUrxnQ2d9FbI5 X-Received: by 10.220.171.129 with SMTP id h1mr1747467vcz.28.1376687168293; Fri, 16 Aug 2013 14:06:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp89430vcz; Fri, 16 Aug 2013 14:06:07 -0700 (PDT) X-Received: by 10.194.240.129 with SMTP id wa1mr2524656wjc.31.1376687167261; Fri, 16 Aug 2013 14:06:07 -0700 (PDT) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by mx.google.com with ESMTPS id h8si246870wiy.13.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:07 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.181 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.181; Received: by mail-we0-f181.google.com with SMTP id q57so1250577wes.26 for ; Fri, 16 Aug 2013 14:06:06 -0700 (PDT) X-Received: by 10.194.241.228 with SMTP id wl4mr2572652wjc.2.1376687166699; Fri, 16 Aug 2013 14:06:06 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id b13sm797327wic.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:05 -0700 (PDT) From: Julien Grall To: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com Cc: patches@linaro.org, andre.przywara@linaro.org, xen-devel@lists.xen.org, Julien Grall Subject: [RFC 01/24] xen/char: dt-uart: Allow the user to give a path to the node Date: Fri, 16 Aug 2013 22:05:33 +0100 Message-Id: <1376687156-6737-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> References: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On some board, there is no alias to the UART. To avoid modification in the device tree, dt-uart should also search device by path. To distinguish an alias from a path, dt-uart will check the first character. If it's a / then it's path, otherwise it's an alias. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/drivers/char/dt-uart.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/drivers/char/dt-uart.c b/xen/drivers/char/dt-uart.c index 93bb0f5..d7204fb 100644 --- a/xen/drivers/char/dt-uart.c +++ b/xen/drivers/char/dt-uart.c @@ -26,9 +26,10 @@ /* * Configure UART port with a string: - * alias,options + * path,options * - * @alias: alias used in the device tree for the UART + * @path: full path used in the device tree for the UART. If the path + * doesn't start with '/', we assuming that it's an alias. * @options: UART speficic options (see in each UART driver) */ static char __initdata opt_dtuart[30] = ""; @@ -38,7 +39,7 @@ void __init dt_uart_init(void) { struct dt_device_node *dev; int ret; - const char *devalias = opt_dtuart; + const char *devpath = opt_dtuart; char *options; if ( !console_has("dtuart") || !strcmp(opt_dtuart, "") ) @@ -53,12 +54,15 @@ void __init dt_uart_init(void) else options = ""; - early_printk("Looking for UART console %s\n", devalias); - dev = dt_find_node_by_alias(devalias); + early_printk("Looking for UART console %s\n", devpath); + if ( *devpath == '/' ) + dev = dt_find_node_by_path(devpath); + else + dev = dt_find_node_by_alias(devpath); if ( !dev ) { - early_printk("Unable to find device \"%s\"\n", devalias); + early_printk("Unable to find device \"%s\"\n", devpath); return; }