Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1206273rwb; Fri, 18 Nov 2022 14:34:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7w4mmmPi8oCHNcw5r00kbEkzenXccFi4M9Qc6c0wu2Eyjh9ktxM0qcgTo+9IifSZ1Hge4J X-Received: by 2002:a05:6a00:26c4:b0:561:c295:7568 with SMTP id p4-20020a056a0026c400b00561c2957568mr9674284pfw.35.1668810899682; Fri, 18 Nov 2022 14:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668810899; cv=none; d=google.com; s=arc-20160816; b=T4qBUV8whu7CFzifOU9PTkawLoYR8zLbuD1bNyXtDo43d2xRNtZ7DxCv2XQ41/tYku IYKgGMoBceHK2iJ/07J2udFTtenscHEs6s725w7Za/pyN3l1BqO8BJSuuqhZHsCKY6bu VZbewe3O9WcnbvpLcpXMoGJexRLmkrQC3r0b8Bh6kkGorILAqA/BrN2xf2h+XHom5mDP 7rcDhsAT3zyOAMXYUC866yW2e0sM3yDO5ub+EhsBEthhRDZVOVEggHaLuZ9oPWICyqRK mXepYuAEwRHYiLgT19NkwQw2S9OLnk9TxObls8D5trKSrM+JwrY6M7GhG0yq5NT7VQ0K zYIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:message-id:references:in-reply-to:reply-to:user-agent :subject:cc:to:from:date:dkim-signature; bh=Cy/UMrRY23kBrD2ecL5l9ho8KZiKHiy2L0b7WpzlhX4=; b=IUboMee5e8w+dnmbj43wGVgULlAdc03P8GC+SjLMU8ei7s9B2j5DhDU7wBmRNd6m2a OO/CKf3kzJfxWMblMQqrgMBPO/KJ1jDhCV4hx99VlElYkwad4ssgq/WVe0PnURy908tZ ye9v89welQ9oUl4aoWC3VsUvxSBt77h3ATyKHB+yCv5bTLBrlioUw2uPY/z0cz1883jr Z+Vl4iAfTqVxSe1vvrdzTax5yqbFpCxq99+G+PXpnahHGJ4QxWeXS/DhIZ+JIE1WX+RG tnw7itg3uQ6/zU/rQ+UMjS3E2p32qASTzqWs4Vnb4GIR/IcnVm27HkixD8ZNBr9hJGet UkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@public-files.de header.s=s31663417 header.b=fxKRAT+H; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020a1709026b8900b001781520b28fsi4508757plk.26.2022.11.18.14.34.41; Fri, 18 Nov 2022 14:34:59 -0800 (PST) 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; dkim=pass header.i=@public-files.de header.s=s31663417 header.b=fxKRAT+H; 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 S229762AbiKRWF5 (ORCPT + 90 others); Fri, 18 Nov 2022 17:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiKRWFz (ORCPT ); Fri, 18 Nov 2022 17:05:55 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9914082236; Fri, 18 Nov 2022 14:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=public-files.de; s=s31663417; t=1668809116; bh=hvzsqeW+pZ6aFflH2DeCG+N++nDpjK40B2TbayEPl3E=; h=X-UI-Sender-Class:Date:From:To:CC:Subject:Reply-to:In-Reply-To: References; b=fxKRAT+HRry568qEjuPyxuqxsmOxh4Ut89W+yMncF4mJNkKMr+YYWLSXrzs8Bhygb gtMmeD8NNRrBa2x/408mJhaEpcv+e7EncaHTSisARCpXGDGqE+Ua78jxcb7qs7fB7v FqSRREPLyy16mkf6slwzRamQdHq7B0MLmBiGY++cvRU/gct7xlgk5a0NONEk7mmiuJ bTMbyOw9Z1x1XJT2wd35t2bO5Tw2ixB0FK1bWOVI+rQL2b3gZ8aZsRWUeC2U9uSdNj MQ2ftGVApLk/FLynG7pklgr0+kBi4vdvKgs2JM71nOCdylNpgdyUN81YUkvaeBuzDK MZ1DqZv4XCJpg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [127.0.0.1] ([80.245.77.125]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N49hB-1p5SwP0bLt-0102e6; Fri, 18 Nov 2022 23:05:16 +0100 Date: Fri, 18 Nov 2022 23:05:11 +0100 From: Frank Wunderlich To: Rob Herring , Frank Wunderlich CC: linux-mediatek@lists.infradead.org, Ryder Lee , Jianjun Wang , Bjorn Helgaas , Krzysztof Kozlowski , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Matthias Brugger , Paolo Abeni , Lorenzo Bianconi , Bo Jiao , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v6 11/11] arm64: dts: mt7986: add BPI-R3 nand/nor overlays User-Agent: K-9 Mail for Android Reply-to: frank-w@public-files.de In-Reply-To: References: <20221118190126.100895-1-linux@fw-web.de> <20221118190126.100895-12-linux@fw-web.de> Message-ID: <99114D73-22EF-43CD-848E-88A37B29B953@public-files.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: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mumZNrbNbBjb3zlIVK6GG HtrmluWV7dcXPXe1YH/AnUqR2kaZ2scpnDI1fyP8Xd1turb8JZUBcdN/vNqg0qiMRt/JfXzfZ 6YV1DFoB4zYXZxodKoC1hU6hE9xlGtaf3Nlhn6fJjGxSsrLTIwSOXtvQMD/b+msc+b3nhs8bq J2vMfA== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Am 18=2E November 2022 22:39:52 MEZ schrieb Rob Herring : >On Fri, Nov 18, 2022 at 1:01 PM Frank Wunderlich wrot= e: >> >> From: Frank Wunderlich >> >> Add devicetree overlays for using nand and nor on BPI-R3=2E > >Can you not tell at runtime which one you booted from? If not, how >does one choose which overlay to apply? If you can, why not populate >both nodes and enable the right one? IMO, if all h/w is present, it >should all be in the DT=2E Selecting what h/w to use is a separate >problem and overlays aren't a great solution for that=2E It is not the decision about bootdevice,more available devices=2E Only 1 spi device (nand OR nor) is available at boottime as they share same spi bus and chipselect is set via hw jumper=2E Both nodes have reg 0,which is imho not supported in linux=2E I choosed overlays to add the right spi device on the right mmc device where similar selection happens (see patch 10)=2E Either sd OR emmc can be used (1 mmc controller,first 4bits from bus switched by hardware jumper)=2EBut for mmc i use it as base fdt because i see mmc as primary device which holds rootfs too=2E Nand/nor is imho helping device for accessing emmc or like rescue system (only uboot)=2E I probe in uboot if emmc is available (mmc partconf) and choose emmc else sd=2E For spi i try with sf command to check for nor,if this does not work i apply nand overlay=2E >> Signed-off-by: Frank Wunderlich >> --- >> maybe rename to dtso? >> >> "kbuild: Allow DTB overlays to built from =2Edtso named source files" >> https://git=2Ekernel=2Eorg/pub/scm/linux/kernel/git/robh/linux=2Egit/co= mmit/?h=3Ddt/next&id=3D363547d2191cbc32ca954ba75d72908712398ff2 Should i do this? >> more comments about the dt overlay-support: >> >> https://patchwork=2Ekernel=2Eorg/comment/25092116/ >> https://patchwork=2Ekernel=2Eorg/comment/25085681/ Daniel suggest define sd/emmc as overlay too=2E=2E=2Ewith way you mention = below we could create 4 full fdt without applying overlays in uboot=2E >> --- a/arch/arm64/boot/dts/mediatek/Makefile >> +++ b/arch/arm64/boot/dts/mediatek/Makefile >> @@ -8,6 +8,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt6797-x20-dev=2Edtb >> dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7622-rfb1=2Edtb >> dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7622-bananapi-bpi-r64=2Edtb >> dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-emmc=2Edtb >> +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-nand=2Edtbo >> +dtb-$(CONFIG_ARCH_MEDIATEK) +=3D mt7986a-bananapi-bpi-r3-nor=2Edtbo > >These need rules to apply them to the base dtb(s)=2E You just need: > >full=2Edtb :=3D base=2Edtb overlay=2Edtb >dtb-y +=3D full=2Edtb I would prefer to do this in bootloader to allow all 4 possible configurat= ions: Sd+nand Sd+nor Emmc+nand Emmc+nor >Rob Hi, regards Frank