All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Bamvor Jian Zhang <bjzhang@suse.com>
Cc: stefano.stabellini@eu.citrix.com, patches@linaro.org,
	ian.campbell@citrix.com, andre.przywara@linaro.org,
	xen-devel@lists.xen.org
Subject: Re: [PATCH V1 17/29] xen/arm: Mark each device used by Xen as disabled in DOM0 FDT
Date: Thu, 29 Aug 2013 13:20:51 +0100	[thread overview]
Message-ID: <521F3CA3.9040707@linaro.org> (raw)
In-Reply-To: <521F2E2E02000030000333EF@soto.provo.novell.com>

On 08/29/2013 02:19 AM, Bamvor Jian Zhang wrote:
> Hi Julien

Hi Bamvor,

>> 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 <julien.grall@xxxxxxxxxx>
>> Acked-by: Ian Cambell <ian.campbell@xxxxxxxxxx>
>> ---
>>  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 '/' start an alias, it should be

>From the ePAR
(http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf)
section 3.3: an alias name must match the following pattern: [0-9a-z-]+
So we can't find '/' in the alias.

> +    if ( *devpath == '/' )
> +        dev = dt_find_node_by_alias(devpath);
> +    else
> +        dev = dt_find_node_by_path(devpath);

A path always start by '/'. With your solution, it won't be possible to
get the UART by path.

-- 
Julien Grall

  parent reply	other threads:[~2013-08-29 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29  1:19 [PATCH V1 17/29] xen/arm: Mark each device used by Xen as disabled in DOM0 FDT Bamvor Jian Zhang
2013-08-29  8:34 ` Ian Campbell
2013-08-29 12:20 ` Julien Grall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-28 14:47 [PATCH V1 00/29] Allow Xen to boot with a raw Device Tree Julien Grall
2013-08-28 14:47 ` [PATCH V1 17/29] xen/arm: Mark each device used by Xen as disabled in DOM0 FDT Julien Grall
2013-09-09 11:37   ` Ian Campbell
2013-09-09 21:53     ` Julien Grall
2013-09-10  9:01       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521F3CA3.9040707@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=andre.przywara@linaro.org \
    --cc=bjzhang@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.