From patchwork Thu Apr 30 21:45:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1140 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 67D103F077 for ; Thu, 30 Apr 2020 23:45:52 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id y7sf6175119plp.8 for ; Thu, 30 Apr 2020 14:45:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588283150; cv=pass; d=google.com; s=arc-20160816; b=dIXFxprYNO14qZ0PBxbdbgv41pOQXCzj9fG4JNZaaqFkoRKQHu8AXArFlPi9+kpxfq csuQO0ZD1qV88miTsFZuE/UgKTfdGX4eLTHwLfSY3ovyt0x470KA3NjyBZ0TBjQFQMmP pCZKUD6Ew2iAwyvCzO5m2zZaqO43vpD9P/H6kr69kKxAOK/yeGSIfHXCgLDAucHx4kXp dEW9kie1FSbLdL0KECBSZrQMBiKdieSSG5jQ6An/TuPWQp4ByXvlr+JzQq9DicN0LQb2 xatfihHoEh/hs/6gTKejNJdNpTq9pZ3J/M3ju9SqjgWwXL0iY46OcKlgw0vA+Me/lXdD OCJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:message-id:date:subject:cc:to:from :mime-version:dkim-signature; bh=gpiv1CkU4bbUeWw+cnTxHNMcJyfNED2uck3IxXTk8oA=; b=qbDiDDTiComOyQXFh/snTyjQ5dXOUExzbiRXe/kcXFDeP5y3rOU2z7/ceYo/P0itKo cxrViXsezvkyTUcNq7+X0DZ4iOsivALC82VU2zmQ3fftUF2jhyt9Y87SjdHT/Mc8oXOk DnwzOSjYM/J+Vb8pK9qAjzOH179YZQHsLnnZ3Wcd628rAPvK8tDdmyBcfhiIPJrN8qc3 Rjurz/+AZyFMeuHXeOV09nb+YQ9QP2HMTmp3BwwN/UNODk1TgyAyL605pX2tK/12m1HR DtA2mlsRUltZSGkg2jqIkEFddOV7xJF0wK3E3SzuQ4ioWlPe0f8MGwXvL8vDoFIMQq8J 5zog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Iys5N08D; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=gpiv1CkU4bbUeWw+cnTxHNMcJyfNED2uck3IxXTk8oA=; b=dN3dwmfN6i9tICH4wx4Aj9yCZEPLuQzsxwIOPrcdi0YnjMlEXBk1UktLx4cvXC84Yl 42S3uYIrAwNH4fZTNjqTD3KJLbGcRcfJeHVnRZ8h0DlkxKNRTSNcnxJGNP0XSDXPCdce jEreyKhqyqwdOQba8zaJGeIVd3stjU3iwaGQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=gpiv1CkU4bbUeWw+cnTxHNMcJyfNED2uck3IxXTk8oA=; b=YTkGb/4jZTskRwLxW9ECx/eRoVVbxZ/ozLggN+MqGaARtiD3bZIB6U+pC51dZjcR04 1JCg7dBFHZJ8MkBAqDhnohlP6T200EIjKKnpCPRgrjuuC1HCjmjb41nHxEmUKgBMD90q 0urj2yJ5P+C3YQ5QhoRVqigu5bZEmYnRcBD9rl7+cvgvEyPLDUzXclTrFP8Iz0E6o/Io P/gyY0Ul3vRO5v9/9EY3sBZcjpbcbSnLSVo6kvv10o/0QUkgdTTYgqGku2DrbYclIhzx beoVN8ecGD3td17fkznOC3m3BNuRrMYpmQwbnz63euaEHzgZOwBDpUxxEy0947rFEjOl 6FOg== X-Gm-Message-State: AGi0PuafCzRZXlNjvlEZ3ePr5M4LcacFGJZNspUuB48E+f2WeYt33Q3i rqtjiffz3w6FEX9qc5aHd9jmoAJr X-Google-Smtp-Source: APiQypKl5IPBOkm43L678/SgjaiCPLSItELqI6tqXtH5h6ukADuG9V0rOgjped6CW9ieI5jzDACx5Q== X-Received: by 2002:a62:7bcf:: with SMTP id w198mr842900pfc.226.1588283150129; Thu, 30 Apr 2020 14:45:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:bd15:: with SMTP id a21ls4506649pff.6.gmail; Thu, 30 Apr 2020 14:45:49 -0700 (PDT) X-Received: by 2002:aa7:9a87:: with SMTP id w7mr848444pfi.47.1588283149573; Thu, 30 Apr 2020 14:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588283149; cv=none; d=google.com; s=arc-20160816; b=GgmEqNEr/koRy8T8MTX7KwqNP9yR6Y7b6+qK7s/nks9jFsYiUgpJitLagNjThER9QX /ngEqtfSeSSPemNRgmGiyqmYIRLIW/pNfZd+CeXYm89EcDNTEALvWm+sxsNxmS6z9KFi YH0tMBkbU4aQOXxnb7ELY+wTEGtdM9qN05s6et5O7KGUqPM7iMXe7zvDTaDpkf30fOnC pPpJWSB08vToaX0cfOsSsmAqt1m+TLq73SkVIrZJHKFIoxh7330gMk6Cf6eSEj25luN/ dkN7GB1bMnI+EXjzshyDMSoTAv3VYKW4/wUW2lgtzeJN/6pOcWwKVZGE1bLL9MHoO8yP ZYTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=Mft02k1EWwZ/HNm5maq7S/AAnogxHFeoUgCVQnPuQmY=; b=pCooJjj6Nj1b8Ntg3mkrICFex9A1jhW3j3KEuVceibg3edBj38SRQDP631tjqrjFzi oGqhKXEgW35mox93rDiBNvrGfKdbmqzydpiH2fTZexeFWZsXuILuC/5ZwzOKXfo3tFep uEYsQ3nXCN3pScYzj+yTmq8GAMwnJdnTfRbmi/vB+dOW48OW0mOoU3NKaV1YzS8uf5c4 NikeGMyF3D/FIVOXQ7tRAzou+HdA5WAtlRDmsSV6nq5JCgtZwXDmH9gWQTpPWWqPrAHQ vPu8K0KsY/rwpDRoZcSOD8R2gQ+HFLBQdKepKFHtJanFpJFyOTzsw6edB94g91X57YG8 a12w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Iys5N08D; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id q23sor1251042plr.54.2020.04.30.14.45.48 for (Google Transport Security); Thu, 30 Apr 2020 14:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:bf46:: with SMTP id u6mr1044774pls.318.1588283148229; Thu, 30 Apr 2020 14:45:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:a9f2:11c6:8c6c:2861]) by smtp.gmail.com with ESMTPSA id p64sm615243pjp.7.2020.04.30.14.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 14:45:47 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich , Tom Rini , Frank Wang , William Wu , Shawn Lin , Heiko Stuebner , Patrice Chotard Cc: u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [RFC 0/7] rockchip: Add PHY drivers Date: Fri, 1 May 2020 03:15:22 +0530 Message-Id: <20200430214529.18887-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Iys5N08D; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch add support for USB2PHY and PCIe PHY driver on rockchip platform and tested the same in rk3399. Basic code is referenced from Linux, hence all the license SPDX are reused. The reason behind sending this as RFC is PHY devices for u2phy, pcie_phy nodes are unable to get via Generic PHY framework. The observed reasons are 1) u2phy is not part of root node. 2) pcie_phy is not part of root node and also parent is of non-PHY type. This is sample PHY provider topology that Generic PHY is failed to get PHY device. /{ grf: syscon@ff770000 { compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd"; reg = <0x0 0xff770000 0x0 0x10000>; #address-cells = <1>; #size-cells = <1>; u2phy0: usb2-phy@e450 { compatible = "rockchip,rk3399-usb2phy"; reg = <0xe450 0x10>; clocks = <&cru SCLK_USB2PHY0_REF>; clock-names = "phyclk"; #clock-cells = <0>; clock-output-names = "clk_usbphy0_480m"; status = "disabled"; u2phy0_host: host-port { #phy-cells = <0>; interrupts = ; interrupt-names = "linestate"; status = "disabled"; }; u2phy0_otg: otg-port { #phy-cells = <0>; interrupts = , , ; interrupt-names = "otg-bvalid", "otg-id", "linestate"; status = "disabled"; }; }; pcie_phy: pcie-phy { compatible = "rockchip,rk3399-pcie-phy"; clocks = <&cru SCLK_PCIEPHY_REF>; clock-names = "refclk"; #phy-cells = <1>; resets = <&cru SRST_PCIEPHY>; drive-impedance-ohm = <50>; reset-names = "phy"; status = "disabled"; }; }; So, this series moved these nodes as part of root to make it work but of course any suggestions on this will be taken into consideration. Any inputs? Jagan. Jagan Teki (7): phy: Add Rockchip PCIe PHY driver clk: rk3399: Enable/Disable the USB2PHY clk phy: rockchip: Add Rockchip USB2PHY driver arm64: dts: rk3399: Move u2phy into root port arm64: dts: rk3399: Move pcie_phy into root port pci: rockchip: Switch to generic-phy pci: rockchip: Drop legacy PHY driver arch/arm/dts/rk3399.dtsi | 118 +++---- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/clk/rockchip/clk_rk3399.c | 12 + drivers/pci/Makefile | 2 +- drivers/pci/pcie_rockchip.c | 95 +++++- drivers/pci/pcie_rockchip.h | 142 -------- drivers/pci/pcie_rockchip_phy.c | 205 ------------ drivers/phy/rockchip/Kconfig | 16 + drivers/phy/rockchip/Makefile | 7 + drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 312 ++++++++++++++++++ drivers/phy/rockchip/phy-rockchip-pcie.c | 271 +++++++++++++++ 12 files changed, 764 insertions(+), 419 deletions(-) delete mode 100644 drivers/pci/pcie_rockchip.h delete mode 100644 drivers/pci/pcie_rockchip_phy.c create mode 100644 drivers/phy/rockchip/Kconfig create mode 100644 drivers/phy/rockchip/Makefile create mode 100644 drivers/phy/rockchip/phy-rockchip-inno-usb2.c create mode 100644 drivers/phy/rockchip/phy-rockchip-pcie.c