{"id":799655,"url":"http://patchwork.ozlabs.org/api/1.2/patches/799655/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1502249789-11462-4-git-send-email-william.wu@rock-chips.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1502249789-11462-4-git-send-email-william.wu@rock-chips.com>","list_archive_url":null,"date":"2017-08-09T03:36:29","name":"[U-Boot,3/3] rockchip: evb-rv1108: add usb init function for dwc2 gadget","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"0e65828830e51ac8caefb0553914dcd424591c16","submitter":{"id":69388,"url":"http://patchwork.ozlabs.org/api/1.2/people/69388/?format=json","name":"William Wu","email":"william.wu@rock-chips.com"},"delegate":{"id":69486,"url":"http://patchwork.ozlabs.org/api/1.2/users/69486/?format=json","username":"ptomsich","first_name":"Philipp","last_name":"Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1502249789-11462-4-git-send-email-william.wu@rock-chips.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/799655/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/799655/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xS7Y20JkCz9sN5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  9 Aug 2017 20:58:29 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 37AD3C21F7D; Wed,  9 Aug 2017 10:53:35 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A6710C21F47;\n\tWed,  9 Aug 2017 10:51:09 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 587D5C21C5C; Wed,  9 Aug 2017 03:36:43 +0000 (UTC)","from regular1.263xmail.com (regular1.263xmail.com [211.150.99.141])\n\tby lists.denx.de (Postfix) with ESMTPS id 5E9F9C21D63\n\tfor <u-boot@lists.denx.de>; Wed,  9 Aug 2017 03:36:42 +0000 (UTC)","from william.wu?rock-chips.com (unknown [192.168.167.84])\n\tby regular1.263xmail.com (Postfix) with ESMTP id 4CE758C\n\tfor <u-boot@lists.denx.de>; Wed,  9 Aug 2017 11:36:39 +0800 (CST)","from localhost.localdomain (localhost [127.0.0.1])\n\tby smtp.263.net (Postfix) with ESMTPA id 4995C3E7;\n\tWed,  9 Aug 2017 11:36:38 +0800 (CST)","from unknown (unknown [58.22.7.114])\n\tby smtp.263.net (Postfix) whith SMTP id 23168QK92AV;\n\tWed, 09 Aug 2017 11:36:39 +0800 (CST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-263anti-spam":"KSV:0;","X-MAIL-GRAY":"0","X-MAIL-DELIVERY":"1","X-KSVirus-check":"0","X-ABS-CHECKED":"4","X-RL-SENDER":"william.wu@rock-chips.com","X-FST-TO":"u-boot@lists.denx.de","X-SENDER-IP":"58.22.7.114","X-LOGIN-NAME":"william.wu@rock-chips.com","X-UNIQUE-TAG":"<a9e011ea845927d59f86bf43380460e3>","X-ATTACHMENT-NUM":"0","X-SENDER":"wulf@rock-chips.com","X-DNS-TYPE":"0","From":"William Wu <william.wu@rock-chips.com>","To":"u-boot@lists.denx.de","Date":"Wed,  9 Aug 2017 11:36:29 +0800","Message-Id":"<1502249789-11462-4-git-send-email-william.wu@rock-chips.com>","X-Mailer":"git-send-email 2.0.0","In-Reply-To":"<1502249789-11462-1-git-send-email-william.wu@rock-chips.com>","References":"<1502249789-11462-1-git-send-email-william.wu@rock-chips.com>","X-Mailman-Approved-At":"Wed, 09 Aug 2017 10:51:00 +0000","Subject":"[U-Boot] [PATCH 3/3] rockchip: evb-rv1108: add usb init function\n\tfor dwc2 gadget","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"This patch implements board_usb_init() for dwc2 gadget, it\ngenerally called from do_fastboot to do dwc2 udc probe and\nsupport fastboot over USB.\n\nSigned-off-by: William Wu <william.wu@rock-chips.com>\n---\n board/rockchip/evb_rv1108/evb_rv1108.c | 47 ++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)","diff":"diff --git a/board/rockchip/evb_rv1108/evb_rv1108.c b/board/rockchip/evb_rv1108/evb_rv1108.c\nindex fe37eac..8ca5ee6 100644\n--- a/board/rockchip/evb_rv1108/evb_rv1108.c\n+++ b/board/rockchip/evb_rv1108/evb_rv1108.c\n@@ -50,3 +50,50 @@ int dram_init_banksize(void)\n \n \treturn 0;\n }\n+\n+#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)\n+#include <usb.h>\n+#include <usb/dwc2_udc.h>\n+\n+static struct dwc2_plat_otg_data rv1108_otg_data = {\n+\t.rx_fifo_sz\t= 512,\n+\t.np_tx_fifo_sz\t= 16,\n+\t.tx_fifo_sz\t= 128,\n+};\n+\n+int board_usb_init(int index, enum usb_init_type init)\n+{\n+\tint node;\n+\tconst char *mode;\n+\tbool matched = false;\n+\tconst void *blob = gd->fdt_blob;\n+\n+\t/* find the usb_otg node */\n+\tnode = fdt_node_offset_by_compatible(blob, -1,\n+\t\t\t\t\t\"rockchip,rv1108-usb\");\n+\n+\twhile (node > 0) {\n+\t\tmode = fdt_getprop(blob, node, \"dr_mode\", NULL);\n+\t\tif (mode && strcmp(mode, \"otg\") == 0) {\n+\t\t\tmatched = true;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tnode = fdt_node_offset_by_compatible(blob, node,\n+\t\t\t\t\t\"rockchip,rv1108-usb\");\n+\t}\n+\tif (!matched) {\n+\t\tdebug(\"Not found usb_otg device\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\trv1108_otg_data.regs_otg = fdtdec_get_addr(blob, node, \"reg\");\n+\n+\treturn dwc2_udc_probe(&rv1108_otg_data);\n+}\n+\n+int board_usb_cleanup(int index, enum usb_init_type init)\n+{\n+\treturn 0;\n+}\n+#endif\n","prefixes":["U-Boot","3/3"]}