Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6166912imu; Mon, 21 Jan 2019 04:24:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN6QxYZ+iz0OVEe/H2qZBoRTtMms4FTUqv81xOqhwp3gIRarg1n3a2fl1eVvDKOeki78hFhc X-Received: by 2002:a62:6f49:: with SMTP id k70mr29314570pfc.7.1548073481439; Mon, 21 Jan 2019 04:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548073481; cv=none; d=google.com; s=arc-20160816; b=QeS4Qzv+UYA5EtdTNUwZiwezlxzB0m+9vGHRX0V6LVXKY9vueTyRxoDwYlXFaqr9wQ id9eX9N3Rq4zPJWdDnECJr7VwQZ3W54i5g4X4W/ImIh4WqZOIVs6AhCSveFzEcBUntlL sA/jEcVWjidGbzx4M8/GxtD1G5wr7+yEc5lzbur1VbGXH1ov+ZcEC1PMIPB7rT+4xnNM tnkhLC+TXHvFJgh26HkWvZKMdDfCQ3QbAmpNwW/YDw6m3/33QWfhfcxEg7Ci1mKhOBfj nqtAHrudE6sOYA6SVuyJviYUqzKzkX8d1gjfviAwVKmeQhWTEPPmsBT5kRg7dflGCPd5 mC6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=LQnHtw7zp+0siyLVnJYNgPrtPXVltSV2bcDEO79Er18=; b=HrycV5ZNGwLjP8LgJog9RQv+spV7VXgDSlgWdaaghypJd0JgpnyWoFjZuUmJq1E+KX a58hmheUjcE4aR5KCG1mjmUcmMeWFN0zlCsZ//V+vGyKa4YI+ulhpKCyi27wREX+0YzI lanGNJL5qoLybm0YOHAb4LXEBHtCvnWFlPnGquC5r48y7i0Dewbjjiib/GunwN/UO2D7 rLjYLN6T6EI5eCdeKIOzyiI3Tz7uOAgePmN56XPeIGAY2sd6fiPjDU3qgnCiXVmF9A7A Y0OD7ykYKX0H+MV5I1EqvbstLwIGdOGBod+t6UAJQQ7Sq9VRr3iDKkt32wAbyvcMV9Iz cbYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x64si12349814pfb.120.2019.01.21.04.24.17; Mon, 21 Jan 2019 04:24:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728623AbfAUMW6 (ORCPT + 99 others); Mon, 21 Jan 2019 07:22:58 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:55969 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728081AbfAUMW5 (ORCPT ); Mon, 21 Jan 2019 07:22:57 -0500 X-UUID: a982f667b1734478baf4c65681294810-20190121 X-UUID: a982f667b1734478baf4c65681294810-20190121 Received: from mtkcas36.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 269036502; Mon, 21 Jan 2019 20:22:36 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 21 Jan 2019 20:22:35 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 21 Jan 2019 20:22:34 +0800 From: To: Bin Liu , Rob Herring CC: Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Alan Stern , , , , , , , , , Min Guo Subject: [PATCH v4 0/6] Add MediaTek MUSB Controller Driver Date: Mon, 21 Jan 2019 20:22:25 +0800 Message-ID: <1548073351-13739-1-git-send-email-min.guo@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Min Guo These patches introduce the MediaTek MUSB controller driver. The driver can be configured as Dual-Role Device (DRD), Peripheral Only and Host Only modes. This has beed tested on MT2701 with a variety of devices in host mode and with the f_mass gadget driver in peripheral mode, plugging otg cables in/out a lot of times in all possible imaginable plug orders. changes in v4: changes of dt-bindings suggested by Sergei: 1. String alignment changes of driver suggested by Tony and Bin: 1. Add a new patch for set/get_toggle() 2. Add a new patch for noirq type of dma 3. Add a new patch musb_clearb/w() 4. Abondon patch "usb: musb: Delete the const attribute of addr parameter in readb/w/l hooks" changes in v3: changes of driver suggested by Bin: 1. Add a new patch for musb_readb/w/l() to remove const attribute 2. Use is_out as function parameter in set_toggle/get_toggle() hooks 3. Remove 'u8/u16 data' parameter in clearb/w() hooks 4. Remove musb_default_clearb/w() 5. Replace musb_readb/w() with musb_clearb/w() to clear pending interrupts 6. Add comments to clearb/w() hooks 7. Replace musb_save_toggle() with musb->io.get_toggle() 8. Replace musb_set_toggle() with musb->io.set_toggle() changes in v2: changes of dt-bindings suggested by Rob and Bin: 1. Modify DRC to DRD 2. Drop the "-musb" in compatible 3. Remove phy-names 4. Add space after comma in clock-names dtsi: 1. Remove phy-names changes of driver suggested by Bin: 1. Add a new patch for musb_set_toggle 2. Add summarize of MediaTek musb controller differences in the commit log 3. Abondon patch "usb: musb: Move musbhsdma macro definition to musb_dma.h" 4. Add "|| COMPILE_TEST" in Kconfig 5. Add musb_clearb() and musb_clearw() hooks 6. Add get_toggle() and set_toggle() hooks 7. Replace musb_readl() with musb_readw() to read 16bit toggle register 8. Move MediaTek's private toggle registers from musb_regs.h to mediatek.c 9. Create musbhs_dma_controller_create_noirq() Min Guo (6): dt-bindings: usb: musb: Add support for MediaTek musb controller arm: dts: mt2701: Add usb2 device nodes usb: musb: Add get/set toggle hooks usb: musb: Add noirq type of dma create interface usb: musb: Add musb_clearb/w() interface usb: musb: Add support for MediaTek musb controller .../devicetree/bindings/usb/mediatek,musb.txt | 43 ++ arch/arm/boot/dts/mt2701-evb.dts | 21 + arch/arm/boot/dts/mt2701.dtsi | 33 ++ drivers/usb/musb/Kconfig | 8 +- drivers/usb/musb/Makefile | 1 + drivers/usb/musb/mediatek.c | 624 +++++++++++++++++++++ drivers/usb/musb/musb_core.c | 74 ++- drivers/usb/musb/musb_core.h | 13 +- drivers/usb/musb/musb_dma.h | 9 + drivers/usb/musb/musb_host.c | 46 +- drivers/usb/musb/musb_io.h | 12 +- drivers/usb/musb/musbhsdma.c | 57 +- drivers/usb/musb/sunxi.c | 4 +- drivers/usb/musb/tusb6010.c | 2 +- 14 files changed, 876 insertions(+), 71 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/mediatek,musb.txt create mode 100644 drivers/usb/musb/mediatek.c -- 1.9.1