[U-Boot] [PATCH 0/4] arm:goni: Update GONI configuration

Samsung's GONI target has been updated to support: - New GPT partition layout - USB Mass Storage Gadget - DFU support - Loading uImage from eMMC not OneNAND
Arkadiusz Wlodarczyk (4): arm:goni: Update configuration for goni target arm:goni:dfu Add support for DFU at GONI target arm:goni: Update of GONI partitioning scheme at eMMC arm:goni: Add support for USB mass storage
board/samsung/goni/goni.c | 75 +++++++++++++++++++++++++++++++++++++ include/configs/s5p_goni.h | 88 ++++++++++++++++++++++++++++++++------------ 2 files changed, 139 insertions(+), 24 deletions(-)

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Configuration file for GONI has been updated to support FAT file system, new mmc partitioning scheme and read linux kernel from eMMC instead of OneNAND.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- include/configs/s5p_goni.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 56e8347..ec43652 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -107,7 +107,7 @@
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
-#define CONFIG_BOOTCOMMAND "run ubifsboot" +#define CONFIG_BOOTCOMMAND "run mmcboot"
#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
@@ -137,7 +137,7 @@ "onenand erase 0x01560000 0x1eaa0000;" \ "onenand write 0x32000000 0x1260000 0x8C0000\0" \ "bootk=" \ - "onenand read 0x30007FC0 0xc00000 0x600000;" \ + "run loaduimage;" \ "bootm 0x30007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \ @@ -156,16 +156,21 @@ "set bootargs " CONFIG_RAMDISK_BOOT \ " initrd=0x33000000,8M ramdisk=8192\0" \ "mmcboot=" \ - "set bootargs root=${mmcblk} rootfstype=${rootfstype}" \ + "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ + "rootfstype=${rootfstype}" \ CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \ CONFIG_COMMON_BOOT "; run bootk\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "verify=n\0" \ - "rootfstype=cramfs\0" \ + "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \ + "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ + "mmcdev=0\0" \ + "mmcbootpart=2\0" \ + "mmcrootpart=5\0" \ "mmcblk=/dev/mmcblk1p1\0" \ "bootblock=9\0" \ "ubiblock=8\0" \ @@ -211,6 +216,10 @@
#define CONFIG_DOS_PARTITION 1
+/* FAT */ +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE + #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_SYS_CACHELINE_SIZE 64

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, }; + +void board_usb_init(void) +{ + debug("USB_udc_probe\n"); + s3c_udc_probe(&s5pc110_otg_data); +} + #endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU + +/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC + +/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \ + "u-boot mmc 80 400;" \ + "uImage fat 0 2\0" \ + #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \ - "opts=always_resume=1" + "opts=always_resume=1\0" \ + "dfu_alt_info=" CONFIG_DFU_ALT +
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */

Hi Lukasz,
I put the dfu support into am335x board even i able to download all images from dfu-util, but when i trying to upload images, (from dfu devices to PC), my system failed.
Could you tell me what is the problem and where should i look into?
Thanks & Regards ~Sumit gemini
On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski l.majewski@samsung.comwrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Sumit,
Hi Lukasz,
I put the dfu support into am335x board even i able to download
all images from dfu-util, but when i trying to upload images, (from dfu devices to PC), my system failed.
Could you tell me what is the problem and where should i look into?
Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend). I've checked and fixed problem with dfu write yesterday (also with eMMC).
Recently the dfu subsystem has been reworked to get rid of fixed buffer size, so please regard it as "under heavy development".
I will look into this problem (for eMMC, not NAND - since my Trats doesn't have NAND memory).
BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian 5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work with current dfu code).
Thanks & Regards ~Sumit gemini
On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski l.majewski@samsung.comwrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Lukasz,
My dfu version is 1.0 and am using SPI flash NOR. downloading is fine but uploading failed.
I am trying lot to upload binary from dfu-device to pc but not able to do that.
I am facing following error :-
when i apply dfu-util -v -a u-boot -U dfu-UBOOT from my host machine,
I got such log on Host machine :-
Device returned transfer size 4096 bytes_per_hash=4096 Copying data from DFU device to PC Starting upload: [] finished! Received a total of 1 bytes
and finally dfu-SPL file created with 4kb size.
but on target machine, i got
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory.
May i know why i got such error or user have to specify address over which we read our binary.
Any help will appreciate and if any body has related pointer, please let me know, I have stuck in this error.
and further more,
After analyzing a lot, i got a function "dfu_upload" in dfu.c file, calling another function "libusb_control_transfer" which return only 1, might be it is not getting interface, because when i pass
dfu-util -a u-boot -U SPL-uboot in host machine
i got in target machine :-
SF: Detected N25Q256 with page size 64 KiB, total 32 MiB
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory
So, how can i analyze flash memory, why it is getting fail to map itself with physical memory.
Thanks
On Tue, Jun 25, 2013 at 12:14 PM, Lukasz Majewski l.majewski@samsung.comwrote:
Hi Sumit,
Hi Lukasz,
I put the dfu support into am335x board even i able to download
all images from dfu-util, but when i trying to upload images, (from dfu devices to PC), my system failed.
Could you tell me what is the problem and where should i look into?
Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend). I've checked and fixed problem with dfu write yesterday (also with eMMC).
Recently the dfu subsystem has been reworked to get rid of fixed buffer size, so please regard it as "under heavy development".
I will look into this problem (for eMMC, not NAND - since my Trats doesn't have NAND memory).
BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian 5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work with current dfu code).
Thanks & Regards ~Sumit gemini
On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski l.majewski@samsung.comwrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
-- Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

