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>; + }; + }; }; };