From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 469AAC32772 for ; Thu, 18 Aug 2022 08:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbiHRIi0 (ORCPT ); Thu, 18 Aug 2022 04:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242010AbiHRIiY (ORCPT ); Thu, 18 Aug 2022 04:38:24 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 630E65C978 for ; Thu, 18 Aug 2022 01:38:20 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id d14so1202345lfl.13 for ; Thu, 18 Aug 2022 01:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=U8mib6crvM0rQuERDFjof2hyN3a8okkIg9elL9u0kJg=; b=jwVCHD0CWJBCZHk/o1nvJTaQxhcAHc0QSo/nmKSl0ydzcjaq1dxcCDu8GNWnH4k7f2 2SCUs2e9LPknCY86BzjOmpULs4gbuOqNVbtX5edaUcGC8z9UL3fmvua8ZvoEV1N7t8gq WIIPvo7UA9Gh9t9c2ZhYrZ016vq8fqqr5tehMISzFX2ohP6OquuzSL7pcco3Z3CUzQDH Xw2v4vuL1W66yymzi3tasz6J9o0r8WBa5olITkHvBDHX06iiJgS1nxmMxnHARUjd0NAr FN8yj9HK3oxugtepJmLkVXc0TXk2qAg7t/G/f2YsLEanoCb9OZmsH4hjgvm/6qqHC5eq ddnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=U8mib6crvM0rQuERDFjof2hyN3a8okkIg9elL9u0kJg=; b=P1IuoJk/1ywhdq9fyxe02gNUzcLW2dXG+WV4W7AUQagTYw5Zni5uaRQoFlL81eJEZh CjAOEIrQVlRcn1uojHKInNpyFnemKJUKn6gWSdliVJpCdLU5b5zEkPF81sVfxsQeZrnE PDeGgRbsJcaQWVVZKiJxqBh7LdZOzCFUmzaWj9hYoq9+xrmMw+TXYkBQJSpoewy4ISfJ D3s1p6Tt7i7AbTXbEj8dmFcSh7Ufbd6wwY2dIYzkLytE8tx3GFGr1vDYVcYWin3CSMgI Jftd61DlW6U10AHOoZINzoCYGjZJwjyjOPZY49nP+CLojkOay7pr/1ftLeyNbmS1Bq6a k4GQ== X-Gm-Message-State: ACgBeo0tusuP0dof97831wtBaUnZrcvpWA6j50COhtMwofLVoHfnMqhA u9Ufta2VHId3jbOEGVhEBNVtqg== X-Google-Smtp-Source: AA6agR5NsU+UQzU9oVHwISH+Y9TpxsOzS9WjuSBkYYfeX1UpvgeIKBtf3CU3dewTKcmiosg1tIUoiQ== X-Received: by 2002:a05:6512:2207:b0:492:b573:63a0 with SMTP id h7-20020a056512220700b00492b57363a0mr685074lfu.325.1660811898541; Thu, 18 Aug 2022 01:38:18 -0700 (PDT) Received: from ?IPV6:2001:14bb:ae:539c:53ab:2635:d4f2:d6d5? (d15l54z9nf469l8226z-4.rev.dnainternet.fi. [2001:14bb:ae:539c:53ab:2635:d4f2:d6d5]) by smtp.gmail.com with ESMTPSA id b18-20020a05651c033200b002618dae9fe8sm136199ljp.73.2022.08.18.01.38.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Aug 2022 01:38:17 -0700 (PDT) Message-ID: Date: Thu, 18 Aug 2022 11:38:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 2/5] dt-bindings: mfd: atmel,at91-usart: convert to json-schema Content-Language: en-US To: Sergiu Moga , lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com, radu_nicolae.pirea@upb.ro, richard.genoud@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, admin@hifiphile.com, kavyasree.kotagiri@microchip.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-clk@vger.kernel.org, linux-serial@vger.kernel.org References: <20220817075517.49575-1-sergiu.moga@microchip.com> <20220817075517.49575-3-sergiu.moga@microchip.com> From: Krzysztof Kozlowski In-Reply-To: <20220817075517.49575-3-sergiu.moga@microchip.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On 17/08/2022 10:55, Sergiu Moga wrote: > Convert at91 USART DT Binding for Atmel/Microchip SoCs to > json-schema format. > > Signed-off-by: Sergiu Moga > --- > .../bindings/mfd/atmel,at91-usart.yaml | 190 ++++++++++++++++++ > .../devicetree/bindings/mfd/atmel-usart.txt | 98 --------- > 2 files changed, 190 insertions(+), 98 deletions(-) > create mode 100644 Documentation/devicetree/bindings/mfd/atmel,at91-usart.yaml > delete mode 100644 Documentation/devicetree/bindings/mfd/atmel-usart.txt > > diff --git a/Documentation/devicetree/bindings/mfd/atmel,at91-usart.yaml b/Documentation/devicetree/bindings/mfd/atmel,at91-usart.yaml > new file mode 100644 > index 000000000000..cf15d73fa1e8 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/atmel,at91-usart.yaml > @@ -0,0 +1,190 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mfd/atmel,at91-usart.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART) > + > +maintainers: > + - Richard Genoud > + > +properties: > + compatible: > + oneOf: This looks quite different than bindings and you commit msg is saying it is only a conversion. Mention any changes against original bindings. > + - const: atmel,at91rm9200-usart > + - const: atmel,at91sam9260-usart > + - const: microchip,sam9x60-usart That's an enum > + - items: > + - const: atmel,at91rm9200-dbgu > + - const: atmel,at91rm9200-usart > + - items: > + - const: atmel,at91sam9260-dbgu > + - const: atmel,at91sam9260-usart > + - items: > + - const: microchip,sam9x60-dbgu > + - const: microchip,sam9x60-usart > + - items: > + - const: microchip,sam9x60-usart > + - const: atmel,at91sam9260-usart This is not correct - contradicts earlier one. > + - items: > + - const: microchip,sam9x60-dbgu > + - const: microchip,sam9x60-usart > + - const: atmel,at91sam9260-dbgu > + - const: atmel,at91sam9260-usart What? You wrote above that microchip,sam9x60-dbgu is compatible only with microchip,sam9x60-usart. Now you write it is also compatible with other ones? > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clock-names: > + contains: > + const: usart No, this has to be specific/fixed list. > + > + clocks: > + minItems: 1 > + maxItems: 2 Not really - define the items. One item could be optional, though. > + > + dmas: > + items: > + - description: TX DMA Channel > + - description: RX DMA Channel > + > + dma-names: > + items: > + - const: tx > + - const: rx > + > + atmel,usart-mode: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | No need for | > + Must be either 1 for SPI or 0 for USART. Mention the header. > + enum: [ 0, 1 ] > + > +required: > + - compatible > + - reg > + - interrupts > + - clock-names > + - clocks > + > +if: Put it under allOf. > + properties: > + $nodename: > + pattern: "^serial@[0-9a-f]+$" > +then: > + allOf: > + - $ref: /schemas/serial/serial.yaml# > + - $ref: /schemas/serial/rs485.yaml# > + > + properties: > + atmel,use-dma-rx: > + type: boolean > + description: use of PDC or DMA for receiving data > + > + atmel,use-dma-tx: > + type: boolean > + description: use of PDC or DMA for transmitting data > + > + atmel,fifo-size: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | No need for | > + Maximum number of data the RX and TX FIFOs can store for FIFO > + capable USARTS. > + enum: [ 16, 32 ] > + > +else: > + if: > + properties: > + $nodename: > + pattern: "^spi@[0-9a-f]+$" > + then: > + allOf: > + - $ref: /schemas/spi/spi-controller.yaml# > + > + properties: > + atmel,usart-mode: > + const: 1 > + > + "#size-cells": > + const: 0 > + > + "#address-cells": > + const: 1 > + > + required: > + - atmel,usart-mode > + - "#size-cells" > + - "#address-cells" > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + #include > + > + /* use PDC */ > + usart0: serial@fff8c000 { > + compatible = "atmel,at91sam9260-usart"; > + reg = <0xfff8c000 0x4000>; > + interrupts = <7>; > + clocks = <&usart0_clk>; > + clock-names = "usart"; > + atmel,use-dma-rx; > + atmel,use-dma-tx; > + rts-gpios = <&pioD 15 GPIO_ACTIVE_LOW>; > + cts-gpios = <&pioD 16 GPIO_ACTIVE_LOW>; > + dtr-gpios = <&pioD 17 GPIO_ACTIVE_LOW>; > + dsr-gpios = <&pioD 18 GPIO_ACTIVE_LOW>; > + dcd-gpios = <&pioD 20 GPIO_ACTIVE_LOW>; > + rng-gpios = <&pioD 19 GPIO_ACTIVE_LOW>; > + }; > + > + - | > + #include > + #include > + #include > + #include > + > + /* use DMA */ > + usart1: serial@f001c000 { > + compatible = "atmel,at91sam9260-usart"; > + reg = <0xf001c000 0x100>; > + interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>; > + clocks = <&usart0_clk>; > + clock-names = "usart"; > + atmel,use-dma-rx; > + atmel,use-dma-tx; > + dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>, > + <&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>; > + dma-names = "tx", "rx"; > + atmel,fifo-size = <32>; > + }; > + > + - | > + #include > + #include > + #include > + #include > + > + /* SPI mode */ > + spi0: spi@f001c000 { > + #address-cells = <1>; > + #size-cells = <0>; > + compatible = "atmel,at91sam9260-usart"; > + atmel,usart-mode = ; > + reg = <0xf001c000 0x100>; compatible, then reg then the reset of properties > + interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>; > + clocks = <&usart0_clk>; > + clock-names = "usart"; > + dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(3)>, > + <&dma0 2 (AT91_DMA_CFG_PER_ID(4) | AT91_DMA_CFG_FIFOCFG_ASAP)>; > + dma-names = "tx", "rx"; > + cs-gpios = <&pioB 3 GPIO_ACTIVE_HIGH>; > + }; Best regards, Krzysztof