* [U-Boot] dfu: using dfu-util -l shows different output
@ 2013-06-25 8:08 Heiko Schocher
2013-06-25 8:16 ` Pantelis Antoniou
0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2013-06-25 8:08 UTC (permalink / raw)
To: u-boot
Hello,
using "dfu-util -l" shows different output connecting to
an am335x based board and using dfu_nand.c with current
u-boot:
after resetting the board I get:
# dfu-util -l
dfu-util 0.5
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
dfu-util does currently only support DFU version 1.0
Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="Device Firmware Upgrade"
#
after a dfu transfer I see:
# dfu-util -l
dfu-util 0.5
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
dfu-util does currently only support DFU version 1.0
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1, name="SPL.backup1"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=2, name="SPL.backup2"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=4, name="u-boot"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b"
Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
#
Which I expected ...
U-Boot environment variable:
U-Boot# print dfu_alt_info
dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b part 0 8;rootfs
part 0 10
U-Boot#
Is this a bug or a feature?
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 8:08 [U-Boot] dfu: using dfu-util -l shows different output Heiko Schocher
@ 2013-06-25 8:16 ` Pantelis Antoniou
2013-06-25 8:25 ` Heiko Schocher
0 siblings, 1 reply; 8+ messages in thread
From: Pantelis Antoniou @ 2013-06-25 8:16 UTC (permalink / raw)
To: u-boot
Heiko,
I don't think the gadget is initialized before you issue
a dfu call.
So that makes sense.
Let's wait until Tom wakes up and have an authoritative answer.
Regards
-- Pantelis
On Jun 25, 2013, at 11:08 AM, Heiko Schocher wrote:
> Hello,
>
> using "dfu-util -l" shows different output connecting to
> an am335x based board and using dfu_nand.c with current
> u-boot:
>
> after resetting the board I get:
>
> # dfu-util -l
> dfu-util 0.5
>
> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> (C) 2010-2011 Tormod Volden (DfuSe support)
> This program is Free Software and has ABSOLUTELY NO WARRANTY
>
> dfu-util does currently only support DFU version 1.0
>
> Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="Device Firmware Upgrade"
> #
>
> after a dfu transfer I see:
>
> # dfu-util -l
> dfu-util 0.5
>
> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> (C) 2010-2011 Tormod Volden (DfuSe support)
> This program is Free Software and has ABSOLUTELY NO WARRANTY
>
> dfu-util does currently only support DFU version 1.0
>
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1, name="SPL.backup1"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=2, name="SPL.backup2"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=4, name="u-boot"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b"
> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
> #
>
> Which I expected ...
>
> U-Boot environment variable:
>
> U-Boot# print dfu_alt_info
> dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b part 0 8;rootfs
> part 0 10
> U-Boot#
>
> Is this a bug or a feature?
>
> bye,
> Heiko
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 8:16 ` Pantelis Antoniou
@ 2013-06-25 8:25 ` Heiko Schocher
2013-06-25 8:44 ` Lukasz Majewski
0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2013-06-25 8:25 UTC (permalink / raw)
To: u-boot
Hello Pantelis,
Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
> Heiko,
>
> I don't think the gadget is initialized before you issue
> a dfu call.
>
> So that makes sense.
?
I call from the host "dfu-util -l" so the gadget on the board
should do the answer ... or?
> Let's wait until Tom wakes up and have an authoritative answer.
Ok!
bye,
Heiko
>
> Regards
>
> -- Pantelis
>
> On Jun 25, 2013, at 11:08 AM, Heiko Schocher wrote:
>
>> Hello,
>>
>> using "dfu-util -l" shows different output connecting to
>> an am335x based board and using dfu_nand.c with current
>> u-boot:
>>
>> after resetting the board I get:
>>
>> # dfu-util -l
>> dfu-util 0.5
>>
>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
>> (C) 2010-2011 Tormod Volden (DfuSe support)
>> This program is Free Software and has ABSOLUTELY NO WARRANTY
>>
>> dfu-util does currently only support DFU version 1.0
>>
>> Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="Device Firmware Upgrade"
>> #
>>
>> after a dfu transfer I see:
>>
>> # dfu-util -l
>> dfu-util 0.5
>>
>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
>> (C) 2010-2011 Tormod Volden (DfuSe support)
>> This program is Free Software and has ABSOLUTELY NO WARRANTY
>>
>> dfu-util does currently only support DFU version 1.0
>>
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1, name="SPL.backup1"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=2, name="SPL.backup2"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=4, name="u-boot"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b"
>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
>> #
>>
>> Which I expected ...
>>
>> U-Boot environment variable:
>>
>> U-Boot# print dfu_alt_info
>> dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b part 0 8;rootfs
>> part 0 10
>> U-Boot#
>>
>> Is this a bug or a feature?
>>
>> bye,
>> Heiko
>> --
>> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>
>
>
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 8:25 ` Heiko Schocher
@ 2013-06-25 8:44 ` Lukasz Majewski
2013-06-25 8:55 ` Heiko Schocher
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2013-06-25 8:44 UTC (permalink / raw)
To: u-boot
Hi Heiko,
> Hello Pantelis,
>
> Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
> > Heiko,
> >
> > I don't think the gadget is initialized before you issue
> > a dfu call.
> >
> > So that makes sense.
>
> ?
>
> I call from the host "dfu-util -l" so the gadget on the board
> should do the answer ... or?
The gadget is not initialized here (so the dfu-util -l shows no
output).
After transfer it shows information about proper alt settings.
This is correct behaviour, but I had discussion about this with Tom and
we agreed, that it would be nice to have "dfu-util -l" exporting from
very beginning the alt setting information.
Frankly, I had too much other work to implement it.
However, I think, that it would be a very useful feature (e.g. to get
alt settings layout at HOST to facilitate automated flashing).
>
> > Let's wait until Tom wakes up and have an authoritative answer.
>
> Ok!
>
> bye,
> Heiko
>
> >
> > Regards
> >
> > -- Pantelis
> >
> > On Jun 25, 2013, at 11:08 AM, Heiko Schocher wrote:
> >
> >> Hello,
> >>
> >> using "dfu-util -l" shows different output connecting to
> >> an am335x based board and using dfu_nand.c with current
> >> u-boot:
> >>
> >> after resetting the board I get:
> >>
> >> # dfu-util -l
> >> dfu-util 0.5
> >>
> >> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> >> (C) 2010-2011 Tormod Volden (DfuSe support)
> >> This program is Free Software and has ABSOLUTELY NO WARRANTY
> >>
> >> dfu-util does currently only support DFU version 1.0
> >>
> >> Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0,
> >> name="Device Firmware Upgrade" #
> >>
> >> after a dfu transfer I see:
> >>
> >> # dfu-util -l
> >> dfu-util 0.5
> >>
> >> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> >> (C) 2010-2011 Tormod Volden (DfuSe support)
> >> This program is Free Software and has ABSOLUTELY NO WARRANTY
> >>
> >> dfu-util does currently only support DFU version 1.0
> >>
> >> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
> >> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1,
> >> name="SPL.backup1" Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0,
> >> alt=2, name="SPL.backup2" Found DFU: [0525:bd00] devnum=0, cfg=2,
> >> intf=0, alt=3, name="SPL.backup3" Found DFU: [0525:bd00] devnum=0,
> >> cfg=2, intf=0, alt=4, name="u-boot" Found DFU: [0525:bd00]
> >> devnum=0, cfg=2, intf=0, alt=5, name="kernel_a" Found DFU:
> >> [0525:bd00] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b" Found
> >> DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=7, name="rootfs" #
> >>
> >> Which I expected ...
> >>
> >> U-Boot environment variable:
> >>
> >> U-Boot# print dfu_alt_info
> >> dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0
> >> 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b
> >> part 0 8;rootfs part 0 10 U-Boot#
> >>
> >> Is this a bug or a feature?
> >>
> >> bye,
> >> Heiko
> >> --
> >> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev
> >> Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> >> Groebenzell, Germany
> >
> >
> >
>
>
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 8:44 ` Lukasz Majewski
@ 2013-06-25 8:55 ` Heiko Schocher
2013-06-25 10:29 ` Lukasz Majewski
0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2013-06-25 8:55 UTC (permalink / raw)
To: u-boot
Hello Lukasz,
Am 25.06.2013 10:44, schrieb Lukasz Majewski:
> Hi Heiko,
>
>> Hello Pantelis,
>>
>> Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
>>> Heiko,
>>>
>>> I don't think the gadget is initialized before you issue
>>> a dfu call.
>>>
>>> So that makes sense.
>>
>> ?
>>
>> I call from the host "dfu-util -l" so the gadget on the board
>> should do the answer ... or?
>
> The gadget is not initialized here (so the dfu-util -l shows no
> output).
>
> After transfer it shows information about proper alt settings.
>
> This is correct behaviour, but I had discussion about this with Tom and
> we agreed, that it would be nice to have "dfu-util -l" exporting from
> very beginning the alt setting information.
Yes, I vote for this too. Connecting to a board, I first
would do a "dfu-util -l" to look, what is possible to
update here ...
> Frankly, I had too much other work to implement it.
>
> However, I think, that it would be a very useful feature (e.g. to get
> alt settings layout at HOST to facilitate automated flashing).
Hmm... I digged into the code, but not really found a place
where I have to start. Can you give me a hint where to start?
So maybe, I can do it?
Thanks!
bye,
Heiko
>>> Let's wait until Tom wakes up and have an authoritative answer.
>>
>> Ok!
>>
>> bye,
>> Heiko
>>
>>>
>>> Regards
>>>
>>> -- Pantelis
>>>
>>> On Jun 25, 2013, at 11:08 AM, Heiko Schocher wrote:
>>>
>>>> Hello,
>>>>
>>>> using "dfu-util -l" shows different output connecting to
>>>> an am335x based board and using dfu_nand.c with current
>>>> u-boot:
>>>>
>>>> after resetting the board I get:
>>>>
>>>> # dfu-util -l
>>>> dfu-util 0.5
>>>>
>>>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
>>>> (C) 2010-2011 Tormod Volden (DfuSe support)
>>>> This program is Free Software and has ABSOLUTELY NO WARRANTY
>>>>
>>>> dfu-util does currently only support DFU version 1.0
>>>>
>>>> Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0,
>>>> name="Device Firmware Upgrade" #
>>>>
>>>> after a dfu transfer I see:
>>>>
>>>> # dfu-util -l
>>>> dfu-util 0.5
>>>>
>>>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
>>>> (C) 2010-2011 Tormod Volden (DfuSe support)
>>>> This program is Free Software and has ABSOLUTELY NO WARRANTY
>>>>
>>>> dfu-util does currently only support DFU version 1.0
>>>>
>>>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
>>>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1,
>>>> name="SPL.backup1" Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0,
>>>> alt=2, name="SPL.backup2" Found DFU: [0525:bd00] devnum=0, cfg=2,
>>>> intf=0, alt=3, name="SPL.backup3" Found DFU: [0525:bd00] devnum=0,
>>>> cfg=2, intf=0, alt=4, name="u-boot" Found DFU: [0525:bd00]
>>>> devnum=0, cfg=2, intf=0, alt=5, name="kernel_a" Found DFU:
>>>> [0525:bd00] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b" Found
>>>> DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=7, name="rootfs" #
>>>>
>>>> Which I expected ...
>>>>
>>>> U-Boot environment variable:
>>>>
>>>> U-Boot# print dfu_alt_info
>>>> dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0
>>>> 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b
>>>> part 0 8;rootfs part 0 10 U-Boot#
>>>>
>>>> Is this a bug or a feature?
>>>>
>>>> bye,
>>>> Heiko
>>>> --
>>>> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev
>>>> Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194
>>>> Groebenzell, Germany
>>>
>>>
>>>
>>
>>
>
>
>
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 8:55 ` Heiko Schocher
@ 2013-06-25 10:29 ` Lukasz Majewski
2013-06-25 11:24 ` Heiko Schocher
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2013-06-25 10:29 UTC (permalink / raw)
To: u-boot
Hi Heiko,
> Hello Lukasz,
>
> Am 25.06.2013 10:44, schrieb Lukasz Majewski:
> > Hi Heiko,
> >
> >> Hello Pantelis,
> >>
> >> Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
> >>> Heiko,
> >>>
> >>> I don't think the gadget is initialized before you issue
> >>> a dfu call.
> >>>
> >>> So that makes sense.
> >>
> >> ?
> >>
> >> I call from the host "dfu-util -l" so the gadget on the board
> >> should do the answer ... or?
> >
> > The gadget is not initialized here (so the dfu-util -l shows no
> > output).
> >
> > After transfer it shows information about proper alt settings.
> >
> > This is correct behaviour, but I had discussion about this with Tom
> > and we agreed, that it would be nice to have "dfu-util -l"
> > exporting from very beginning the alt setting information.
>
> Yes, I vote for this too. Connecting to a board, I first
> would do a "dfu-util -l" to look, what is possible to
> update here ...
>
> > Frankly, I had too much other work to implement it.
> >
> > However, I think, that it would be a very useful feature (e.g. to
> > get alt settings layout at HOST to facilitate automated flashing).
>
> Hmm... I digged into the code, but not really found a place
> where I have to start. Can you give me a hint where to start?
> So maybe, I can do it?
The problem here is to switch:
f_dfu->usb_function.strings = dfu_strings | NULL;
f_dfu->usb_function.hs_descriptors = f_dfu->function |
dfu_runtime_descs;
The trick here is to properly fill in hs USB descriptors to embed the
alt settings strings.
dfu-util -l can read the alt settings when following patch is applied:
@@ -655,6 +656,7 @@ static int dfu_bind(struct usb_configuration *c,
struct usb_function *f)
stringtab_dfu.strings = f_dfu->strings;
+ to_dfu_mode(f_dfu);
cdev->req->context = f_dfu;
error:
Unfortunately this breaks normal dfu operation, since board hangs at
"dfu mode".
It seems that after initialization dfu is at "runtime mode". In this
time standard information via USB hs.descriptor and strings is exposed.
Also during this time you call dfu-util -l (just after first DFU
gadget initialization).
When we program the device, we issue dfu-util -a X -D ....
Then we switch to "dfu mode" and replace USB descriptor's fields.
When we issue dfu-util -l afterwards, the updated descriptors are read.
Two important functions:
1. dfu_prepare_function - here we modify the usb descriptor
2. dfu_prepare_strings - here the detailed information about alt
settings is read from DFU core.
Please ask if you need help. I think that change with descriptors shall
receive good testing.
>
> Thanks!
>
> bye,
> Heiko
> >>> Let's wait until Tom wakes up and have an authoritative answer.
> >>
> >> Ok!
> >>
> >> bye,
> >> Heiko
> >>
> >>>
> >>> Regards
> >>>
> >>> -- Pantelis
> >>>
> >>> On Jun 25, 2013, at 11:08 AM, Heiko Schocher wrote:
> >>>
> >>>> Hello,
> >>>>
> >>>> using "dfu-util -l" shows different output connecting to
> >>>> an am335x based board and using dfu_nand.c with current
> >>>> u-boot:
> >>>>
> >>>> after resetting the board I get:
> >>>>
> >>>> # dfu-util -l
> >>>> dfu-util 0.5
> >>>>
> >>>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> >>>> (C) 2010-2011 Tormod Volden (DfuSe support)
> >>>> This program is Free Software and has ABSOLUTELY NO WARRANTY
> >>>>
> >>>> dfu-util does currently only support DFU version 1.0
> >>>>
> >>>> Found Runtime: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0,
> >>>> name="Device Firmware Upgrade" #
> >>>>
> >>>> after a dfu transfer I see:
> >>>>
> >>>> # dfu-util -l
> >>>> dfu-util 0.5
> >>>>
> >>>> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> >>>> (C) 2010-2011 Tormod Volden (DfuSe support)
> >>>> This program is Free Software and has ABSOLUTELY NO WARRANTY
> >>>>
> >>>> dfu-util does currently only support DFU version 1.0
> >>>>
> >>>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
> >>>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=1,
> >>>> name="SPL.backup1" Found DFU: [0525:bd00] devnum=0, cfg=2,
> >>>> intf=0, alt=2, name="SPL.backup2" Found DFU: [0525:bd00]
> >>>> devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3" Found DFU:
> >>>> [0525:bd00] devnum=0, cfg=2, intf=0, alt=4, name="u-boot" Found
> >>>> DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
> >>>> Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0, alt=6,
> >>>> name="kernel_b" Found DFU: [0525:bd00] devnum=0, cfg=2, intf=0,
> >>>> alt=7, name="rootfs" #
> >>>>
> >>>> Which I expected ...
> >>>>
> >>>> U-Boot environment variable:
> >>>>
> >>>> U-Boot# print dfu_alt_info
> >>>> dfu_alt_info=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0
> >>>> 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel_a part 0 7;kernel_b
> >>>> part 0 8;rootfs part 0 10 U-Boot#
> >>>>
> >>>> Is this a bug or a feature?
> >>>>
> >>>> bye,
> >>>> Heiko
> >>>> --
> >>>> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev
> >>>> Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> >>>> Groebenzell, Germany
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
>
>
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 10:29 ` Lukasz Majewski
@ 2013-06-25 11:24 ` Heiko Schocher
2013-06-25 11:35 ` Lukasz Majewski
0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2013-06-25 11:24 UTC (permalink / raw)
To: u-boot
Hello Lukasz,
Am 25.06.2013 12:29, schrieb Lukasz Majewski:
> Hi Heiko,
>
>> Hello Lukasz,
>>
>> Am 25.06.2013 10:44, schrieb Lukasz Majewski:
>>> Hi Heiko,
>>>
>>>> Hello Pantelis,
>>>>
>>>> Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
>>>>> Heiko,
>>>>>
>>>>> I don't think the gadget is initialized before you issue
>>>>> a dfu call.
>>>>>
>>>>> So that makes sense.
>>>>
>>>> ?
>>>>
>>>> I call from the host "dfu-util -l" so the gadget on the board
>>>> should do the answer ... or?
>>>
>>> The gadget is not initialized here (so the dfu-util -l shows no
>>> output).
>>>
>>> After transfer it shows information about proper alt settings.
>>>
>>> This is correct behaviour, but I had discussion about this with Tom
>>> and we agreed, that it would be nice to have "dfu-util -l"
>>> exporting from very beginning the alt setting information.
>>
>> Yes, I vote for this too. Connecting to a board, I first
>> would do a "dfu-util -l" to look, what is possible to
>> update here ...
>>
>>> Frankly, I had too much other work to implement it.
>>>
>>> However, I think, that it would be a very useful feature (e.g. to
>>> get alt settings layout at HOST to facilitate automated flashing).
>>
>> Hmm... I digged into the code, but not really found a place
>> where I have to start. Can you give me a hint where to start?
>> So maybe, I can do it?
>
> The problem here is to switch:
> f_dfu->usb_function.strings = dfu_strings | NULL;
> f_dfu->usb_function.hs_descriptors = f_dfu->function |
> dfu_runtime_descs;
>
> The trick here is to properly fill in hs USB descriptors to embed the
> alt settings strings.
>
>
> dfu-util -l can read the alt settings when following patch is applied:
>
> @@ -655,6 +656,7 @@ static int dfu_bind(struct usb_configuration *c,
> struct usb_function *f)
> stringtab_dfu.strings = f_dfu->strings;
>
> + to_dfu_mode(f_dfu);
> cdev->req->context = f_dfu;
>
> error:
>
> Unfortunately this breaks normal dfu operation, since board hangs at
> "dfu mode".
What do you mean with "normal dfu operation" ?
I just tried the following patch, and "dfu-util -l" and
"dfu-util -a ... -D ..." works ...
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index a322ae5..0334d9f 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -653,6 +653,9 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f)
->iInterface = id;
}
+ to_dfu_mode(f_dfu);
+ f_dfu->dfu_state = DFU_STATE_dfuIDLE;
+
stringtab_dfu.strings = f_dfu->strings;
cdev->req->context = f_dfu;
log on the host, where I use dfu-util:
after restart of the board:
[root at ts8 ~]# dfu-util -l
dfu-util 0.5
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
dfu-util does currently only support DFU version 1.0
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=1, name="SPL.backup1"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=2, name="SPL.backup2"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=4, name="u-boot"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
[root at ts8 ~]# dfu-util -a rootfs -D dxr2-org/dxr2.xx-release-image-UNKNOWN-dxr2.ubi
dfu-util 0.5
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
dfu-util does currently only support DFU version 1.0
Opening DFU USB device... ID 0525:4a47
WARNING: Can not find cached DFU functional descriptor
Warning: Assuming DFU version 1.0
Run-time device DFU version 0100
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting #7 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Error obtaining cached DFU functional descriptor
DFU mode device DFU version 0110
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
bytes_per_hash=576716
Copying data from PC to DFU device
Starting download: [##################################################] finished!
state(2) = dfuIDLE, status(0) = No error condition is present
Done!
[root at ts8 ~]# dfu-util -l
dfu-util 0.5
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
dfu-util does currently only support DFU version 1.0
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=1, name="SPL.backup1"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=2, name="SPL.backup2"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=3, name="SPL.backup3"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=4, name="u-boot"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=5, name="kernel_a"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=6, name="kernel_b"
Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
[root at ts8 ~]#
seems to me, that we should add
"f_dfu->dfu_state = DFU_STATE_dfuIDLE"
into to_dfu_mode() as, after all places where to_dfu_mode() is called
f_dfu->dfu_state = DFU_STATE_dfuIDLE is set ...
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] dfu: using dfu-util -l shows different output
2013-06-25 11:24 ` Heiko Schocher
@ 2013-06-25 11:35 ` Lukasz Majewski
0 siblings, 0 replies; 8+ messages in thread
From: Lukasz Majewski @ 2013-06-25 11:35 UTC (permalink / raw)
To: u-boot
Hi Heiko,
> Hello Lukasz,
>
> Am 25.06.2013 12:29, schrieb Lukasz Majewski:
> > Hi Heiko,
> >
> >> Hello Lukasz,
> >>
> >> Am 25.06.2013 10:44, schrieb Lukasz Majewski:
> >>> Hi Heiko,
> >>>
> >>>> Hello Pantelis,
> >>>>
> >>>> Am 25.06.2013 10:16, schrieb Pantelis Antoniou:
> >>>>> Heiko,
> >>>>>
> >>>>> I don't think the gadget is initialized before you issue
> >>>>> a dfu call.
> >>>>>
> >>>>> So that makes sense.
> >>>>
> >>>> ?
> >>>>
> >>>> I call from the host "dfu-util -l" so the gadget on the board
> >>>> should do the answer ... or?
> >>>
> >>> The gadget is not initialized here (so the dfu-util -l shows no
> >>> output).
> >>>
> >>> After transfer it shows information about proper alt settings.
> >>>
> >>> This is correct behaviour, but I had discussion about this with
> >>> Tom and we agreed, that it would be nice to have "dfu-util -l"
> >>> exporting from very beginning the alt setting information.
> >>
> >> Yes, I vote for this too. Connecting to a board, I first
> >> would do a "dfu-util -l" to look, what is possible to
> >> update here ...
> >>
> >>> Frankly, I had too much other work to implement it.
> >>>
> >>> However, I think, that it would be a very useful feature (e.g. to
> >>> get alt settings layout at HOST to facilitate automated flashing).
> >>
> >> Hmm... I digged into the code, but not really found a place
> >> where I have to start. Can you give me a hint where to start?
> >> So maybe, I can do it?
> >
> > The problem here is to switch:
> > f_dfu->usb_function.strings = dfu_strings | NULL;
> > f_dfu->usb_function.hs_descriptors = f_dfu->function |
> > dfu_runtime_descs;
> >
> > The trick here is to properly fill in hs USB descriptors to embed
> > the alt settings strings.
> >
> >
> > dfu-util -l can read the alt settings when following patch is
> > applied:
> >
> > @@ -655,6 +656,7 @@ static int dfu_bind(struct usb_configuration *c,
> > struct usb_function *f)
> > stringtab_dfu.strings = f_dfu->strings;
> >
> > + to_dfu_mode(f_dfu);
> > cdev->req->context = f_dfu;
> >
> > error:
> >
> > Unfortunately this breaks normal dfu operation, since board hangs at
> > "dfu mode".
>
> What do you mean with "normal dfu operation" ?
>
> I just tried the following patch, and "dfu-util -l" and
> "dfu-util -a ... -D ..." works ...
>
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index a322ae5..0334d9f 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -653,6 +653,9 @@ static int dfu_bind(struct usb_configuration *c,
> struct usb_function *f) ->iInterface = id;
> }
>
> + to_dfu_mode(f_dfu);
> + f_dfu->dfu_state = DFU_STATE_dfuIDLE;
^^^^^ = this is what I was missing.
> +
> stringtab_dfu.strings = f_dfu->strings;
>
> cdev->req->context = f_dfu;
>
> log on the host, where I use dfu-util:
>
> after restart of the board:
>
> [root at ts8 ~]# dfu-util -l
> dfu-util 0.5
>
> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> (C) 2010-2011 Tormod Volden (DfuSe support)
> This program is Free Software and has ABSOLUTELY NO WARRANTY
>
> dfu-util does currently only support DFU version 1.0
>
> Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
> Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=1,
> name="SPL.backup1" Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0,
> alt=2, name="SPL.backup2" Found DFU: [0525:4a47] devnum=0, cfg=2,
> intf=0, alt=3, name="SPL.backup3" Found DFU: [0525:4a47] devnum=0,
> cfg=2, intf=0, alt=4, name="u-boot" Found DFU: [0525:4a47] devnum=0,
> cfg=2, intf=0, alt=5, name="kernel_a" Found DFU: [0525:4a47]
> devnum=0, cfg=2, intf=0, alt=6, name="kernel_b" Found DFU:
> [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs" [root at ts8
> ~]# dfu-util -a rootfs -D
> dxr2-org/dxr2.xx-release-image-UNKNOWN-dxr2.ubi dfu-util 0.5
>
> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> (C) 2010-2011 Tormod Volden (DfuSe support)
> This program is Free Software and has ABSOLUTELY NO WARRANTY
>
> dfu-util does currently only support DFU version 1.0
>
> Opening DFU USB device... ID 0525:4a47
> WARNING: Can not find cached DFU functional descriptor
> Warning: Assuming DFU version 1.0
> Run-time device DFU version 0100
> Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs"
> Claiming USB DFU Interface...
> Setting Alternate Setting #7 ...
> Determining device status: state = dfuIDLE, status = 0
> dfuIDLE, continuing
> Error obtaining cached DFU functional descriptor
> DFU mode device DFU version 0110
> Device returned transfer size 4096
> No valid DFU suffix signature
> Warning: File has no DFU suffix
> bytes_per_hash=576716
> Copying data from PC to DFU device
> Starting download:
> [##################################################] finished!
> state(2) = dfuIDLE, status(0) = No error condition is present Done!
> [root at ts8 ~]# dfu-util -l
> dfu-util 0.5
>
> (C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
> (C) 2010-2011 Tormod Volden (DfuSe support)
> This program is Free Software and has ABSOLUTELY NO WARRANTY
>
> dfu-util does currently only support DFU version 1.0
>
> Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=0, name="SPL"
> Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0, alt=1,
> name="SPL.backup1" Found DFU: [0525:4a47] devnum=0, cfg=2, intf=0,
> alt=2, name="SPL.backup2" Found DFU: [0525:4a47] devnum=0, cfg=2,
> intf=0, alt=3, name="SPL.backup3" Found DFU: [0525:4a47] devnum=0,
> cfg=2, intf=0, alt=4, name="u-boot" Found DFU: [0525:4a47] devnum=0,
> cfg=2, intf=0, alt=5, name="kernel_a" Found DFU: [0525:4a47]
> devnum=0, cfg=2, intf=0, alt=6, name="kernel_b" Found DFU:
> [0525:4a47] devnum=0, cfg=2, intf=0, alt=7, name="rootfs" [root at ts8
> ~]#
>
> seems to me, that we should add
>
> "f_dfu->dfu_state = DFU_STATE_dfuIDLE"
> into to_dfu_mode() as, after all places where to_dfu_mode() is called
> f_dfu->dfu_state = DFU_STATE_dfuIDLE is set ...
Yes, indeed. This seems as a good solution.
>
> bye,
> Heiko
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-06-25 11:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-25 8:08 [U-Boot] dfu: using dfu-util -l shows different output Heiko Schocher
2013-06-25 8:16 ` Pantelis Antoniou
2013-06-25 8:25 ` Heiko Schocher
2013-06-25 8:44 ` Lukasz Majewski
2013-06-25 8:55 ` Heiko Schocher
2013-06-25 10:29 ` Lukasz Majewski
2013-06-25 11:24 ` Heiko Schocher
2013-06-25 11:35 ` Lukasz Majewski
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.