From patchwork Mon Mar 20 16:57:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181616 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 46833C7618A for ; Mon, 20 Mar 2023 16:59:04 +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=ptxCsmVjrntvkMTFq+i5en2e55/pEHP4mX1gyjLRg2A=; b=jYEhOIjOY5kHJb/nYtnN1yb7bW i3kmKlwKiqFpbKvn427ADUKA/l3SLhC3c7421q5NNy0wcsxhTmQL+A7JkgyrbBq9acbveC+ncgdyh HMS/LjexROmaqbD+ECNoLyCYZJEQE5bjvK2z38EEM/yAkVsNlji8W0VSFO12hZ9fPRIvbHMeCYd7s UxtzpUMLTQIaSmAA+8SqmLACg862FuuKVvRCBBWJ+G+kxTLs3tHtS8zeph42WpZL/q8UaAtdWiO4y olj5Khl8Ugd9xwRILTP6TyAJpHdIuv/8+krwGzubZPCS/6jcwLCcyPIZQDC8d1qe6blC9oWkjQ6Lk BAJwYitQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqZ-009tvb-07; Mon, 20 Mar 2023 16:58:59 +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 1peIqV-009tuq-30 for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:58: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 2DE6461701; Mon, 20 Mar 2023 16:58:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E42A8C4339B; Mon, 20 Mar 2023 16:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331534; bh=kJn6Wm7582WE4Dn1E73Md1ECuMNXKy9TdKSqsainkW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KtHvmQ6BOF/qk4D1a2TydF+HQ6P3Zx4O3Bft4B6NUcv59eYTACyJOM3ErzLfRpQm7 GfpqEiYdBKarLgWuJexJ442cqH0yaqLC3aDPJMs7OVq+fYz1zfPTgCb6TseJB6S9F/ UEbpHx3pPmkdwqzaVQARI3kDz95MG5DHB5OiLi2dmhnUWhENAdWHOVThNom8u206oE uD6mXTqQ2GWt5oc8euVJFlvl0nVfg+4Y6gXn+sRu8HxZVvtdvQDFcCsWgybEgSsu1B TNsZHrzN7+lXXAxT4J5/aHPgBsnRjdk1BdbO4/kMpQKVieoXPPTSiOia+lzXrl0yJX dF3RXt3QbXPrQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 01/10] net: ethernet: mtk_wed: rename mtk_wed_get_memory_region in mtk_wed_get_reserved_memory_region Date: Mon, 20 Mar 2023 17:57:55 +0100 Message-Id: <9e6defc0bb80dcdf9d8256f81882e58eea250665.1679330630.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-20230320_095856_010477_A3F8B6C1 X-CRM114-Status: GOOD ( 11.10 ) 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 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 Mon Mar 20 16:57:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181617 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 054C5C6FD1D for ; Mon, 20 Mar 2023 16:59:09 +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=XAdcrH0zeh+G4aAxPV3Iw6Nlwgz8zXVTK8qa/Wfo2D0=; b=oPQ0MBJT49fecxurBvSxjF5AP1 zVe+yGyrlzdCwqPp6jbkSKm/NFaRji2A9wDmuGnUcYzCKQg2S6QIH676fP+eo3fgk8M4G4E4nfME9 FNdDFsqwnjJGF/jGYUECLg+HHNXocln6zdVmhbCpjHErScD//8e56yw4ktwO4GxCvhyKRHSw4zMY3 HDUDBP4bun5RQelKs2VcQq4JkbWTfEo0JfRwwipRubu4j+PZCed4e1lk/mlDXFY4LGuWJeGv9D/p9 i5rQw95w+31Zy5TCCKuPMCnoY1w0wyoPdkuUdT9xJYXL2CgErrKnXWfMkXTMOfq/WXnIkQZWlXL0G H+HdAuww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqd-009tws-1m; Mon, 20 Mar 2023 16:59:03 +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 1peIqb-009tvs-1c for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:03 +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 C9631B80FA6; Mon, 20 Mar 2023 16:58:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA1C2C433D2; Mon, 20 Mar 2023 16:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331538; bh=XXr9JXnAjx/mfQBSeN4a1DymTIk6vQWBuniCnuc64RU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqFgvWbXvlzbXYq0MfOhuxQOxZGSmY1vKJhV4D497HHT/5LJBdnzum/O2mHuyzquW AOYRp0RhxOjqC/+/usXxDibwRPA82a8hLVWpCzd26HVSPcsacnalGxUjZ4TdPM0ptx QtBWfX8NCPqmeKPjEq+m9Way08yuMMKFYYkyHCIserKTsl38UQwvxG5VAuN2/lBVpX bn/o/rSIgoiLP6XFMwB4KFRLP9h30ZItGDCNOW8oHQQOVaQ8Wetc0Cp1gjvMG1l5xs Fsm+i+PVNX0p3gWC0uzSYYJJ6aRRW5HgsAAJY2Dok7cZtR8h8GkL4tcyNojxTYhf+s Ha512zd9M1X/g== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 02/10] net: ethernet: mtk_wed: move cpuboot in a dedicated dts node Date: Mon, 20 Mar 2023 17:57:56 +0100 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-20230320_095901_825238_3419FB0D X-CRM114-Status: GOOD ( 15.34 ) 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 SoC, move cpuboot in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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 Mon Mar 20 16:57:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181618 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 A5551C7618D for ; Mon, 20 Mar 2023 16:59:13 +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=TOs2zDAksZxgEDpEqR6zfSadJss6mYdcyAY7VyT0r+w=; b=v4ctr+nTIPUntrWFlzqOHiy2IN J9PeGD1kSBTxCn2h2oQnP69l3OA29ix5iRXwca7EPGIfYMFB61IAs5VY+n5xWdzBXNCK4OweaF8ws p4hKoHHv11Ndodj8Yf8SWZ711PvQTd+KvepDoSxnbTbsRgmwo0VS64rLMlg4G//wKI9XUC+42CUuY pG3XWg+apJLPZDDOkixCOh6MGwouvpHBkkMxREIQn+2ypBiISsyUl9U2XYWH9Ysr35Eu4oScnCQhB P0uQZ63sB6VgN3XmH9lXPMduIjyAcJ940+01Nk4KSBz4ZqDd7HmDJOJDmEXrYfpyLxVR0e3SFkeEH HGRrfgxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqi-009tyI-0A; Mon, 20 Mar 2023 16:59:08 +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 1peIqf-009tx7-18 for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:07 +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 AB9E5B80FA3; Mon, 20 Mar 2023 16:59:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166DCC4339B; Mon, 20 Mar 2023 16:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331542; bh=ao4CYNapakrruJ8mCYWnK7EoI2sRP6454dsCyonVsXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NeUsjGCtZmTj+Cbr5txUkqDmLpUV00IhYgL3XvKXKiKTfTjS3b4Csgp+QF+yDvpLQ ee3bqKb3jREcz7cKgnWIX9nenBD9bQWSI7KdKoJUNyKcoc2mBpkDtXO0ogkXk/U+Rw XNZjqAkH7la3QtYst+t800U88fkrDt2DFAMnP2FPGmP0ndEImnFK4mvReZTC57MC5X weshLkjlFeDM/vwrxzW6yxaaBwAtUOYCn/TQLY2ZIZl80ndD6ZiwsDHOPMUfyTSgGj ntQ3XKpNtmjDHUIDFHeRM33wMtcoKXjPMoMrQq4sNNDrwtS2s7bA6f9y8Uk5iPhZmL UvygYW8hipL/g== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 03/10] dt-bindings: soc: mediatek: move cpuboot in a dedicated dts node Date: Mon, 20 Mar 2023 17:57:57 +0100 Message-Id: <0e34c42af917646c057e3a37ee08a38c4ef5b6c8.1679330630.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-20230320_095905_680371_98FBFE95 X-CRM114-Status: GOOD ( 14.54 ) 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 SoC, move cpuboot in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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 Mon Mar 20 16:57:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181619 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 89687C7618A for ; Mon, 20 Mar 2023 16:59:16 +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=1yPLdRArzhGP5b6xyzP+wdoYtIf+AayS7rO8O1L8lt8=; b=4QnNU3vleF5qwFodZUNdVb2/P0 jgnOfmcrHm+tw8qHB4bqWC9tD24YtUeyHbcnrqpzFGPnxWJgXz5RC7TZg6VO9my0yin+Sdg7U6BLb GE7AuuQ56hveAbwDlt9s2TIkuvM8ZWKbVeONqGwRrI3Mc6Im67wRlRI8/Z/SbqDo772PaAGFbcZPC 3NawmM6tsWWQpcN2SM+1mDhmViFuS0o65sMAQ8ZGyQPNclstrm1D3b1fJnBIfDHelGI/n5TuoDyEH Ci3tE8Q343deSiw+aJiQufqCjOyK6z0RJeyOGqcFSGUnQC3+GQ2Syc3IN6WGPdmlce9V9Ei8ix3eP ICnpELcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIql-009tzT-1j; Mon, 20 Mar 2023 16:59:11 +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 1peIqh-009txo-11 for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:08 +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 DB704616DF; Mon, 20 Mar 2023 16:59:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE26DC433EF; Mon, 20 Mar 2023 16:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331546; bh=Pe3VP2wxZ1LgzDKFV9zDltQiMh3cGeAqwPGq68FDOlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FkGr472jOTqkgltHePWWiSJxD3ZM6RmRsglUXYf4dBC59FaFr72iibUPBtSLSIzIE SLUoXipwmHSrFKeH3gQcSoYIw+5/ljBSWw01GIO6JkA9/TGH+9ZoxJXFJWbvDu0V7E IiKZ/vB7zUETiSoBcC7N5boYCmVBxJQ/+vgpsaH8/H59tYsNoOzzEU10L1ma1g54JV RzGTV0LalvNkOBa/AYYO+a6uvBFLrk0722COR4g8fNVH/QDhuVAFaX4zNB3Ss2ZkFg j5fKOLqB0Y8oQkwv3uG2g+woQ+PnYE23w9nBgAVWHRJTt7PW4QgoZ6KDecE+uGaL/O GhG2uVEJEYujg== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 04/10] arm64: dts: mt7986: move cpuboot in a dedicated node Date: Mon, 20 Mar 2023 17:57:58 +0100 Message-Id: <61e2445f79d8642e7749dac409e2b93b96667610.1679330630.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-20230320_095907_388186_ED3BC286 X-CRM114-Status: GOOD ( 10.04 ) 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 SoC, move cpuboot in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. Signed-off-by: Lorenzo Bianconi Acked-by: Matthias Brugger --- 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 Mon Mar 20 16:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181620 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 29175C7618D for ; Mon, 20 Mar 2023 16:59:19 +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=WC7ioW4jMIOPo39Wjt+8ppUz+aWZQc6QhdzoLorBQII=; b=ym28V6lD70IgSFv+A8KV9hI7tA eW8JJ7ALxaRoaU/pwhmyVG4hpNSJH6Ol1ocJhuohlsXCFrQjfkm7mbfaTUT3uIYOXZGu9w+RWeEH5 X72rSgaUEBQUoa+lSmoZtRdbQeArx7dCvwcOlPaomFALTmLudab0SzSe/7YKR1MRTHAzzcAiVzJE8 fMpz5rrpvM5bAJLpvGXouAdvnJ5NY+dFYyGTmgU9wtckasxPWnhuAJiEQRYooFqlKPTzPGdCRsMpq 1xHMT/BgsPLWl6SibyWl3GagV02qhGl4vW1+puPJCcKXp7jMXei5XLYg5NKuXgWmZ9zjnWCRvDCT9 I+5meunw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqn-009u0C-04; Mon, 20 Mar 2023 16:59:13 +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 1peIql-009tz2-07 for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:12 +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 98C93616DD; Mon, 20 Mar 2023 16:59:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD177C433EF; Mon, 20 Mar 2023 16:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331550; bh=zBR/CZyJ28kqYG49+d/k9o/82Jp0pG3tobqqcDf2lo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rUr/2Xbs9M66djwtqMYR+hNW+hPSW8Y+pWI8x5o51unJK6ZGPSiXxgpeddswGs3FY tOxQq/jR+qXdTrfxHjH645JPz3H69hU14TdSX/9AQhqJ7ZsC4ZiYtBlFk6ECzUcgw7 jQj/p9c+wDqa4fmBCINe8uRS51Q6VO0oNZgUUe6qVbFTW56IDb+8nPNqGWCKwn2/fW BWjVtDLOmoqmVocpEjmVVLHZsHpQu/q/d4K/Qj7aOAGcfCkZlJwsrD1QVmKOHSTnvN +t6K512qbV7P45bRmBgJqmZpcRlEUXImaMNj33vmHvkIljqVlRAQ4d1KDC5Nyoie6J cutm8Dmq5leoA== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 05/10] net: ethernet: mtk_wed: move ilm a dedicated dts node Date: Mon, 20 Mar 2023 17:57:59 +0100 Message-Id: <93f309bafc6f3f9ddeeba81eea04b3769e70febf.1679330630.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-20230320_095911_150611_AD51B5C7 X-CRM114-Status: GOOD ( 14.63 ) 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 RAM SoC, move ilm in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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 Mon Mar 20 16:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181621 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 D1EA6C7618A for ; Mon, 20 Mar 2023 16:59:25 +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=q243Oz8Et7dP2L1gZ24l6vi2Mq0khbvVAwif1sBRX5g=; b=fzo0VhuDDzmTPU4qcH6wnLMFD8 mBiMTEXdSOlF6d80h49Z6dP2z9OmJGCAlIHrHmOIceN9DkRCZKHEuQ/sTjLW/B4tbUcTXIFp3qiY7 oeXoUI/bKfU7f75Agz5C1BvKFLkkG55tKay1tJYyLIZc7DtWOK2MtPJUls2ESRznGUzVNLcf4sN9h I4IzsYmueCgPDVb5bDaS90qTeYf5EiBt/HUPOR7dDExOa2kLqsCgNjj5XzkSIbh/FUGbsGapZ0z/P +dUdziBl5qRANeDl+s1etlIYfkoncUpX4FLtrTDg5ep6cPt2P3t3RlTClKxcZWQbq2dQY7uZxfJ2Q bbOpOPgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqt-009u2X-2t; Mon, 20 Mar 2023 16:59:19 +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 1peIqq-009u1D-1Z for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:18 +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 31C47B80FF2; Mon, 20 Mar 2023 16:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85043C4339B; Mon, 20 Mar 2023 16:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331553; bh=RPN5GKehZn7MatCJiaJVlbKQyXSE1v+L4syKACvc6v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q7kE/g/grJp2TGih7tfNFWvm5Zt0eLUv2hxrd2188xBXqzJ6sBudotFlJKy0C/GtZ pmXPtBVNjnmLmgduzdwMEeCCSEa/UssLmNYIwEmuQI4TWoUV/El7UJx/r/v7cu6n/l BRORfrJnUCJXUmYLaFU/gJq4ki/gsUGDVLVOh2+BUqPtgbA7skFuMGIIuvFJDWU/gV qjJaYDoqQ85yg/+h9smoXjsBVdi2+7FhwuTpKQ0UKkS8PWrW+Ph52n/Bc/vbNnX4XA 6nQllJRFo9bvz6kzWnJARyO+VyNIK0SjUS+JsXU8906UvEvEtNtpEjneT79ZVfdi5A IWRC0XoPA0XoQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 06/10] dt-bindings: soc: mediatek: move ilm in a dedicated dts node Date: Mon, 20 Mar 2023 17:58:00 +0100 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-20230320_095916_801298_972BE027 X-CRM114-Status: GOOD ( 15.24 ) 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 SoC, move ilm in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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..5d2397ec5891 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 Mon Mar 20 16:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181622 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 9DFF8C7618D for ; Mon, 20 Mar 2023 16:59:28 +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=3dpcwQhihfQUtL7kUJfHhFephZIeUzaPQhWxuBAGmbA=; b=fJ6iSVsx15+kS2jFZKzZoNdQcM lePFDaeoWvyaKJHfaWi5VOyppgZ98FzLdx+f2VtCgk7ewJr27GuvrIHZA8txC0dv/wEVz5wbiQmGK E6Xm3v377bKJ/unhqfZVPMuzQYjhGOCL2vSB33c+Ch5FKKj4bxoLFLv9fVhKkMrMe57j8HrTqiRz5 fHcq9Qn8AUJsXbSkPP2eD9LwSgshlyx2GUBr2gddu5+2ZeQ66MGXTYq1Hj0RXTS6kciOHALtYTBsn /iRuGCe5DIUpCLAX+IqRl93SF1f2u9gp4kxJ1jgkk06dzN4TPVhqTqEfJaanZkIWSDwAgi+TQ//LY sOtpwFpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqx-009u41-1M; Mon, 20 Mar 2023 16:59:23 +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 1peIqu-009u2Q-0m for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:21 +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 D62EDB80FF1; Mon, 20 Mar 2023 16:59:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AB44C433D2; Mon, 20 Mar 2023 16:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331557; bh=4/gQUt4YWFNm/6YwT4rVQA1tyKYT3o8UQlO++zo/1OQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c085N1aFCtD3ZLC4G1Wr8tStlsKV6pZIijpWWJYjGy3QwNos3yiXvlVHdk2EcxakJ jiIUavZhu2ccRhaGs1ck01pU0vRKizw6jsvX6n/fuX3jtB6t5TF7fYzz9517/TEFPX bQjo5Pq2woJfNNLCzww7s+ebjulp9XqmleR37touusZAD2xsFpIx5uaCtdndBhX3Rd tubf6mrBkjcKWm+1+LFypVN0Xw83NqnhXEm3XT1bPcqc/+G/2rbZQj+yDQ5xSylJ17 su7dQ6q84anmfWwSWQqY3Dm5vnoyA3JKkhC/xwwNhIyJiUkZphjubGqb8tuqthCj+3 R6zxdpF/VtLBg== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 07/10] arm64: dts: mt7986: move ilm in a dedicated node Date: Mon, 20 Mar 2023 17:58:01 +0100 Message-Id: <5e1168bc8fd29f4871f81d8e4a9fd43a2c3be146.1679330630.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-20230320_095920_575419_0F53570C X-CRM114-Status: UNSURE ( 9.88 ) 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 RAM SoC, move ilm in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. Signed-off-by: Lorenzo Bianconi Acked-by: Matthias Brugger --- 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 Mon Mar 20 16:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181623 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 EEE42C7618A for ; Mon, 20 Mar 2023 16:59:31 +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=zOx58xhjMFGv+0FnBpdzP0CdIdHRC9I8u554r/lS/7Q=; b=yO2adKoFyXxmINo9VZzPvYWLqi NlH7OYvLy7Yc9HbJIKREYJ0BdbFGlIayuOZD7v5+rdvdFZv9p9Q05szOv6Wc2rXmXAMkDYuYBtRrH oLhyw9ut4qMvCaWDk889KOdK1bVnHOH1SHOwRqMKKs6pLlR+h/tt1LXRDiXsaKbeWkB7YI+VEEjpq b0P/c3YeCM9mNUHw4TKB69Mlp8+lCqXmXqI2IGaFNVMBMqi1dsunGH/rztNgvqksQKT7zjbOXmVkg 6CB1QoUOb8J8XK8fmEzU+ALse0hfqbAzXq1hdQoRjkt64OBXPfhr67F/oDGBtlOOfop8M93QQqewx +rnv6qag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIqz-009u4u-2q; Mon, 20 Mar 2023 16:59:25 +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 1peIqw-009u3e-2d for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:24 +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 1919561708; Mon, 20 Mar 2023 16:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 226FBC433EF; Mon, 20 Mar 2023 16:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331561; bh=JtDTeOb+XfC/OkGaG3mNl+0+89/XnhPEztBv7Gcpg0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mgnp5ehW8FoncfryGLBiiQ7ZfcPZRvHraZzOp9LBphJgbNAoghJsjwI/+It5GkAWf AVcHZIwVL36R39b4KNfytJXLwE491hffko00Y36Fmxw0879/hrWfELOoWamZPb7yPM fcMgV51QMuZNCwCYHj7kgvc4noeICyEwxh9xcg1txK59UMhrwufkGyXj1uS8fwgjHi kjcybCx3hYxgqVJd0quEib0FtpXD4F/8PxsFcEKh5J0h60QhC86P6/TOxoOvMcxIAD vsb2FjYq8S8m2y9G391+VgXH+cAlKka9nJKWQMCGassbE7Zp3AB0xpNIvr0X4vNKRt EjKLAk3sRZGjQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 08/10] net: ethernet: mtk_wed: move dlm a dedicated dts node Date: Mon, 20 Mar 2023 17:58:02 +0100 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-20230320_095922_890389_0178F117 X-CRM114-Status: GOOD ( 12.24 ) 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. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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 Mon Mar 20 16:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181624 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 7D8EFC6FD1D for ; Mon, 20 Mar 2023 16:59:37 +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=WbnN79ZAZsmzkk1ZWwtg0wa+FYZ413hkzbBFx9Kdlbg=; b=Yb7BwsG7Q+UNLiul6aS1ow6rmo /GhWaMuiShFj5KP4fqdEgvATu5wh0HYqLDvcrYB3xKA3jP52/do+3B/99QLlPNy818kJz3bfqTdID mWsE0Ih94hLm8rLnsOUQCESEBQB6GGyu0ELKYYOTHHxMWQO7fDE+Nyl2ZuY7jaYRP2CjMnBAOqefx 5yKwYXmNLtI5wOKax0flsCNWZl2adDdsro47K+YiX1I1J+8szGN08yL1pSfw0IJXz981nitPfhcC+ JODoBDnXTtOA6Mq8moR144ZF9jKVKC1/CYi06i5I8h173bFz1Wudo+7TxqMbvmUb0MoxGL61xEYBn kRX0ZCOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIr5-009u7A-1Q; Mon, 20 Mar 2023 16:59:31 +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 1peIr2-009u5R-0L for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:29 +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 7BA76B80FF1; Mon, 20 Mar 2023 16:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD997C4339B; Mon, 20 Mar 2023 16:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331565; bh=JGceNNPm2h9mHgqAOqJItA9A7Xxmjgx4sH2gAUDtI54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h9GiySGkaU7sK05Sv6JaUINHJhaM1UxUFiMHs2i8Qsnw7RW5qEE7NJeLbqDYdRgJM j6y4u64NGy0//Pg1+8AK4hq+jBYqYnzLHx/UyAU3h5lmAmkTk0UP6R2B+aiUppVNHw EXSBQN+8Ltr3uGexYTHaqun4LHNHC4xU0ogo3ubpXDVSbiD4H43n5ZEd/ehuyigC1z y8CW3C/jgvH+MRJ2jpL/kDDOHP0Pa0dESP9YDY1cjxuopRarRPURSMakBlgUT3Jv3j 6SZ49QCoMCRxqXyadEgq+TIO6wSNYHgLPRlwiqPjTffLKxnJEj3UqFPf71g3Qb1l8T 4n7Luj0vyVaog== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 09/10] dt-bindings: soc: mediatek: move dlm in a dedicated dts node Date: Mon, 20 Mar 2023 17:58:03 +0100 Message-Id: <63bf6061ec5ee6d706a18b45a0b3714b891cb439.1679330630.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-20230320_095928_439626_CB78ED12 X-CRM114-Status: GOOD ( 14.85 ) 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 SoC, move dlm in a deidicated syscon node. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. 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 5d2397ec5891..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 Mon Mar 20 16:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13181625 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 AAEFDC6FD1D for ; Mon, 20 Mar 2023 16:59:41 +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=yX3X6XUUIZJHDMdzSW16zvJ7y/lCtQTDcoWIHMDryz8=; b=mr/9617LzSLADRS6IlviSaVBn5 gb0ZdunZ4jrPoISzbrN+80WEozTNvte4Abp6BOFxvcEOZmBTUsCrKJHam3sjSniPfLZLiDeQvGHMr HEn9dQsCgMZJIkxaGrfCUBMNWrWr7YxFXJV40+ze6aOoZPYb6M5vBexfWo23dhbejoeN/zzART7t1 o9UDSfpP2PxbhJBT/5A71aBt6y22h19hapIiZaHy38Ls4Z0GRfzjkR6D3rVx0H6NfLskmFpUS2fVn MfX7fQgbZUpa2Qoy6+4aj4mwZtXZkax44UgaKdgFJEIi331zpjCa8dF4mgIlWMbE+/6bX/245lzLB 8FhykUwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peIr8-009u8M-0f; Mon, 20 Mar 2023 16:59:34 +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 1peIr3-009u6P-3A for linux-mediatek@lists.infradead.org; Mon, 20 Mar 2023 16:59:31 +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 7C140616DD; Mon, 20 Mar 2023 16:59:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B860C433D2; Mon, 20 Mar 2023 16:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679331568; bh=erXq85FyIZtloI+86moWAdAbuiYWCHhJtUTWTR5zF24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6Yew46aNS37ilruUDPlt8PDEPagkM02hjjuYvwmCyha0ErZGzm+AnrYwU4QfSneu aVhngWEpjFKmnzW/ounuNw2VTPBYK4UVmX8666/kyvzx4MvPPWvIXSuo7ty1fSrpqy EX3RTHitTqmOuAENKuqWmy+Wdj9oPbECvfe4MbQFZ7Xjl3Fdz6HucCyw2CwowTc8rZ ToR74R+tKAslNphht+kW1LWEEtow7yyvayizvEUUwtY52+nkSy6g5qRQ0RAmBw5rE2 PC7E4NPpSULVp1NCM8fVAB66RJFwZvCIJ15jlo4d4P3tBnHbs8tNTQpeliwS2Fpx1Y G4KaBPh8WWIvQ== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, 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 net-next 10/10] arm64: dts: mt7986: move dlm in a dedicated node Date: Mon, 20 Mar 2023 17:58:04 +0100 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-20230320_095930_090237_920D150B X-CRM114-Status: UNSURE ( 9.74 ) 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. This patch helps to keep backward-compatibility with older version of uboot codebase where we have a limit of 8 reserved-memory dts child nodes. Signed-off-by: Lorenzo Bianconi Acked-by: Matthias Brugger --- 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>;