Hi Sumit,
Hi Lukasz,
My dfu version is 1.0 and am using SPI flash NOR. downloading is
fine but uploading failed.
I am trying lot to upload binary from dfu-device to pc but not
able to do that.
I am facing following error :- when i apply dfu-util -v -a u-boot -U dfu-UBOOT from my host
machine,
I got such log on Host machine :-
Device returned transfer size 4096 bytes_per_hash=4096 Copying data from DFU device to PC Starting upload: [] finished! Received a total of 1 bytes
and finally dfu-SPL file created with 4kb size.
Why dfu-SPL? Not dfu-BOOT? (you are calling the dfu-util command with -U dfu-UBOOT)
but on target machine, i got
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory.
I'm not the right person to answer. You ought to ask Tom Rini or other developers involved in flash development (e.g. Pantelis, Heiko).
May i know why i got such error or user have to specify address over which we read our binary.
Any help will appreciate and if any body has related pointer, please let me know, I have stuck in this error.
and further more,
After analyzing a lot, i got a function "dfu_upload" in dfu.c file, calling another function "libusb_control_transfer" which return only 1, might be it is not getting interface, because when i pass
dfu-util -a u-boot -U SPL-uboot in host machine
i got in target machine :-
SF: Detected N25Q256 with page size 64 KiB, total 32 MiB
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory
So, how can i analyze flash memory, why it is getting fail to map itself with physical memory.
What I can do is to check if the USB gadget DFU layer works with upload. With the NAND backend I'm not able to help much here (I don't have NAND memory on my targets).
Thanks
On Tue, Jun 25, 2013 at 12:14 PM, Lukasz Majewski l.majewski@samsung.comwrote:
Hi Sumit,
Hi Lukasz,
I put the dfu support into am335x board even i able to
download all images from dfu-util, but when i trying to upload images, (from dfu devices to PC), my system failed.
Could you tell me what is the problem and where should i look into?
Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend). I've checked and fixed problem with dfu write yesterday (also with eMMC).
Recently the dfu subsystem has been reworked to get rid of fixed buffer size, so please regard it as "under heavy development".
I will look into this problem (for eMMC, not NAND - since my Trats doesn't have NAND memory).
BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian 5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work with current dfu code).
Thanks & Regards ~Sumit gemini
On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski l.majewski@samsung.comwrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
-- Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

Hi Lukasz,
sorry i just copy and paste that...
"why dfu-SPL? Not dfu-BOOT"
dfu-Boot will come instead of dfu-SPL
and thanks for help, i talk to Pantelis, Heiko for the same. Thanks & Regards ~Sumit Gemini
On Tue, Jun 25, 2013 at 1:05 PM, Lukasz Majewski l.majewski@samsung.comwrote:
Hi Sumit,
Hi Lukasz,
My dfu version is 1.0 and am using SPI flash NOR. downloading is
fine but uploading failed.
I am trying lot to upload binary from dfu-device to pc but not
able to do that.
I am facing following error :- when i apply dfu-util -v -a u-boot -U dfu-UBOOT from my host
machine,
I got such log on Host machine :-
Device returned transfer size 4096 bytes_per_hash=4096 Copying data from DFU device to PC Starting upload: [] finished! Received a total of 1 bytes
and finally dfu-SPL file created with 4kb size.
Why dfu-SPL? Not dfu-BOOT? (you are calling the dfu-util command with -U dfu-UBOOT)
but on target machine, i got
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory.
I'm not the right person to answer. You ought to ask Tom Rini or other developers involved in flash development (e.g. Pantelis, Heiko).
May i know why i got such error or user have to specify address over which we read our binary.
Any help will appreciate and if any body has related pointer, please let me know, I have stuck in this error.
and further more,
After analyzing a lot, i got a function "dfu_upload" in dfu.c file, calling another function "libusb_control_transfer" which return only 1, might be it is not getting interface, because when i pass
dfu-util -a u-boot -U SPL-uboot in host machine
i got in target machine :-
SF: Detected N25Q256 with page size 64 KiB, total 32 MiB
Running: sf read 0x00000000 0x20000 0x0 Failed to map physical memory
So, how can i analyze flash memory, why it is getting fail to map itself with physical memory.
What I can do is to check if the USB gadget DFU layer works with upload. With the NAND backend I'm not able to help much here (I don't have NAND memory on my targets).
Thanks
On Tue, Jun 25, 2013 at 12:14 PM, Lukasz Majewski l.majewski@samsung.comwrote:
Hi Sumit,
Hi Lukasz,
I put the dfu support into am335x board even i able to
download all images from dfu-util, but when i trying to upload images, (from dfu devices to PC), my system failed.
Could you tell me what is the problem and where should i look into?
Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend). I've checked and fixed problem with dfu write yesterday (also with eMMC).
Recently the dfu subsystem has been reworked to get rid of fixed buffer size, so please regard it as "under heavy development".
I will look into this problem (for eMMC, not NAND - since my Trats doesn't have NAND memory).
BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian 5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work with current dfu code).
Thanks & Regards ~Sumit gemini
On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski l.majewski@samsung.comwrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
-- Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
-- Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

