Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1124512rwr; Fri, 5 May 2023 09:24:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Q8RxjoJAPUFFo8gJuREM+QhJ7nMD6moH6hjOWfCPWLJypYpUIwOfFf3ypjPLOoEDRkHRg X-Received: by 2002:a05:6a00:198d:b0:63f:1600:e711 with SMTP id d13-20020a056a00198d00b0063f1600e711mr2755374pfl.29.1683303883633; Fri, 05 May 2023 09:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683303883; cv=none; d=google.com; s=arc-20160816; b=kmYbSGwEFKekaF9Trp77P5J+z+03Ro+CjCqdl7fZP8J0Gt4RfiZJ2fPN5kQnqvdQfH +rghLOuGTTMroW/5HmchdjYXVAzl6YUg6oNWuxix7NxCcg26itZibIPc8TMrftSWLVYh F9aPMCDGYCifYGcVMu9GhQgcdQj/mWbAw5rrN7E5DiT20fElIhMAC09orDBn4Pwg99ia ZtzICjh1feq34+8/E8DMOtbT6IxPIjWCDi02yeLNn1pwqaY689Hz6hUyRmQl0hEiu8Gc LbjgUWiiSIWSSecJswtV3JS7+R0532M8wD2z1DWlq7Tv3IABFyIy1A8D+5pGxEKps3y2 VF+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=YlWj75iOW1mPPUfb7JjVVkFc/E/PPPGObmLRv4IECf4=; b=Cl57gVo0vsOt1cSe9z/4e+wLyliuhJAMo0cMTfESFIkOtWvL1qoy7abwJ45V0TXHP6 yZXbDAvUNRU3djnZE9f+TanG/HJsU5uWRgq8Viz8Ht+ffuz79rvRJn9pj8OmP+gbrbge g0qFpLyfTiUdUwg3aqCX1sHRIMB025pTrZdr/8OWIBscIVUYWCkfUgjY0Jsto2zhrMRu wkzlvIub7LsV5gdn6H0JeTga5N7moy7rNTspaCQZJo/LRU+Qg756ZawNDD+pUXINjmAc 36cJP2gtaSFqy9jS0LA+8vdUbseQBvWSVt6w0ioQl7FaIk6RDOWXgbX/Am7yOJjIStM5 m2Ow== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a15-20020aa795af000000b0063afd8a5b8dsi2322971pfk.186.2023.05.05.09.24.27; Fri, 05 May 2023 09:24:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232898AbjEEQAW (ORCPT + 99 others); Fri, 5 May 2023 12:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbjEEQAV (ORCPT ); Fri, 5 May 2023 12:00:21 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CF07160BE; Fri, 5 May 2023 09:00:20 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0B3E61FB; Fri, 5 May 2023 09:01:04 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFA093F5A1; Fri, 5 May 2023 09:00:17 -0700 (PDT) Date: Fri, 5 May 2023 17:00:15 +0100 From: Andre Przywara To: Maxim Kiselev Cc: robh+dt@kernel.org, Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Cristian Ciocaltea , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: dts: allwinner: d1: Add SPI0 controller node Message-ID: <20230505170015.664c18bc@donnerap.cambridge.arm.com> In-Reply-To: References: <20230505074701.1030980-1-bigunclemax@gmail.com> <20230505105805.548d1a1b@donnerap.cambridge.arm.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 On Fri, 5 May 2023 17:27:07 +0400 Maxim Kiselev wrote: Hi Maxim, > > From a quick glance at the manuals, it > > looks like there are not quite the same, though: the D1/R528/T113s > > mentions a SPI_SAMP_DL register @0x28, whereas the older IP has a SPI_CCR > > register @0x24 - which is not mentioned in the newer manuals. The driver > > relies on that clock control register, so it wouldn't really work > > reliably, if that register is not there. > > Thank you for pointing this out. I missed this difference. > I actually have a board with T113 SoC, and it looks like writing to > SPI_CCR@0x24 does nothing. According to the manual, the register doesn't exist, so this would support this theory. Most Allwinner IP just implements non-existing registers as RAZ/WI. > And it doesn't affect access to connected SPI NOR flash (read\write > operations are fine). I guess it just works with *some* (default?) clock settings then. Might be faster than configured, but the SPI flash chip might be fine with that. > But I completely agree with you that this difference should be handled > by the spi driver. As Samuel pointed out on IRC, there are patches, for the R329, using the same IP: https://lore.kernel.org/lkml/BYAPR20MB2472E8B10BFEF75E7950BBC0BCF79@BYAPR20MB2472.namprd20.prod.outlook.com/ And he also seemed to have issues, at least with SPI-NAND on one board: https://lore.kernel.org/lkml/0b5b586a-3bc7-384e-103c-e40d0b2fac23@sholland.org/ Can you please try these patches, and use: compatible = "allwinner,sun20i-d1-spi", "allwinner,sun50i-r329-spi"; for the compatible string? If possible, you could revive this series, and add the D1/T113s support on top: just add the compatible string combo to the binding document. Cheers, Andre