diff mbox

[3/3] ARM: am57xx_evm: enable DFU support

Message ID 20160825151427.9434-4-nsekhar@ti.com
State New
Headers show

Commit Message

Sekhar Nori Aug. 25, 2016, 3:14 p.m. UTC
AM57xx GP EVM has USB2 port of the SoC exposed as
USB client port.

It is useful to be able to use this port for USB
DFU downloads.

Enable USB DFU support. Tested on AM57x GP EVM Rev
A3 using DFU to download to connected SD card, on
board eMMC and to the RAM.

Also tested to make sure connected mass storage
device to USB1 (host) port continues to get
enumerated.

configs for HS version of the AM57x EVM are
included in the patch but not really tested.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>

---
 configs/am57xx_evm_defconfig    | 10 +++++++++
 configs/am57xx_hs_evm_defconfig | 10 +++++++++
 include/configs/am57xx_evm.h    | 46 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+)

-- 
2.9.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Kishon Vijay Abraham I Aug. 26, 2016, 5:51 a.m. UTC | #1
Hi Lokesh,

On Friday 26 August 2016 10:38 AM, Lokesh Vutla wrote:
> 

> 

> On Friday 26 August 2016 10:36 AM, Lokesh Vutla wrote:

>> [..snip..]

>>

>>> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h

>>> index 46e8d4cfd715..3d5ae1ae1d54 100644

>>> --- a/include/configs/am57xx_evm.h

>>> +++ b/include/configs/am57xx_evm.h

>>> @@ -41,6 +41,47 @@

>>>  	"uuid_disk=${uuid_gpt_disk};" \

>>>  	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"

>>>  

>>> +#define DFU_ALT_INFO_MMC \

>>> +	"dfu_alt_info_mmc=" \

>>> +	"boot part 0 1;" \

>>> +	"rootfs part 0 2;" \

>>> +	"MLO fat 0 1;" \

>>> +	"MLO.raw raw 0x100 0x100;" \

>>> +	"u-boot.img.raw raw 0x300 0x400;" \

>>> +	"spl-os-args.raw raw 0x80 0x80;" \

>>> +	"spl-os-image.raw raw 0x900 0x2000;" \

>>> +	"spl-os-args fat 0 1;" \

>>> +	"spl-os-image fat 0 1;" \

>>> +	"u-boot.img fat 0 1;" \

>>> +	"uEnv.txt fat 0 1\0"

>>> +

>>> +#define DFU_ALT_INFO_EMMC \

>>> +	"dfu_alt_info_emmc=" \

>>> +	"rawemmc raw 0 3751936;" \

>>> +	"boot part 1 1;" \

>>> +	"rootfs part 1 2;" \

>>> +	"MLO fat 1 1;" \

>>> +	"MLO.raw raw 0x100 0x100;" \

>>> +	"u-boot.img.raw raw 0x300 0x400;" \

>>> +	"spl-os-args.raw raw 0x80 0x80;" \

>>> +	"spl-os-image.raw raw 0x900 0x2000;" \

>>> +	"spl-os-args fat 1 1;" \

>>> +	"spl-os-image fat 1 1;" \

>>> +	"u-boot.img fat 1 1;" \

>>> +	"uEnv.txt fat 1 1\0"

>>> +

>>> +#define DFU_ALT_INFO_RAM \

>>> +	"dfu_alt_info_ram=" \

>>> +	"kernel ram 0x80200000 0x4000000;" \

>>> +	"fdt ram 0x80f80000 0x80000;" \

>>> +	"ramdisk ram 0x81000000 0x4000000\0"

>>> +

>>> +#define DFUARGS \

>>> +	"dfu_bufsiz=0x10000\0" \

>>> +	DFU_ALT_INFO_MMC \

>>> +	DFU_ALT_INFO_EMMC \

>>> +	DFU_ALT_INFO_RAM \

>>> +

>>

>> Can you also add DFU_ALT_INFO_QSPI as am57xx-idk has QSPI.

> 

> Any reason why these cannot be moved to ti_omap5_common.h?


it was NAK'ed before.
http://lists.denx.de/pipermail/u-boot/2015-August/224635.html

Thanks
Kishon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Sekhar Nori Aug. 26, 2016, 5:53 a.m. UTC | #2
On Friday 26 August 2016 10:38 AM, Lokesh Vutla wrote:
> 

