[U-Boot] [PATCH 0/3] AM57x EVM: Enable USB DFU support

Hi,
Here is a patch series that enables USB DFU support on AM57x GP EVM.
Thanks, Sekhar
Sekhar Nori (3): configs: dra7xx: get rid of duplicate #define board: ti: am57xx-evm: fix build warnings ARM: am57xx_evm: enable DFU support
board/ti/am57xx/board.c | 20 ------------------ configs/am57xx_evm_defconfig | 10 +++++++++ configs/am57xx_hs_evm_defconfig | 10 +++++++++ include/configs/am57xx_evm.h | 46 +++++++++++++++++++++++++++++++++++++++++ include/configs/dra7xx_evm.h | 1 - 5 files changed, 66 insertions(+), 21 deletions(-)

CONFIG_DFU_RAM is repeated twice in dra7xx_evm.h file. Remove the duplicate.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- include/configs/dra7xx_evm.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index b66949f4155b..4ea993d3f5db 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -218,7 +218,6 @@
/* USB Device Firmware Update support */ #define CONFIG_USB_FUNCTION_DFU -#define CONFIG_DFU_RAM
#define CONFIG_DFU_MMC #define CONFIG_DFU_RAM

On Thursday 25 August 2016 08:44 PM, Sekhar Nori wrote:
CONFIG_DFU_RAM is repeated twice in dra7xx_evm.h file. Remove the duplicate.
Reviewed-by: Lokesh Vutla lokeshvutla@ti.com
Thanks and regards, Lokesh
Signed-off-by: Sekhar Nori nsekhar@ti.com
include/configs/dra7xx_evm.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index b66949f4155b..4ea993d3f5db 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -218,7 +218,6 @@
/* USB Device Firmware Update support */ #define CONFIG_USB_FUNCTION_DFU -#define CONFIG_DFU_RAM
#define CONFIG_DFU_MMC #define CONFIG_DFU_RAM

USB1 is not used on AM57xx GP EVM in device mode. Enabling DWC3 USB support for AM57xx EVM gives the following warnings:
CC board/ti/am57xx/board.o ../board/ti/am57xx/board.c:448:27: warning: 'usb_otg_ss1' defined but not used [-Wunused-variable] static struct dwc3_device usb_otg_ss1 = { ^ ../board/ti/am57xx/board.c:455:32: warning: 'usb_otg_ss1_glue' defined but not used [-Wunused-variable] static struct dwc3_omap_device usb_otg_ss1_glue = { ^ ../board/ti/am57xx/board.c:461:33: warning: 'usb_phy1_device' defined but not used [-Wunused-variable] static struct ti_usb_phy_device usb_phy1_device = {
Fix it by getting rid of USB1 related structures from board.c. They can be added back if there is a need for them.
Signed-off-by: Sekhar Nori nsekhar@ti.com --- board/ti/am57xx/board.c | 20 -------------------- 1 file changed, 20 deletions(-)
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 927d1364fe46..288ff346e0ca 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -445,26 +445,6 @@ int spl_start_uboot(void) #endif
#ifdef CONFIG_USB_DWC3 -static struct dwc3_device usb_otg_ss1 = { - .maximum_speed = USB_SPEED_SUPER, - .base = DRA7_USB_OTG_SS1_BASE, - .tx_fifo_resize = false, - .index = 0, -}; - -static struct dwc3_omap_device usb_otg_ss1_glue = { - .base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE, - .utmi_mode = DWC3_OMAP_UTMI_MODE_SW, - .index = 0, -}; - -static struct ti_usb_phy_device usb_phy1_device = { - .pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL, - .usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER, - .usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER, - .index = 0, -}; - static struct dwc3_device usb_otg_ss2 = { .maximum_speed = USB_SPEED_HIGH, .base = DRA7_USB_OTG_SS2_BASE,

On Thursday 25 August 2016 08:44 PM, Sekhar Nori wrote:
USB1 is not used on AM57xx GP EVM in device mode. Enabling DWC3 USB support for AM57xx EVM gives the following warnings:
CC board/ti/am57xx/board.o ../board/ti/am57xx/board.c:448:27: warning: 'usb_otg_ss1' defined but not used [-Wunused-variable] static struct dwc3_device usb_otg_ss1 = { ^ ../board/ti/am57xx/board.c:455:32: warning: 'usb_otg_ss1_glue' defined but not used [-Wunused-variable] static struct dwc3_omap_device usb_otg_ss1_glue = { ^ ../board/ti/am57xx/board.c:461:33: warning: 'usb_phy1_device' defined but not used [-Wunused-variable] static struct ti_usb_phy_device usb_phy1_device = {
Fix it by getting rid of USB1 related structures from board.c. They can be added back if there is a need for them.
Reviewed-by: Lokesh Vutla lokeshvutla@ti.com
Thanks and regards, Lokesh
Signed-off-by: Sekhar Nori nsekhar@ti.com
board/ti/am57xx/board.c | 20 -------------------- 1 file changed, 20 deletions(-)
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 927d1364fe46..288ff346e0ca 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -445,26 +445,6 @@ int spl_start_uboot(void) #endif
#ifdef CONFIG_USB_DWC3 -static struct dwc3_device usb_otg_ss1 = {
- .maximum_speed = USB_SPEED_SUPER,
- .base = DRA7_USB_OTG_SS1_BASE,
- .tx_fifo_resize = false,
- .index = 0,
-};
-static struct dwc3_omap_device usb_otg_ss1_glue = {
- .base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE,
- .utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
- .index = 0,
-};
-static struct ti_usb_phy_device usb_phy1_device = {
- .pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL,
- .usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER,
- .usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER,
- .index = 0,
-};
static struct dwc3_device usb_otg_ss2 = { .maximum_speed = USB_SPEED_HIGH, .base = DRA7_USB_OTG_SS2_BASE,

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(+)
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

[..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.
Thanks and regards, Lokesh

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?
Thanks and regards, Lokesh
Thanks and regards, Lokesh

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

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

On Friday 26 August 2016 11:23 AM, Sekhar Nori wrote:
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.
As Kishon mentioned on the other thread, Tom objected to this idea saying this is dependent on board.
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.
Well, I do agree it is board dependent, but most of the OMAP based TI platforms follow the same convention regarding DFU args. (keystone has a bit different). So, I would suggest to move it to ti_armv7_omap.h. Tom, are you ok with this?
Thanks and regards, Lokesh
Thanks, Sekhar

On Fri, Aug 26, 2016 at 06:33:31PM +0530, Lokesh Vutla wrote:
On Friday 26 August 2016 11:23 AM, Sekhar Nori wrote:
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.
As Kishon mentioned on the other thread, Tom objected to this idea saying this is dependent on board.
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.
Well, I do agree it is board dependent, but most of the OMAP based TI platforms follow the same convention regarding DFU args. (keystone has a bit different). So, I would suggest to move it to ti_armv7_omap.h. Tom, are you ok with this?
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 :)

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

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.

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

On Tue, Aug 30, 2016 at 04:55:35PM +0530, Sekhar Nori wrote:
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?
Yeah, we don't have to do all of the environment stuff at first, but it does need to be moved as that's kind of the final blocker to 100% Kconfig migration, long term :)
participants (4)
-
Kishon Vijay Abraham I
-
Lokesh Vutla
-
Sekhar Nori
-
Tom Rini