On 25/06/13 00:36, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
- debug("USB_udc_probe\n");
- s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
- "u-boot mmc 80 400;" \
- "uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
- "opts=always_resume=1"
- "opts=always_resume=1\0" \
- "dfu_alt_info=" CONFIG_DFU_ALT
please remove this blank line.
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
Thanks, Minkyu Kang.

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
--- Changes for v2: - Remove blank line --- board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, }; + +void board_usb_init(void) +{ + debug("USB_udc_probe\n"); + s3c_udc_probe(&s5pc110_otg_data); +} + #endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU + +/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC + +/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \ + "u-boot mmc 80 400;" \ + "uImage fat 0 2\0" \ + #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \ - "opts=always_resume=1" + "opts=always_resume=1\0" \ + "dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */

On 26/06/13 19:23, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
Changes for v2:
- Remove blank line
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
- debug("USB_udc_probe\n");
- s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
- "u-boot mmc 80 400;" \
- "uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
- "opts=always_resume=1"
- "opts=always_resume=1\0" \
- "dfu_alt_info=" CONFIG_DFU_ALT
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
failed to apply your patch.
$ git am -s U-Boot-2-4-arm-goni-dfu-Add-support-for-DFU-at-GONI-target.patch Applying: arm:goni:dfu Add support for DFU at GONI target fatal: corrupt patch at line 75 Patch failed at 0001 arm:goni:dfu Add support for DFU at GONI target
$ patch --dry-run -p1 < U-Boot-2-4-arm-goni-dfu-Add-support-for-DFU-at-GONI-target.patch patching file board/samsung/goni/goni.c patching file include/configs/s5p_goni.h patch: **** malformed patch at line 99: @@ -242,5 +259,6 @@
please check.
Thanks, Minkyu Kang.

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
New partitioning scheme has been defined at GONI target. It complies with new GPT partitioning introduced previously.
Default partition layout has been defined at s5p_goni.h
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- include/configs/s5p_goni.h | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 8a824c7..e8f2639 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -84,9 +84,9 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_REGINFO #define CONFIG_CMD_ONENAND -#define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC #define CONFIG_CMD_DFU +#define CONFIG_CMD_GPT
/* USB Composite download gadget - g_dnl */ #define CONFIG_USBDOWNLOAD_GADGET @@ -101,26 +101,30 @@ #define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK
-#define CONFIG_MTD_DEVICE -#define CONFIG_MTD_PARTITIONS - -/* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */ -#define MTDIDS_DEFAULT "onenand0=samsung-onenand" -#define MTDPARTS_DEFAULT "mtdparts=samsung-onenand:1m(bootloader)"\ - ",256k(params)"\ - ",2816k(config)"\ - ",8m(csa)"\ - ",7m(kernel)"\ - ",1m(log)"\ - ",12m(modem)"\ - ",60m(qboot)"\ - ",-(UBI)\0" - #define CONFIG_DFU_ALT \ "u-boot mmc 80 400;" \ "uImage fat 0 2\0" \
-#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT +/* partitions definitions */ +#define PARTS_CSA "csa-mmc" +#define PARTS_BOOTLOADER "u-boot" +#define PARTS_BOOT "boot" +#define PARTS_ROOT "platform" +#define PARTS_DATA "data" +#define PARTS_CSC "csc" +#define PARTS_UMS "ums" + +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ + "name="PARTS_BOOTLOADER",size=60MiB," \ + "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \ + "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ + "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ + "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ + "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ + "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ +
#define CONFIG_BOOTCOMMAND "run mmcboot"
@@ -180,12 +184,12 @@ "verify=n\0" \ "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ - "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \ "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ "mmcdev=0\0" \ "mmcbootpart=2\0" \ "mmcrootpart=5\0" \ + "partitions=" PARTS_DEFAULT \ "mmcblk=/dev/mmcblk1p1\0" \ "bootblock=9\0" \ "ubiblock=8\0" \ @@ -237,6 +241,10 @@ #define CONFIG_CMD_FAT #define CONFIG_FAT_WRITE
+/* GPT */ +#define CONFIG_EFI_PARTITION +#define CONFIG_PARTITION_UUIDS + #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_SYS_CACHELINE_SIZE 64

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
This commit enables support for USB mass storage composite function. It defines platform code and enables it at config file.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- board/samsung/goni/goni.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/s5p_goni.h | 5 ++++ 2 files changed, 73 insertions(+)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 3c53106..a09daca 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -29,6 +29,7 @@ #include <usb/s3c_udc.h> #include <asm/arch/cpu.h> #include <power/max8998_pmic.h> +#include <usb_mass_storage.h> DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio; @@ -163,3 +164,70 @@ void board_usb_init(void) }
#endif + +#ifdef CONFIG_USB_GADGET_MASS_STORAGE +static int ums_read_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, void *buf) +{ + if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static int ums_write_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, const void *buf) +{ + if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static void ums_get_capacity(struct ums_device *ums_dev, + long long int *capacity) +{ + long long int tmp_capacity; + + tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size) + * SECTOR_SIZE); + *capacity = ums_dev->mmc->capacity - tmp_capacity; +} + +static struct ums_board_info ums_board = { + .read_sector = ums_read_sector, + .write_sector = ums_write_sector, + .get_capacity = ums_get_capacity, + .name = "GONI UMS disk", + .ums_dev = { + .mmc = NULL, + .dev_num = 0, + .offset = 0, + .part_size = 0. + }, +}; + +struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int offset, + unsigned int part_size) +{ + struct mmc *mmc; + + mmc = find_mmc_device(dev_num); + /* mmc initialization is necessary prior to the ums command usage + * due to fact that on goni target environment is read from oneNand + * memory, so the mmc remains uninitialized whenu-boot prompt appears + * */ + if (!mmc || mmc_init(mmc)) + return NULL; + + ums_board.ums_dev.mmc = mmc; + ums_board.ums_dev.dev_num = dev_num; + ums_board.ums_dev.offset = offset; + ums_board.ums_dev.part_size = part_size; + + return &ums_board; +} + +#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index e8f2639..1cfbb88 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -269,4 +269,9 @@ #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_CMD_USB_MASS_STORAGE +#if defined(CONFIG_CMD_USB_MASS_STORAGE) +#define CONFIG_USB_GADGET_MASS_STORAGE +#endif + #endif /* __CONFIG_H */