> 

> On Friday 26 August 2016 10:36 AM, Lokesh Vutla wrote:

>> [..snip..]

>>

>>> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h

>>> index 46e8d4cfd715..3d5ae1ae1d54 100644

>>> --- a/include/configs/am57xx_evm.h

>>> +++ b/include/configs/am57xx_evm.h

>>> @@ -41,6 +41,47 @@

>>>  	"uuid_disk=${uuid_gpt_disk};" \

>>>  	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"

>>>  

>>> +#define DFU_ALT_INFO_MMC \

>>> +	"dfu_alt_info_mmc=" \

>>> +	"boot part 0 1;" \

>>> +	"rootfs part 0 2;" \

>>> +	"MLO fat 0 1;" \

>>> +	"MLO.raw raw 0x100 0x100;" \

>>> +	"u-boot.img.raw raw 0x300 0x400;" \

>>> +	"spl-os-args.raw raw 0x80 0x80;" \

>>> +	"spl-os-image.raw raw 0x900 0x2000;" \

>>> +	"spl-os-args fat 0 1;" \

>>> +	"spl-os-image fat 0 1;" \

>>> +	"u-boot.img fat 0 1;" \

>>> +	"uEnv.txt fat 0 1\0"

>>> +

>>> +#define DFU_ALT_INFO_EMMC \

>>> +	"dfu_alt_info_emmc=" \

>>> +	"rawemmc raw 0 3751936;" \

>>> +	"boot part 1 1;" \

>>> +	"rootfs part 1 2;" \

>>> +	"MLO fat 1 1;" \

>>> +	"MLO.raw raw 0x100 0x100;" \

>>> +	"u-boot.img.raw raw 0x300 0x400;" \

>>> +	"spl-os-args.raw raw 0x80 0x80;" \

>>> +	"spl-os-image.raw raw 0x900 0x2000;" \

>>> +	"spl-os-args fat 1 1;" \

>>> +	"spl-os-image fat 1 1;" \

>>> +	"u-boot.img fat 1 1;" \

>>> +	"uEnv.txt fat 1 1\0"

>>> +

>>> +#define DFU_ALT_INFO_RAM \

>>> +	"dfu_alt_info_ram=" \

>>> +	"kernel ram 0x80200000 0x4000000;" \

>>> +	"fdt ram 0x80f80000 0x80000;" \

>>> +	"ramdisk ram 0x81000000 0x4000000\0"

>>> +

>>> +#define DFUARGS \

>>> +	"dfu_bufsiz=0x10000\0" \

>>> +	DFU_ALT_INFO_MMC \

>>> +	DFU_ALT_INFO_EMMC \

>>> +	DFU_ALT_INFO_RAM \

>>> +

>>

>> Can you also add DFU_ALT_INFO_QSPI as am57xx-idk has QSPI.

> 

> Any reason why these cannot be moved to ti_omap5_common.h?


No reason, I guess, just that its being done per platform today.

If we are going to make it common, why not a step further and move it to
ti_armv7_common.h so that similar looking defines from am335x_evm.h and
am43xx_evm.h can be eliminated as well? Or do you see any reason why
am335x and am437x need to be kept different.

Thanks,
Sekhar
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Sekhar Nori Aug. 30, 2016, 6:33 a.m. UTC | #3
Hi Tom,

On Saturday 27 August 2016 02:31 AM, Tom Rini wrote:
> This is another example of needing to find a place and a way to put

> vendor specific stuff somewhere.  Along with needing to figure out how

> to move environment stuff out of include/configs/ if we can.  The half

> idea I'm toying with right now is include/environment/.... and making

> various fragments be included in env_default.h.

> 

> I suppose to start with, we could move the TI-as-vendor-suggested DFU

> args there, once we have board/ti/Kconfig for the other

> TI-as-vendor-suggested stuff :)


To be clear, you are asking for a new file
"include/environment/ti/omap.h" to be created and DFU args for TI's
OMAP-style platforms consolidated there in v2 of this patch series. Right?

Regards,
Sekhar
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Sekhar Nori Aug. 30, 2016, 11:25 a.m. UTC | #4
On Tuesday 30 August 2016 04:50 PM, Tom Rini wrote:
> On Tue, Aug 30, 2016 at 12:03:32PM +0530, Sekhar Nori wrote:

