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: 665315 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5A97C6FD1D for ; Mon, 20 Mar 2023 17:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232498AbjCTRGA (ORCPT ); Mon, 20 Mar 2023 13:06:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232501AbjCTRFk (ORCPT ); Mon, 20 Mar 2023 13:05:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7226D17CD9; Mon, 20 Mar 2023 10:00:23 -0700 (PDT) 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 2E59961704; 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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: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: 665310 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39208C6FD1D for ; Mon, 20 Mar 2023 17:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232136AbjCTRNR (ORCPT ); Mon, 20 Mar 2023 13:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbjCTRMi (ORCPT ); Mon, 20 Mar 2023 13:12:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFCAE83C3; Mon, 20 Mar 2023 10:08:43 -0700 (PDT) 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 DE92561701; 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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: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: 665313 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 120B0C7618A for ; Mon, 20 Mar 2023 17:06:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232225AbjCTRG5 (ORCPT ); Mon, 20 Mar 2023 13:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232596AbjCTRGV (ORCPT ); Mon, 20 Mar 2023 13:06:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1937C3AA9; Mon, 20 Mar 2023 10:01:09 -0700 (PDT) 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 3EB1161706; 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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: 665312 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A626C7618A for ; Mon, 20 Mar 2023 17:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233272AbjCTRG7 (ORCPT ); Mon, 20 Mar 2023 13:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232489AbjCTRGW (ORCPT ); Mon, 20 Mar 2023 13:06:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F2CC144A1; Mon, 20 Mar 2023 10:01:11 -0700 (PDT) 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 11BE161707; 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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: 665311 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03190C6FD1D for ; Mon, 20 Mar 2023 17:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233182AbjCTRHt (ORCPT ); Mon, 20 Mar 2023 13:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbjCTRHT (ORCPT ); Mon, 20 Mar 2023 13:07:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD0313866D; Mon, 20 Mar 2023 10:01:44 -0700 (PDT) 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 D4356616DF; Mon, 20 Mar 2023 16:59:25 +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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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>; + }; + };