Samsung's GONI target has been updated to support: - New GPT partition layout - USB Mass Storage Gadget - DFU support - Loading uImage from eMMC not OneNAND
Arkadiusz Wlodarczyk (4): arm:goni: Update configuration for goni target arm:goni:dfu Add support for DFU at GONI target arm:goni: Update of GONI partitioning scheme at eMMC arm:goni: Add support for USB mass storage
board/samsung/goni/goni.c | 75 +++++++++++++++++++++++++++++++++++++ include/configs/s5p_goni.h | 88 ++++++++++++++++++++++++++++++++------------ 2 files changed, 139 insertions(+), 24 deletions(-)

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Configuration file for GONI has been updated to support FAT file system, new mmc partitioning scheme and read linux kernel from eMMC instead of OneNAND.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- include/configs/s5p_goni.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 56e8347..ec43652 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -107,7 +107,7 @@
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
-#define CONFIG_BOOTCOMMAND "run ubifsboot" +#define CONFIG_BOOTCOMMAND "run mmcboot"
#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
@@ -137,7 +137,7 @@ "onenand erase 0x01560000 0x1eaa0000;" \ "onenand write 0x32000000 0x1260000 0x8C0000\0" \ "bootk=" \ - "onenand read 0x30007FC0 0xc00000 0x600000;" \ + "run loaduimage;" \ "bootm 0x30007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \ @@ -156,16 +156,21 @@ "set bootargs " CONFIG_RAMDISK_BOOT \ " initrd=0x33000000,8M ramdisk=8192\0" \ "mmcboot=" \ - "set bootargs root=${mmcblk} rootfstype=${rootfstype}" \ + "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ + "rootfstype=${rootfstype}" \ CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \ CONFIG_COMMON_BOOT "; run bootk\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "verify=n\0" \ - "rootfstype=cramfs\0" \ + "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \ + "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ + "mmcdev=0\0" \ + "mmcbootpart=2\0" \ + "mmcrootpart=5\0" \ "mmcblk=/dev/mmcblk1p1\0" \ "bootblock=9\0" \ "ubiblock=8\0" \ @@ -211,6 +216,10 @@
#define CONFIG_DOS_PARTITION 1
+/* FAT */ +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE + #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_SYS_CACHELINE_SIZE 64

