From patchwork Fri Jul 8 15:40:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1654211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=u9rwqHDm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lfcv04M50z9sGH for ; Sat, 9 Jul 2022 01:41:00 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1o9q66-00056U-LE; Fri, 08 Jul 2022 15:40:50 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o9q64-00055W-1s for kernel-team@lists.ubuntu.com; Fri, 08 Jul 2022 15:40:48 +0000 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D23073F1AA for ; Fri, 8 Jul 2022 15:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657294847; bh=7p9nDi1eGTpfw45To60MQwPiPcpyjDLsXE92Vec5/pw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u9rwqHDmH1D7D8Uk+6aFvfaZepmsh1JONNIZRWP+n29MzCAIJRJ6zPSPa8vFod258 WHUv2/zBYQ7bbJg/LNXGxr6V88wJXvWA0M+8UTOjrS612SwfyHL0pSNkslabsfSxO1 uPifiih180Lww3v26qNy/XgVOFeEOP7i5AnE3wAfuBC4RKdDLrT1mHMIolx5IH3izP +zJdoqQ25rz4mpq3Ado3KJ84J9sMt+ZvKyPWKdzefRwS8KxfFZv4p0eNLQb3R/T8AG hQqr6OJsnbYV/265Lnsbec/4ID5WeHntI3ldrphV1knzWvZXLcayKVsUlThLfGcI0C C3Ep5ZRi6Bg7g== Received: by mail-wr1-f70.google.com with SMTP id q12-20020adfab0c000000b0021d6dcb51e8so2931570wrc.13 for ; Fri, 08 Jul 2022 08:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7p9nDi1eGTpfw45To60MQwPiPcpyjDLsXE92Vec5/pw=; b=gEew+kOi3O46+64pIaMiJ9EdU1u6RX97dBuUbbo+G8+e7WIajb0O3XOn87QjcHYDZp OhS/zP1x1QtZRNHCNy41Rc8/mQ6bMOrmo3DRve1VvbxML46Vvv+Avz+XSUm4fO8JyFQs TTncHyr3uMWlUIE0bJ2DJgaPdG5/wPrLskeuS4uh8q9e5XKP/XkP7I2SdX4moksOBs55 672oTZQADPPtpI0i/pD+CqQWC/FCUxtZJWC55oVFVng6lX4crUMaUZ8rq1i0spdujdph utjpRFE3dZAn7M9RTXah0xKQfgzoXJ5/LJsn08XoDJIyE/UaYBepAfx9B4rUmxIPL0ZY ZrWg== X-Gm-Message-State: AJIora+FsN7fG/zumvg53ryVzocVtj7qOrUD68G6XrT/80mnI6hOamta TA6WKcpsyNlLQM8RtGfLC2LrTg0f9zD+okhl9cKd5R7hFIXxpa1cmNLc4no1lDcksxBkRfJQSbF PTqzb8gVYJlAFLfSRRuZ6+/BaelDbl8jZvBwYQfs2Dw== X-Received: by 2002:a5d:4806:0:b0:21d:66a2:5a52 with SMTP id l6-20020a5d4806000000b0021d66a25a52mr3879579wrq.632.1657294847278; Fri, 08 Jul 2022 08:40:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxfi3d4ODhXdBQ6pfHKOg/5C2Ecr92qPmNMReDFYepc1bBQ+m/1E1c6TcEByWvV0Y3DQ331A== X-Received: by 2002:a5d:4806:0:b0:21d:66a2:5a52 with SMTP id l6-20020a5d4806000000b0021d66a25a52mr3879556wrq.632.1657294846959; Fri, 08 Jul 2022 08:40:46 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id i18-20020a1c5412000000b003a03be22f9fsm2992573wmb.18.2022.07.08.08.40.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 08:40:46 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][J/allwinner-5.17][PATCH v2 1/4] phy: sun4i-usb: Rework HCI PHY (aka "pmu_unk1") handling Date: Fri, 8 Jul 2022 17:40:41 +0200 Message-Id: <20220708154044.944176-2-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708154044.944176-1-emil.renner.berthing@canonical.com> References: <20220708154044.944176-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andre Przywara BugLink: https://bugs.launchpad.net/bugs/1981074 As Icenowy pointed out, newer manuals (starting with H6) actually document the register block at offset 0x800 as "HCI controller and PHY interface", also describe the bits in our "PMU_UNK1" register. Let's put proper names to those "unknown" variables and symbols. While we are at it, generalise the existing code by allowing a bitmap of bits to clear and set, to cover newer SoCs: The A100 and H616 use a different bit for the SIDDQ control. Signed-off-by: Andre Przywara Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220203013558.11490-3-samuel@sholland.org Signed-off-by: Vinod Koul (cherry-pick from commit 1743dea7f06b939f67ba258bab993fa5ff6e43fb) Signed-off-by: Emil Renner Berthing --- drivers/phy/allwinner/phy-sun4i-usb.c | 30 ++++++++++++--------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 788dd5cdbb7d..142f4cafdc78 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -43,7 +43,7 @@ #define REG_PHYCTL_A33 0x10 #define REG_PHY_OTGCTL 0x20 -#define REG_PMU_UNK1 0x10 +#define REG_HCI_PHY_CTL 0x10 #define PHYCTL_DATA BIT(7) @@ -82,6 +82,7 @@ /* A83T specific control bits for PHY0 */ #define PHY_CTL_VBUSVLDEXT BIT(5) #define PHY_CTL_SIDDQ BIT(3) +#define PHY_CTL_H3_SIDDQ BIT(1) /* A83T specific control bits for PHY2 HSIC */ #define SUNXI_EHCI_HS_FORCE BIT(20) @@ -115,9 +116,9 @@ struct sun4i_usb_phy_cfg { int hsic_index; enum sun4i_usb_phy_type type; u32 disc_thresh; + u32 hci_phy_ctl_clear; u8 phyctl_offset; bool dedicated_clocks; - bool enable_pmu_unk1; bool phy0_dual_route; int missing_phys; }; @@ -288,6 +289,12 @@ static int sun4i_usb_phy_init(struct phy *_phy) return ret; } + if (phy->pmu && data->cfg->hci_phy_ctl_clear) { + val = readl(phy->pmu + REG_HCI_PHY_CTL); + val &= ~data->cfg->hci_phy_ctl_clear; + writel(val, phy->pmu + REG_HCI_PHY_CTL); + } + if (data->cfg->type == sun8i_a83t_phy || data->cfg->type == sun50i_h6_phy) { if (phy->index == 0) { @@ -297,11 +304,6 @@ static int sun4i_usb_phy_init(struct phy *_phy) writel(val, data->base + data->cfg->phyctl_offset); } } else { - if (phy->pmu && data->cfg->enable_pmu_unk1) { - val = readl(phy->pmu + REG_PMU_UNK1); - writel(val & ~2, phy->pmu + REG_PMU_UNK1); - } - /* Enable USB 45 Ohm resistor calibration */ if (phy->index == 0) sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1); @@ -863,7 +865,6 @@ static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A10, .dedicated_clocks = false, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun5i_a13_cfg = { @@ -872,7 +873,6 @@ static const struct sun4i_usb_phy_cfg sun5i_a13_cfg = { .disc_thresh = 2, .phyctl_offset = REG_PHYCTL_A10, .dedicated_clocks = false, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun6i_a31_cfg = { @@ -881,7 +881,6 @@ static const struct sun4i_usb_phy_cfg sun6i_a31_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A10, .dedicated_clocks = true, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = { @@ -890,7 +889,6 @@ static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = { .disc_thresh = 2, .phyctl_offset = REG_PHYCTL_A10, .dedicated_clocks = false, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun8i_a23_cfg = { @@ -899,7 +897,6 @@ static const struct sun4i_usb_phy_cfg sun8i_a23_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A10, .dedicated_clocks = true, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun8i_a33_cfg = { @@ -908,7 +905,6 @@ static const struct sun4i_usb_phy_cfg sun8i_a33_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A33, .dedicated_clocks = true, - .enable_pmu_unk1 = false, }; static const struct sun4i_usb_phy_cfg sun8i_a83t_cfg = { @@ -925,7 +921,7 @@ static const struct sun4i_usb_phy_cfg sun8i_h3_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A33, .dedicated_clocks = true, - .enable_pmu_unk1 = true, + .hci_phy_ctl_clear = PHY_CTL_H3_SIDDQ, .phy0_dual_route = true, }; @@ -935,7 +931,7 @@ static const struct sun4i_usb_phy_cfg sun8i_r40_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A33, .dedicated_clocks = true, - .enable_pmu_unk1 = true, + .hci_phy_ctl_clear = PHY_CTL_H3_SIDDQ, .phy0_dual_route = true, }; @@ -945,7 +941,7 @@ static const struct sun4i_usb_phy_cfg sun8i_v3s_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A33, .dedicated_clocks = true, - .enable_pmu_unk1 = true, + .hci_phy_ctl_clear = PHY_CTL_H3_SIDDQ, .phy0_dual_route = true, }; @@ -955,7 +951,7 @@ static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = { .disc_thresh = 3, .phyctl_offset = REG_PHYCTL_A33, .dedicated_clocks = true, - .enable_pmu_unk1 = true, + .hci_phy_ctl_clear = PHY_CTL_H3_SIDDQ, .phy0_dual_route = true, }; From patchwork Fri Jul 8 15:40:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1654213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=cRMi7nIE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lfcv43TLhz9ryY for ; Sat, 9 Jul 2022 01:41:04 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1o9q6B-0005BH-2v; Fri, 08 Jul 2022 15:40:55 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o9q66-00055d-5b for kernel-team@lists.ubuntu.com; Fri, 08 Jul 2022 15:40:50 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id AD2113F1AA for ; Fri, 8 Jul 2022 15:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657294848; bh=ViNVAaCd3El0kMdOjRi4M+B84TEWJKL0cHJUzKMwufY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cRMi7nIE4Vdj8X6ub8J5pxBHawUfqe6iQAHX6z+eZKG/EcjrtBgHRH/THG+OKxhts wHCCMTZl20eGJ9nsAdykM5t4vyqe5TYnmlA5UMvXxHDiHQ38pFTz1lHHc2A+nZJyXv 9WrzeSw18pzKYJncgMfpWiZUkBrIs4N47XEtJfr+r/X7BS8kanoO18IKQHEtR96DfY YO/rTskbVeC74wUpVyoF/qH2+Tjh4PZE1kKkfLrIBicFknYtwYLll7C88xONmzmLQm 6PdHKQEZT8+lw0xIxAsb3TNOJZK1FV6aYLShLpTtinTDQiZYPVM8ws3pI4VXlnV10O sN5pwikWYtMtw== Received: by mail-wm1-f70.google.com with SMTP id n18-20020a05600c501200b003a050cc39a0so9598284wmr.7 for ; Fri, 08 Jul 2022 08:40:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ViNVAaCd3El0kMdOjRi4M+B84TEWJKL0cHJUzKMwufY=; b=s5TI0snuDwF+bQbVczfFFnBQhz++1EcGNoHigIRleLcxtGWjoo5f5s/UgJW1OjQwZh zWshNBZAK15UehvHkIwAbeLSnAehV2X4MNcx3P+/uVzJK4n9a5+2rrFd31yydaQD9jb2 QaA7AxMD9npSnAbePc+6VG1tskMGF/akhf23N7sull7TbKpSeLow1jECr1gOp/GvJgmN Jm0q2zVi9v6TO7r9O+k0wais+ESe9iphkZXuLy33rSbNx/rKt53WBkA2kPfhESJbY0F1 ns7uvcjDdXmNoB6eFJWB++wauOAYHmzvW/Z1/RndPmBK0FSMqkg9+XsrlVIUiFZroZjP vYOw== X-Gm-Message-State: AJIora/R+D0umQyLvQeONHJpKeWB89Ido4zaYrB+9TP29vGQeWRhUPW+ 5gHdv7+ihEAQtNKaGd3QSVTb68Zy3W3FQ1WHnJmKvteRas6L07CYWYW+r8k25e4RFPaqQ2BZj0S Rjm+nyfQDe56eNPHw4rjJ3azs00mJ6AJQpMfbFyIx5w== X-Received: by 2002:a5d:5986:0:b0:21d:8779:8220 with SMTP id n6-20020a5d5986000000b0021d87798220mr3913563wri.165.1657294848204; Fri, 08 Jul 2022 08:40:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWhElPUNyCAZmtZxP1fq15spW5uNAuJQve2/1kupbVH36/XK31Xvi7aibNGn3Kk8KLXUkv+A== X-Received: by 2002:a5d:5986:0:b0:21d:8779:8220 with SMTP id n6-20020a5d5986000000b0021d87798220mr3913549wri.165.1657294847960; Fri, 08 Jul 2022 08:40:47 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id i18-20020a1c5412000000b003a03be22f9fsm2992573wmb.18.2022.07.08.08.40.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 08:40:47 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][J/allwinner-5.17][PATCH v2 2/4] UBUNTU: SAUCE: phy: sun4i-usb: Add D1 variant Date: Fri, 8 Jul 2022 17:40:42 +0200 Message-Id: <20220708154044.944176-3-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708154044.944176-1-emil.renner.berthing@canonical.com> References: <20220708154044.944176-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Samuel Holland BugLink: https://bugs.launchpad.net/bugs/1981074 D1 has a register layout like A100 and H616, with the moved SIDDQ bit. Unlike H616 it does not have any dependencies between PHY instances. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220203013558.11490-4-samuel@sholland.org Signed-off-by: Vinod Koul (cherry-pick from https://github.com/smaeul/linux.git riscv/d1-wip) Signed-off-by: Emil Renner Berthing --- drivers/phy/allwinner/phy-sun4i-usb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 142f4cafdc78..997a5e5e8136 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -945,6 +945,15 @@ static const struct sun4i_usb_phy_cfg sun8i_v3s_cfg = { .phy0_dual_route = true, }; +static const struct sun4i_usb_phy_cfg sun20i_d1_cfg = { + .num_phys = 2, + .type = sun50i_h6_phy, + .phyctl_offset = REG_PHYCTL_A33, + .dedicated_clocks = true, + .hci_phy_ctl_clear = PHY_CTL_SIDDQ, + .phy0_dual_route = true, +}; + static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = { .num_phys = 2, .type = sun50i_a64_phy, @@ -976,6 +985,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = { { .compatible = "allwinner,sun8i-h3-usb-phy", .data = &sun8i_h3_cfg }, { .compatible = "allwinner,sun8i-r40-usb-phy", .data = &sun8i_r40_cfg }, { .compatible = "allwinner,sun8i-v3s-usb-phy", .data = &sun8i_v3s_cfg }, + { .compatible = "allwinner,sun20i-d1-usb-phy", .data = &sun20i_d1_cfg }, { .compatible = "allwinner,sun50i-a64-usb-phy", .data = &sun50i_a64_cfg}, { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, From patchwork Fri Jul 8 15:40:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1654214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=rQeqN2YP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lfcv735FNz9ryY for ; Sat, 9 Jul 2022 01:41:07 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1o9q6E-0005FV-6T; Fri, 08 Jul 2022 15:40:58 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o9q66-00056K-GS for kernel-team@lists.ubuntu.com; Fri, 08 Jul 2022 15:40:50 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 3649E3F1AA for ; Fri, 8 Jul 2022 15:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657294850; bh=0Rrgfp2Pxje9MbLYfkVzQsoFTP60uoqT+1dvLih5WZI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rQeqN2YP1h0Dczl2CpKsmN+WhM2ZFSCXF4I7/a/c0Jkk6/69Vz0TbDXZCJJISiTdO Xop47gPa+QOpyzC0/NHw/MMM9RCSw3gBs9RGLH0D+a569DsenD+WrFR7z5EACqEqyY 51a05RjHEQb/m33SxNy+u7d9cMH7j3w7o7KsogGQzkdprDb8FfZqVvw4ijrQD8QQb8 zsAOcAXulqMUM5hSEyi9yW1QXCbGVXL0sglKWhxQauLLi2ZNCLT85C1U9gDH7bdZcZ HsxD3a4TmNI8QNFZeXxVCruxAtHWiWPJDTQ/+noWNQkr4zL5rBamvTQxp4LDOor9kR tHbn1l6NdA8nA== Received: by mail-wr1-f69.google.com with SMTP id g9-20020adfa489000000b0021d6e786099so2660548wrb.7 for ; Fri, 08 Jul 2022 08:40:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Rrgfp2Pxje9MbLYfkVzQsoFTP60uoqT+1dvLih5WZI=; b=VlLePtMcfk5wITclXyefyphG+MjHbWs1S5VLPdVm+VWOGiegXl9a4zsyQhW/34i70e kTIz/CgeCqXI73oxYF6tzvfxtOaO6VOmtRS8WHIEhEjFs56qWH7SKfyXN5xAEX4ComRb FinO5PjGN51KVp7vT2GILieEfKkIsR4HZyI1atQHXxvj482l9lB+D18YmH03BOsEKwYN Zi5OKaSALdervutwZfk0K7py4tJJ8lXhseX0v+e+L3ket1bTAiytkZtbSjtON69RaBcw qJAYBmOWL4HM4fHyzbLWVAjkh/oIFDPddm9ilgRCqThWsLA1/HLHnfMnudUmXtkXtzso JZxA== X-Gm-Message-State: AJIora/PfhWcLP1PjSvMoSDsGHWjjOSHw3OcVo/pUnOg66GBGFNUZvQ/ lKt7WkwI+cIWPbJ4xT9yBzT3bY3+x2j72aw7Q8Y3EN4dTJNtpULD95/Dm1HSTiSU8zZ6hEQTdRh uu9VT0jRC0lQogrbf+tmX5QsnYKcTgd5FwJP8mKRMuw== X-Received: by 2002:a5d:595f:0:b0:21d:78fd:70d6 with SMTP id e31-20020a5d595f000000b0021d78fd70d6mr3857446wri.402.1657294849099; Fri, 08 Jul 2022 08:40:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v54NFtywA16SjBg7Y7YyjKPuXYff0hfMyxNXDM4b/GkTRsN25p3TeysPvt4UBmoxlO7Lkxvg== X-Received: by 2002:a5d:595f:0:b0:21d:78fd:70d6 with SMTP id e31-20020a5d595f000000b0021d78fd70d6mr3857421wri.402.1657294848847; Fri, 08 Jul 2022 08:40:48 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id i18-20020a1c5412000000b003a03be22f9fsm2992573wmb.18.2022.07.08.08.40.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 08:40:48 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][J/allwinner-5.17][PATCH v2 3/4] UBUNTU: SAUCE: PM / devfreq: Add dummy R329/D1 MBUS driver Date: Fri, 8 Jul 2022 17:40:43 +0200 Message-Id: <20220708154044.944176-4-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708154044.944176-1-emil.renner.berthing@canonical.com> References: <20220708154044.944176-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Samuel Holland BugLink: https://bugs.launchpad.net/bugs/1981074 Signed-off-by: Samuel Holland (cherry-pick from https://github.com/smaeul/linux.git riscv/d1-wip) Signed-off-by: Emil Renner Berthing --- drivers/devfreq/Kconfig | 6 ++++++ drivers/devfreq/Makefile | 1 + drivers/devfreq/sun50i-r329-mbus.c | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 drivers/devfreq/sun50i-r329-mbus.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 87eb2b837e68..2823d72dae16 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -141,6 +141,12 @@ config ARM_SUN8I_A33_MBUS_DEVFREQ This adds the DEVFREQ driver for the MBUS controller in some Allwinner sun8i (A33 through H3) and sun50i (A64 and H5) SoCs. +config ARM_SUN50I_R329_MBUS_DEVFREQ + tristate "Allwinner R329 MBUS DEVFREQ Driver" + help + This adds the DEVFREQ driver for the MBUS controller in some + Allwinner sun20i (D1) and sun50i (R329) SoCs. + source "drivers/devfreq/event/Kconfig" endif # PM_DEVFREQ diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index 0b6be92a25d9..017ce88f6d0b 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o obj-$(CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ) += sun8i-a33-mbus.o +obj-$(CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ) += sun50i-r329-mbus.o obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o # DEVFREQ Event Drivers diff --git a/drivers/devfreq/sun50i-r329-mbus.c b/drivers/devfreq/sun50i-r329-mbus.c new file mode 100644 index 000000000000..983a366a1f13 --- /dev/null +++ b/drivers/devfreq/sun50i-r329-mbus.c @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Copyright (C) 2022 Samuel Holland +// + +#include +#include +#include + +static const struct of_device_id sun50i_r329_mbus_of_match[] = { + { .compatible = "allwinner,sun20i-d1-mbus" }, + { .compatible = "allwinner,sun50i-r329-mbus" }, + { }, +}; +MODULE_DEVICE_TABLE(of, sun50i_r329_mbus_of_match); + +static struct platform_driver sun50i_r329_mbus_driver = { + .driver = { + .name = "sun50i-r329-mbus", + .of_match_table = sun50i_r329_mbus_of_match, + }, +}; +module_platform_driver(sun50i_r329_mbus_driver); + +MODULE_AUTHOR("Samuel Holland "); +MODULE_DESCRIPTION("Allwinner R329 MBUS DEVFREQ Driver"); +MODULE_LICENSE("GPL v2"); From patchwork Fri Jul 8 15:40:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 1654212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=KE8LUoYP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lfcv22Jwhz9s09 for ; Sat, 9 Jul 2022 01:41:02 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1o9q68-00058V-Tu; Fri, 08 Jul 2022 15:40:52 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1o9q66-00056y-Uw for kernel-team@lists.ubuntu.com; Fri, 08 Jul 2022 15:40:50 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id ADA233F1AA for ; Fri, 8 Jul 2022 15:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657294850; bh=PHR4/gEWeOHNBQwzSkntLZwZfwOFxZ67k+uUt774HaM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KE8LUoYPrQygNsKxkbiSbEnxn7x0k+xpjDfP3oii9G9MwZxW+/2o2mnh7bQste4/r wRFz17f5Xvzba19ljbsLeRVxD3XFiCgqNBaA3oFeqkKvYO2akJtg7WT1NU6bCCO07x fkXpDgzxFCUXV3ZsO3v4brc0De8PSWYI7A1g35FdSZ+hn5F6H7yweuqZJnxpJ/M4A+ pChXvjh0NonXuTlu7WqCJeretRrOutIzzBQCjWHTv9IFQG7rNtiIW1buKBDDs3D1bu IhG03ULX6K3Zjc7ecF7RgZk9JivzoQPjqte8h9rxjUGRNzYLunS88yNSyokpHn8I3m qs5VgQ0uQUb7Q== Received: by mail-wm1-f72.google.com with SMTP id h65-20020a1c2144000000b003a2cf5b5aabso10505wmh.8 for ; Fri, 08 Jul 2022 08:40:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PHR4/gEWeOHNBQwzSkntLZwZfwOFxZ67k+uUt774HaM=; b=zAl3IFuW/XrowvtkV+DfAzXzJBCiGgpGi1vj+bj3AhunzyuWWvDKMUKT8xoial27J2 DzSFJfBdSp5CWbWpfQVnUD6ZhFbsXkA/vLqepKaJjxIkvSZzJSM9fuezHoOF6d3VymKU VwkUqfSEdLUywLJUQZiMqTKNrVLgn8GYw+W+LVw9+QXeuu4kZ2ViTTjI1E4u/2UpN24A I2PdwIjTR9ursOHXdrQrBuCl9hcO/nYG757TK/d43iQLC8gaGefP8YiyJ1TNy8+kwD+h QdBbLxK59Yd98cCN953uOFj/Wd9B+kzpAL4Jk/9k7WRUvC7byHvclJlffYaHApvPzXoF uRBw== X-Gm-Message-State: AJIora9oWX4UHZH3hQbWaCjMExV6BSHkRDIUO9yTwW9JJD33rZWLE+pn 5C3Vt6W8AUtKWZCdiYcJW/dVPvCyc22LjMixo3DISxcmMeW6t1RvNiWnCS+q9+SQcLh8eY1F1Cn SCam62kCDup1vZi5B7i8S4gVuVdtYWVGe1FPxBEF9jw== X-Received: by 2002:a5d:464a:0:b0:21d:68db:5244 with SMTP id j10-20020a5d464a000000b0021d68db5244mr3863350wrs.566.1657294850200; Fri, 08 Jul 2022 08:40:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uPp+pMrXhikscyG/kItd2djb53GFhGAhudKhXC0Q8AJXZg0awyzLR0r1ia9p7Ra2t0gr4l5A== X-Received: by 2002:a5d:464a:0:b0:21d:68db:5244 with SMTP id j10-20020a5d464a000000b0021d68db5244mr3863336wrs.566.1657294849938; Fri, 08 Jul 2022 08:40:49 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id i18-20020a1c5412000000b003a03be22f9fsm2992573wmb.18.2022.07.08.08.40.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 08:40:49 -0700 (PDT) From: Emil Renner Berthing To: kernel-team@lists.ubuntu.com Subject: [SRU][J/allwinner-5.17][PATCH v2 4/4] UBUNTU: [Config] Enable additional Allwinner D1 options Date: Fri, 8 Jul 2022 17:40:44 +0200 Message-Id: <20220708154044.944176-5-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708154044.944176-1-emil.renner.berthing@canonical.com> References: <20220708154044.944176-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1981074 CONFIG_SUN6I_RTC_CCU=y is needed to export the iosc clock for the random number generator in the crypto peripheral or the driver won't probe. CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG=y enables support for the "true random number generator" now that the crypto driver works. CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ=y enables the newly added dummy driver that the display engine depends on. Add annotations for the clock drivers, crypto driver and the new dummy devfreq driver while we're here. Signed-off-by: Emil Renner Berthing --- debian.allwinner/config/annotations | 16 ++++++++++++++++ debian.allwinner/config/config.common.ubuntu | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/debian.allwinner/config/annotations b/debian.allwinner/config/annotations index 06efec7fbf99..dc779e4bb1d2 100644 --- a/debian.allwinner/config/annotations +++ b/debian.allwinner/config/annotations @@ -155,6 +155,11 @@ CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG policy<{'riscv64': 'n'}> # Menu: Cryptographic API >> Hardware crypto devices >> Freescale CAAM Job Ring driver backend # Menu: Cryptographic API >> Hardware crypto devices >> Support for Allwinner cryptographic offloader +CONFIG_CRYPTO_DEV_SUN8I_CE policy<{'riscv64': 'y'}> +CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG policy<{'riscv64': 'y'}> +CONFIG_CRYPTO_DEV_SUN8I_CE_HASH policy<{'riscv64': 'y'}> +CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG policy<{'riscv64': 'y'}> +CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG policy<{'riscv64': 'y'}> # Menu: Cryptographic API >> Hardware crypto devices >> Support for OMAP crypto HW accelerators @@ -462,6 +467,14 @@ CONFIG_COMMON_CLK_FIXED_MMIO policy<{'riscv64': 'y'}> # Menu: Device Drivers >> Common Clock Framework >> Clock driver for MediaTek SoC >> Clock driver for MediaTek MT8183 # Menu: Device Drivers >> Common Clock Framework >> Clock support for Allwinner SoCs +CONFIG_SUNXI_CCU policy<{'riscv64': 'y'}> +CONFIG_SUN20I_D1_CCU policy<{'riscv64': 'y'}> +CONFIG_SUN20I_D1_R_CCU policy<{'riscv64': 'y'}> +CONFIG_SUN6I_RTC_CCU policy<{'riscv64': 'y'}> +CONFIG_SUN8I_DE2_CCU policy<{'riscv64': 'y'}> +CONFIG_SUN8I_R_CCU policy<{'riscv64': 'y'}> + +CONFIG_SUN6I_RTC_CCU note # Menu: Device Drivers >> Common Clock Framework >> Ingenic SoCs drivers @@ -772,6 +785,9 @@ CONFIG_DEVFREQ_GOV_PERFORMANCE policy<{'riscv64': 'y'}> CONFIG_DEVFREQ_GOV_POWERSAVE policy<{'riscv64': 'y'}> CONFIG_DEVFREQ_GOV_USERSPACE policy<{'riscv64': 'y'}> CONFIG_DEVFREQ_GOV_PASSIVE policy<{'riscv64': 'y'}> +CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ policy<{'riscv64': 'y'}> + +CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ note # Menu: Device Drivers >> Generic Dynamic Voltage and Frequency Scaling (DVFS) support >> DEVFREQ-Event device Support CONFIG_PM_DEVFREQ_EVENT policy<{'riscv64': 'y'}> diff --git a/debian.allwinner/config/config.common.ubuntu b/debian.allwinner/config/config.common.ubuntu index d74825fa6340..722cec25cc7b 100644 --- a/debian.allwinner/config/config.common.ubuntu +++ b/debian.allwinner/config/config.common.ubuntu @@ -270,6 +270,7 @@ CONFIG_ARCNET_COM90xxIO=m CONFIG_ARCNET_RAW=m CONFIG_ARCNET_RIM_I=m CONFIG_ARCX_ANYBUS_CONTROLLER=m +CONFIG_ARM_SUN50I_R329_MBUS_DEVFREQ=y CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ=m CONFIG_AS3935=m CONFIG_AS73211=m @@ -1277,7 +1278,7 @@ CONFIG_CRYPTO_DEV_SUN8I_CE=y CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG=y CONFIG_CRYPTO_DEV_SUN8I_CE_HASH=y CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG=y -# CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG is not set +CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG=y CONFIG_CRYPTO_DEV_SUN8I_SS=y CONFIG_CRYPTO_DEV_SUN8I_SS_DEBUG=y CONFIG_CRYPTO_DEV_SUN8I_SS_HASH=y @@ -7254,7 +7255,7 @@ CONFIG_SUN50I_DE2_BUS=y CONFIG_SUN50I_IOMMU=y CONFIG_SUN5I_HSTIMER=y CONFIG_SUN6I_MSGBOX=y -CONFIG_SUN6I_RTC_CCU=m +CONFIG_SUN6I_RTC_CCU=y CONFIG_SUN8I_DE2_CCU=y # CONFIG_SUN8I_DSP_REMOTEPROC is not set CONFIG_SUN8I_MSGBOX=y