Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813014/?format=api
{ "id": 813014, "url": "http://patchwork.ozlabs.org/api/patches/813014/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/b866ade7c8b89137a593a603ecba0d8cfedb1224.1505242834.git-series.maxime.ripard@free-electrons.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "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": "<b866ade7c8b89137a593a603ecba0d8cfedb1224.1505242834.git-series.maxime.ripard@free-electrons.com>", "list_archive_url": null, "date": "2017-09-12T19:01:39", "name": "[U-Boot,v2,11/14] musb: sunxi: switch to the device model", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "aad9949853674024e4d8dd621de2ff88d973f0d9", "submitter": { "id": 12916, "url": "http://patchwork.ozlabs.org/api/people/12916/?format=api", "name": "Maxime Ripard", "email": "maxime.ripard@free-electrons.com" }, "delegate": { "id": 68827, "url": "http://patchwork.ozlabs.org/api/users/68827/?format=api", "username": "lukma", "first_name": "Lukasz", "last_name": "Majewski", "email": "lukma@denx.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/b866ade7c8b89137a593a603ecba0d8cfedb1224.1505242834.git-series.maxime.ripard@free-electrons.com/mbox/", "series": [ { "id": 2759, "url": "http://patchwork.ozlabs.org/api/series/2759/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2759", "date": "2017-09-12T19:01:28", "name": "sunxi: convert musb to the device model and enable usb_ether", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/2759/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813014/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813014/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 3xsDjT0CvJz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 05:03:57 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid C3FEAC221DC; Tue, 12 Sep 2017 19:03:51 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 50758C220ED;\n\tTue, 12 Sep 2017 19:01:51 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid CF4A6C21C40; Tue, 12 Sep 2017 19:01:47 +0000 (UTC)", "from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54])\n\tby lists.denx.de (Postfix) with ESMTP id 8B27CC21D78\n\tfor <u-boot@lists.denx.de>; Tue, 12 Sep 2017 19:01:47 +0000 (UTC)", "by mail.free-electrons.com (Postfix, from userid 110)\n\tid 5B8C020981; Tue, 12 Sep 2017 21:01:47 +0200 (CEST)", "from localhost (LFbn-TOU-1-209-191.w86-201.abo.wanadoo.fr\n\t[86.201.56.191])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 2BF7C2091D;\n\tTue, 12 Sep 2017 21:01:47 +0200 (CEST)" ], "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=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0", "From": "Maxime Ripard <maxime.ripard@free-electrons.com>", "To": "Tom Rini <trini@konsulko.com>,\n\tJagan Teki <jagan@openedev.com>", "Date": "Tue, 12 Sep 2017 21:01:39 +0200", "Message-Id": "<b866ade7c8b89137a593a603ecba0d8cfedb1224.1505242834.git-series.maxime.ripard@free-electrons.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": [ "<cover.afe89ac52a0b82d1c12952c3cb82bb3762c85fa8.1505242834.git-series.maxime.ripard@free-electrons.com>", "<cover.afe89ac52a0b82d1c12952c3cb82bb3762c85fa8.1505242834.git-series.maxime.ripard@free-electrons.com>" ], "References": [ "<cover.afe89ac52a0b82d1c12952c3cb82bb3762c85fa8.1505242834.git-series.maxime.ripard@free-electrons.com>", "<cover.afe89ac52a0b82d1c12952c3cb82bb3762c85fa8.1505242834.git-series.maxime.ripard@free-electrons.com>" ], "Cc": "Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, marex@denx.de,\n\tu-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>", "Subject": "[U-Boot] [PATCH v2 11/14] musb: sunxi: switch to the device model", "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": "The device model was implemented so far using a hook that needed to be\ncalled from the board support, without DT support and only for the host.\n\nSwitch to probing both in peripheral and host mode through the DT.\n\nReviewed-by: Simon Glass <sjg@chromium.org>\nSigned-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>\n---\n arch/arm/include/asm/arch-sunxi/usb_phy.h | 7 +---\n board/sunxi/board.c | 1 +-\n drivers/usb/musb-new/sunxi.c | 56 +++++++++++-------------\n 3 files changed, 27 insertions(+), 37 deletions(-)", "diff": "diff --git a/arch/arm/include/asm/arch-sunxi/usb_phy.h b/arch/arm/include/asm/arch-sunxi/usb_phy.h\nindex cef6c985bc8d..5a9cacb6f4a3 100644\n--- a/arch/arm/include/asm/arch-sunxi/usb_phy.h\n+++ b/arch/arm/include/asm/arch-sunxi/usb_phy.h\n@@ -19,10 +19,3 @@ void sunxi_usb_phy_power_off(int index);\n int sunxi_usb_phy_vbus_detect(int index);\n int sunxi_usb_phy_id_detect(int index);\n void sunxi_usb_phy_enable_squelch_detect(int index, int enable);\n-\n-/* Not really phy related, but we have to declare this somewhere ... */\n-#if defined(CONFIG_USB_MUSB_HOST) || defined(CONFIG_USB_MUSB_GADGET)\n-void sunxi_musb_board_init(void);\n-#else\n-#define sunxi_musb_board_init()\n-#endif\ndiff --git a/board/sunxi/board.c b/board/sunxi/board.c\nindex 70e01437c4f4..f9224360d758 100644\n--- a/board/sunxi/board.c\n+++ b/board/sunxi/board.c\n@@ -736,7 +736,6 @@ int misc_init_r(void)\n \tif (ret)\n \t\treturn ret;\n #endif\n-\tsunxi_musb_board_init();\n \n \treturn 0;\n }\ndiff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c\nindex 5c1a902e42dc..7ee44ea91900 100644\n--- a/drivers/usb/musb-new/sunxi.c\n+++ b/drivers/usb/musb-new/sunxi.c\n@@ -308,9 +308,6 @@ static struct musb_hdrc_platform_data musb_plat = {\n \t.platform_ops\t= &sunxi_musb_ops,\n };\n \n-#ifdef CONFIG_USB_MUSB_HOST\n-static int musb_usb_remove(struct udevice *dev);\n-\n static int musb_usb_probe(struct udevice *dev)\n {\n \tstruct musb_host_data *host = dev_get_priv(dev);\n@@ -319,16 +316,20 @@ static int musb_usb_probe(struct udevice *dev)\n \n \tpriv->desc_before_addr = true;\n \n+#ifdef CONFIG_USB_MUSB_HOST\n \thost->host = musb_init_controller(&musb_plat, NULL,\n \t\t\t\t\t (void *)SUNXI_USB0_BASE);\n \tif (!host->host)\n \t\treturn -EIO;\n \n \tret = musb_lowlevel_init(host);\n-\tif (ret == 0)\n-\t\tprintf(\"MUSB OTG\\n\");\n-\telse\n-\t\tmusb_usb_remove(dev);\n+\tif (!ret)\n+\t\tprintf(\"Allwinner mUSB OTG (Host)\\n\");\n+#else\n+\tret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);\n+\tif (!ret)\n+\t\tprintf(\"Allwinner mUSB OTG (Peripheral)\\n\");\n+#endif\n \n \treturn ret;\n }\n@@ -352,30 +353,27 @@ static int musb_usb_remove(struct udevice *dev)\n \treturn 0;\n }\n \n-U_BOOT_DRIVER(usb_musb) = {\n-\t.name\t= \"sunxi-musb\",\n-\t.id\t= UCLASS_USB,\n-\t.probe = musb_usb_probe,\n-\t.remove = musb_usb_remove,\n-\t.ops\t= &musb_usb_ops,\n-\t.platdata_auto_alloc_size = sizeof(struct usb_platdata),\n-\t.priv_auto_alloc_size = sizeof(struct musb_host_data),\n+static const struct udevice_id sunxi_musb_ids[] = {\n+\t{ .compatible = \"allwinner,sun4i-a10-musb\" },\n+\t{ .compatible = \"allwinner,sun6i-a31-musb\" },\n+\t{ .compatible = \"allwinner,sun8i-a33-musb\" },\n+\t{ .compatible = \"allwinner,sun8i-h3-musb\" },\n+\t{ }\n };\n-#endif\n \n-void sunxi_musb_board_init(void)\n-{\n+U_BOOT_DRIVER(usb_musb) = {\n+\t.name\t\t= \"sunxi-musb\",\n #ifdef CONFIG_USB_MUSB_HOST\n-\tstruct udevice *dev;\n-\n-\t/*\n-\t * Bind the driver directly for now as musb linux kernel support is\n-\t * still pending upstream so our dts files do not have the necessary\n-\t * nodes yet. TODO: Remove this as soon as the dts nodes are in place\n-\t * and bind by compatible instead.\n-\t */\n-\tdevice_bind_driver(dm_root(), \"sunxi-musb\", \"sunxi-musb\", &dev);\n+\t.id\t\t= UCLASS_USB,\n #else\n-\tmusb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);\n+\t.id\t\t= UCLASS_USB_DEV_GENERIC,\n #endif\n-}\n+\t.of_match\t= sunxi_musb_ids,\n+\t.probe\t\t= musb_usb_probe,\n+\t.remove\t\t= musb_usb_remove,\n+#ifdef CONFIG_USB_MUSB_HOST\n+\t.ops\t\t= &musb_usb_ops,\n+#endif\n+\t.platdata_auto_alloc_size = sizeof(struct usb_platdata),\n+\t.priv_auto_alloc_size = sizeof(struct musb_host_data),\n+};\n", "prefixes": [ "U-Boot", "v2", "11/14" ] }