On 07/04/2013 07:52 PM, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Configuration file for GONI has been updated to support FAT file system, new mmc partitioning scheme and read linux kernel from eMMC instead of OneNAND.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
include/configs/s5p_goni.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 56e8347..ec43652 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -107,7 +107,7 @@
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
-#define CONFIG_BOOTCOMMAND "run ubifsboot" +#define CONFIG_BOOTCOMMAND "run mmcboot"
#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
@@ -137,7 +137,7 @@ "onenand erase 0x01560000 0x1eaa0000;" \ "onenand write 0x32000000 0x1260000 0x8C0000\0" \ "bootk=" \
"onenand read 0x30007FC0 0xc00000 0x600000;" \
"bootm 0x30007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \"run loaduimage;" \
@@ -156,16 +156,21 @@ "set bootargs " CONFIG_RAMDISK_BOOT \ " initrd=0x33000000,8M ramdisk=8192\0" \ "mmcboot=" \
"set bootargs root=${mmcblk} rootfstype=${rootfstype}" \
"set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
"rootfstype=${rootfstype}" \
Could you add the "rootwait"?
CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \ CONFIG_COMMON_BOOT "; run bootk\0" \
"boottrace=setenv opts initcall_debug; run bootcmd\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "verify=n\0" \
- "rootfstype=cramfs\0" \
- "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \
- "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
- "mmcdev=0\0" \
- "mmcbootpart=2\0" \
- "mmcrootpart=5\0" \ "mmcblk=/dev/mmcblk1p1\0" \
mmcblk can be removed?
Best Regards, Jaehoon Chung
"bootblock=9\0" \ "ubiblock=8\0" \ @@ -211,6 +216,10 @@
#define CONFIG_DOS_PARTITION 1
+/* FAT */ +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_SYS_CACHELINE_SIZE 64

On Fri, 05 Jul 2013 13:17:07 +0900, Jaehoon Chung wrote:
On 07/04/2013 07:52 PM, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Configuration file for GONI has been updated to support FAT file system, new mmc partitioning scheme and read linux kernel from eMMC instead of OneNAND.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
include/configs/s5p_goni.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 56e8347..ec43652 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -107,7 +107,7 @@
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
-#define CONFIG_BOOTCOMMAND "run ubifsboot" +#define CONFIG_BOOTCOMMAND "run mmcboot"
#define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
@@ -137,7 +137,7 @@ "onenand erase 0x01560000 0x1eaa0000;" \ "onenand write 0x32000000 0x1260000 0x8C0000\0" \ "bootk=" \
"onenand read 0x30007FC0 0xc00000 0x600000;" \
"bootm 0x30007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \"run loaduimage;" \
@@ -156,16 +156,21 @@ "set bootargs " CONFIG_RAMDISK_BOOT \ " initrd=0x33000000,8M ramdisk=8192\0" \ "mmcboot=" \
"set bootargs root=${mmcblk}
rootfstype=${rootfstype}" \
"set bootargs
root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
"rootfstype=${rootfstype}" \
Could you add the "rootwait"?
Yes, correct. Thanks for pointing.
CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \ CONFIG_COMMON_BOOT "; run bootk\0" \
"boottrace=setenv opts initcall_debug; run bootcmd\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "verify=n\0" \
- "rootfstype=cramfs\0" \
- "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000
mem=128M@0x50000000\0" \
- "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart}
0x30007FC0 uImage\0" \
- "mmcdev=0\0" \
- "mmcbootpart=2\0" \
- "mmcrootpart=5\0" \ "mmcblk=/dev/mmcblk1p1\0" \
mmcblk can be removed?
Yes, it seems redundant here.
Best Regards, Jaehoon Chung
"bootblock=9\0" \ "ubiblock=8\0" \ @@ -211,6 +216,10 @@
#define CONFIG_DOS_PARTITION 1
+/* FAT */ +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000) #define CONFIG_SYS_CACHELINE_SIZE 64
Thanks for review.

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, }; + +void board_usb_init(void) +{ + debug("USB_udc_probe\n"); + s3c_udc_probe(&s5pc110_otg_data); +} + #endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU + +/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC + +/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \ + "u-boot mmc 80 400;" \ + "uImage fat 0 2\0" \ + #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \ - "opts=always_resume=1" + "opts=always_resume=1\0" \ + "dfu_alt_info=" CONFIG_DFU_ALT +
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */

Dear Lukasz,
On 4 July 2013 19:52, Lukasz Majewski l.majewski@samsung.com wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
Please add change log here. And this patch seem version 3 (or 2?), but you did not mention it.
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
seems redundant blank line.
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Thanks, Minkyu Kang.

