Message ID | 20230210072643.2772-2-chiawei_wang@aspeedtech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp809451wrn; Thu, 9 Feb 2023 23:31:51 -0800 (PST) X-Google-Smtp-Source: AK7set81Hs+Trp7CXTjhEMeZZVcYL6MNpicVWCVVg5VQtK16hA4Ij6ptuUVK0L/hW0mtVQb3EWX1 X-Received: by 2002:a17:906:2e89:b0:8a4:7fb9:5658 with SMTP id o9-20020a1709062e8900b008a47fb95658mr14551629eji.55.1676014311252; Thu, 09 Feb 2023 23:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676014311; cv=none; d=google.com; s=arc-20160816; b=Q1nKTVHQUKjw/q1xA+lFzjgvOUlZgvm2vZqchPacPvuG5y2n/wkFlaJPPXxELIfBn0 udGGIgHqddOXklSXyiAMf61cIFrAEKUP3ni0Ll6/idyBAv9p4X5h8W2DJER4TouJJKqd lwxA0h6+beKty9gWBzZdkQeizL0UkTlaEtXc2yX5CV2Ax4LCVq78B5lQfPJSy4iaEhfa 9BUVC/2TGMJ9ylkU/L7iouIGelHKsQwsUy02l/kzaEJFceU7IBOJVt9TIbOOsS6cc/k+ v3UGZeWWLcoqpAdWVsoD6ZWAG5ZOWoRvOPbl6dDgGhX2o+6Af3Ynfqs4Q1eSZOtyJrh9 GnRA== 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:to:from; bh=Fi+c97TCrjwpcpWamBsG9pdUgWeKL5AchlqCKF+WW/E=; b=jLBLda02qiLu0HegFr98zrXm9W9Y9E3m1Hn85Zwgc3h2HCETAkFfh/8jKxlV6DhGJB CCRZdiVzofIV+Jc89dF95dOC9ridhFn4SRgc5o9rcsbpip+V/cA/9ttklKJ9RBsuNPKO AbQL1Rq6Iovwdz+e3SRARS61zNGbPYcoywc+xK9KQMQ4Ia3YaDwqiPKDXZ2C2mxEuu1k 0/v1QJac5UC07c9j/bodcvFb337v1teg1zGNO+T9pH5qEanyf4DmBZlIgoHHuZ5Q58rO WQwfL9jSubTMYmZLXbwpw6pNuGbhCsP+dZfB+ABojJMHQGTYgThoi8ylkWazZyYeMoV6 W5gg== 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 bp24-20020a170907919800b008aecca87f8bsi3850069ejb.648.2023.02.09.23.31.28; Thu, 09 Feb 2023 23:31:51 -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; 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 S231440AbjBJH17 (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Fri, 10 Feb 2023 02:27:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbjBJH1x (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Feb 2023 02:27:53 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1812861856; Thu, 9 Feb 2023 23:27:51 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 31A7EWro068845; Fri, 10 Feb 2023 15:14:32 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from Chiawei-PC03.aspeed.com (192.168.2.66) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Feb 2023 15:26:47 +0800 From: Chia-Wei Wang <chiawei_wang@aspeedtech.com> To: <gregkh@linuxfoundation.org>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <joel@jms.id.au>, <andrew@aj.id.au>, <jirislaby@kernel.org>, <linux-serial@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-aspeed@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>, <openbmc@lists.ozlabs.org> Subject: [PATCH 1/4] dt-bindings: aspeed: Add UART controller Date: Fri, 10 Feb 2023 15:26:40 +0800 Message-ID: <20230210072643.2772-2-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230210072643.2772-1-chiawei_wang@aspeedtech.com> References: <20230210072643.2772-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.66] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 31A7EWro068845 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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?1757428382210590961?= X-GMAIL-MSGID: =?utf-8?q?1757428382210590961?= |
Series |
arm: aspeed: Add UART with DMA support
|
|
Commit Message
ChiaWei Wang
Feb. 10, 2023, 7:26 a.m. UTC
Add dt-bindings for Aspeed UART controller.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
---
.../bindings/serial/aspeed,uart.yaml | 81 +++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 Documentation/devicetree/bindings/serial/aspeed,uart.yaml
Comments
On 10/02/2023 08:26, Chia-Wei Wang wrote: > Add dt-bindings for Aspeed UART controller. Describe the hardware. What's the difference against existing Aspeed UART used everywhere? > > Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> > --- > .../bindings/serial/aspeed,uart.yaml | 81 +++++++++++++++++++ > 1 file changed, 81 insertions(+) > create mode 100644 Documentation/devicetree/bindings/serial/aspeed,uart.yaml Filename: aspeed,ast2600-uart.yaml (unless you are adding here more compatibles, but your const suggests that it's not going to happen) > > diff --git a/Documentation/devicetree/bindings/serial/aspeed,uart.yaml b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml > new file mode 100644 > index 000000000000..10c457d6a72e > --- /dev/null > +++ b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml > @@ -0,0 +1,81 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/serial/aspeed,uart.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Aspeed Universal Asynchronous Receiver/Transmitter This title matches other Aspeed UARTs, so aren't you duplicating bindings? > + > +maintainers: > + - Chia-Wei Wang <chiawei_wang@aspeedtech.com> > + > +allOf: > + - $ref: serial.yaml# > + > +description: | > + The Aspeed UART is based on the basic 8250 UART and compatible > + with 16550A, with support for DMA > + > +properties: > + compatible: > + const: aspeed,ast2600-uart > + > + reg: > + description: The base address of the UART register bank Drop description > + maxItems: 1 > + > + clocks: > + description: The clock the baudrate is derived from > + maxItems: 1 > + > + interrupts: > + description: The IRQ number of the device Drop description > + maxItems: 1 > + > + dma-mode: > + type: boolean > + description: Enable DMA Drop property. DMA is enabled on presence of dmas. > + > + dma-channel: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: The channel number to be used in the DMA engine That's not a correct DMA property. dmas and dma-names git grep dma -- Documentation/devicetree/bindings/ > + > + virtual: > + type: boolean > + description: Indicate virtual UART Virtual means not existing in real world? We do not describe in DTS non-existing devices. Drop entire property. > + > + sirq: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: The serial IRQ number on LPC bus interface Drop entire property. > + > + sirq-polarity: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: The serial IRQ polarity on LPC bus interface Drop entire property. > + > + pinctrl-0: true > + > + pinctrl_names: > + const: default Drop both, you do no not need them. > + > +required: > + - compatible > + - reg > + - clocks > + - interrupts > + > +unevaluatedProperties: false > + Best regards, Krzysztof
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > Sent: Friday, February 10, 2023 5:13 PM > > On 10/02/2023 08:26, Chia-Wei Wang wrote: > > Add dt-bindings for Aspeed UART controller. > > Describe the hardware. What's the difference against existing Aspeed UART > used everywhere? The description will be revised to explain more for UART and Virtual UART controllers. > > > > > Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> > > --- > > .../bindings/serial/aspeed,uart.yaml | 81 > +++++++++++++++++++ > > 1 file changed, 81 insertions(+) > > create mode 100644 > > Documentation/devicetree/bindings/serial/aspeed,uart.yaml > > Filename: aspeed,ast2600-uart.yaml > (unless you are adding here more compatibles, but your const suggests that it's > not going to happen) > > > > > diff --git a/Documentation/devicetree/bindings/serial/aspeed,uart.yaml > > b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml > > new file mode 100644 > > index 000000000000..10c457d6a72e > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml > > @@ -0,0 +1,81 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/serial/aspeed,uart.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Aspeed Universal Asynchronous Receiver/Transmitter > > This title matches other Aspeed UARTs, so aren't you duplicating bindings? > > > + > > +maintainers: > > + - Chia-Wei Wang <chiawei_wang@aspeedtech.com> > > + > > +allOf: > > + - $ref: serial.yaml# > > + > > +description: | > > + The Aspeed UART is based on the basic 8250 UART and compatible > > + with 16550A, with support for DMA > > + > > +properties: > > + compatible: > > + const: aspeed,ast2600-uart > > + > > + reg: > > + description: The base address of the UART register bank > > Drop description Will revise as suggested. > > > + maxItems: 1 > > + > > + clocks: > > + description: The clock the baudrate is derived from > > + maxItems: 1 > > + > > + interrupts: > > + description: The IRQ number of the device > > Drop description Will revise as suggested. > > > + maxItems: 1 > > + > > + dma-mode: > > + type: boolean > > + description: Enable DMA > > Drop property. DMA is enabled on presence of dmas. > > > + > > + dma-channel: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: The channel number to be used in the DMA engine > > That's not a correct DMA property. dmas and dma-names git grep dma -- > Documentation/devicetree/bindings/ > > > > + > > + virtual: > > + type: boolean > > + description: Indicate virtual UART > > Virtual means not existing in real world? We do not describe in DTS > non-existing devices. Drop entire property. The virtual property indicates it is a Virtual UART device. VUART of Aspeed SoC is actually a FIFO exposed in the 16550A UART interface. The one head of the FIFO is exposed to Host via eSPI/LPC and the other one is for BMC. There is no physical serial link between Host and BMC. And thus named as Virtual UART. > > > + > > + sirq: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: The serial IRQ number on LPC bus interface > > Drop entire property. Mandatory for Virtual UART > > > + > > + sirq-polarity: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: The serial IRQ polarity on LPC bus interface > > Drop entire property. Mandatory for Virtual UART > > > + > > + pinctrl-0: true > > + > > + pinctrl_names: > > + const: default > > > Drop both, you do no not need them. Will revise as suggested > > > + > > +required: > > + - compatible > > + - reg > > + - clocks > > + - interrupts > > + > > +unevaluatedProperties: false > > + Regards, Chiawei
On 13/02/2023 02:57, ChiaWei Wang wrote: >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> Sent: Friday, February 10, 2023 5:13 PM >> >> On 10/02/2023 08:26, Chia-Wei Wang wrote: >>> Add dt-bindings for Aspeed UART controller. >> >> Describe the hardware. What's the difference against existing Aspeed UART >> used everywhere? > > The description will be revised to explain more for UART and Virtual UART controllers. > >> >>> >>> Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> >>> --- >>> .../bindings/serial/aspeed,uart.yaml | 81 >> +++++++++++++++++++ >>> 1 file changed, 81 insertions(+) >>> create mode 100644 >>> Documentation/devicetree/bindings/serial/aspeed,uart.yaml >> >> Filename: aspeed,ast2600-uart.yaml >> (unless you are adding here more compatibles, but your const suggests that it's >> not going to happen) >> >>> >>> diff --git a/Documentation/devicetree/bindings/serial/aspeed,uart.yaml >>> b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml >>> new file mode 100644 >>> index 000000000000..10c457d6a72e >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml >>> @@ -0,0 +1,81 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/serial/aspeed,uart.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Aspeed Universal Asynchronous Receiver/Transmitter >> >> This title matches other Aspeed UARTs, so aren't you duplicating bindings? >> >>> + >>> +maintainers: >>> + - Chia-Wei Wang <chiawei_wang@aspeedtech.com> >>> + >>> +allOf: >>> + - $ref: serial.yaml# >>> + >>> +description: | >>> + The Aspeed UART is based on the basic 8250 UART and compatible >>> + with 16550A, with support for DMA >>> + >>> +properties: >>> + compatible: >>> + const: aspeed,ast2600-uart >>> + >>> + reg: >>> + description: The base address of the UART register bank >> >> Drop description > > Will revise as suggested. > >> >>> + maxItems: 1 >>> + >>> + clocks: >>> + description: The clock the baudrate is derived from >>> + maxItems: 1 >>> + >>> + interrupts: >>> + description: The IRQ number of the device >> >> Drop description > > Will revise as suggested. > >> >>> + maxItems: 1 >>> + >>> + dma-mode: >>> + type: boolean >>> + description: Enable DMA >> >> Drop property. DMA is enabled on presence of dmas. >> >>> + >>> + dma-channel: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + description: The channel number to be used in the DMA engine >> >> That's not a correct DMA property. dmas and dma-names git grep dma -- >> Documentation/devicetree/bindings/ >> >> >>> + >>> + virtual: >>> + type: boolean >>> + description: Indicate virtual UART >> >> Virtual means not existing in real world? We do not describe in DTS >> non-existing devices. Drop entire property. > > The virtual property indicates it is a Virtual UART device. vuart already has its bindings, so you do not need this in such case. > VUART of Aspeed SoC is actually a FIFO exposed in the 16550A UART interface. > The one head of the FIFO is exposed to Host via eSPI/LPC and the other one is for BMC. > There is no physical serial link between Host and BMC. And thus named as Virtual UART. I don't understand what is the virtual in terms of hardware. How you route your serial lines does not change the type of the device. You need to describe the hardware in Devicetree, not some concepts for system. > >> >>> + >>> + sirq: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + description: The serial IRQ number on LPC bus interface >> >> Drop entire property. > > Mandatory for Virtual UART It's not a explanation why this is a property suitable for Devicetree. IRQ numbers are given via interrupts field. > >> >>> + >>> + sirq-polarity: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + description: The serial IRQ polarity on LPC bus interface >> >> Drop entire property. > > Mandatory for Virtual UART > Same here, this is a flag for interrupts field. Best regards, Krzysztof
On 10/02/2023 10:12, Krzysztof Kozlowski wrote: > On 10/02/2023 08:26, Chia-Wei Wang wrote: >> Add dt-bindings for Aspeed UART controller. > > Describe the hardware. What's the difference against existing Aspeed > UART used everywhere? I expect the answer here. You are adding duplicated driver and bindings instead of merging with existing ones. That's common issue and explanation "it is different" is not enough. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/serial/aspeed,uart.yaml b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml new file mode 100644 index 000000000000..10c457d6a72e --- /dev/null +++ b/Documentation/devicetree/bindings/serial/aspeed,uart.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/aspeed,uart.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Aspeed Universal Asynchronous Receiver/Transmitter + +maintainers: + - Chia-Wei Wang <chiawei_wang@aspeedtech.com> + +allOf: + - $ref: serial.yaml# + +description: | + The Aspeed UART is based on the basic 8250 UART and compatible + with 16550A, with support for DMA + +properties: + compatible: + const: aspeed,ast2600-uart + + reg: + description: The base address of the UART register bank + maxItems: 1 + + clocks: + description: The clock the baudrate is derived from + maxItems: 1 + + interrupts: + description: The IRQ number of the device + maxItems: 1 + + dma-mode: + type: boolean + description: Enable DMA + + dma-channel: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The channel number to be used in the DMA engine + + virtual: + type: boolean + description: Indicate virtual UART + + sirq: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The serial IRQ number on LPC bus interface + + sirq-polarity: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The serial IRQ polarity on LPC bus interface + + pinctrl-0: true + + pinctrl_names: + const: default + +required: + - compatible + - reg + - clocks + - interrupts + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/ast2600-clock.h> + + serial@1e783000 { + compatible = "aspeed,ast2600-uart"; + reg = <0x1e783000 0x20>; + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_LOW>; + clocks = <&syscon ASPEED_CLK_GATE_UART1CLK>; + pinctrl-0 = <&pinctrl_txd1_default &pinctrl_rxd1_default>; + dma-mode; + dma-channel = <0>; + };