From patchwork Fri Mar 31 13:12:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195988 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 D5D95C77B6E for ; Fri, 31 Mar 2023 13:13:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dfcXdohjvKRQy+EOUZJ4rpmUL6tZkFjY6y4oH8PwkNI=; b=a0zenO8mcwNt2k+ysmBXls+LqK 0Mr8SVJ69sEe84Wkl0Lrv+YESxZwmn4RCdS5cILD+Drp6Mq/m8XhFyzk8kWzQhsmRV1E8bqjuQRog 8B+w7v+MKrKZRCGWtPd2nHCgbsKzCm1cCxTuEDeWblzXojGUo2tWHdh0BddMHVmJe2ftAzgi0S3KX aMAs1D/O3AmpjDKu5CjmIT5C3eyh49g4/m8EY3WWbjloHgvaz1J5iOa1PqxGICMkyv7ND+OCyhRva XFJ9MQdR+lmxFIDfRYes2oixBDUcwAQUv7610RZoMbHu+NU0LcuRU535kEv4mjbIKqGRTlyY64v2q ZXT1GHpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZV-007USi-01; Fri, 31 Mar 2023 13:13:37 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZS-007URl-2P for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:35 +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 3DC05628C8; Fri, 31 Mar 2023 13:13:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6B86C433EF; Fri, 31 Mar 2023 13:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268412; bh=0Z0VSc/Pdg8WAOtxQIuNbiILq7OdgMdHZPAiZ/hleNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RMS0Vb5+vEa1g/Kqfrg1KNSBMoPz2kc0O+kTypYgZCOxjBFIAls+i+VyuJwXgDn/d M1ar0Bw8m8qRBLSWeokN8yKUg2yOL1Mme+RwjvuMrpgwekcASFCbImWa6/mbXJnVVR FlVTc3kQew36Kw6RWdiJ1aACzV6TL7LGng4TKFSpHZzzOwCweQAbtNu55g9CRbURuz VwQ93LFugK3eaCdVP5jcm7x+ayu41FgVlfJAIdkWj6fmPIn6cNTNCJ5DkXeTetoNz0 +FV4mfuE8a5tYkeedfjwKUNy2ZiW/2aC0GFK2UGx3VUoecbY5uREpVdlVW6huE7f0R 55tnNUpbIxpqA== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 01/10] net: ethernet: mtk_wed: rename mtk_wed_get_memory_region in mtk_wed_get_reserved_memory_region Date: Fri, 31 Mar 2023 15:12:37 +0200 Message-Id: <2915976b78fddb4b918c071d7409efa832201f3e.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061334_821232_DE23B7AA X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org This is a preliminary patch to move Wireless Ethernet Dispatch (WED) ilm/dlm and cpuboot properties in dedicated dts nodes. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index 6bad0d262f28..6624f6d6abdd 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -215,8 +215,8 @@ int mtk_wed_mcu_msg_update(struct mtk_wed_device *dev, int id, void *data, } static int -mtk_wed_get_memory_region(struct mtk_wed_wo *wo, - struct mtk_wed_wo_memory_region *region) +mtk_wed_get_reserved_memory_region(struct mtk_wed_wo *wo, + struct mtk_wed_wo_memory_region *region) { struct reserved_mem *rmem; struct device_node *np; @@ -311,13 +311,13 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) /* load firmware region metadata */ for (i = 0; i < ARRAY_SIZE(mem_region); i++) { - ret = mtk_wed_get_memory_region(wo, &mem_region[i]); + ret = mtk_wed_get_reserved_memory_region(wo, &mem_region[i]); if (ret) return ret; } wo->boot.name = "wo-boot"; - ret = mtk_wed_get_memory_region(wo, &wo->boot); + ret = mtk_wed_get_reserved_memory_region(wo, &wo->boot); if (ret) return ret; From patchwork Fri Mar 31 13:12:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195989 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 8DA23C77B62 for ; Fri, 31 Mar 2023 13:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RtuUSBCL6oK0wCo9g5IU1bv/6d1t1iIG4a9k1pYuPAw=; b=KCUEOaOgUUe9yE/dKy6LaSD5el DM7PrXTaIioPZHKVE4bb988RESgw3RxYfYCdYWLcnHWoeTdHuu1LHtwoWQ+Lom2eo7uBoui7hXOQo xG7mNeVIjGKtgiMxrviplue1TWCqqdjx2j3VSthfZGYxbRHtmgXnlzlwcqzHz32/0NMWiOzkcYf1A q39FXBDSnBIwXtWmTQQ+SG4zoYk0Zp/Wo62pBIziU1mjW7Yru1kJlwkJXcxUijVs+ObVt0OjrI4T3 Ko+s9wSjwcUgEQi/EnsMX4C8w/LDsAkq/GWgX/5B5kG1hr3YiIAMLswh+0V1ZU0+AwcvB6i3TmeF2 2ss7RiyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZY-007UUF-1x; Fri, 31 Mar 2023 13:13:41 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZV-007USf-0E for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:38 +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 A854E62709; Fri, 31 Mar 2023 13:13:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 846DEC433EF; Fri, 31 Mar 2023 13:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268415; bh=hLAVugf0wJMRhEaxQsvqqH7c9szSLlu5vrY4HfSo9tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EIbzxKeiYwg4H5W5KbXKGlMazIyivy0rCuyVuSKwL6EuM9HG2PbqrCHGOgpdq6AUj Zx/DsteS5DrWzVcrx0dKvjlwx3Z4f2HLUvT5IXxvgZ3H9jEpax0Qoc89VqONaU77+Q 7zUzavyXeHuqR2kYJ2tHBIHXYXtQmgH4FnoQ/V1p8RurjADnS0MIoC36MrHkJGfzlP aWZAroYpC23dNVzCrW09maHjIylqy5BpOkETQkw68ED994GniBBc9qPEJDLSXY/vXg fI70Mp+tWHu9kx1lwikE0O6haXvo1Zks7pYEhuaLjUNuu+SEWD1CuZU7BsZKwvpNsb glkwmp/b1s0PA== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 02/10] net: ethernet: mtk_wed: move cpuboot in a dedicated dts node Date: Fri, 31 Mar 2023 15:12:38 +0200 Message-Id: <56ed497762b1c031c553210a0e5c7717c6069642.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061337_227624_73023CC3 X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the cpuboot memory region is not part of the RAM MT7986 SoC, move cpuboot in a deidicated syscon node. Keep backward-compatibility with older dts version where cpuboot was defined as reserved-memory child node. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 34 +++++++++++++++++---- drivers/net/ethernet/mediatek/mtk_wed_wo.h | 3 +- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index 6624f6d6abdd..797c3b412ab6 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -18,12 +18,23 @@ static u32 wo_r32(struct mtk_wed_wo *wo, u32 reg) { - return readl(wo->boot.addr + reg); + u32 val; + + if (!wo->boot_regmap) + return readl(wo->boot.addr + reg); + + if (regmap_read(wo->boot_regmap, reg, &val)) + val = ~0; + + return val; } static void wo_w32(struct mtk_wed_wo *wo, u32 reg, u32 val) { - writel(val, wo->boot.addr + reg); + if (wo->boot_regmap) + regmap_write(wo->boot_regmap, reg, val); + else + writel(val, wo->boot.addr + reg); } static struct sk_buff * @@ -316,10 +327,21 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) return ret; } - wo->boot.name = "wo-boot"; - ret = mtk_wed_get_reserved_memory_region(wo, &wo->boot); - if (ret) - return ret; + wo->boot_regmap = syscon_regmap_lookup_by_phandle(wo->hw->node, + "mediatek,wo-cpuboot"); + if (IS_ERR(wo->boot_regmap)) { + if (wo->boot_regmap != ERR_PTR(-ENODEV)) + return PTR_ERR(wo->boot_regmap); + + /* For backward compatibility, we need to check if cpu_boot + * is defined through reserved memory property. + */ + wo->boot_regmap = NULL; + wo->boot.name = "wo-boot"; + ret = mtk_wed_get_reserved_memory_region(wo, &wo->boot); + if (ret) + return ret; + } /* set dummy cr */ wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL, diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.h b/drivers/net/ethernet/mediatek/mtk_wed_wo.h index dbcf42ce9173..c03071203cc0 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h @@ -227,7 +227,8 @@ struct mtk_wed_wo_queue { struct mtk_wed_wo { struct mtk_wed_hw *hw; - struct mtk_wed_wo_memory_region boot; + struct mtk_wed_wo_memory_region boot; /* backward compatibility */ + struct regmap *boot_regmap; struct mtk_wed_wo_queue q_tx; struct mtk_wed_wo_queue q_rx; From patchwork Fri Mar 31 13:12:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195991 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 78614C761AF for ; Fri, 31 Mar 2023 13:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EPXEI8cxACCrckexq4FDW5tlpaRz47piREN+70HEg/4=; b=xcHcbOiEO48p5LftoPyF0jQyZv eMz8qTavltEEY6//XRQ8+1Iq3iBfv/m2QOnFOGasAsq8DSp7EMCQT3+JOqdd0fXpHd/4FuExrI2vf rZjb8JCsFRhF308Vfm9cquwRWNenuKDHVdR8CGTA+tblxpZa7YLfiWbqo+tkBRiPef8WdK7yWUCn0 crixzt4w5Rsa2yKIeqU4kiC8Uxa0UjZviEKkPX4pa5mJYe1x9Q9xu+iRtRugmDQbaw8zIzNEog/Vc Up0S5qgQpIj4Sfb043Kqr3fDeaqPqYqZIEJF8ug+FuIRUvfv7ZX5bJoVnA1KdfwAq4pcw3gAuhU3Z lEJZ9nOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZf-007UXf-1g; Fri, 31 Mar 2023 13:13:47 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZc-007UUY-03 for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:46 +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 CEFB6B82F6C; Fri, 31 Mar 2023 13:13:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C94AC433D2; Fri, 31 Mar 2023 13:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268419; bh=/usCdjjdk5pmrYcvc63cZkA8n8A5vCGCRoBFREfreXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktSReE20BLiQkThthcOvaMG8Ftq8Tm2tVd77CqL7hM0MJeeqpOQm8tHPOeJUcUt/T FQkfjyaZ4qfcY4d8fZK/Wn9lFaQI7jwcflu23RroSreQuilgq8pjKyMVt2EyDOQx4k cVRa0n9VMgMQ2AbpHO9+UDncIpV9dRHea8FHXc5pcWwCFO0Ub5sdJdakB3UfbgHgEe EiLdsdBF3byCBRNEptkccpmo6pNYM4PjFz7KAxIXhrC0sx1DFBHbdgUEIMASZQ5h7B sOHV6WLWm1bm4qaT18JkijydAfAY+LeIj8sYcL2mozHUeY8R21eQiiJCZxlqQ4Tgsq 79ihvOLSw+oWQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 03/10] dt-bindings: soc: mediatek: move cpuboot in a dedicated dts node Date: Fri, 31 Mar 2023 15:12:39 +0200 Message-Id: <62ef3b737de26c3b7f553e1a35a12c36e290773e.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061344_610578_E547783D X-CRM114-Status: GOOD ( 13.88 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the cpuboot memory region is not part of the MT7986 RAM SoC, move cpuboot in a deidicated syscon node. Signed-off-by: Lorenzo Bianconi --- .../arm/mediatek/mediatek,mt7622-wed.yaml | 12 +++-- .../mediatek/mediatek,mt7986-wo-cpuboot.yaml | 45 +++++++++++++++++++ 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-cpuboot.yaml diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml index 5c223cb063d4..7f6638d43854 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml @@ -35,7 +35,6 @@ properties: - description: firmware ILM region - description: firmware DLM region - description: firmware CPU DATA region - - description: firmware BOOT region memory-region-names: items: @@ -43,12 +42,15 @@ properties: - const: wo-ilm - const: wo-dlm - const: wo-data - - const: wo-boot mediatek,wo-ccif: $ref: /schemas/types.yaml#/definitions/phandle description: mediatek wed-wo controller interface. + mediatek,wo-cpuboot: + $ref: /schemas/types.yaml#/definitions/phandle + description: mediatek wed-wo cpuboot controller interface. + allOf: - if: properties: @@ -60,6 +62,7 @@ allOf: memory-region-names: false memory-region: false mediatek,wo-ccif: false + mediatek,wo-cpuboot: false required: - compatible @@ -95,9 +98,10 @@ examples: interrupts = ; memory-region = <&wo_emi>, <&wo_ilm>, <&wo_dlm>, - <&wo_data>, <&wo_boot>; + <&wo_data>; memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data", "wo-boot"; + "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; + mediatek,wo-cpuboot = <&wo_cpuboot>; }; }; diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-cpuboot.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-cpuboot.yaml new file mode 100644 index 000000000000..1b45c8a86989 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-cpuboot.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt7986-wo-cpuboot.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Wireless Ethernet Dispatch (WED) WO Boot firmware interface for MT7986 + +maintainers: + - Lorenzo Bianconi + - Felix Fietkau + +description: + The MediaTek wo-cpuboot provides a configuration interface for WED WO + controller boot firmware. WED is used to perform offload rx packet + processing (e.g. 802.11 aggregation packet reordering or rx header + translation) on MT7986 soc. + +properties: + compatible: + items: + - enum: + - mediatek,mt7986-wo-cpuboot + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + syscon@15194000 { + compatible = "mediatek,mt7986-wo-cpuboot", "syscon"; + reg = <0 0x15194000 0 0x1000>; + }; + }; From patchwork Fri Mar 31 13:12:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195990 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 AF6AEC6FD18 for ; Fri, 31 Mar 2023 13:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ybd8G0xFJHWDTaQGrkD9l1At0q6A5075aYXdaq7Qnxc=; b=Lv6lH7xpJtqAW1jZaEQR7s22Mo V6qNFFN3ce85yCoq3YGQPN5OMbQbHGOwFvy5YTm2vI7Nx1fZED8xibdkOR4a93y3NDuKbKjUBnXXM QQmTF9gr2HbPbicn2GHA7DOvaojodFcZfmjw8fYur0I2rzDh8L18ItasR4weyCnOzkTYVZMbL+X7i 2yLCls1Ratml3NLPIxCl5Jh04MTCXyFxLS2etr1D4o4T8CSg45q6Tu2INEbTxGBLnRVyo6ItwEIgs DbSwRyhIaGcnXA1SaBgYJ9w6KKuc1zlnqWHJ+kZwMtOBAcgXa2RWVoC9jALmkggeltFmWMSIUpvea m0OsZakA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZe-007UXQ-30; Fri, 31 Mar 2023 13:13:46 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZc-007UVl-0o for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:45 +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 C23316290D; Fri, 31 Mar 2023 13:13:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D6F9C4339B; Fri, 31 Mar 2023 13:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268423; bh=a7RlPuu7MvSxqwEXcrLQIgFMCd4DHwUbSml1aECRMIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zgtz4gCbONlRSOWEdIhp+sSDoMwKXRIiez+xhP/ZBMA1djCH1C22p/RfgOfvsJzjb yKzEQ4ISqFEkAnL4NEDjUO/mTNeNY3dRUaADiP8Be5LUfnrYaUKR4km8QWj+efk22o DlFBmHmpmXFFDAoDeXp2yZGyRdj02hdsQoLcXHhLaLLtedlfN1IJx2OxKiSnaVny0n Ap36N68wqM0kmgNoR9OaA8PE1SoNlGzBj2LVFY37bQIIlDxVZ5UTGefYl40cRoquo+ D3rSnfQqjGee2DV8VBpvWGOjp1NsJNsxDj1nimgGHcz8/L4ynIDPok9dXeNnG2fomu BN9vKZOGGimOg== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 04/10] arm64: dts: mt7986: move cpuboot in a dedicated node Date: Fri, 31 Mar 2023 15:12:40 +0200 Message-Id: <56608130babe671e5dd354900480abbe43bec362.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061344_359323_4D48EBB3 X-CRM114-Status: UNSURE ( 9.40 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the cpuboot memory region is not part of the MT7986 RAM SoC, move cpuboot in a deidicated syscon node. Acked-by: Matthias Brugger Signed-off-by: Lorenzo Bianconi --- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index 51944690e790..668b6cfa6a3d 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -113,12 +113,6 @@ wo_dlm1: wo-dlm@151f8000 { reg = <0 0x151f8000 0 0x2000>; no-map; }; - - wo_boot: wo-boot@15194000 { - reg = <0 0x15194000 0 0x1000>; - no-map; - }; - }; timer { @@ -461,10 +455,11 @@ wed0: wed@15010000 { interrupt-parent = <&gic>; interrupts = ; memory-region = <&wo_emi0>, <&wo_ilm0>, <&wo_dlm0>, - <&wo_data>, <&wo_boot>; + <&wo_data>; memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data", "wo-boot"; + "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; + mediatek,wo-cpuboot = <&wo_cpuboot>; }; wed1: wed@15011000 { @@ -474,10 +469,11 @@ wed1: wed@15011000 { interrupt-parent = <&gic>; interrupts = ; memory-region = <&wo_emi1>, <&wo_ilm1>, <&wo_dlm1>, - <&wo_data>, <&wo_boot>; + <&wo_data>; memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data", "wo-boot"; + "wo-data"; mediatek,wo-ccif = <&wo_ccif1>; + mediatek,wo-cpuboot = <&wo_cpuboot>; }; wo_ccif0: syscon@151a5000 { @@ -494,6 +490,11 @@ wo_ccif1: syscon@151ad000 { interrupts = ; }; + wo_cpuboot: syscon@15194000 { + compatible = "mediatek,mt7986-wo-cpuboot", "syscon"; + reg = <0 0x15194000 0 0x1000>; + }; + eth: ethernet@15100000 { compatible = "mediatek,mt7986-eth"; reg = <0 0x15100000 0 0x80000>; From patchwork Fri Mar 31 13:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195992 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 BB577C76196 for ; Fri, 31 Mar 2023 13:13:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6hI90FZ1mPuYzzPOovhINGKv8AZ1A/m0FBqsqiEEvTY=; b=p0qEFEiXFpKE63yQNjQIYECdCn EBDmRZ7025l4IVqi8ZLNok5TmeBe7PCVv9tfGq+NkB025nJONICTDSRUiStzavk6N3E0oBuZ/7Or0 FiWZihik+Uu0yiWBHfo7UnH+8a1M90DYxf81JQGq6Gc8piLpnMOqrvjqVqiIzsvZ0rMLLep/RWQJr IUo0NZPY+OBYcvLk5hKRKUKr1dJwrTUmrVVf3WiU5XqfDCGuYwAm48tSPMDt7Bdx2s98bN6oKp7fi QibSGKedbEavULMRwgsFhVZP9eImiat7Vbkld6AdookKkGKZzs2TSW0uiB7jBd+ZHc0jR080s69l4 ibAkGifg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZm-007UbP-1N; Fri, 31 Mar 2023 13:13:54 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZi-007UYq-1k for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:52 +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 D7F95B82F6A; Fri, 31 Mar 2023 13:13:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B04DC433D2; Fri, 31 Mar 2023 13:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268427; bh=iXJPhBHDQg2tjMUV/aUNW08i5wKVl3q2xMq8Iulzdpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyqdu4ZqH8jKKsKkEKYXmG/tJLnw/KRGgCnUJasU02/vKuL7PojM739thQGSiuESC RV88IsI4GaqK2nNDJNTw9vXJFlHfxn9jEfiK5f8qyR8H81P6iJkB7DmPlahRzJcur4 ZX6wh+55tulzpmBz4Va5XM11fuOoOu2NjfJJai2422ikyODBrDA2Wa5MDUA/B8gPBZ n2t55cYQhxmcR0Sw1dVGueFApwOSJSIfRX7jXSFRplBsnIJfdPxvokVtXDhueXjTGG q4iwBEISCAhheodfW7vP0zyyILtNd5OQP/qpsd+ETyn75+sP/4LadPEH4XnxOXZo5k PTUFRRz1LDegw== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 05/10] net: ethernet: mtk_wed: move ilm a dedicated dts node Date: Fri, 31 Mar 2023 15:12:41 +0200 Message-Id: <44c210cd9135e9574ae7c2c01070aa58d39d018f.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061350_941308_0B7A96A3 X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the ilm memory region is not part of the MT7986 RAM SoC, move ilm in a deidicated syscon node. Keep backward-compatibility with older dts version where ilm was defined as reserved-memory child node. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 55 ++++++++++++++++++--- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index 797c3b412ab6..a19db914ebd2 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -299,6 +299,52 @@ mtk_wed_mcu_run_firmware(struct mtk_wed_wo *wo, const struct firmware *fw, return -EINVAL; } +static int +mtk_wed_mcu_load_memory_regions(struct mtk_wed_wo *wo, + struct mtk_wed_wo_memory_region *region) +{ + struct device_node *np; + int ret; + + /* firmware EMI memory region */ + ret = mtk_wed_get_reserved_memory_region(wo, + ®ion[MTK_WED_WO_REGION_EMI]); + if (ret) + return ret; + + /* firmware DATA memory region */ + ret = mtk_wed_get_reserved_memory_region(wo, + ®ion[MTK_WED_WO_REGION_DATA]); + if (ret) + return ret; + + np = of_parse_phandle(wo->hw->node, "mediatek,wo-ilm", 0); + if (np) { + struct mtk_wed_wo_memory_region *ilm_region; + struct resource res; + + ret = of_address_to_resource(np, 0, &res); + of_node_put(np); + + if (ret < 0) + return ret; + + ilm_region = ®ion[MTK_WED_WO_REGION_ILM]; + ilm_region->phy_addr = res.start; + ilm_region->size = resource_size(&res); + ilm_region->addr = devm_ioremap(wo->hw->dev, ilm_region->phy_addr, + ilm_region->size); + + return ilm_region->addr ? 0 : -ENOMEM; + } + + /* For backward compatibility, we need to check if ILM + * node is defined through reserved memory property. + */ + return mtk_wed_get_reserved_memory_region(wo, + ®ion[MTK_WED_WO_REGION_ILM]); +} + static int mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) { @@ -320,12 +366,9 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) u32 val, boot_cr; int ret, i; - /* load firmware region metadata */ - for (i = 0; i < ARRAY_SIZE(mem_region); i++) { - ret = mtk_wed_get_reserved_memory_region(wo, &mem_region[i]); - if (ret) - return ret; - } + ret = mtk_wed_mcu_load_memory_regions(wo, mem_region); + if (ret) + return ret; wo->boot_regmap = syscon_regmap_lookup_by_phandle(wo->hw->node, "mediatek,wo-cpuboot"); From patchwork Fri Mar 31 13:12:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195993 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 78238C6FD18 for ; Fri, 31 Mar 2023 13:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9eHFYLtHhWopRug6RgckDsf0Bhv5ZhjwFSHg44nk/bk=; b=uu1eVE2e4/VL7bOLHH4KH81Yxi e7wHtQ51PKxnP1oOlzZXTUy9/hhMrNHpp8bhAv2rQsZuUZ1Fp44O0R2QeeqI/UrilSL9tNfBk+bna dqBig7esr0781e7Vt6rcWNxSvjCEM64WzoyIdkxS0qG/bVhDaoTxMQzrG84IPafjpoxmvjtRDZM91 VtxmXDqoiyQpiqccyRCj41/MZ8I5mdU4u6KIfiQsJRNIwFlWvrjydBCxvhly+mT97KddHUvV9ZllN OJtAK93Ghs0M4YoEfJZvxwK85snV7t6eAzjZCsZZZxAabvrAr2B+8aqJwSXoAyx7hS5E13tHR4RX/ JLZ0QeuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZp-007Ucn-0p; Fri, 31 Mar 2023 13:13:57 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZk-007UZs-1M for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:54 +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 09091628C8; Fri, 31 Mar 2023 13:13:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16D59C433EF; Fri, 31 Mar 2023 13:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268431; bh=EPYHZ8tZ9OKv8lK5Q0XeiNsOLRPnw/R2yxzVXTgnTqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGsugcbk1J4ACNuQHPhzp+WllX6tzk0z75JdIM31NXpukcJbSSyH7zwefpJqsdXcw iikWnbjXwDqhe3+WIQS6SzcHl5e5v4dq+kF7cG12J0+qF6+hD/8ARyQ1c0UTexiYKq Zp/xMXtRezNakgSeyeG3QKLNtgMDHEhj8X4qHnzOKoGUKEJ10xGeTbx7R6rmEHQata hnv7sGqSTcSHZV73HOqlGF1O6XnZl1dv8ndlrM+DfU/4R7P2U1+p7Kl2LF2HMWwObz RmoO7J4eT4K9iqtsDC8P9lNxqq7hT8W3b9otDOxLJHSSGKcBfBDhk/W29Crsh0HLVF 3tZL9fq1KU+5w== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 06/10] dt-bindings: soc: mediatek: move ilm in a dedicated dts node Date: Fri, 31 Mar 2023 15:12:42 +0200 Message-Id: <18109725ba14d2fe5c00e627b064b38b5c8f2223.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061352_573489_51FF5BE3 X-CRM114-Status: GOOD ( 14.58 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the ilm memory region is not part of the MT7986 RAM SoC, move ilm in a deidicated syscon node. Signed-off-by: Lorenzo Bianconi --- .../arm/mediatek/mediatek,mt7622-wed.yaml | 14 +++--- .../soc/mediatek/mediatek,mt7986-wo-ilm.yaml | 45 +++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ilm.yaml diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml index 7f6638d43854..e63fb22447c6 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml @@ -32,14 +32,12 @@ properties: memory-region: items: - description: firmware EMI region - - description: firmware ILM region - description: firmware DLM region - description: firmware CPU DATA region memory-region-names: items: - const: wo-emi - - const: wo-ilm - const: wo-dlm - const: wo-data @@ -51,6 +49,10 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle description: mediatek wed-wo cpuboot controller interface. + mediatek,wo-ilm: + $ref: /schemas/types.yaml#/definitions/phandle + description: mediatek wed-wo ilm interface. + allOf: - if: properties: @@ -63,6 +65,7 @@ allOf: memory-region: false mediatek,wo-ccif: false mediatek,wo-cpuboot: false + mediatek,wo-ilm: false required: - compatible @@ -97,11 +100,10 @@ examples: reg = <0 0x15010000 0 0x1000>; interrupts = ; - memory-region = <&wo_emi>, <&wo_ilm>, <&wo_dlm>, - <&wo_data>; - memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data"; + memory-region = <&wo_emi>, <&wo_dlm>, <&wo_data>; + memory-region-names = "wo-emi", "wo-dlm", "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; mediatek,wo-cpuboot = <&wo_cpuboot>; + mediatek,wo-ilm = <&wo_ilm>; }; }; diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ilm.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ilm.yaml new file mode 100644 index 000000000000..2a3775cd941e --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ilm.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt7986-wo-ilm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Wireless Ethernet Dispatch (WED) WO ILM firmware interface for MT7986 + +maintainers: + - Lorenzo Bianconi + - Felix Fietkau + +description: + The MediaTek wo-ilm (Information Lifecycle Management) provides a configuration + interface for WiFi critical data used by WED WO firmware. WED WO controller is + used to perform offload rx packet processing (e.g. 802.11 aggregation packet + reordering or rx header translation) on MT7986 soc. + +properties: + compatible: + items: + - enum: + - mediatek,mt7986-wo-ilm + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + syscon@151e0000 { + compatible = "mediatek,mt7986-wo-ilm", "syscon"; + reg = <0 0x151e0000 0 0x8000>; + }; + }; From patchwork Fri Mar 31 13:12:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195994 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 C7E3DC76196 for ; Fri, 31 Mar 2023 13:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wJt1YJZCNbMWnYusEP5LK8uNhUZ3IJMqYE3HMfURltM=; b=G2z/yn/8KfauMdhDEAP0lgBVz0 pGeZx6YHCy9RHuDw3hYmBu3L9b4SCoIdjpfgqe9ChIs3c4v8m5qVI5KN/g8XthQ7LLHo+VUJSCmvf wy3iFk+ocJfJtsXo2M+rW6R6/o6tRdFMFq3TeAhp9e+6l/WOustkGJKVfdPbrbl7RyR1Ovw5uplsY +xWAwHUU6c3NXHpY+k8/8SbHnupePKMy3o0fr1cn5RgXT2P4lhpcXZZOaKsxluTqjq4T9CfdLrO4z fYE/Aa2Zsj/f/uybubSqVHP52c3Z8wvQvLPbt/Gwnuq1OOPloU8DJnnO1nWBpOQPvzmcWE5+LvTKn wPXzrdJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZu-007Uf2-0x; Fri, 31 Mar 2023 13:14:02 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZn-007Ubv-2J for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:13:57 +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 3FF386290D; Fri, 31 Mar 2023 13:13:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B09AAC4339C; Fri, 31 Mar 2023 13:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268435; bh=4cHdHnyTAhlO3f0cK1byiul6wL08Fc18njzb8Jp2zLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VBsKpbWD8FtuvEtQqWYtSO10q+cA3UyyeHUuVAUDglQuekLueAoxi1dmLXQfl77ji HX6C3pEoOYXO6Kqu69oB1ZtcwD8DUrxAIhBKAPgiw2+3eK41O0eWHS32/fYJ3xADxB anmlaPvXPwwEJoG2/LojRVs1+4aKdwC9zjLOMVOnoGT5z4Hk6RzZ2hHF77ZR8ZVdI3 iau0np5uRiI1FQ6szkcfJeh3xaP8oUAnffnUveMAjOIt9qqNf0gy8KjIHPT3t8Jj2g /D9g40ssIf1YoFjbJv6VGqIl5mr/5UGf+qhDTjeUd6bWw/1TH1CK7KV3kFXX93pMjj rtKh/sd3PYi1g== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 07/10] arm64: dts: mt7986: move ilm in a dedicated node Date: Fri, 31 Mar 2023 15:12:43 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061355_831288_9EE1C797 X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the ilm memory region is not part of the MT7986 RAM SoC, move ilm in a deidicated syscon node. Acked-by: Matthias Brugger Signed-off-by: Lorenzo Bianconi --- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 34 +++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index 668b6cfa6a3d..a0d96d232ee5 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -89,16 +89,6 @@ wo_emi1: wo-emi@4fd40000 { no-map; }; - wo_ilm0: wo-ilm@151e0000 { - reg = <0 0x151e0000 0 0x8000>; - no-map; - }; - - wo_ilm1: wo-ilm@151f0000 { - reg = <0 0x151f0000 0 0x8000>; - no-map; - }; - wo_data: wo-data@4fd80000 { reg = <0 0x4fd80000 0 0x240000>; no-map; @@ -454,11 +444,10 @@ wed0: wed@15010000 { reg = <0 0x15010000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; - memory-region = <&wo_emi0>, <&wo_ilm0>, <&wo_dlm0>, - <&wo_data>; - memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data"; + memory-region = <&wo_emi0>, <&wo_dlm0>, <&wo_data>; + memory-region-names = "wo-emi", "wo-dlm", "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; + mediatek,wo-ilm = <&wo_ilm0>; mediatek,wo-cpuboot = <&wo_cpuboot>; }; @@ -468,11 +457,10 @@ wed1: wed@15011000 { reg = <0 0x15011000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; - memory-region = <&wo_emi1>, <&wo_ilm1>, <&wo_dlm1>, - <&wo_data>; - memory-region-names = "wo-emi", "wo-ilm", "wo-dlm", - "wo-data"; + memory-region = <&wo_emi1>, <&wo_dlm1>, <&wo_data>; + memory-region-names = "wo-emi", "wo-dlm", "wo-data"; mediatek,wo-ccif = <&wo_ccif1>; + mediatek,wo-ilm = <&wo_ilm1>; mediatek,wo-cpuboot = <&wo_cpuboot>; }; @@ -490,6 +478,16 @@ wo_ccif1: syscon@151ad000 { interrupts = ; }; + wo_ilm0: syscon@151e0000 { + compatible = "mediatek,mt7986-wo-ilm", "syscon"; + reg = <0 0x151e0000 0 0x8000>; + }; + + wo_ilm1: syscon@151f0000 { + compatible = "mediatek,mt7986-wo-ilm", "syscon"; + reg = <0 0x151f0000 0 0x8000>; + }; + wo_cpuboot: syscon@15194000 { compatible = "mediatek,mt7986-wo-cpuboot", "syscon"; reg = <0 0x15194000 0 0x1000>; From patchwork Fri Mar 31 13:12:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195995 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 7D0F8C77B62 for ; Fri, 31 Mar 2023 13:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CO0pQDMp5I0AV3BjTtxDDlMUrQBt4c30rrUmdLkhQxQ=; b=S6dyrCntZUnTzQ93aTBHWc7ocF X2BBM0Q1VKzynf+pOQPTOd842+ELfFWrkfyKfci5aBzqx3c4Vlz0rSlccp7rJcG4SZDP6enOBy9cs T32+ma2+a7Oh/8QphV6P7iPqsWnpC0p00upYQz23uTEOnslWaHuxPAOjUBAfQutLHVPbkNUL0FR/v 5kHfhpPydhQ5lKzVClV2v3VwBep/r0oqinarPZT0xj1Zj/alm+wqdgG9Z7/FkKDo7ZS0E+QIZagyx J7Pa7s1z10T8m0eErZp1jtdI1LHsSt5iE27WcnLCwM4SDT/LzFFsgAR3xnzeZsf4dthnPHGYM3zXv AaZ11EIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEZy-007Ugi-0d; Fri, 31 Mar 2023 13:14:06 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZt-007Udz-1i for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:14:02 +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 22607B82F6D; Fri, 31 Mar 2023 13:14:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8137FC433EF; Fri, 31 Mar 2023 13:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268438; bh=N4DT9nDSliiFONQaT3jUyRHewbKeqGxRRHMjesy9rxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jNYohSc0UcD9cddo/U7K31IbDSvz89gZSLvZUWkQXOqF/wvHNss9OWZIWy0Rq7ujh asHIMyuS2EWDoGW5Q27wlCkiRcb+erpnHE0iB8GXLwfA20nfmsRrrqmVwXsP04/DpG DrItq8R/XuQzqr2j/RlAbTeuWjl0h2trtxpfX//x3fqbgjfnpzhKrs8phEm4gT1yxZ 4IwlTQA4lbC35RVkD10iAi6Qh6CYRipo6KIrP/10HcGB9EHiiJnVeG68ePOmMhlchC 2d5sGpxfxMw7zDbNYuXhIsDpPGZ8wAaJtJZmNEllw+dYoHlAZNSUBDWwNRTzjJ470W xA9wjZNMTyuKw== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 08/10] net: ethernet: mtk_wed: move dlm a dedicated dts node Date: Fri, 31 Mar 2023 15:12:44 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061401_779117_DDB0EBD0 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the dlm memory region is not part of the MT7986 RAM SoC, move dlm in a deidicated syscon node. Keep backward-compatibility with older dts version where dlm was defined as reserved-memory child node. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/mediatek/mtk_wed.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c index 95d890870984..e479ff924ed6 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c @@ -799,6 +799,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device *dev) struct device_node *np; int index; + np = of_parse_phandle(dev->hw->node, "mediatek,wo-dlm", 0); + if (np) { + struct resource res; + int ret; + + ret = of_address_to_resource(np, 0, &res); + of_node_put(np); + + if (ret < 0) + return ret; + + dev->rro.miod_phys = res.start; + goto out; + } + + /* For backward compatibility, we need to check if DLM + * node is defined through reserved memory property. + */ index = of_property_match_string(dev->hw->node, "memory-region-names", "wo-dlm"); if (index < 0) @@ -815,6 +833,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device *dev) return -ENODEV; dev->rro.miod_phys = rmem->base; +out: dev->rro.fdbk_phys = MTK_WED_MIOD_COUNT + dev->rro.miod_phys; return mtk_wed_rro_ring_alloc(dev, &dev->rro.ring, From patchwork Fri Mar 31 13:12:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195996 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 CA17CC6FD18 for ; Fri, 31 Mar 2023 13:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Q+V8XDimd3JYOxlNJ7W37Ml/SA3OuBbDfDmwz+VXaBA=; b=ify5jdFT856+K7HegOEmPM8ANs RiDEXcSvhyfbP0WJ/j7DNuyEil5Mf06R4EZYUrJPHCh2qqZwnEFcv9emSOzy6/JafUfJcwgeZyGXj 6yXpZyQyvqFLeplwVYYxBjZypYaNSDIf4iL/xa5oktfLmiO7rqF4/qwrv59gUAXg/1hdAd8NRXJq4 K0Qb6lvdUFVrYzaRXP2B8awQbkfJB9e04n+T61vvzFeNQnPj5XA6TzudcAZmuPje2Bh/XOcHP8JDN DHkyi8gJchDCFkYw1CfckWis07thtNugeV9u/5xwUfjKkmlZsKMjPalTnabE8JmDQPN1cIWr/Z2H3 YOQoxv3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEa0-007Uhl-2Z; Fri, 31 Mar 2023 13:14:08 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEZv-007UfZ-2f for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:14:05 +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 DEF7262908; Fri, 31 Mar 2023 13:14:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A232C4339B; Fri, 31 Mar 2023 13:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268442; bh=fWp4pnTJD6ujYu6baXkTpEw8R10yq2a2e3WshWOsoi0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O78v4MA3B5ozyLWWBY/eyfLNI8PD/9KVAWRL6xcOM3oULxFydgffux6ZeQ9XdprDx WVpVfY/BVACj0pL9whFW+cBK1Fgzk1990UZy5rEToMpQfhL0ksno/8iOHPHAsVjOIB azc5yCHyMuhIjJVpgCf8P18Mr4wMqCH0SFV8n7Pi9B6nqkAJ840+6nZ6294V1QQkc9 jUCYEP6l52FGREetP7OpAVIsh/6kYbaiz3heUahpay9vTt1FgtneRJMTzFtKdduHs7 UrbuSSSF98V+/NicwUizG4yAohcbMXCyac7+2o+g2Nn4Tb/IykZedsReT3YzU6q6LW fz3v+Baegr9UQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 09/10] dt-bindings: soc: mediatek: move dlm in a dedicated dts node Date: Fri, 31 Mar 2023 15:12:45 +0200 Message-Id: <6c169516bad15826a292d66923e49e28c9a64146.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061403_938414_5B1FAAFA X-CRM114-Status: GOOD ( 14.30 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the dlm memory region is not part of the MT7986 RAM SoC, move dlm in a deidicated syscon node. Signed-off-by: Lorenzo Bianconi --- .../arm/mediatek/mediatek,mt7622-wed.yaml | 12 +++-- .../soc/mediatek/mediatek,mt7986-wo-dlm.yaml | 46 +++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-dlm.yaml diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml index e63fb22447c6..e4707880eca7 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml @@ -32,13 +32,11 @@ properties: memory-region: items: - description: firmware EMI region - - description: firmware DLM region - description: firmware CPU DATA region memory-region-names: items: - const: wo-emi - - const: wo-dlm - const: wo-data mediatek,wo-ccif: @@ -53,6 +51,10 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle description: mediatek wed-wo ilm interface. + mediatek,wo-dlm: + $ref: /schemas/types.yaml#/definitions/phandle + description: mediatek wed-wo dlm interface. + allOf: - if: properties: @@ -66,6 +68,7 @@ allOf: mediatek,wo-ccif: false mediatek,wo-cpuboot: false mediatek,wo-ilm: false + mediatek,wo-dlm: false required: - compatible @@ -100,10 +103,11 @@ examples: reg = <0 0x15010000 0 0x1000>; interrupts = ; - memory-region = <&wo_emi>, <&wo_dlm>, <&wo_data>; - memory-region-names = "wo-emi", "wo-dlm", "wo-data"; + memory-region = <&wo_emi>, <&wo_data>; + memory-region-names = "wo-emi", "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; mediatek,wo-cpuboot = <&wo_cpuboot>; mediatek,wo-ilm = <&wo_ilm>; + mediatek,wo-dlm = <&wo_dlm>; }; }; diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-dlm.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-dlm.yaml new file mode 100644 index 000000000000..2b9c6a8ef918 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-dlm.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt7986-wo-dlm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek Wireless Ethernet Dispatch (WED) WO DLM firmware interface for MT7986 + +maintainers: + - Lorenzo Bianconi + - Felix Fietkau + +description: + The MediaTek wo-dlm (Data Lifecycle Management) provides a configuration + interface for WED WO firmware rx rings, including firmware I/O descriptor + ring, feedback command ring. WED WO controller is used to perform offload + rx packet processing (e.g. 802.11 aggregation packet reordering or rx + header translation) on MT7986 soc. + +properties: + compatible: + items: + - enum: + - mediatek,mt7986-wo-dlm + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + syscon@151e8000 { + compatible = "mediatek,mt7986-wo-dlm", "syscon"; + reg = <0 0x151e8000 0 0x2000>; + }; + }; From patchwork Fri Mar 31 13:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13195997 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 00DB8C6FD18 for ; Fri, 31 Mar 2023 13:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J/1f/z2iPURKXTzRW+RARF8092JPPAYrikirYbwjvYU=; b=Z9ZVq7ZFyofEffODFbO2WIWYpI 5YdXe3Cq1s5k4ChrxkUhnuAgQRL+vhpPfsR2KaZq+XNiHFYm8yhPpWSmFyYA7qKFQ4XDCJ+RgNULK Dj2b+GmI7wRL3RUJ++vGWYTMwRz3vpD23mAFZhZmcDkLVm5zalJDcFi5g5/D4x63Wec5eVLPk6qf3 JM13UOFQnD/dqW7+DEbGYhJIKI1XJlGasQ9A9q/iy5PmNmvYgx0pREFKDERoJMMzGqysfpNtFLU7M SMBlk/AMR7Ql2winkFXkwoDfXfivPChwafqhiu2XBd1JxBxwmL7JR3vbQ7hsmI6CR+pUEzUhNChxc fm3fy5Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piEa8-007UkI-1x; Fri, 31 Mar 2023 13:14:16 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piEa0-007UhQ-2a for linux-mediatek@lists.infradead.org; Fri, 31 Mar 2023 13:14:10 +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 839F2B82F6D; Fri, 31 Mar 2023 13:14:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E85E1C433D2; Fri, 31 Mar 2023 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680268446; bh=mkUhLoNbLeiHtSsfwVORMtUtAD48E6wlCdxRrEPVV30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqULA+hFBdKRZjy/9rQlidaQwQ578NiyOjHLH2/c7HVAHeq3QEHMJjfqrxIioizZ9 RVhRZ6N1u4stIykzG7h02KfCC2ucGV52xwu//c7ZBYKCA4dcbPCYsQoclPVDXZZ24A WYTlrj9yDDiJ8tenhJDOuk19mNzJnIpEMj/AyECgH+QDJdvpPGnOHdOG80GCEnz69Z SJSCYpzok/j2gPPoKJiaTWEfRSXGBmcoxOJhi3801Fmv52Xz1H9stxx0LlNbnsU4s9 rnCheTKHf1A7BMqFaNb4m0MKDa6kyAmxMKZkh6Gq/N87AdB56nYNdxp6Imq4wPWDdo CGOOfMYrwaLOQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, lorenzo.bianconi@redhat.com, daniel@makrotopia.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 net-next 10/10] arm64: dts: mt7986: move dlm in a dedicated node Date: Fri, 31 Mar 2023 15:12:46 +0200 Message-Id: <7787ec209a3c79cd83ed4660ad4189a163dac734.1680268101.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_061409_197985_0BA77EF8 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Since the dlm memory region is not part of the RAM SoC, move dlm in a deidicated syscon node. Acked-by: Matthias Brugger Signed-off-by: Lorenzo Bianconi --- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 30 ++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index a0d96d232ee5..0ae6aa59d3c6 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -93,16 +93,6 @@ wo_data: wo-data@4fd80000 { reg = <0 0x4fd80000 0 0x240000>; no-map; }; - - wo_dlm0: wo-dlm@151e8000 { - reg = <0 0x151e8000 0 0x2000>; - no-map; - }; - - wo_dlm1: wo-dlm@151f8000 { - reg = <0 0x151f8000 0 0x2000>; - no-map; - }; }; timer { @@ -444,10 +434,11 @@ wed0: wed@15010000 { reg = <0 0x15010000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; - memory-region = <&wo_emi0>, <&wo_dlm0>, <&wo_data>; - memory-region-names = "wo-emi", "wo-dlm", "wo-data"; + memory-region = <&wo_emi0>, <&wo_data>; + memory-region-names = "wo-emi", "wo-data"; mediatek,wo-ccif = <&wo_ccif0>; mediatek,wo-ilm = <&wo_ilm0>; + mediatek,wo-dlm = <&wo_dlm0>; mediatek,wo-cpuboot = <&wo_cpuboot>; }; @@ -457,10 +448,11 @@ wed1: wed@15011000 { reg = <0 0x15011000 0 0x1000>; interrupt-parent = <&gic>; interrupts = ; - memory-region = <&wo_emi1>, <&wo_dlm1>, <&wo_data>; - memory-region-names = "wo-emi", "wo-dlm", "wo-data"; + memory-region = <&wo_emi1>, <&wo_data>; + memory-region-names = "wo-emi", "wo-data"; mediatek,wo-ccif = <&wo_ccif1>; mediatek,wo-ilm = <&wo_ilm1>; + mediatek,wo-dlm = <&wo_dlm1>; mediatek,wo-cpuboot = <&wo_cpuboot>; }; @@ -488,6 +480,16 @@ wo_ilm1: syscon@151f0000 { reg = <0 0x151f0000 0 0x8000>; }; + wo_dlm0: syscon@151e8000 { + compatible = "mediatek,mt7986-wo-dlm", "syscon"; + reg = <0 0x151e8000 0 0x2000>; + }; + + wo_dlm1: syscon@151f8000 { + compatible = "mediatek,mt7986-wo-dlm", "syscon"; + reg = <0 0x151f8000 0 0x2000>; + }; + wo_cpuboot: syscon@15194000 { compatible = "mediatek,mt7986-wo-cpuboot", "syscon"; reg = <0 0x15194000 0 0x1000>;