From patchwork Sat May 2 09:35:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 1281798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FvS3ckPU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49F8523XCzz9sSk for ; Sun, 3 May 2020 11:47:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BB9381DA8; Sun, 3 May 2020 03:47:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FvS3ckPU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7BF2381D31; Sat, 2 May 2020 11:35:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 088F681D26 for ; Sat, 2 May 2020 11:35:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=frank.wunderlich@gmail.com Received: by mail-wr1-x444.google.com with SMTP id x17so14692900wrt.5 for ; Sat, 02 May 2020 02:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FamQ4DYjr99lGPHO6j0tFaTqDEJVbjsRYcP0ph/8I1I=; b=FvS3ckPUWR30jzifkXMPhw/4AEMikqDh5sVhRV3dLTTH+d22X1GDf0TfnHVsH098Sv RCAUaLFkAqloxfJLbPMSkQjpnjy5BwbMIBl4qIcOZxM8zkPV4PtGJtAhsakSoxt2tzqW lyh6l+IGi1Aj89NPglWXftmu8AVqkj4TTERWPjtZo85Aw8dTySmJzy1Au8XLlOCPO2uz 4/1i7+E2lyl6IZrUMxb0GkcHz9vtLsTgGv1u9ENE9PiQHpHBqU+zlvQlrxaxfOAY3jtS GVp0Ly52LIQYA+BdtW3fo/9a57//DJAX7HXNkQX9dxzLY8aafdbZcN5DP2dPSwRnVtfE kgXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FamQ4DYjr99lGPHO6j0tFaTqDEJVbjsRYcP0ph/8I1I=; b=dg+XwbExd5LP7nMWmm7SI6WjlMGOLSU2D3RpxOQ6xNXh17PCEtc+efv9jwQcKIop5H u0EJOir/Q31vGZjheX5jKizxcC5pluGwvXOD8kltb/Z05ThCzua3MNHGmzaa533hkopl v/Kr8BFVLof0W3RXPTyjQI4J6R4kJD+GX5LgB85Yy4P/BSbA9+gkLXoSpxzA1KTSXr/6 MAff6N2SVbDngthaGyTy3QnbTCjSIsFiOpqrylDuSND51UiGfatWVwbCEArU0A6j4OEU y4Fhoj0t4WbKO0JHHBCYIfS/53gPjXKwo/3q7egkmbJRDv6aO0jb/dlFSf3wsjWdx974 oYew== X-Gm-Message-State: AGi0PuZbCHBK+EsMpT+bHHt04I3AIoeCNTN7LT1jKvzlD7Yjgem8Ws5w mpGDxnjdyyRk7rF5MyA/mx0= X-Google-Smtp-Source: APiQypIcCvr7qTUqLG0fzgOWoX5Te+4ALKGWIJO7J9p2lP2hnA2nLfdgq5oeQtVAoJR1UnmzZLsWnQ== X-Received: by 2002:adf:9d8d:: with SMTP id p13mr8255156wre.17.1588412137480; Sat, 02 May 2020 02:35:37 -0700 (PDT) Received: from localhost.localdomain (fttx-pool-185.76.96.142.bambit.de. [185.76.96.142]) by smtp.gmail.com with ESMTPSA id l16sm8196681wrp.91.2020.05.02.02.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 02:35:36 -0700 (PDT) From: Frank Wunderlich X-Google-Original-From: Frank Wunderlich To: Simon Glass , Ryder Lee , Marek Vasut , Bin Meng Cc: Frank Wunderlich , Weijie Gao , GSS_MTK_Uboot_upstream , Jagan Teki , Stefan Roese , Neil Armstrong , Sam Shih , Chunfeng Yun , Jean-Jacques Hiblot , Alex Marginean , Patrick Delaunay , Lukasz Majewski , AKASHI Takahiro , Anatolij Gustschin , Ye Li , Fabio Estevam , Marcel Ziswiler , Heiko Schocher , Mark Kettenis , Adam Ford , u-boot@lists.denx.de, Masahiro Yamada , Vignesh Raghavendra Subject: [PATCH v8 00/14] Add support for MediaTek xHCI host controller Date: Sat, 2 May 2020 11:35:08 +0200 Message-Id: <20200502093522.3568-1-frank-w@public-files.de> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Sun, 03 May 2020 03:47:24 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The series of patches are used to support xHCI host controller on MediaTek SoCs which has a glue layer IPPC (IP Port Control), and add USB function on T-PHY including T-PHY V1 and V2; Finally add USB related nodes for MT7629 platform. The files of xhci-mtk.* and phy-mtk-tphy.* are ported from Linux Kenrel 5.6-rc1 v8 changes: 1. fix build-error reported by Marek in Part 5 2. make 2 functions static in part 10 suggested by Jagan 3. added review by Jagan on parts 4 + 10 v7 changes: 1. add @index for nodes with reg property suggested by Fabio 2. provide phy bulk init/exit/power on/off suggested by Jagan v6 changes: 1. add Reviewed-by Simon & Weijie v5 changes: 1. print error number suggested by Marek 2. support interrupt transfer 3. update MAINTAINER about MediaTek v4 changes: 1. add phy_bulk API 2. use phy_bulk in xhci-mtk driver, also include dwc3/dwc2 drivers v3 changes: 1. provide non/inline edev_get_child_count() suggested by Simon 2. squash [PATCH v2 02/10] into [PATCH v2 03/10] suggested by Simon 3. use macros to access IPPC registers suggested by Marek v2 changes: 1. move ofnode_get_child_count() into ofnode.c suggested by Simon 2. add a test item for ofnode_get_child_count() suggested by Simon 3. use clk_bulk to get clocks suggested by Marek 4. use clrsetbits_le32() etc suggeseted by Marek 5. get the count of phys by dev_get_child_count() 6. drop reference to fixed clock clk20m Chunfeng Yun (14): dm: core: Add function to get child count of ofnode or device test: dm: add test item for ofnode_get_child_count() phy: Add API for a bulk of phys test: dm: phy: add a test item for the phy_bulk API usb: dwc3: use the phy bulk API to get phys usb: dwc2_udc_otg: use the phy bulk API to get phys phy: phy-mtk-tphy: add support USB phys phy: phy-mtk-tphy: add support new version phy: phy-mtk-tphy: add a new reference clock xhci: mediatek: Add support for MTK xHCI host controller arm: dts: mt7629: add usb related nodes dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller MAINTAINERS: MediaTek: add USB related files MAINTAINERS | 3 + arch/arm/dts/mt7629-rfb.dts | 8 + arch/arm/dts/mt7629.dtsi | 41 +++ arch/sandbox/dts/test.dts | 29 ++ doc/device-tree-bindings/phy/phy-mtk-tphy.txt | 78 ++++- .../usb/mediatek,mtk-xhci.txt | 40 +++ drivers/core/ofnode.c | 11 + drivers/core/read.c | 5 + drivers/phy/phy-mtk-tphy.c | 316 +++++++++++++++++- drivers/phy/phy-uclass.c | 97 ++++++ drivers/usb/dwc3/core.c | 87 +---- drivers/usb/dwc3/dwc3-generic.c | 7 +- drivers/usb/gadget/dwc2_udc_otg.c | 93 +----- drivers/usb/host/Kconfig | 6 + drivers/usb/host/Makefile | 1 + drivers/usb/host/xhci-dwc3.c | 7 +- drivers/usb/host/xhci-mtk.c | 303 +++++++++++++++++ drivers/usb/host/xhci.c | 10 + include/dm/ofnode.h | 8 + include/dm/read.h | 13 + include/dwc3-uboot.h | 11 +- include/generic-phy.h | 92 +++++ include/usb/xhci.h | 3 + test/dm/ofnode.c | 21 ++ test/dm/phy.c | 33 ++ 25 files changed, 1135 insertions(+), 188 deletions(-) create mode 100644 doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt create mode 100644 drivers/usb/host/xhci-mtk.c