On Sun, 07 Jul 2013 14:48:18 +0900, Minkyu Kang wrote:
Dear Minkyu,
Dear Lukasz,
On 4 July 2013 19:52, Lukasz Majewski l.majewski@samsung.com wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
Please add change log here. And this patch seem version 3 (or 2?), but you did not mention it.
To be honest it is RESEND to v2 of this patch. Since v2 didn't applied to u-boot-samsung/master branch.
Why I did resend? You have only replied on the PATCH 2/4 and I thought that other patches are still under review. I didn't want to send v3 over patches which might be under review.
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
seems redundant blank line.
Ok.
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Thanks, Minkyu Kang.

On 08/07/13 15:19, Lukasz Majewski wrote:
On Sun, 07 Jul 2013 14:48:18 +0900, Minkyu Kang wrote:
Dear Minkyu,
Dear Lukasz,
On 4 July 2013 19:52, Lukasz Majewski l.majewski@samsung.com wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
Please add change log here. And this patch seem version 3 (or 2?), but you did not mention it.
To be honest it is RESEND to v2 of this patch. Since v2 didn't applied to u-boot-samsung/master branch.
why you resend v1 patch?
Why I did resend? You have only replied on the PATCH 2/4 and I thought that other patches are still under review. I didn't want to send v3 over patches which might be under review.
Suit yourself.
board/samsung/goni/goni.c | 7 +++++++ include/configs/s5p_goni.h | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ff76963..3c53106 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, };
+void board_usb_init(void) +{
debug("USB_udc_probe\n");
s3c_udc_probe(&s5pc110_otg_data);
+}
#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index ec43652..8a824c7 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -86,6 +86,17 @@ #define CONFIG_CMD_ONENAND #define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU
+/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC
+/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
#define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK @@ -105,6 +116,10 @@ ",60m(qboot)"\ ",-(UBI)\0"
+#define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
#define CONFIG_BOOTCOMMAND "run mmcboot" @@ -175,7 +190,9 @@ "bootblock=9\0" \ "ubiblock=8\0" \ "ubi=enabled\0" \
"opts=always_resume=1"
"opts=always_resume=1\0" \
"dfu_alt_info=" CONFIG_DFU_ALT
seems redundant blank line.
Ok.
/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */ @@ -242,5 +259,6 @@ #define CONFIG_USB_GADGET #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_VBUS_DRAW 2
#endif /* __CONFIG_H */
1.7.10.4
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Thanks, Minkyu Kang.

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
New partitioning scheme has been defined at GONI target. It complies with new GPT partitioning introduced previously.
Default partition layout has been defined at s5p_goni.h
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- include/configs/s5p_goni.h | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 8a824c7..e8f2639 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -84,9 +84,9 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_REGINFO #define CONFIG_CMD_ONENAND -#define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC #define CONFIG_CMD_DFU +#define CONFIG_CMD_GPT
/* USB Composite download gadget - g_dnl */ #define CONFIG_USBDOWNLOAD_GADGET @@ -101,26 +101,30 @@ #define CONFIG_BOOTDELAY 1 #define CONFIG_ZERO_BOOTDELAY_CHECK
-#define CONFIG_MTD_DEVICE -#define CONFIG_MTD_PARTITIONS - -/* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */ -#define MTDIDS_DEFAULT "onenand0=samsung-onenand" -#define MTDPARTS_DEFAULT "mtdparts=samsung-onenand:1m(bootloader)"\ - ",256k(params)"\ - ",2816k(config)"\ - ",8m(csa)"\ - ",7m(kernel)"\ - ",1m(log)"\ - ",12m(modem)"\ - ",60m(qboot)"\ - ",-(UBI)\0" - #define CONFIG_DFU_ALT \ "u-boot mmc 80 400;" \ "uImage fat 0 2\0" \
-#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT +/* partitions definitions */ +#define PARTS_CSA "csa-mmc" +#define PARTS_BOOTLOADER "u-boot" +#define PARTS_BOOT "boot" +#define PARTS_ROOT "platform" +#define PARTS_DATA "data" +#define PARTS_CSC "csc" +#define PARTS_UMS "ums" + +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ + "name="PARTS_BOOTLOADER",size=60MiB," \ + "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \ + "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ + "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ + "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ + "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ + "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ +
#define CONFIG_BOOTCOMMAND "run mmcboot"
@@ -180,12 +184,12 @@ "verify=n\0" \ "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ - "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \ "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ "mmcdev=0\0" \ "mmcbootpart=2\0" \ "mmcrootpart=5\0" \ + "partitions=" PARTS_DEFAULT \ "mmcblk=/dev/mmcblk1p1\0" \ "bootblock=9\0" \ "ubiblock=8\0" \ @@ -237,6 +241,10 @@ #define CONFIG_CMD_FAT #define CONFIG_FAT_WRITE
+/* GPT */ +#define CONFIG_EFI_PARTITION +#define CONFIG_PARTITION_UUIDS + #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
#define CONFIG_SYS_CACHELINE_SIZE 64

