From patchwork Wed Aug 28 14:47:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19564 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1874B25E58 for ; Wed, 28 Aug 2013 14:48:04 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r5sf6468507yen.11 for ; Wed, 28 Aug 2013 07:48:03 -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=8GtyBUEiFvwXhiBFZ4U1vDtyahApDbDOFGPL1C39h6o=; b=cT/MdWt+enB4subIDAMgGn2hDIHmL0lqEyf4Y3G13HLidh3xM9rvDOXxS/jZNm/w4F PASiQZmq9oNJCF5/6bUIf1Adi5mb37/zwFarVtSqUeCE22Fh3BjorNQcwpyE23WOtJ/w 25UO6OkFNi62lsRpnfFUNyWi9S47mt5hMe4UgKykQaVbzQpHbrHY6aO1Uh2ASIb36diF 8ivdCSyiCLs9ZyDIEBd283khpc4AoJNGgO3bqEdEPA1+BF2LvvtICHsiTjTOmq8dHnrJ ee+qN6mDXE63uBwL570TvdEUFAYNdqUvAEFc4nNx2hA51FsUBYg+fGk4ThfH9mr9l5J7 aiOQ== X-Received: by 10.236.108.233 with SMTP id q69mr10044723yhg.11.1377701283825; Wed, 28 Aug 2013 07:48:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.165 with SMTP id dd5ls362600qeb.87.gmail; Wed, 28 Aug 2013 07:48:03 -0700 (PDT) X-Received: by 10.58.56.230 with SMTP id d6mr143996veq.45.1377701283639; Wed, 28 Aug 2013 07:48:03 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id fe2si6617713vcb.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id cz11so4181990veb.22 for ; Wed, 28 Aug 2013 07:48:03 -0700 (PDT) X-Gm-Message-State: ALoCoQnDNqvQ/80yAbnUl8Q0VdMzItd/i1eDHrgGdyWfu7AlSugyGehr+ZluiILhCud7Alfe9OxY X-Received: by 10.52.164.201 with SMTP id ys9mr509878vdb.39.1377701283525; Wed, 28 Aug 2013 07:48:03 -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 u4csp359927vcz; Wed, 28 Aug 2013 07:48:02 -0700 (PDT) X-Received: by 10.194.179.98 with SMTP id df2mr3278102wjc.49.1377701282229; Wed, 28 Aug 2013 07:48:02 -0700 (PDT) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id ev1si91422wib.32.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.181; Received: by mail-wi0-f181.google.com with SMTP id ex4so3556531wid.8 for ; Wed, 28 Aug 2013 07:48:01 -0700 (PDT) X-Received: by 10.194.174.36 with SMTP id bp4mr20204269wjc.7.1377701281422; Wed, 28 Aug 2013 07:48:01 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:00 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 01/29] xen/char: dt-uart: Allow the user to give a path to the node Date: Wed, 28 Aug 2013 15:47:15 +0100 Message-Id: <1377701263-3319-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-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.177 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 Cambell --- 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; }