Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp572080rwr; Wed, 26 Apr 2023 03:31:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bAe8oQ9Sb8XWrEMscIMTp69KD75TlB8DUE16X3dszYwTqplxe9NouGbn7dZcAdc7HndnjK X-Received: by 2002:a05:6a00:1894:b0:63d:2f12:fa35 with SMTP id x20-20020a056a00189400b0063d2f12fa35mr28938231pfh.26.1682505110627; Wed, 26 Apr 2023 03:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682505110; cv=none; d=google.com; s=arc-20160816; b=QircC9aHdtYukMH0xZ1wmZ2GTxP665xZc5vVu4lgTZZISzvVJZ+oNxgzKrRkiy/HS6 OIhnqFr/TUO6ubzaFa3x0h1yM9ZtN0xDOf37ZyDe3dM231oIBqRxrwk1q35BrS310GXP fFGLnb0TzWReOmvR2A4d1UDbD/oY3S8yUYfKeGcho9ohdBs/Qc4e9+CqmY2XuGjyBS3f uZ2VsGRyvDnv4MGMXbf6cmPclodno67+/ijsQwY5mPmOKwnhrfpP9g91uOOw6besN93C c0IoygcHrtTbahQ95EYZma1mfoP5sglOHdNK3d2wY4kRzbGJozdtYRLGvPcjDUhflbRt 88uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=G2zp6fXp50ZrnxTL45q7kYiCTTf6jCTtGwh/0Q+wtss=; b=S0kZ7MTTjcO0eDwi++y2/9rCZVg39XDk7LO5U+VQGX1zYwwOZPELEa9Qwh7VIUm2Sl 0+Lp/JruChkn/MiHrqbq5k1CH3/IQYWVa8pC+HsA2dj4TOzsfwhuOakwoHQKFfLo8CbD Lgz5eO5DosBHX00TbGRkL4f//X9wTg7JzKTRXOXQ0pwo/1eXGKxrSXIUKGSqVjOCWXdN 21DQ2VJHSPaKb+TQ0T0iogjavZ81GM8CjBYn607kw47zBNLLXr588aAHcQ0PQpDUgA5A QXsd8XWidYx0z1ZVPTDdzReipSUDcyYwUtdWQQfKrHiMKOznPg1QH03hbDxlkZCCm2Af Mucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=TuYBmAqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020aa79d0c000000b0063d23db693asi12282330pfp.234.2023.04.26.03.31.37; Wed, 26 Apr 2023 03:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=TuYBmAqF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240443AbjDZK3u (ORCPT + 99 others); Wed, 26 Apr 2023 06:29:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239463AbjDZK3l (ORCPT ); Wed, 26 Apr 2023 06:29:41 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4490249F0; Wed, 26 Apr 2023 03:29:39 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id A06385FD7A; Wed, 26 Apr 2023 13:29:37 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682504977; bh=G2zp6fXp50ZrnxTL45q7kYiCTTf6jCTtGwh/0Q+wtss=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TuYBmAqFr809pIi+6bVNedFGOtePyBzWRfuu4qWOQbnHjW3reDXL/t3nwejNgv53k FiXNL54F3rxJtviC8KOfwrX/pM5EgqXxiC+uAuNHP6Ra+TsLWDhLZx+6Po6fW4EEtR LqBqIpoBFQKnNtw/w3RRyyMUJH2MM3tjwLFht3fyey2WuV4iiixgYkeQjipdH8dPjT 3u3kBl77oMxFJ9WwanIiJ52RtHisH0hDzJP0lNW7vyxv9TYeORcoidVvUdFxRsfJux 6VeTgFjrDiEuFNGHwNpU1lxF51TO7DbCdvNDdIDNA8MKg7XMkOqNrLgoTBQNyh9biA YUThncWFN1BCw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 26 Apr 2023 13:29:35 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , , , , CC: , , , , , , , , , , Dmitry Rokosov Subject: [PATCH v3 0/5] arm64: meson: support Amlogic A1 USB OTG controller Date: Wed, 26 Apr 2023 13:29:17 +0300 Message-ID: <20230426102922.19705-1-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/04/26 04:45:00 #21166225 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series introduces full support for the Amlogic A1 USB controller in OTG mode (peripheral and host modes switching). Previously, Amlogic's patch series [1] was applied to the upstream tree, but it only had USB host mode support. Furthermore, the device tree patchset [2] wasn't merged due to a missing clk driver. Patchset [2] has been completely reworked: - changed register base offsets to proper values - introduced dwc2 in peripheral mode - OTG mode support - the SoB of Amlogic authors still remain Testing: - USB OTG role switching between gadget and host - OK - Peripheral mode - OK (tested with adb shell/push/pop) - Host mode - OK (tested only USB enumeration and detection) Changes v3 since v2 at [4]: - if reset_control_reset() fails during phy_exit() callback execution, do not disable clkin, instead, return an error immediately - provide proper 'phy-names' for the dwc2 device tree node as 'usb2-phy' instead of 'usb2_phy' (replace underscore with dash) Changes v2 since v1 at [3]: - as Martin suggested in v1, this commit completely removes the 'otg_switch_supported' parameter from dwc3_meson_g12a_drvdata; this parameter is no longer necessary as all IP versions now support OTG switching - this commit moves the USB PHY clkin enable/disable calls to the PHY init/exit routines Links: [1] https://lore.kernel.org/all/1581990859-135234-1-git-send-email-hanjie.lin@amlogic.com/ [2] https://lore.kernel.org/all/1581990859-135234-4-git-send-email-hanjie.lin@amlogic.com/ [3] https://lore.kernel.org/all/20230414152423.19842-1-ddrokosov@sberdevices.ru/ [4] https://lore.kernel.org/all/20230418111612.19479-1-ddrokosov@sberdevices.ru/ Dmitry Rokosov (5): phy: amlogic: enable/disable clkin during Amlogic USB PHY init/exit usb: dwc2: support dwc2 IP for Amlogic A1 SoC family dt-bindings: usb: dwc2: add support for Amlogic A1 SoC USB peripheral usb: dwc3-meson-g12a: support OTG switch for all IP versions arm64: dts: meson: a1: support USB controller in OTG mode .../devicetree/bindings/usb/dwc2.yaml | 1 + arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 59 +++++++++++++++++++ drivers/phy/amlogic/phy-meson-g12a-usb2.c | 15 ++++- drivers/usb/dwc2/params.c | 21 +++++++ drivers/usb/dwc3/dwc3-meson-g12a.c | 16 +---- 5 files changed, 97 insertions(+), 15 deletions(-) -- 2.36.0