]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: goni: dfu: Add support for DFU to Goni target
authorMateusz Zalega <m.zalega@samsung.com>
Mon, 28 Apr 2014 19:13:30 +0000 (21:13 +0200)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 16 May 2014 04:35:54 +0000 (13:35 +0900)
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.

The malloc pool has been enlarged in order to support larger buffer
sizes needed by DFU implementation.

Signed-off-by: Arkadiusz Wlodarczyk <a.wlodarczyk@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Tested-by: Arkadiusz Wlodarczyk <a.wlodarczyk@samsung.com>
Tested-by: Mateusz Zalega <m.zalega@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/goni/goni.c
include/configs/s5p_goni.h

index 4cea63b813ed3f5ba16c6b0a971aab6adba8c344..eb0f9bffae0e4a3b925b570af2ab4f1337aa2f60 100644 (file)
@@ -14,6 +14,8 @@
 #include <asm/arch/cpu.h>
 #include <power/max8998_pmic.h>
 #include <samsung/misc.h>
+#include <usb.h>
+#include <usb_mass_storage.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -175,6 +177,12 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
        .regs_otg = S5PC110_OTG_BASE,
        .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
 };
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+       debug("USB_udc_probe\n");
+       return s3c_udc_probe(&s5pc110_otg_data);
+}
 #endif
 
 #ifdef CONFIG_MISC_INIT_R
index cc0691fde75a63d8e3aa3ad386b7fe4ea3566506..94cdce0e8010010cec5dbb20ecca45b639154c3f 100644 (file)
@@ -40,7 +40,7 @@
 #define CONFIG_CMDLINE_EDITING
 
 /* Size of malloc() pool.*/
-#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + SZ_1M)
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 80 * SZ_1M)
 
 /*
  * select serial console configuration
 #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_BOOTDELAY               1
-#define CONFIG_ZERO_BOOTDELAY_CHECK
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
 
-#define CONFIG_MTD_DEVICE
-#define CONFIG_MTD_PARTITIONS
+/* USB Samsung's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
+#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
+#define CONFIG_G_DNL_MANUFACTURER "Samsung"
 
 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
 #define MTDIDS_DEFAULT         "onenand0=samsung-onenand"
                                ",12m(modem)"\
                                ",60m(qboot)\0"
 
-#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
+#define CONFIG_BOOTDELAY               1
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+
+/* 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 CONFIG_DFU_ALT \
+       "u-boot raw 0x80 0x400;" \
+       "uImage ext4 0 2;" \
+       "exynos3-goni.dtb ext4 0 2;" \
+       ""PARTS_ROOT" part 0 5\0"
+
+#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"
 
        "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" \
+       "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
        "mmcdev=0\0" \
        "mmcbootpart=2\0" \
        "mmcrootpart=5\0" \
+       "partitions=" PARTS_DEFAULT \
        "bootblock=9\0" \
        "ubiblock=8\0" \
        "ubi=enabled\0" \
-       "opts=always_resume=1"
+       "opts=always_resume=1\0" \
+       "dfu_alt_info=" CONFIG_DFU_ALT "\0"
 
-/* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP            /* undef to save memory */
 #define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser    */
 #define CONFIG_SYS_PROMPT      "Goni # "
 
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
 
 /* write support for filesystems */
 #define CONFIG_FAT_WRITE