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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6DF6C46467 for ; Wed, 4 Jan 2023 14:08:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D980385588; Wed, 4 Jan 2023 15:08:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="EAkJCqMs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7824D851EE; Wed, 4 Jan 2023 15:08:18 +0100 (CET) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CB6DE80A55 for ; Wed, 4 Jan 2023 15:08:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Sergiu.Moga@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1672841295; x=1704377295; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MIgKx2f8uJAkPpZ55QIdpok74Y3FqNSRKDxqFFLxU+A=; b=EAkJCqMswA6dNaj/8jCtJWW4TMENR1S41tbHtswerQh88TqTKtfqhSnQ A5d+5ewZpFTtMMpcREf7rEHDGNNaaE0PIqkOOaRFlDrTWxaUBJvNXb3Xk BqEdoIpNBBl5oxzpvB9r1cirAIyI++p9izQcIzcr+y0Jvl3QDhT+ZmThX o4g6c1NP0SrJdR9N8jh60BgVYgiKBkTQCpcj0lHbrUrpdQPAFdAsx2RoS 88R7IOrSWMlbY+/Dax4RhTMdEad6Nm/S0xSjT0ep1k02AENeZrid4kC7Z WA/I3XqHmcieTlBW/4U78QFn+VqttrbsmuzqFyHH9Z7HIFKADJS1b+gu8 w==; X-IronPort-AV: E=Sophos;i="5.96,300,1665471600"; d="scan'208";a="190701344" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Jan 2023 07:08:13 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 4 Jan 2023 07:08:11 -0700 Received: from ROB-ULT-M68701.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Wed, 4 Jan 2023 07:08:08 -0700 From: Sergiu Moga To: , , , , , , , , , CC: Subject: [PATCH v3 0/3] Register at91 OHCI into DM and add SAMA7 USB PHY's Date: Wed, 4 Jan 2023 16:08:04 +0200 Message-ID: <20230104140806.150097-1-sergiu.moga@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This patch series originates from a bigger patch series: https://lists.denx.de/pipermail/u-boot/2022-December/502865.html Register ohci-at91 driver into Driver Model. In order for the VBUS to stay enabled, a `child_pre_probe` method has been added to overcome the DM core disabling it in `usb_scan_device`: when the generic `device_probe` method is called, the pinctrl is processed once again, undoing whatever changes have been made in our driver's probe method. In order to enable USB on SAMA7G5 the addition of the USB 2.0 PHY drivers were required. v1 -> v2: - squashed previous 3/4 patch into 2/4 patch - used *_bulk API's - re-wrote at91_for_each_port - use dev_read_u32_default for pdata->ports v2 -> v3: - corrected memory leak in the utmi phy driver probe method - checked dev_read_addr return value - add clk_disable in case of failure after at91_start_hc - prefer using if (CONFIG_IS_ENABLED(...)) - add comment regarding why non-DM version must stay Sergiu Moga (3): phy: at91: Add support for the USB 2.0 PHY's of SAMA7 usb: ohci-at91: Enable OHCI functionality and register into DM usb: ohci-at91: Add USB PHY functionality drivers/phy/Kconfig | 10 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-sama7-usb.c | 90 +++++++++++++ drivers/phy/phy-sama7-utmi-clk.c | 216 +++++++++++++++++++++++++++++++ drivers/usb/host/Kconfig | 1 + drivers/usb/host/ohci-at91.c | 187 ++++++++++++++++++++++++++ 6 files changed, 505 insertions(+) create mode 100644 drivers/phy/phy-sama7-usb.c create mode 100644 drivers/phy/phy-sama7-utmi-clk.c -- 2.34.1