public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] fdt command: can't set a value-less property
@ 2007-09-06 13:44 Bartlomiej Sieka
  2007-09-06 13:54 ` Jerry Van Baren
  0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Sieka @ 2007-09-06 13:44 UTC (permalink / raw)
  To: u-boot

Hello,

I'm playing with the fdt command in recent (60174746) U-Boot and I can't
set a property that does not have a value.
Documentation/powerpc/booting-without-of.txt" says "A property can have
a value or not.", and fdt help suggests the same:
fdt set    <path> <prop> [<val>]    - Set <property> [to <val>]

However, I am getting:

=> fdt mknode / testnode
=> fdt list /testnode
testnode {
};
=> fdt set /testnode testprop
Usage:
fdt     - flattened device tree utility commands

=> fdt list /testnode
testnode {
};

Setting a property with value works:

=> fdt set /testnode testprop "testvalue"
=> fdt list /testnode
testnode {
         testprop=""testvalue"";
};

Am I doing something wrong, or is it a bug?

Regards,
Bartlomiej

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] fdt command: can't set a value-less property
  2007-09-06 13:44 [U-Boot-Users] fdt command: can't set a value-less property Bartlomiej Sieka
@ 2007-09-06 13:54 ` Jerry Van Baren
  2007-09-06 15:15   ` Bartlomiej Sieka
  0 siblings, 1 reply; 4+ messages in thread
From: Jerry Van Baren @ 2007-09-06 13:54 UTC (permalink / raw)
  To: u-boot

Bartlomiej Sieka wrote:
> Hello,
> 
> I'm playing with the fdt command in recent (60174746) U-Boot and I can't
> set a property that does not have a value.
> Documentation/powerpc/booting-without-of.txt" says "A property can have
> a value or not.", and fdt help suggests the same:
> fdt set    <path> <prop> [<val>]    - Set <property> [to <val>]
> 
> However, I am getting:
> 
> => fdt mknode / testnode
> => fdt list /testnode
> testnode {
> };
> => fdt set /testnode testprop
> Usage:
> fdt     - flattened device tree utility commands
> 
> => fdt list /testnode
> testnode {
> };
> 
> Setting a property with value works:
> 
> => fdt set /testnode testprop "testvalue"
> => fdt list /testnode
> testnode {
>          testprop=""testvalue"";
> };
> 
> Am I doing something wrong, or is it a bug?
> 
> Regards,
> Bartlomiej

Hi Bartlomiej,

That looks like a bug.  The cmd_fdt.c parser looks like it is insisting 
on a value (looking for three parameters to the "fdt set" subcommand).

I have not looked at the code to confirm the above hypothesis yet...

Best regards,
gvb

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] fdt command: can't set a value-less property
  2007-09-06 13:54 ` Jerry Van Baren
@ 2007-09-06 15:15   ` Bartlomiej Sieka
  2007-09-06 15:20     ` Jerry Van Baren
  0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Sieka @ 2007-09-06 15:15 UTC (permalink / raw)
  To: u-boot

Jerry Van Baren wrote:
> Bartlomiej Sieka wrote:
>> Hello,
>>
>> I'm playing with the fdt command in recent (60174746) U-Boot and I can't
>> set a property that does not have a value.
[...]
>> Am I doing something wrong, or is it a bug?
[...]>
> That looks like a bug.  The cmd_fdt.c parser looks like it is insisting 
> on a value (looking for three parameters to the "fdt set" subcommand).
> 
> I have not looked at the code to confirm the above hypothesis yet...
> 
> Best regards,
> gvb

Hi Jerry,

Thanks for a quick reply.

I've got a few comments after playing with fdt commands a little bit 
more. They concern the help message of "fdt move", which says:
fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr>

And the comments are:
- <fdt> -> <addr> (to be in sync with "fdt addr" description)
- <length> -> [<length>]
- Copy the fdt to <addr> -> Copy the fdt to <newaddr>
- to me, it's not clear from the description that this command will make 
the blob at the new location the "active" one.

Does the above make sense? If yes, it might be a good idea to update the 
help message while working on the "fdt set" issue.

Regards,
Bartlomiej

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] fdt command: can't set a value-less property
  2007-09-06 15:15   ` Bartlomiej Sieka
@ 2007-09-06 15:20     ` Jerry Van Baren
  0 siblings, 0 replies; 4+ messages in thread
From: Jerry Van Baren @ 2007-09-06 15:20 UTC (permalink / raw)
  To: u-boot

Bartlomiej Sieka wrote:
> Jerry Van Baren wrote:
>> Bartlomiej Sieka wrote:
>>> Hello,
>>>
>>> I'm playing with the fdt command in recent (60174746) U-Boot and I can't
>>> set a property that does not have a value.
> [...]
>>> Am I doing something wrong, or is it a bug?
> [...]>
>> That looks like a bug.  The cmd_fdt.c parser looks like it is 
>> insisting on a value (looking for three parameters to the "fdt set" 
>> subcommand).
>>
>> I have not looked at the code to confirm the above hypothesis yet...
>>
>> Best regards,
>> gvb
> 
> Hi Jerry,
> 
> Thanks for a quick reply.
> 
> I've got a few comments after playing with fdt commands a little bit 
> more. They concern the help message of "fdt move", which says:
> fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr>
> 
> And the comments are:
> - <fdt> -> <addr> (to be in sync with "fdt addr" description)
> - <length> -> [<length>]
> - Copy the fdt to <addr> -> Copy the fdt to <newaddr>
> - to me, it's not clear from the description that this command will make 
> the blob at the new location the "active" one.
> 
> Does the above make sense? If yes, it might be a good idea to update the 
> help message while working on the "fdt set" issue.
> 
> Regards,
> Bartlomiej

Agreed, the help text should be improved to be more specific, less 
confusing, and its accuracy should be verified.

Best regards,
gvb

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-06 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-06 13:44 [U-Boot-Users] fdt command: can't set a value-less property Bartlomiej Sieka
2007-09-06 13:54 ` Jerry Van Baren
2007-09-06 15:15   ` Bartlomiej Sieka
2007-09-06 15:20     ` Jerry Van Baren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox