From patchwork Mon Apr 1 16:51:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10880297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6199139A for ; Mon, 1 Apr 2019 16:52:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DAA02866D for ; Mon, 1 Apr 2019 16:52:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D3DB286B2; Mon, 1 Apr 2019 16:52:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 273822866D for ; Mon, 1 Apr 2019 16:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6V9f+vlhs0JQ5LhhvtWC2buYlR8el5NMXsB5L6zD5s8=; b=gESBB84vB5U+u+ H2GiK2wxO6c13r3loPh/X53zHmPGDMjMtwJTc4vXdfqZ44tOqxwXwXQvnCH3uTdOcccMtE6dnO5eT 0WeWH2lHlORKSdRab9X3Y4tTrM/7stp/tVZEmGYKFDYaJdkgc1QD5f4l7u3FsaND93F9LXkOrHZ01 oA6EcFjSZUMSGlo3sUKvB0VTNQvc9qpvZuIlXUBTbVB5/hCh30OtSvs7fNbEuCEiE6pXGXj6/2GGG d4cwMxD0aU1ip110UDLqZZxxIGkdWm9AsbAOIUbJYjr3dPqHzzk7RpCJKpQ111ZrW+vjzgMFler4b BfAJAGIOW+0smduanIEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0AC-0007ZD-Bs; Mon, 01 Apr 2019 16:52:00 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0A2-0007Qe-On for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 16:51:52 +0000 X-Originating-IP: 81.185.163.178 Received: from localhost.localdomain (178.163.185.81.rev.sfr.net [81.185.163.178]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 14542240011; Mon, 1 Apr 2019 16:51:36 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Kishon Vijay Abraham I Subject: [PATCH 00/15] Enhance CP110 COMPHY support Date: Mon, 1 Apr 2019 18:51:16 +0200 Message-Id: <20190401165131.23370-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_095150_959138_6FBADCC6 X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Antoine Tenart , Russell King , Maxime Chevallier , Nadav Haklai , Rob Herring , Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Armada CP110 have a COMPHY IP which supports configuring SERDES lanes in one mode, either: - SATA - USB3 host - PCIe (several width) - Ethernet (several modes) As of today, only a few Ethernet modes are supported and the code is embedded in the Linux driver. A more complete COMPHY driver that can be used by both Linux and U-Boot is embedded in the firmware and can be run through SMC calls. First the current COMPHY driver is updated to use SMC calls but fallbacks to the already existing functions if the firmware is not up-to-date. Then, more Ethernet modes are added (through SMC calls only). SATA, USB3H and PCIe modes are also supported one by one. There is one subtle difference with the PCIe functions: we must tell the firmware the number of lanes to configure (x1, x2 or x4). This parameter depends on the number of entries in the 'phys' property describing the PCIe PHY. We use the "submode" parameter of the generic PHY API to carry this value. The Armada-8k PCIe driver has been updated to follow this idea, see [1]. Finally, as pointed by Rob during a review, there is a phy-supply property (part of the generic PHY framework) which is supposed to take over the usb-phy property, while at modifying PHY properties, we do the translation for COMPHY PHYs. [1] http://patchwork.ozlabs.org/patch/1072763/ Thanks, Miquèl Miquel Raynal (15): phy: mvebu-cp110-comphy: Explicitly initialize the lane submode phy: mvebu-cp110-comphy: Add SMC call support phy: mvebu-cp110-comphy: List already supported Ethernet modes phy: mvebu-cp110-comphy: Add RXAUI support phy: mvebu-cp110-comphy: Rename the macro handling only Ethernet modes phy: mvebu-cp110-comphy: Allow non-Ethernet modes to be configured phy: mvebu-cp110-comphy: Add USB3 host/device support phy: mvebu-cp110-comphy: Add SATA support phy: mvebu-cp110-comphy: Cosmetic change in a helper phy: mvebu-cp110-comphy: Add PCIe support phy: mvebu-cp110-comphy: Update comment about powering off all lanes at boot arm64: dts: marvell: Add 7k/8k per-port PHYs in SATA nodes arm64: dts: marvell: Add 7k/8k PHYs in USB3 nodes arm64: dts: marvell: Add 7k/8k PHYs in PCIe nodes arm64: dts: marvell: Convert 7k/8k usb-phy properties to phy-supply .../arm64/boot/dts/marvell/armada-7040-db.dts | 37 ++- .../marvell/armada-8040-clearfog-gt-8k.dts | 22 +- .../arm64/boot/dts/marvell/armada-8040-db.dts | 43 ++- .../boot/dts/marvell/armada-8040-mcbin.dtsi | 37 ++- drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 293 +++++++++++++++--- 5 files changed, 355 insertions(+), 77 deletions(-)