Message ID | 20230506073018.1411583-2-bigunclemax@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp907941vqo; Sat, 6 May 2023 00:33:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5y9RLxeUcY0SMsRZbcd5JUDPFO1Uj1VzSusggNXByv6t4OtIAdmA7DkVKMByWDk2BQ4Izg X-Received: by 2002:a05:6a20:8e14:b0:fa:4fc6:79ab with SMTP id y20-20020a056a208e1400b000fa4fc679abmr4760432pzj.11.1683358411930; Sat, 06 May 2023 00:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683358411; cv=none; d=google.com; s=arc-20160816; b=jXm5qNn8JFWwe5BHCaj/vMLIh1jAxYpNtt/2nF3w5ut9RSLBdgsuDOmT24ycLf/FDo PLiOxnO0CVlybVaLGAN1QEcs26GIN9Fbzkc1f3NbdJ/UlTDOyrKbonrQEvlYNAN9mWZR 2QdXJDM91LfJcTUTUT4EXAp1Wq6/qwaLnBy5nPHTPRPknqTB8oIay1Elcsj4rDbjEhNF JVgiVg8fe/UdPXt1ahgnVRxiTP0zhx1Y8WlioC7taJkpTXE1F1ClLPXgFKpdpqcGJexN sjsuNCPDtG8rduXOThfx0YyayaNMb4WfMQBAm1XHcpR3pvFZkMXnWJQJDz2NitCgSHqU XkyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0/p1ytnQh6YEGVhEhqDXJrPOG30ZOWl4FCmbFIXesQs=; b=hwI1hsS2AmKPqUCpxMwPXXpFuCKy1Z92SFg5CCnLBKpAbPsXtrnwhw5G5CcRP+kVgj rvjLMNgHRiSfRJorslMYHPYSNDUUaopXLvg6JgHLP+AtbsdVNqqIcWaoMGa8248vo0Dm F6W6UnKPe9TYPA6XhCzD22Cg1Lrjesjxr9RY6ivujwpxAd4F6+VDA68SJ959bj7oLu4r qArSkos0U3xm4wx4D/ap8+XErRW+iMIhO6ZFc8xbgq21nQ5iSeE435aLqKf+5sx3xMKg ex7CchgBMzsmFzHjjXi4sWIGBi1IwWtr+Rj2q+x2t6HVOMpMOcDbXupTD/2dltZESMfl ddHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=bHsdH9QL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i187-20020a639dc4000000b0051344de1eb8si3557070pgd.276.2023.05.06.00.33.16; Sat, 06 May 2023 00:33:31 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=bHsdH9QL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjEFHch (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Sat, 6 May 2023 03:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbjEFHcQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 6 May 2023 03:32:16 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33EC11B7B; Sat, 6 May 2023 00:32:06 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f4000ec71dso17630405e9.2; Sat, 06 May 2023 00:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683358325; x=1685950325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0/p1ytnQh6YEGVhEhqDXJrPOG30ZOWl4FCmbFIXesQs=; b=bHsdH9QLBx95JODO+aI3BTZ9JpWH80AULgNrIwX35ln3QWMnNrfyonN+IEHO3a2qXT zQayMOl3UCEcpbg7SLIxbGxSaxH7wpxwpx3k6GfGLVqIOq34mTLj/N+WmeALlM/BV8QJ 1Yg5TejIXbppSec1n7g550mo+9+Ow80CwC8KhpOwO5B33fezYPoOP1ue2+MnAAhZR7aN JYTD8eG2esMfafDyBkIrl8YCg2DAoQqQYOlOqcRt0aAiXAXbBP9eR0f06G21todRHxqn emMzyrfrkGuzCNT+6qaxL0Pc0Ktrb3COiRtiFN7x/LlK6Ftkp/pBQI9OGoIAW5IOERVy l0fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683358325; x=1685950325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0/p1ytnQh6YEGVhEhqDXJrPOG30ZOWl4FCmbFIXesQs=; b=MbJ39SrwMDx6Y0V+47CqUU1VwXu/V1pJGTCMRKNwHXbmZOqhGgkXBuLSnenGxklBRy jMHBKJTKTSnSgDaIWlQgDNt+Vih42lfK0tDfiR+kgy5CimlBLZhjQwCfuCn3iGIdxLrx B41IQXdqz9WsGKaIwOs64Q70ksea8pXQ02WNg1fQnQusDUD/K0bQ4TmxDsEYaqC+wToK njdQNU/vibBhZi0EN7NuQmbAkvAnZqqItbXFglSgbXoHEyuzHGwJBAJBiHg7GRZIydI+ rv+EBF3Yqgj9p2M4k7ke3vmH5cV1RQFkOoFrj8m5L3r1vjxVSZXX47ykKdYKkqgFMdiL 5tnw== X-Gm-Message-State: AC+VfDzaqgevYnwcVfundZnREjXL2trrez6S+BC6OHjIosaUjnRdjgpm ih3L3fW2oMuMCiIaXH7/FiE= X-Received: by 2002:a7b:cb53:0:b0:3f2:53a5:d308 with SMTP id v19-20020a7bcb53000000b003f253a5d308mr2586133wmj.6.1683358324784; Sat, 06 May 2023 00:32:04 -0700 (PDT) Received: from localhost.localdomain ([176.221.215.212]) by smtp.gmail.com with ESMTPSA id q14-20020a7bce8e000000b003f182a10106sm10071944wmj.8.2023.05.06.00.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 00:32:04 -0700 (PDT) From: Maksim Kiselev <bigunclemax@gmail.com> To: Andre Przywara <andre.przywara@arm.com> Cc: Icenowy Zheng <icenowy@aosc.io>, Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Cristian Ciocaltea <cristian.ciocaltea@collabora.com>, Heiko Stuebner <heiko.stuebner@vrull.eu>, Maksim Kiselev <bigunclemax@gmail.com>, Maxime Ripard <mripard@kernel.org>, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 1/6] dt-bindings: spi: sun6i: add DT bindings for Allwinner R329 SPI Date: Sat, 6 May 2023 10:30:09 +0300 Message-Id: <20230506073018.1411583-2-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230506073018.1411583-1-bigunclemax@gmail.com> References: <20230506073018.1411583-1-bigunclemax@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765129230319501245?= X-GMAIL-MSGID: =?utf-8?q?1765129230319501245?= |
Series |
Allwinner R329/D1/R528/T113s SPI support
|
|
Commit Message
Maxim Kiselev
May 6, 2023, 7:30 a.m. UTC
From: Icenowy Zheng <icenowy@aosc.io> Allwinner R329 SPI has two controllers, and the second one has helper functions for MIPI-DBI Type C. Add compatible strings for these controllers Signed-off-by: Icenowy Zheng <icenowy@aosc.io> --- .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml | 2 ++ 1 file changed, 2 insertions(+)
Comments
Hey Maksim, On Sat, May 06, 2023 at 10:30:09AM +0300, Maksim Kiselev wrote: > From: Icenowy Zheng <icenowy@aosc.io> > > Allwinner R329 SPI has two controllers, and the second one has helper > functions for MIPI-DBI Type C. > > Add compatible strings for these controllers > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io> > --- > .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > index de36c6a34a0f..2c1b8da35339 100644 > --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > @@ -21,6 +21,8 @@ properties: > oneOf: > - const: allwinner,sun6i-a31-spi > - const: allwinner,sun8i-h3-spi > + - const: allwinner,sun50i-r329-spi > + - const: allwinner,sun50i-r329-spi-dbi From the driver patch: "Add basical support for these controllers. As we're not going to support the DBI functionality now, just implement the two kinds of controllers as the same." Should this not be set up as a fallback compatible, per Samuel's suggestion here: https://lore.kernel.org/lkml/9ae7d1ee-4e2d-f3c1-f55f-e96b0e449b63@sholland.org/ Thanks, Conor. > - items: > - enum: > - allwinner,sun8i-r40-spi > -- > 2.39.2 >
On 06/05/2023 09:30, Maksim Kiselev wrote: > From: Icenowy Zheng <icenowy@aosc.io> > > Allwinner R329 SPI has two controllers, and the second one has helper > functions for MIPI-DBI Type C. I wonder what is the difference of DBI compatible. You refer to "helper functions", which sounds like driver... do you mean some parts of SPI controller? > > Add compatible strings for these controllers > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io> > --- > .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > index de36c6a34a0f..2c1b8da35339 100644 > --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > @@ -21,6 +21,8 @@ properties: > oneOf: > - const: allwinner,sun6i-a31-spi > - const: allwinner,sun8i-h3-spi > + - const: allwinner,sun50i-r329-spi > + - const: allwinner,sun50i-r329-spi-dbi As Conor pointed out, nothing improved here. Best regards, Krzysztof
> Should this not be set up as a fallback compatible, per Samuel's > suggestion here: Ok, I'll do it in the next version. > I wonder what is the difference of DBI compatible. You refer to "helper > functions", which sounds like driver... do you mean some parts of SPI > controller? According to the D1 datasheet the SPI_DBI controller uses the same registers layout as the regular SPI0 controller. But also it has an additional DBI mode functionality. Support for this mode is not yet implemented. So there is no difference between 'sun50i-r329-spi' and 'sun50i-r329-spi-dbi' controllers types in the SPI driver. Maybe we should drop 'sun50i-r329-spi-dbi' compatible struct from here https://lore.kernel.org/lkml/20230506073018.1411583-5-bigunclemax@gmail.com/ for a while the DBI mode functionality will not be implemented?
On Sat, 6 May 2023 12:53:07 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: Hi Maksim, > On 06/05/2023 09:30, Maksim Kiselev wrote: > > From: Icenowy Zheng <icenowy@aosc.io> > > > > Allwinner R329 SPI has two controllers, and the second one has helper > > functions for MIPI-DBI Type C. > > I wonder what is the difference of DBI compatible. You refer to "helper > functions", which sounds like driver... do you mean some parts of SPI > controller? So I checked the manuals, all of the D1, T113-s and R329 are the same in this respect: - There are two SPI controllers, the "first" one is what this series fully supports. - The second SPI controller has some additional registers and two extra bits in the control register to drive the DBI extension, but is otherwise compatible to the first one: So I'd suggest to introduce the following compatible string combinations to the binding *now*. We don't support the DBI bits (yet), but this would be the correct hardware description: For the R329: spi0: spi@4025000 { compatible = "allwinner,sun50i-r329-spi"; .... spi1: spi@4026000 { compatible = "allwinner,sun50i-r329-spi-dbi", "allwinner,sun50i-r329-spi"; For the D1/T113s: spi0: spi@4025000 { compatible = "allwinner,sun20i-d1-spi", "allwinner,sun50i-r329-spi"; .... spi1: spi@4026000 { compatible = "allwinner,sun20i-d1-spi-dbi", "allwinner,sun50i-r329-spi-dbi", "allwinner,sun50i-r329-spi"; I leave that as an exercise to the reader to convert that into the minimal set of DT schema lines ;-) I would suggest to add both the D1/T113s and the R329 bindings in this one patch, to reduce the churn. I guess if you do this, you could even drop Icenowy's authorship on this patch, since it has not much to do with the original version anymore. Cheers, Andre > > Add compatible strings for these controllers > > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.io> > > > --- > > .../devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > > index de36c6a34a0f..2c1b8da35339 100644 > > --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > > +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml > > @@ -21,6 +21,8 @@ properties: > > oneOf: > > - const: allwinner,sun6i-a31-spi > > - const: allwinner,sun8i-h3-spi > > + - const: > > + - const: allwinner,sun50i-r329-spi-dbi > > As Conor pointed out, nothing improved here. > > Best regards, > Krzysztof >
On 06/05/2023 14:59, Maxim Kiselev wrote: >> Should this not be set up as a fallback compatible, per Samuel's >> suggestion here: > > Ok, I'll do it in the next version. > >> I wonder what is the difference of DBI compatible. You refer to "helper >> functions", which sounds like driver... do you mean some parts of SPI >> controller? > > According to the D1 datasheet the SPI_DBI controller uses the same > registers layout as the regular SPI0 controller. > But also it has an additional DBI mode functionality. Support for this > mode is not yet implemented. > So there is no difference between 'sun50i-r329-spi' and > 'sun50i-r329-spi-dbi' controllers types in the SPI driver. > > Maybe we should drop 'sun50i-r329-spi-dbi' compatible struct from here > https://lore.kernel.org/lkml/20230506073018.1411583-5-bigunclemax@gmail.com/ > for a while the DBI mode functionality will not be implemented? You need both compatibles, but keep DBI compatible with regular one. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml index de36c6a34a0f..2c1b8da35339 100644 --- a/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml +++ b/Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml @@ -21,6 +21,8 @@ properties: oneOf: - const: allwinner,sun6i-a31-spi - const: allwinner,sun8i-h3-spi + - const: allwinner,sun50i-r329-spi + - const: allwinner,sun50i-r329-spi-dbi - items: - enum: - allwinner,sun8i-r40-spi