]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynq: Add USB lthor download protocol support
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 8 Sep 2014 16:39:37 +0000 (22:09 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 10 Sep 2014 09:03:49 +0000 (11:03 +0200)
updated the zynq config to support the lthor
download protocol.
This lthor functionality helps us to load linux
images on to DDR/MMC and can boot linux using bootm.
In order to load images the user should run lthor
command run "thor_ram" from u-boot prompt and
then send the images from host using lthor utility.

Define g_dnl_bind_fixup for zynq so that correct vendor
and product ids assigned incase of DFU and lthor.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynq/Makefile
board/xilinx/zynq/thor.c [new file with mode: 0644]
include/configs/zynq-common.h

index 71c0c351f929b33ae5b1f5406d8eb81690ca6dd6..6b8b093347bb2887493e7935a90c5621f93eb312 100644 (file)
@@ -6,6 +6,7 @@
 #
 
 obj-y  := board.o
+obj-$(CONFIG_THOR_FUNCTION) += thor.o
 
 # Please copy ps7_init.c/h from hw project to this directory
 obj-$(CONFIG_SPL_BUILD) += \
diff --git a/board/xilinx/zynq/thor.c b/board/xilinx/zynq/thor.c
new file mode 100644 (file)
index 0000000..1c7630d
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  Copyright (C) 2013 Samsung Electronics
+ *  Lukasz Majewski <l.majewski@samsung.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <linux/usb/ch9.h>
+
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+       if (!strcmp(name, "usb_dnl_thor")) {
+               put_unaligned(CONFIG_G_DNL_THOR_VENDOR_NUM, &dev->idVendor);
+               put_unaligned(CONFIG_G_DNL_THOR_PRODUCT_NUM, &dev->idProduct);
+       } else {
+               put_unaligned(CONFIG_G_DNL_VENDOR_NUM, &dev->idVendor);
+               put_unaligned(CONFIG_G_DNL_PRODUCT_NUM, &dev->idProduct);
+       }
+       return 0;
+}
index df3708370b1220b855d56841427d9eee3c4c2704..402fc45fb1810cfaa5f7f970d1b8b28d334f3c73 100644 (file)
 # define CONFIG_USB_GADGET_VBUS_DRAW   2
 # define CONFIG_G_DNL_VENDOR_NUM       0x03FD
 # define CONFIG_G_DNL_PRODUCT_NUM      0x0300
+/* used samsung ids below because of limitation in lthor on host side */
+# define CONFIG_G_DNL_THOR_VENDOR_NUM  0x04E8
+# define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D
 # define CONFIG_G_DNL_MANUFACTURER     "Xilinx"
 # define CONFIG_USB_GADGET
 # define CONFIG_USB_CABLE_CHECK
 # define CONFIG_CMD_DFU
+# define CONFIG_CMD_THOR_DOWNLOAD
+# define CONFIG_THOR_FUNCTION
 # define DFU_ALT_INFO_RAM \
        "dfu_ram_info=" \
        "set dfu_alt_info " \
        "${kernel_image} ram 0x3000000 0x500000\\\\;" \
        "${devicetree_image} ram 0x2A00000 0x20000\\\\;" \
        "${ramdisk_image} ram 0x2000000 0x600000\0" \
-       "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0"
+       "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
+       "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
 
 # if defined(CONFIG_ZYNQ_SDHCI0) || defined(CONFIG_ZYNQ_SDHCI1)
 #  define CONFIG_DFU_MMC
        "${kernel_image} fat 0 1\\\\;" \
        "${devicetree_image} fat 0 1\\\\;" \
        "${ramdisk_image} fat 0 1\0" \
-       "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0"
+       "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \
+       "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0"
+
 #  define DFU_ALT_INFO \
        DFU_ALT_INFO_RAM \
        DFU_ALT_INFO_MMC