From patchwork Mon Jan 3 14:32:15 2022 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: 12702553 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 6E2D9C433FE for ; Mon, 3 Jan 2022 14:32:32 +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=inkFTg8PyeyImJFR35z8fpCbEkaE7ZLEDMAHTlKSwVk=; b=Bg2gIQ/zd6RiL0 2LmLdVqJcJfrHpAvMEpiq78Vf1LLKeQIk7J5XZRhvmO7bcBIv5TLaFG79Dx6OdN+Sbqk/P6WWDtjp BpKSCLe8RGTkip6xQAykaycj0KNpVbZkkXJ9e5AFLthxtOCvN1GrXlYsVNtfxtt7+70C2iVEPoqjW Ic3UGgC133LFneagBVUk83dsgniGRjeA2vHTBfuF2cywSpEQW8PQsmfaoXFazluNfxR+zTjWkAwGF dkKFs9L9Pswn4Dn2pphwdzdveq7vZ203lCUihfU+SiZocqLhv/aPoNQ8EO7Ezan3edDEQQQ2D3RUI RsvVBKbJjjJnQ9SFaSOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4ONz-009CM2-QC; Mon, 03 Jan 2022 14:32:31 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4ONx-009CLK-A8 for linux-phy@lists.infradead.org; Mon, 03 Jan 2022 14:32:30 +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 dfw.source.kernel.org (Postfix) with ESMTPS id B82836111C; Mon, 3 Jan 2022 14:32:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D681C36AED; Mon, 3 Jan 2022 14:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641220346; bh=2R/vT5PYrv4pGEbU4bI6HlTM/+DhqVhkSRgEU+OeoMs=; h=From:To:Cc:Subject:Date:From; b=SA2gNcaawZovs14jKBM6BWwwznJnHJl+3mWDMbLA3/j/Ju/aDAi6uGlG8m6A1kEWI DCooiY19WYhJT0LtQMsmTmp30+LlJztbuCFIMXhAxt5A129txRDDebDzlzasJl9vnZ +bo+O8PEN9+Lgrc1s75l3fmos41E3wwUev3WFv6v6ItxquK8mcYoVVryUpQmBa64cX flZIQVe/NHF+/+3FCL4pF9RKSpEJB3GqCC2Mwv89ezDtXszXOA9wt1lH5mnmCn1mhX vkuAqwI90OAxJHiRcHpXLpx1y+xHLDt8BKeUDkLJbKPLUqQYSREWuyskIGl1DoOXMO 1zqef53KN1SVg== 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 v3 0/5] Armada 3720 comphy native implementation Date: Mon, 3 Jan 2022 15:32:15 +0100 Message-Id: <20220103143220.13070-1-kabel@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220103_063229_481651_96707640 X-CRM114-Status: GOOD ( 13.95 ) 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 v3 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 v2: - removed device-tree changing patch, Gregory applied it on mvebu/dt64 - changed raw spin lock to ordinary spin lock - fixed indentation of gbe_phy_init_fix - use FIELD_PREP() macro 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 (5): phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver configuration phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation 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" 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 | 1369 ++++++++++++++++-- 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 - 9 files changed, 1245 insertions(+), 203 deletions(-)