From patchwork Thu Feb 3 21:44:39 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: 12734676 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 2E816C433EF for ; Thu, 3 Feb 2022 21:44:55 +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=posFnHza//XLmRjwJwKbzVt2fchgIxyns6YjlXPnOTw=; b=mSXRC6KULMPjdS SKmeTOLo6MwMMHaYhIYTW4rdESq/9zMPOVFY6Re77sYQ3RiwhjBC12aCFQf3I8QXO1AG4dxPaBYks +nz+abjnT6P6xE0+DOxhgdm+Fx8CnvH+uuQyOvZEozJHsGUQmqswO/K+IymY0mdiz9PZNanDRvNiE 56Ce6LC59ePWXx80QXgKlo9KDJkVnpFw9OvYoyhyh5dhJZsmVQizbBI8q+RHgA14vmkjnVmLUyqaZ cxin4mpivPoe8ADbqSDLJdYuilZ6ufvqaPSAbSKUBCRHQ60e8n9Yzvo0Dvxx19PBu5KG0l+5/Y/ru S5KTPddpbLEEjmIHR/rA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFjuQ-002zbX-L4; Thu, 03 Feb 2022 21:44:54 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFjuN-002zac-9a for linux-phy@lists.infradead.org; Thu, 03 Feb 2022 21:44:53 +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 ams.source.kernel.org (Postfix) with ESMTPS id 02B3BB83599; Thu, 3 Feb 2022 21:44:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2655C340E8; Thu, 3 Feb 2022 21:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643924688; bh=S4IcmWFgeEX5Rbg7yY3zjfyPk5tegN86fESCn+C8fo0=; h=From:To:Cc:Subject:Date:From; b=k5vQw+WtF5eUy9/pI1Hn8nuvU7u6z+UF5Xv75qyG6RwylvDGckI0IM3pxwJ6vXbbd oqsdj90fdj666FAmkJzH2C3/LgrFNujqRHjULs1/o4iCs37CMIgn5VCTL8yxEBkyWO SazewB8KyxqWl2155cbjeikqG1W5ithgnZaz6hT6QrTlVQ+1M2k3GHRK0r7yXn2kt7 mq0WTR2lYjCuM9w9sUgui1ZURegX66dtenRa6YWwM7AyvSCBpG23f9w/I5vx19Ly0B SKYqA25JNSCeNoBb1Xrbr/a+S6Mb+OBL8BjiwQtuvi+N/wp3IHasyxIIiVwoeqQwnI Yh4O7RAi6nskg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Vinod Koul Cc: linux-phy@lists.infradead.org, Kishon Vijay Abraham I , pali@kernel.org, =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH phy v4 0/5] Armada 3720 comphy native implementation Date: Thu, 3 Feb 2022 22:44:39 +0100 Message-Id: <20220203214444.1508-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-20220203_134451_638932_EB195C0A X-CRM114-Status: GOOD ( 14.25 ) 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 v4 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 v3: - addressed Vinod's comments, see https://lore.kernel.org/linux-phy/20220203223913.41e9f375@thinkpad/T/#u - changed comment of step 12 in mvebu_a3700_comphy_ethernet_power_on() a little 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 | 1350 ++++++++++++++++-- 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, 1226 insertions(+), 203 deletions(-)