[U-Boot] DFU on OMAP4?
Lukasz Majewski
l.majewski at samsung.com
Wed Feb 20 08:52:23 CET 2013
Hi Michael,
> Greetings,
>
> I've been trying to do some feasibility (performance / features)
> testing of DFU to see if it might work on a project I'm involved
> with. Due to architecture similarities I'm trying to do this using a
> custom-built u-boot from Denx mainline on a OMAP4460 ES1.1
> Pandaboard. But I've been having problems.
>
> I'm not sure I have the right set of CONFIG options. The DFU-relevant
> ones (I think) are:
>
> #define CONFIG_CMD_DFU
> #define CONFIG_DFU_FUNCTION
> #define CONFIG_DFU_MMC
> #define CONFIG_USBDOWNLOAD_GADGET
> #define CONFIG_USB_GADGET
> #define CONFIG_USB_GADGET_OMAP
> #define CONFIG_USB_GADGET_VBUS_DRAW 500
>
> #define CONFIG_G_DNL_MANUFACTURER "TI" // just
> #define CONFIG_G_DNL_VENDOR_NUM 0x0451 // for
> #define CONFIG_G_DNL_PRODUCT_NUM 0xd022 // evaluation
>
> #define CONFIG_DFU_ALT \
> "ipl mmc 100 100;" \
> "u-boot mmc 200 200\0" \
> …
> #define CONFIG_EXTRA_ENV_SETTINGS \
> "dfu_alt_info=" CONFIG_DFU_ALT \
> …
>
Those are CONFIGS needed for DFU running.
> With this I get unresolved symbols at link time:
>
> /home/cashwell/eval/u-boot/common/cmd_dfu.c:64: undefined reference
> to `usb_gadget_handle_interrupts' drivers/usb/gadget/libusb_gadget.o:
> In function
> `usb_composite_unregister': /home/cashwell/eval/u-boot/drivers/usb/gadget/composite.c:1081:
> undefined reference to `usb_gadget_unregister_driver'
> drivers/usb/gadget/libusb_gadget.o: In function
> `usb_composite_register': /home/cashwell/eval/u-boot/drivers/usb/gadget/composite.c:1067:
> undefined reference to `usb_gadget_register_driver'
>
> The only possibilities I can find that might resolve those missing
> functions are in the files:
>
> ./drivers/usb/musb-new/musb_uboot.c
> ./drivers/usb/gadget/s3c_udc_otg.c
I can only speak of Samsung code. The s3c_udc_otg.c shall be regarded
as a reference (at least for the current DFU implementation).
In this file you will find a UDC (USB Device Controller) driver, which
exports USB Gadget (ported from linux) API.
Please notice, that "usb_gadget_register_driver" is one of those calls.
> ./drivers/usb/gadget/pxa25x_udc.c
> ./drivers/usb/gadget/mv_udc.c
>
> But I'm confused by the relationship between musb, musb-new, and the
> UDC gadget drivers. I also can't find UDC code for OMAP4 that would
> work for DFU.
UDC/GADGET/DFU can be depicted as:
------------------------------ -------------------------
| DFU code (high level code) | | UMS (USB Mass Storage)|
------------------------------ -------------------------
| |
\|/ |
-------------------------/ |
|Composite (composite.c)|----------------------
-------------------------\
|
\|/
------------------------------------
|UDC driver + Gadget API exported |
| s3c_udc_otg.c for Samsung |
------------------------------------
|
\|/
----------------
| USB HW |
----------------
It seems that UDC driver, which you are using is not exporting proper
API which is used by composite.c layer.
But I think, that Linux kernel UDC driver (for Pandaboard) shall have a
good support for Gadget API. You can look there for a reference.
>
> Am I trying to do something that's impossible on OMAP4 using its
> built-in OTG controller and PHY or am I just doing something dumb?
What I can advice is:
- Look for TI's UDC driver for anadboard. Especially pay attention for
the Gadget API export.
- Then compare this code with current UDC implementation at U-boot -
they shall match in a larger part.
- Add missing API calls.
>
> Has anyone used u-boot DFU on a Pandaboard?
You probably are the first one :-)
>
> Sorry for the n00b question but I've been banging my head on this for
> several days and I just can't sort out which part is the horse and
> which the cart.
I hope, that the ASCII picture will help you to understand the stuff.
When we were developing the feature for Samsung boards, we were trying
to stick to Linux reference code as much as possible (of course we had
to add a small compatibility layer, but the UDC driver was almost not
changed).
>
> Best regards,
> -Michael Cashwell
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
--
Best regards,
Lukasz Majewski
Samsung R&D Poland (SRPOL) | Linux Platform Group
More information about the U-Boot
mailing list