Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4216023imu; Mon, 14 Jan 2019 17:47:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN6w6CJQjqXsmSsmgAga1oBT2UkQRQKIN24cwFs3VSD8BKEtWmcaH4NHgv6QPOjBOO9qgPrM X-Received: by 2002:a17:902:7443:: with SMTP id e3mr1510594plt.304.1547516820235; Mon, 14 Jan 2019 17:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547516820; cv=none; d=google.com; s=arc-20160816; b=q3QpCvttnhVKNOsm8wRx4vrbXMTJhw5f97+ke6Uhtb/25a/UupVC1jOO03VkEPoFPw JTNT3YmmNgMQMVwveCyOF6+AE6vAXuys10dxro+Kix6NiWa6/+JpTNILwP8SQNtISjew vpf+arE3rUEvDMas0107wEb5J02SYr43GrCIMdQL4NtV2Nb7fCQPILYr1X9nO6Fyp8Wf AUqeXHpb+xuBRJW9BNSo1x3UHiESSGbgP5AHw453FZsahDiJtR+mWavSCiN3xV2f7sfF ZEVVB5M4NxT20JaHX5oSErTcwgyB2e4ZWGXekDtslcqcRo5cT+PYDMNREvpSYB/BrBwo gODw== 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=Gor4pcn+8RdC+5RN0YzPQgBDTqRSjpA55mtBww4l3JQ=; b=BuwNDxx0KLHMKY98/UmD75JhaaA7W22H4GvCP7pX6VMLIlcyIm+brNeGYJLgiv+Ish RKEXpnn7GhEZ9uwP3e1nzqEnAzku5Jho7a0+fcXPWbFsBwpGK4Hnr8UIuzUpTDpSf+26 YSDsicvj59sW3KfSsXro4zU1sIu3VH1mP/rB5d66oIl7ki7cQ71KMyrdpOt0X+6HjkVa MkTd/khQCrwshSQeZvUhP+Cf2wBDZWZXXbGkMeryvpQq75vFbytST+VxKzRcS/ETMNPh NeUh/wTqZZQVndsdqSeCznKTmaLWcKURGS4vkKVMrJBbYcvtpJSfytaog2ThhJ1I+aH0 kTEg== 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 e4si1841847pgl.570.2019.01.14.17.46.44; Mon, 14 Jan 2019 17:47:00 -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 S1727815AbfAOBoW (ORCPT + 99 others); Mon, 14 Jan 2019 20:44:22 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:35448 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727718AbfAOBoP (ORCPT ); Mon, 14 Jan 2019 20:44:15 -0500 X-UUID: 33d4b2c4cbed4d8cbd1f04548147b402-20190115 X-UUID: 33d4b2c4cbed4d8cbd1f04548147b402-20190115 Received: from mtkcas32.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2008819444; Tue, 15 Jan 2019 09:43:52 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 15 Jan 2019 09:43:50 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 15 Jan 2019 09:43:49 +0800 From: To: Bin Liu , Rob Herring CC: Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Alan Stern , , , , , , , Min Guo Subject: [PATCH v2 0/4] Add MediaTek MUSB Controller Driver Date: Tue, 15 Jan 2019 09:43:42 +0800 Message-ID: <1547516626-5084-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 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 (4): dt-bindings: usb: musb: Add support for MediaTek musb controller arm: dts: mt2701: Add usb2 device nodes usb: musb: Extract set toggle as a separate 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 | 617 +++++++++++++++++++++ drivers/usb/musb/musb_core.c | 69 +++ drivers/usb/musb/musb_core.h | 9 + drivers/usb/musb/musb_dma.h | 9 + drivers/usb/musb/musb_host.c | 35 +- drivers/usb/musb/musb_io.h | 6 + drivers/usb/musb/musbhsdma.c | 55 +- 12 files changed, 868 insertions(+), 38 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/mediatek,musb.txt create mode 100644 drivers/usb/musb/mediatek.c -- 1.9.1