>> Hi Tom,

>>

>> On Saturday 27 August 2016 02:31 AM, Tom Rini wrote:

>>> This is another example of needing to find a place and a way to put

>>> vendor specific stuff somewhere.  Along with needing to figure out how

>>> to move environment stuff out of include/configs/ if we can.  The half

>>> idea I'm toying with right now is include/environment/.... and making

>>> various fragments be included in env_default.h.

>>>

>>> I suppose to start with, we could move the TI-as-vendor-suggested DFU

>>> args there, once we have board/ti/Kconfig for the other

>>> TI-as-vendor-suggested stuff :)

>>

>> To be clear, you are asking for a new file

>> "include/environment/ti/omap.h" to be created and DFU args for TI's

>> OMAP-style platforms consolidated there in v2 of this patch series. Right?

> 

> Something inside of include/environment/ should be created, yes.  For

> the exact name(s), I think a re-read of all of the environment bits in

> include/configs/ti_* needs to be taken into consideration too, and the

> possibly used combinations there-of.  My first thought is that you'd

> want a dfu.h for the DFU related parts.  And something-else.h for other

> things and so forth.


Alright, I will start with dfu.h, and I guess over time we can move over
rest of the environment bits?

Thanks,
Sekhar
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig
index c95f45aca8b5..698c489552df 100644
--- a/configs/am57xx_evm_defconfig
+++ b/configs/am57xx_evm_defconfig
@@ -17,6 +17,7 @@  CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -36,6 +37,15 @@  CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_FIT=y
 CONFIG_SPL_OF_LIBFDT=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/am57xx_hs_evm_defconfig b/configs/am57xx_hs_evm_defconfig
index a4bfdd594e26..a7288bce51b8 100644
--- a/configs/am57xx_hs_evm_defconfig
+++ b/configs/am57xx_hs_evm_defconfig
@@ -18,6 +18,7 @@  CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -37,6 +38,15 @@  CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_FIT=y
 CONFIG_SPL_OF_LIBFDT=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 46e8d4cfd715..3d5ae1ae1d54 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -41,6 +41,47 @@ 
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+#define DFU_ALT_INFO_MMC \
+	"dfu_alt_info_mmc=" \
+	"boot part 0 1;" \
+	"rootfs part 0 2;" \
+	"MLO fat 0 1;" \
+	"MLO.raw raw 0x100 0x100;" \
+	"u-boot.img.raw raw 0x300 0x400;" \
+	"spl-os-args.raw raw 0x80 0x80;" \
+	"spl-os-image.raw raw 0x900 0x2000;" \
+	"spl-os-args fat 0 1;" \
+	"spl-os-image fat 0 1;" \
+	"u-boot.img fat 0 1;" \
+	"uEnv.txt fat 0 1\0"
+
+#define DFU_ALT_INFO_EMMC \
+	"dfu_alt_info_emmc=" \
+	"rawemmc raw 0 3751936;" \
+	"boot part 1 1;" \
+	"rootfs part 1 2;" \
+	"MLO fat 1 1;" \
+	"MLO.raw raw 0x100 0x100;" \
+	"u-boot.img.raw raw 0x300 0x400;" \
+	"spl-os-args.raw raw 0x80 0x80;" \
+	"spl-os-image.raw raw 0x900 0x2000;" \
+	"spl-os-args fat 1 1;" \
+	"spl-os-image fat 1 1;" \
+	"u-boot.img fat 1 1;" \
+	"uEnv.txt fat 1 1\0"
+
+#define DFU_ALT_INFO_RAM \
+	"dfu_alt_info_ram=" \
+	"kernel ram 0x80200000 0x4000000;" \
+	"fdt ram 0x80f80000 0x80000;" \
+	"ramdisk ram 0x81000000 0x4000000\0"
+
+#define DFUARGS \
+	"dfu_bufsiz=0x10000\0" \
+	DFU_ALT_INFO_MMC \
+	DFU_ALT_INFO_EMMC \
+	DFU_ALT_INFO_RAM \
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
@@ -70,6 +111,11 @@ 
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB3PHY1_HOST
 
+/* USB Device Firmware Update support */
+#define CONFIG_USB_FUNCTION_DFU
+#define CONFIG_DFU_RAM
+#define CONFIG_DFU_MMC
+
 /* SATA */
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_SCSI