From patchwork Thu Apr 30 07:04:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1131 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9D5553F0D3 for ; Thu, 30 Apr 2020 09:04:26 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id m23sf4561730pfa.19 for ; Thu, 30 Apr 2020 00:04:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588230264; cv=pass; d=google.com; s=arc-20160816; b=Ov8Dzi1poVDSeRg9ugFIMcFwTMEsZNelNIcMvmZHCcwweqE1NTFimmIcq2qRvmtQvo zAy/6ITwccHulH4yXhKH3P6KqWMNqcMfRlnQe6F6ciep+/1DHSmrxKNq9pgmfogCwj7+ B9O3C0BKJTqFcaZ0Uzij/4V0lEsc4AZbmVRvpyu77swvWrcs/zpYyKhHr9joeyXNW5Tt qT0WiY/XSVvPd1ksS3UAWxdPPeJttaYKJnRITVfo3X9WbasCDmJWp1eEkNs8sTFdizxG Nsrlu7Ls7egjvr9sS05IpHVoARblMMMPVdiqyGRhKjHBc6IP7uzLGfg9Ew14nNQIWD9Q qX4w== 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=7ES/k6a9q7qeYexHIGNf8cT9iG8OD2C6xxA5wrwB0LE=; b=mQVzNMhT/JjuK5lrCMDAl/UVxJjrMgEcplo1mFj3nDstIaMPKx7dy6yKxw/47mpSvG joPP3pjXNq7N2t2MUFFICuQRXDMJmXPPUzQOkw0sZAG3EFIC632RsDCX6RCgk+8Oia1u 3tKAunKzmVxDuJnCoESQ7CBt8Snv5YFeEmfaJOxDUXAvbtOHKjPuHIEJrygUQontjSLs VkzTx2b3HO/SsENoeppRdy/6545qC9L0APO6S4qVpb/vD60tobr+tfPe7ipQXoDCZwps +UdfYr38IvdIXvvyPOEQPbUbb5PBavSHGQ0BdwVscmVQUgbYFDVNX5345sKMp8ErK8Bi s4tQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HgyYiIuu; 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=7ES/k6a9q7qeYexHIGNf8cT9iG8OD2C6xxA5wrwB0LE=; b=p1tPpPvWXMS7xJiceliZZnWDe6M4DPBRxlTgHx9z2xpjqdnDtp5hkx7Mk5J96CR7V9 qPD6JaSapD5zEp+yiqdApu/0WomL9fNfzTHwVKVWzNI/tFrvTVya92hSF2egujY9mOPN 1iY/woG3yohsH6m2YdXKyPNgp0u9bQ0CGf/sk= 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=7ES/k6a9q7qeYexHIGNf8cT9iG8OD2C6xxA5wrwB0LE=; b=bHAwyI4Ek2PDRSM7p2iVSbDbqcS0FmACEofYl6bLCc/dVhMPfFQDjaoENUNSosax/o xLwSvhQ44e821p2BXiVq1s9KS2xyDI2fcsRKNuia68fFsfYU9P/VUQN7f+fBHmUj5QFw ULl4il/EVw3eN9Fgi284rdkXJAGRinbK3LYS4cOgaj3Hz3Y1a/gm/87oElLFZVpeCgoc 2zNjLphHTA8s3bLPdC9lKy7SAsuTriviT78/uGYHMzNnhZUK7TOOwUKC8c3k1exBaTge 7b7CcrWDwD0ZF5GU4eMui4orGb/T8+lJB+KVlhnqZNslI59D8eO+iFoE+AgyofJi9X6P I4kQ== X-Gm-Message-State: AGi0PubuixXJmHLXaJb2lHVFs962izqXZJq4c1CzHfcqcFIkeGVtxuL2 l/VuW9IhUR/XSoP52Eyvlogg9Shn X-Google-Smtp-Source: APiQypJv3d4zHcQILPuoe/SoistlLtukX4dAzXUbOI30z0AtTa/SmZuWH4nFBMUfLKVgy/q8Len4Tw== X-Received: by 2002:a17:90a:2170:: with SMTP id a103mr1328295pje.181.1588230264283; Thu, 30 Apr 2020 00:04:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:3657:: with SMTP id nh23ls1675639pjb.1.canary-gmail; Thu, 30 Apr 2020 00:04:23 -0700 (PDT) X-Received: by 2002:a17:90a:8d0f:: with SMTP id c15mr1418978pjo.100.1588230263653; Thu, 30 Apr 2020 00:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588230263; cv=none; d=google.com; s=arc-20160816; b=xwuZQoiFdsSx8GjJR87/4I2AjsKnYXY8CClybUh2yFbPceHi7pnrG8Xcg0+2YaYMYr PShDXeWLAgyPi0GpBrkwCa9YI9KtV7Jmy21fzZ/MKoy2INDWRdhRwArUQP/qR+7QJFcy OncWXXl0PHF65BicVncUoT4V0fbf8qnK75mxjDhQJw71rm87JQOftqxmKvH1xh1caP8+ V7e/kceUnv0K6lYXIczbazpllPQ0y9n232yWqIrRFxOsnZyw4CkdtP8coqzpWOmJllOL J04bghTilLKCS4SIqboBlpOv51u6RnkotZ5yS3kIEBXS/zSYUat0Jc06S4cMksNEagj3 4oqw== 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=li/Zb4mnPfD0Nmbji9RC2oKn/VTNSvLAxiaobEeGvYM=; b=t+dR75kGtpZyCHadloWrXzJF7tY1WCpruIP4daDgLvP0c5ULDz8jI4rnfo5m9ULdMK ENkT7F0CO4XXBM7RWucF5AL555pyT67haBEBGei+SDeemgUUSclR80OSOCUbJMP3E9Fn YvbBcl8qZvQWXdJywoN87VkHwDzZhbRH6FH+AGEMJP8wgayOaKWhyBXuXcgrUdJw6Hdo Ox5qdQmQtxJh/oaeCoQEx/AWK1XlfaR3f+rGx+FSCEEemScWp4dnohhZayHqsE5fOo5w x/YvKmUoGjdv6MzU3bffkz4iPEjrypygNmLe7Y3f9yoe0lOwjMjXEqO87UcusHB6+jh1 ss/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HgyYiIuu; 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 d3sor4586766pgv.69.2020.04.30.00.04.22 for (Google Transport Security); Thu, 30 Apr 2020 00:04:22 -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:a63:e210:: with SMTP id q16mr1973617pgh.26.1588230262313; Thu, 30 Apr 2020 00:04:22 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:6514:3619:d1af:85f6]) by smtp.gmail.com with ESMTPSA id p64sm964143pjp.7.2020.04.30.00.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 00:04:21 -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 v2 0/8] rockchip: Add PCIe host support Date: Thu, 30 Apr 2020 12:34:04 +0530 Message-Id: <20200430070412.12499-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=HgyYiIuu; 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 series support PCIe host controller support on rockchip rk3399 platform. It is based on previous version[1] changes. Works well on rk3399 boards like rock960, nanopc-t4 and roc-kr3399-pc-mezzanine board as Gen1 configurable host with M.2 SSD. Changes for v2: - handle USB, GMAC clocks - collect kever r-o-b tag - simplify rd and wr conf API [1] http://patchwork.ozlabs.org/project/uboot/cover/20200425110354.12381-1-jagan@amarulasolutions.com/ Any inputs? Jagan. Jagan Teki (8): iopoll: Add dealy to read poll iopoll: Add readl_poll_sleep_timeout clk: rk3399: Add enable/disable clks clk: rk3399: Enable/Disable the PCIEPHY clk 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 | 154 ++++++ drivers/pci/Kconfig | 8 + drivers/pci/Makefile | 1 + drivers/pci/pcie_rockchip.c | 491 ++++++++++++++++++++ drivers/pci/pcie_rockchip.h | 142 ++++++ drivers/pci/pcie_rockchip_phy.c | 205 ++++++++ include/linux/iopoll.h | 23 +- 12 files changed, 1049 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