From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
This commit enables support for USB mass storage composite function. It defines platform code and enables it at config file.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com --- board/samsung/goni/goni.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/s5p_goni.h | 5 ++++ 2 files changed, 73 insertions(+)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 3c53106..a09daca 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -29,6 +29,7 @@ #include <usb/s3c_udc.h> #include <asm/arch/cpu.h> #include <power/max8998_pmic.h> +#include <usb_mass_storage.h> DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio; @@ -163,3 +164,70 @@ void board_usb_init(void) }
#endif + +#ifdef CONFIG_USB_GADGET_MASS_STORAGE +static int ums_read_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, void *buf) +{ + if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static int ums_write_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, const void *buf) +{ + if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static void ums_get_capacity(struct ums_device *ums_dev, + long long int *capacity) +{ + long long int tmp_capacity; + + tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size) + * SECTOR_SIZE); + *capacity = ums_dev->mmc->capacity - tmp_capacity; +} + +static struct ums_board_info ums_board = { + .read_sector = ums_read_sector, + .write_sector = ums_write_sector, + .get_capacity = ums_get_capacity, + .name = "GONI UMS disk", + .ums_dev = { + .mmc = NULL, + .dev_num = 0, + .offset = 0, + .part_size = 0. + }, +}; + +struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int offset, + unsigned int part_size) +{ + struct mmc *mmc; + + mmc = find_mmc_device(dev_num); + /* mmc initialization is necessary prior to the ums command usage + * due to fact that on goni target environment is read from oneNand + * memory, so the mmc remains uninitialized whenu-boot prompt appears + * */ + if (!mmc || mmc_init(mmc)) + return NULL; + + ums_board.ums_dev.mmc = mmc; + ums_board.ums_dev.dev_num = dev_num; + ums_board.ums_dev.offset = offset; + ums_board.ums_dev.part_size = part_size; + + return &ums_board; +} + +#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index e8f2639..1cfbb88 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -269,4 +269,9 @@ #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_CMD_USB_MASS_STORAGE +#if defined(CONFIG_CMD_USB_MASS_STORAGE) +#define CONFIG_USB_GADGET_MASS_STORAGE +#endif + #endif /* __CONFIG_H */

On 04/07/13 19:52, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com
This commit enables support for USB mass storage composite function. It defines platform code and enables it at config file.
Signed-off-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Tested-by: Arkadiusz Wlodarczyk a.wlodarczyk@samsung.com Cc: Minkyu Kang mk7.kang@samsung.com
board/samsung/goni/goni.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/s5p_goni.h | 5 ++++ 2 files changed, 73 insertions(+)
please run checkpatch before submitting.
CHECK: Alignment should match open parenthesis #51: FILE: board/samsung/goni/goni.c:173: + if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt)
CHECK: Alignment should match open parenthesis #61: FILE: board/samsung/goni/goni.c:183: + if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num, + start + ums_dev->offset, blkcnt, buf) != blkcnt)
total: 0 errors, 0 warnings, 2 checks, 86 lines checked
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 3c53106..a09daca 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -29,6 +29,7 @@ #include <usb/s3c_udc.h> #include <asm/arch/cpu.h> #include <power/max8998_pmic.h> +#include <usb_mass_storage.h> DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio; @@ -163,3 +164,70 @@ void board_usb_init(void) }
#endif
+#ifdef CONFIG_USB_GADGET_MASS_STORAGE +static int ums_read_sector(struct ums_device *ums_dev,
ulong start, lbaint_t blkcnt, void *buf)
+{
- if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
return -1;
- return 0;
+}
+static int ums_write_sector(struct ums_device *ums_dev,
ulong start, lbaint_t blkcnt, const void *buf)
+{
- if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
return -1;
indentation error.
- return 0;
+}
+static void ums_get_capacity(struct ums_device *ums_dev,
long long int *capacity)
+{
- long long int tmp_capacity;
- tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size)
* SECTOR_SIZE);
- *capacity = ums_dev->mmc->capacity - tmp_capacity;
+}
+static struct ums_board_info ums_board = {
- .read_sector = ums_read_sector,
- .write_sector = ums_write_sector,
- .get_capacity = ums_get_capacity,
- .name = "GONI UMS disk",
- .ums_dev = {
.mmc = NULL,
.dev_num = 0,
.offset = 0,
.part_size = 0.
- },
+};
+struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int offset,
unsigned int part_size)
+{
- struct mmc *mmc;
- mmc = find_mmc_device(dev_num);
- /* mmc initialization is necessary prior to the ums command usage
* due to fact that on goni target environment is read from oneNand
* memory, so the mmc remains uninitialized whenu-boot prompt appears
* */
- if (!mmc || mmc_init(mmc))
return NULL;
- ums_board.ums_dev.mmc = mmc;
- ums_board.ums_dev.dev_num = dev_num;
- ums_board.ums_dev.offset = offset;
- ums_board.ums_dev.part_size = part_size;
- return &ums_board;
+}
+#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index e8f2639..1cfbb88 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -269,4 +269,9 @@ #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_CMD_USB_MASS_STORAGE +#if defined(CONFIG_CMD_USB_MASS_STORAGE)
unnecessary ifdef. this file is board specific and we already knew that CONFIG_CMD_USB_MASS_STORAGE is defined.
+#define CONFIG_USB_GADGET_MASS_STORAGE +#endif
#endif /* __CONFIG_H */

