From patchwork Wed Apr 19 19:15:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 85532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp616527vqo; Wed, 19 Apr 2023 12:25:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZG+LJk/GBTOh+eWMzH7EDPvJ2/viUOfADvpn1s1Ah7gG8kmQelTY5Y9zVoEYXise6PnlFC X-Received: by 2002:a05:6a20:a5a6:b0:ef:ba1a:e7bb with SMTP id bc38-20020a056a20a5a600b000efba1ae7bbmr4585217pzb.24.1681932345357; Wed, 19 Apr 2023 12:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681932345; cv=none; d=google.com; s=arc-20160816; b=C1iyxXg2s4FC3oq6x2x4xD5JFrOkbKk0FJlMjxlFBiiCO7WM6RR+kZM2AmR58tKiih Lu76GvlXMtxRpb4OMlDQHhbPxNHVDRopGVILzT4iA8nkiz5iMZnm07cDKjCDIqaYtOMU d0WlP6bQ7AHV33Lb409D6oaBI51ONwkt9ZbYL2YmjkqZLkjEM55fxou+OSKPSUzzBYzT c6DTswk3wClCvnnRnwR6wNKDYzmuXKspOBlHXoW0UFytov6ediX9FoaMxX6SonKWGN93 tfEdmh6dYbAlczkNFM2WPeQVim1tXC4MBrDdwQuxkOmPpP5/dZgpooQZV9zlOtcsoEcN fQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=Kx4ScIwodZZdp5YVes34mvncFAPh7iF0I6vBg8NkTqs=; b=YYH70ysoJzKNMHg/vAO9G+0A6iu1KPsc1MkqkkzpZhkFHfkSJWLBpX7k8ILi1Ix4EP upaSZvsjtc+PaUM+YFU+3LY/tBoCAz4AsGnm684KBh5xU3CBK7gB1YvC59RU1MfqPx4l 1W0spydtwjmox8nc9ZIcaDS33wyuL8+k+1aIdMTinP6WEA9jYSUMbAl34GpGaOcdS2dX Z52uofcESttr7pLD84xntJIjtekuM1RBgLGuW9daPmJ10Lj2M44IuRYnfYYnJc+/o5IW hI38gKGy1ekUaUrJlLMfXJ7FdwvQVLq1ARZbJEbfcT2GujcH94VCfhUACCNMaI0+EpSc d+QA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020a632b12000000b0050af2178284si17373420pgr.819.2023.04.19.12.25.31; Wed, 19 Apr 2023 12:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjDSTQG (ORCPT + 99 others); Wed, 19 Apr 2023 15:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbjDSTQE (ORCPT ); Wed, 19 Apr 2023 15:16:04 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10F85B99; Wed, 19 Apr 2023 12:16:00 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1ppDHa-0003rR-2a; Wed, 19 Apr 2023 21:15:58 +0200 Date: Wed, 19 Apr 2023 20:15:53 +0100 From: Daniel Golle To: devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH 1/2] arm64: dts: mt7622: declare SPI-NAND present on BPI-R64 Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763633890923700571?= X-GMAIL-MSGID: =?utf-8?q?1763633890923700571?= The SPI-NOR node in the device tree of the BananaPi R64 has most likely been copied from the reference board's device tree even though the R64 comes with an SPI-NAND chip rather than SPI-NOR. Setup the Serial NAND Flash Interface (SNFI) controller, enable hardware BCH error detection and correction engine and add the SPI-NAND chip including basic partitions, Signed-off-by: Daniel Golle --- .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) base-commit: 13961ef828cbc254cc272221b7fc54851caa39a7 diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts index af3fe61e40938..d583e816684cf 100644 --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts @@ -248,14 +248,42 @@ &nandc { status = "disabled"; }; -&nor_flash { - pinctrl-names = "default"; - pinctrl-0 = <&spi_nor_pins>; - status = "disabled"; +&bch { + status = "okay"; +}; +&snfi { + pinctrl-names = "default"; + pinctrl-0 = <&serial_nand_pins>; + status = "okay"; flash@0 { - compatible = "jedec,spi-nor"; + compatible = "spi-nand"; reg = <0>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + nand-ecc-engine = <&snfi>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "fip"; + reg = <0x80000 0x200000>; + read-only; + }; + + ubi: partition@280000 { + label = "ubi"; + reg = <0x280000 0x7d80000>; + }; + }; }; }; From patchwork Wed Apr 19 19:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 85530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp612615vqo; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+430D8VVAg8yZISb01i60jdqtBe0BeKOVcz0XU5aGi5K1BNyjMffAg1V6wuN7SrpLElGw X-Received: by 2002:a17:903:650:b0:1a8:1798:11d0 with SMTP id kh16-20020a170903065000b001a8179811d0mr3421699plb.18.1681931894368; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681931894; cv=none; d=google.com; s=arc-20160816; b=kIFv5XoGlCi0MRuV/u5FCrmZN/LcGqqf9AOE33rYoecy+Hch4zk6OFrqgkvj2kU31f QcdXjEX05iqvxPtjvBXIPGmlrU+19Udb7vc+WqU4KD4owVX2euJ0UCG/50mzUwUhH2Ut MQ4OXrBRCECyXGudRecS8GkT8jPTDxZVFWCcPwX37JRcTNLx7MrqV0AE3QKNanHB2v/p 5HaKAQGTiXeUXHJA98X5hL0o+1caI8tKCdo/HZLiOowH7qzj/jWZIMM0y/j2G2IBI2k3 odpZagmDetdFK9T7CD/fm2mUG5Ot/ZmzDDm8dh+JCUSea0TpOEdcoT0hcFyaYt2e7z72 n62g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=F45UzTj4xsAwlT7Xf12zmKoApQ324lriJEm4bTv4O2s=; b=JKoP8HwFG1t1Q+UMjxEoGvidmrLOHbuO4V3uKUN5V/FQNm3x4YB9aMMd1yQzpU9vKx jYx4TDs0vf5KB+w82BjmOHnI3mIoN6t0IFXo1WbCEz1RLtmFBqQsnc7KmSPZHmMe51XF zy+HvD8NLAAHQz6R0dnPLf/wfB49H9T0sbfri2JnP464EcR8FBR69M4UUhkuETbyUgMb o/1ubfFz19qhg8X5I6Dqw/C4vo3G6RvDct/WbmlYjK1Q30DGR2rd3Qz1x3tjh365xV1u Sq2vUeynIcgvGYhLMC4SDGgFEbUhXELUjcr77+eRGzrDEacfWWg8/rYmpuc3vLK8bYlX lMfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902cecc00b001a81e552dc7si2296093plg.637.2023.04.19.12.18.01; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231572AbjDSTFl (ORCPT + 99 others); Wed, 19 Apr 2023 15:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbjDSTFi (ORCPT ); Wed, 19 Apr 2023 15:05:38 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B48749E7; Wed, 19 Apr 2023 12:05:25 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1ppD7K-0003n3-2L; Wed, 19 Apr 2023 21:05:22 +0200 Date: Wed, 19 Apr 2023 20:05:16 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH net-next 2/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981 Message-ID: <2651cfd1427175ac1ad08d5b7be146c55d94b674.1681930898.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763633418439805626?= X-GMAIL-MSGID: =?utf-8?q?1763633418439805626?= In order to support wireless offloading on MT7981 we need to load the appropriate firmware. Recognize MT7981 and load mt7981_wo.bin. Signed-off-by: Daniel Golle --- drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 7 ++++++- drivers/net/ethernet/mediatek/mtk_wed_wo.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index 6bad0d262f286..071ed3dea860d 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -326,7 +326,11 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) wo->hw->index + 1); /* load firmware */ - fw_name = wo->hw->index ? MT7986_FIRMWARE_WO1 : MT7986_FIRMWARE_WO0; + if (of_device_is_compatible(wo->hw->node, "mediatek,mt7981-wed")) + fw_name = MT7981_FIRMWARE_WO; + else + fw_name = wo->hw->index ? MT7986_FIRMWARE_WO1 : MT7986_FIRMWARE_WO0; + ret = request_firmware(&fw, fw_name, wo->hw->dev); if (ret) return ret; @@ -386,5 +390,6 @@ int mtk_wed_mcu_init(struct mtk_wed_wo *wo) 100, MTK_FW_DL_TIMEOUT); } +MODULE_FIRMWARE(MT7981_FIRMWARE_WO); MODULE_FIRMWARE(MT7986_FIRMWARE_WO0); MODULE_FIRMWARE(MT7986_FIRMWARE_WO1); diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.h b/drivers/net/ethernet/mediatek/mtk_wed_wo.h index dbcf42ce9173c..7a1a2a28f1acb 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h @@ -88,6 +88,7 @@ enum mtk_wed_dummy_cr_idx { MTK_WED_DUMMY_CR_WO_STATUS, }; +#define MT7981_FIRMWARE_WO "mediatek/mt7981_wo.bin" #define MT7986_FIRMWARE_WO0 "mediatek/mt7986_wo_0.bin" #define MT7986_FIRMWARE_WO1 "mediatek/mt7986_wo_1.bin"