From patchwork Sat Apr 25 11:03:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1114 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8EF053F078 for ; Sat, 25 Apr 2020 13:04:10 +0200 (CEST) Received: by mail-pj1-f71.google.com with SMTP id l3sf302580pjk.8 for ; Sat, 25 Apr 2020 04:04:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587812649; cv=pass; d=google.com; s=arc-20160816; b=Py5kNk1c5z05N1m0rL2RTk+Y3/6CkVtlOyWz9yEX3Pvdlzt3Ok/IQg8KRNtsorxQwS 4piPUuO8TvyMpx0avAnLGOZ8X/1LPfqgGXiHvaydwh1+uiYrp0NDLaMuF8MFslU52o5M Cmkd5J1MHJZ4OdyzsxPUrhCWAZpI5+VPRPLdqcF3oWwqaOewf7Cr42YgDMcVmP2lP2gp Wu4SY6GsiEYqRRvyoRVMd8sTl2rSYFtm9EmaCEKah0vMmqMMd3GDWNqB4xMEomkcwAgS jinILH4a/wyoX3KZbhoWSAM1PziciS7oVBfNTa8B98U3rnmyJ8Mpnw0QWiddHSWzRkoh bZvA== 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=oIyXWCtEeYoen+D4V7tBX7nTAxmgd7xbvEFXHxghBCA=; b=Sc71HplzgrYCQ2OLj9CZCv6w6xb3mr0omgrTJnFlbs+SyqGJmbNwSwM+jFpwXzKgK1 4kO/31IzA4ZGRXmcja5zM/NTHHReREgrKBgmYZBFJCh7JTRiDUgk5twJpR71FAxcVemS o41jkkfL9AzqyQ5Lpkmtt4QGUMrnJXNMGRVaXPmUCIqgPkumB1nV+cW4aByyjBCdJY1c FYw/ZenPS5IZW/Arc75qVsBZ7XnA6tycbpwFsS1QJ0HERiF5WSu8kZ555ogAk7kVuWwy 7eh69GqzUDmZrDzbIrjh5XkFFarl2L0RbOuywdxxBN1DQ+jrUSaHxkpW4O2OPk/omof+ lokg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qo2xxTtD; 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=oIyXWCtEeYoen+D4V7tBX7nTAxmgd7xbvEFXHxghBCA=; b=F7WrzRbtPxkofk9oHT6ulvrFtHN0Ej+VsoEIx+/QsuZgNIm7qP/c/KeuJ2uvcxwUF4 z4MrwnPjR7hNwKMgbhrkQutmPf9LKCF6zGMGqbkJ6rsNaW0vZeUBWYXSPWKrme76z4/O iqqs6lmNa+jV0pjKyLU1CIjpdITYojttrw1wc= 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=oIyXWCtEeYoen+D4V7tBX7nTAxmgd7xbvEFXHxghBCA=; b=rAJzqMWX9QzttwaZaUmYTwmXiVeWIpl3oxl6vHbNcp8rZmM9EzpcjrFaq6kVzbgVjd 1vmDWFGN2bPEkVOV4KluKpPUtu8K9nSsdi0OIuckmZUFuR5y20ywa+9hNJ2TOvv49VwV fCFSO7zSSRtRgoiOQFyyvrXo+T5EpdeisKUXw21tPtfyZYq8t2HZ/zT54v9YtjmaOZ/D Bz7REMPYn4bL56abT2P3c5XLKc3ip8yErNpFFsnpGeSiM5hcUwAQNbLL+XZzmqLo7mL+ FHjnMW1YQ4bhp2Kwwyo/XIjX9/lO+wSusrsm+iPJfCIRJ0ZK5PUmR/L5C7waeh3dhrDQ bfSw== X-Gm-Message-State: AGi0PuZCdMsYQmVjCIPeRW/vohOYUb06op1CPJKIwVx5GPIkUonHxXGV KdIgj4stxXXxize7z05/k12IUPPL X-Google-Smtp-Source: APiQypIfxIvan289pAWbX2hzhO6ISJJ7HH42hr7/arVFNiAzchjxA/WGhmXZEpRLYwFFzf0FWOXC/w== X-Received: by 2002:a17:90a:1b0c:: with SMTP id q12mr12136111pjq.116.1587812648834; Sat, 25 Apr 2020 04:04:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:7b5c:: with SMTP id k28ls8809179pgn.4.gmail; Sat, 25 Apr 2020 04:04:08 -0700 (PDT) X-Received: by 2002:a65:68c7:: with SMTP id k7mr14090016pgt.248.1587812648389; Sat, 25 Apr 2020 04:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587812648; cv=none; d=google.com; s=arc-20160816; b=OyjTiJKdJEkMv8IxGDTLlHwC+G5WRY1d9VkD+ENFJtDV0OuiUL7fO12/hisanLEKFM a9GdeJ+wxG7tPFOGq0vnd4BFUnWipGhT4NcXdkAOQu1DnF4nLhXtCIt7I4ePrt2PsvMs 5m6FsnMdO04PzdCw67k1k910/eL/YNZB2RDeGBlVGn1v+8l+zsbGAb+cEfmpYbxRh1kF gKxxXhKLcRVqnKvIEozyGPgA/KydmGE5PNvbBwx5TKIJD5NX+iZVb8KCqlmvs4TyHDeA Q0x5E/IwF2RYa52ZlOOH3TQ0bvRZaLBUO8CdJS31fT4R5lPNweShEX7u67jTMD8rWlfE /4tw== 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=45Ydihz1IvX8uDoyYZB1qVjbx6jXCFJDXqo8J6o2bN0=; b=XERTCuWeX3mVsmnjTP4pEYjIZtfcAw9zI9u8nq42w4y8+JQGsvmLHYjRG+6QW1rZTC AIGLYBoxy+yQSg684WCVHWv+yxXCFTsxL2J9AqpL5kayyxL7FyyPZgYweLoVc8+ZYynx arImnxk7uLsFeNVULDsRlKNw1yk2JHSziY7NfgAg6ejfswTL8poxyl0hFgLnR+GGVp7U CqMnysQGNrkDD7qhonjXIJsGWkl7Vj4lU3oNuc1qCfs1KCXW1kgZjQhQGWGizXLCRjG0 iidQvVOuAMnu5SKPQe3a4jw0zDCjMPejNXvysU8MLQujmC8TDvjNnvK91JCsON6oZR/q AcYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qo2xxTtD; 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 r5sor10947416pfq.37.2020.04.25.04.04.07 for (Google Transport Security); Sat, 25 Apr 2020 04:04:07 -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:a62:6dc6:: with SMTP id i189mr4073165pfc.30.1587812647226; Sat, 25 Apr 2020 04:04:07 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:1d46:fa69:c34:93dc]) by smtp.gmail.com with ESMTPSA id v94sm6922831pjb.39.2020.04.25.04.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 04:04:06 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: patrick@blueri.se, sunil@amarulasolutions.com, u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 0/8] rockchip: Add PCIe host support Date: Sat, 25 Apr 2020 16:33:46 +0530 Message-Id: <20200425110354.12381-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=qo2xxTtD; 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: , Thanks to Patrick for initial work done on this. This series support PCIe host controller support on rockchip rk3399 platform. Works well on rk3399 boards like rock960, nanopc-t4 and roc-kr3399-pc-mezzanine board as Gen1 configurable host. It has dependency with v5.7-rc1 dts(i) sync series[1] [1] https://patchwork.ozlabs.org/project/uboot/cover/20200425105319.12009-1-jagan@amarulasolutions.com/ Any inputs? Jagan. Jagan Teki (8): iopoll: Add dealy to read poll iopoll: Add readl_poll_sleep_timeout clk: rk3399: Enable PCIE_PHY clock clk: rk3399: Disable PCIE_PHY clock pci: Add Rockchip PCIe controller driver pci: Add Rockchip PCIe PHY controller driver rockchip: Enable PCIe/M.2 on rk3399 board w/ M.2 rockchip: Enable PCIe/M.2 on rock960 board arch/arm/dts/rk3399-u-boot.dtsi | 1 + board/vamrs/rock960_rk3399/rock960-rk3399.c | 20 + configs/nanopc-t4-rk3399_defconfig | 4 + configs/roc-pc-mezzanine-rk3399_defconfig | 4 + configs/rock960-rk3399_defconfig | 5 + drivers/clk/rockchip/clk_rk3399.c | 32 ++ drivers/pci/Kconfig | 8 + drivers/pci/Makefile | 1 + drivers/pci/pcie_rockchip.c | 484 ++++++++++++++++++++ drivers/pci/pcie_rockchip.h | 142 ++++++ drivers/pci/pcie_rockchip_phy.c | 205 +++++++++ include/linux/iopoll.h | 23 +- 12 files changed, 920 insertions(+), 9 deletions(-) create mode 100644 drivers/pci/pcie_rockchip.c create mode 100644 drivers/pci/pcie_rockchip.h create mode 100644 drivers/pci/pcie_rockchip_phy.c