On Monday, July 8, 2013, Minkyu Kang wrote:
On 04/07/13 19:52, Lukasz Majewski wrote:
From: Arkadiusz Wlodarczyk <a.wlodarczyk@samsung.com javascript:;>
This commit enables support for USB mass storage composite function. It defines platform code and enables it at config file.
Signed-off-by: Arkadiusz Wlodarczyk <a.wlodarczyk@samsung.comjavascript:;
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com javascript:;> Tested-by: Arkadiusz Wlodarczyk <a.wlodarczyk@samsung.com javascript:;
Cc: Minkyu Kang <mk7.kang@samsung.com javascript:;>
board/samsung/goni/goni.c | 68
++++++++++++++++++++++++++++++++++++++++++++
include/configs/s5p_goni.h | 5 ++++ 2 files changed, 73 insertions(+)
please run checkpatch before submitting.
CHECK: Alignment should match open parenthesis #51: FILE: board/samsung/goni/goni.c:173:
if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
CHECK: Alignment should match open parenthesis #61: FILE: board/samsung/goni/goni.c:183:
if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
total: 0 errors, 0 warnings, 2 checks, 86 lines checked
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 3c53106..a09daca 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -29,6 +29,7 @@ #include <usb/s3c_udc.h> #include <asm/arch/cpu.h> #include <power/max8998_pmic.h> +#include <usb_mass_storage.h> DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio; @@ -163,3 +164,70 @@ void board_usb_init(void) }
#endif
+#ifdef CONFIG_USB_GADGET_MASS_STORAGE +static int ums_read_sector(struct ums_device *ums_dev,
ulong start, lbaint_t blkcnt, void *buf)
+{
if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
return -1;
return 0;
+}
+static int ums_write_sector(struct ums_device *ums_dev,
ulong start, lbaint_t blkcnt, const void
*buf)
+{
if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num,
start + ums_dev->offset, blkcnt, buf) != blkcnt)
return -1;
indentation error.
return 0;
+}
+static void ums_get_capacity(struct ums_device *ums_dev,
long long int *capacity)
+{
long long int tmp_capacity;
tmp_capacity = (long long int) ((ums_dev->offset +
ums_dev->part_size)
* SECTOR_SIZE);
*capacity = ums_dev->mmc->capacity - tmp_capacity;
+}
+static struct ums_board_info ums_board = {
.read_sector = ums_read_sector,
.write_sector = ums_write_sector,
.get_capacity = ums_get_capacity,
.name = "GONI UMS disk",
.ums_dev = {
.mmc = NULL,
.dev_num = 0,
.offset = 0,
.part_size = 0.
},
+};
+struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned
int offset,
unsigned int part_size)
+{
struct mmc *mmc;
mmc = find_mmc_device(dev_num);
/* mmc initialization is necessary prior to the ums command usage
* due to fact that on goni target environment is read from oneNand
* memory, so the mmc remains uninitialized whenu-boot prompt
appears
* */
please fix multiline comment style.
if (!mmc || mmc_init(mmc))
return NULL;
ums_board.ums_dev.mmc = mmc;
ums_board.ums_dev.dev_num = dev_num;
ums_board.ums_dev.offset = offset;
ums_board.ums_dev.part_size = part_size;
return &ums_board;
+}
+#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index e8f2639..1cfbb88 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -269,4 +269,9 @@ #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2
+#define CONFIG_CMD_USB_MASS_STORAGE +#if defined(CONFIG_CMD_USB_MASS_STORAGE)
unnecessary ifdef. this file is board specific and we already knew that CONFIG_CMD_USB_MASS_STORAGE is defined.
+#define CONFIG_USB_GADGET_MASS_STORAGE +#endif
#endif /* __CONFIG_H */
U-Boot mailing list U-Boot@lists.denx.de javascript:; http://lists.denx.de/mailman/listinfo/u-boot
participants (5)
-
Jaehoon Chung
-
Lukasz Majewski
-
Minkyu Kang
-
Minkyu Kang
-
Sumit Gemini