From patchwork Wed Dec 8 02:40:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12663283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF486C433EF for ; Wed, 8 Dec 2021 02:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=o0qK49fNFYinm8ysQB+FoSNJ+jLpwvMwNmG+4Ts9pJk=; b=Qq24owNaHTrfqU aFExajYXKE7npupCdavjKCltIfTEzfRIfWxnTuNf9+sPvo/bTrvUPKSPTZL7GMOIuzUYICPAtBKWT cdBsAJHXjna6iEMN+z/luo/Miu9CVF4pFYhbDz9kJGuYOXxfqCW4HKY85SANSOqsGJo0BPh2ywV7u Ohe29E25lWb+eTYQ/wuawmVx58FCwLxbyELabEAUx5W6ox7l8HsJOyCN/c9WtPkkOI9y6PRhMFJkZ HE7qiexs1cjtOe50ss0kQxRkGN98Ie0Mex+Q+iT+rZe9nYYwCaXRNmTJb5VNluCLa26FfPePYtaIG MZ5a7rwDrZGS+2WIuKLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mumt0-00AiBr-BM; Wed, 08 Dec 2021 02:40:50 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mumsx-00AiAc-8A for linux-phy@lists.infradead.org; Wed, 08 Dec 2021 02:40:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EDBDDCE1F59; Wed, 8 Dec 2021 02:40:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F47BC341C5; Wed, 8 Dec 2021 02:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638931243; bh=mKJYw9rOWK5J2xoaJNV9PFNdrOW62dvvsvoMX8oKAHc=; h=From:To:Cc:Subject:Date:From; b=dY4GbZ6P/Kgm8k/s0lbBh3NY0BInPy2JKJnTMYLqKI8HLjHg/iQxP+fj1aP27N6lF WQlPmoeP2t3pt3nrON+BTGJ6hgOTMVD7AjfZARAikMaX914cZtjR93PNlA9Oc7Lp22 FtsNRnMZX4J8CqXslhMPVTl9J/nWW5WtdFPe7Da8pBm77KGWfEZEst5jSKAb503rW+ UoEcHFYgiUjaGx0AIu+lFoi2Erth/+eEzi/o4B4M4h2CNtL+dAbcJGOkpcb+RJ048j M88JJtZ34vtA9YAsFO3HSFuTztEgNYGL5hMFWIkMEOcPXzRlmWFTRNV0ybqaRli70Z /H0S+xb0nNzVg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Vinod Koul Cc: linux-phy@lists.infradead.org, Kishon Vijay Abraham I , pali@kernel.org, Miquel Raynal , Gregory CLEMENT , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH phy v2 0/6] Armada 3720 comphy native implementation Date: Wed, 8 Dec 2021 03:40:32 +0100 Message-Id: <20211208024038.8797-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_184047_712506_77762BB8 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Hello Vinod, this is v2 of series converting A3720 comphy to native kernel implementation. Tested on Turris MOX and ESPRESSObin (tested all supported PHY modes: ethernet, PCIe, USB3, SATA). Changes since v1 (all changes in patch 2/6): - refactored to use GENMASK() - fixed various register names to conform to Functional Specification - refactored various register names to have uniform naming - refactored register access into one function, which decides whether the access should be direct or indirect, so as to not have all these checks done everywhere in the code - moved around one register definition to have the registers sorted according to their offset - added comments to some register definitions - added support for PHY reset() method - when changing PHY mode, the driver now resets the PHY and its registers to put the PHY in known state - fixed the power_off() method - added spinlock guard when accessing PHY Selector register, since it is shared between the PHYs and so the PHY mutex is insufficient - upon driver probe changed the calls to power_off() to reset() The original cover letter said: The RPC calling to ARM Trusted Firmware implementation of Armada 3720 comphy driver caused quite a number of issues (explained more in patch 2). This series fixes those issues by reimplementing the driver to native kernel implementation. The last 3 commits revert commits in AHCI, USB, and PCI drivers, that were introduced there because of those issues. Pali Rohár (6): phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver configuration phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation arm64: dts: marvell: armada-37xx: Add xtal clock to comphy node Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada 3720" Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720" Revert "PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware" arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 2 + drivers/ata/ahci.h | 2 - drivers/ata/ahci_mvebu.c | 2 +- drivers/ata/libahci_platform.c | 2 +- drivers/pci/controller/pci-aardvark.c | 4 +- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 1362 ++++++++++++++++-- drivers/usb/host/xhci-mvebu.c | 42 - drivers/usb/host/xhci-mvebu.h | 6 - drivers/usb/host/xhci-plat.c | 20 +- drivers/usb/host/xhci-plat.h | 1 - 10 files changed, 1240 insertions(+), 203 deletions(-)