Message ID | bb2d5985a3d9fd8e7ccbe2794842d93a8978d8a6.1686192243.git.zhoubinbin@loongson.cn (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | New driver for the Loongson LS2X APB DMA Controller | expand |
On 08/06/2023 04:55, Binbin Zhou wrote: > Add Loongson LS2X APB DMA controller binding with DT schema > format using json-schema. > > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > +properties: > + compatible: > + oneOf: > + - const: loongson,ls2k1000-apbdma > + - items: > + - const: loongson,ls2k0500-apbdma > + - const: loongson,ls2k1000-apbdma > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + "#dma-cells": > + const: 1 > + > + dma-channels: > + const: 1 If it is const, why do you need it? Best regards, Krzysztof
On Sat, Jun 10, 2023 at 12:49 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 08/06/2023 04:55, Binbin Zhou wrote: > > Add Loongson LS2X APB DMA controller binding with DT schema > > format using json-schema. > > > > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> > > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > > +properties: > > + compatible: > > + oneOf: > > + - const: loongson,ls2k1000-apbdma > > + - items: > > + - const: loongson,ls2k0500-apbdma > > + - const: loongson,ls2k1000-apbdma > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + "#dma-cells": > > + const: 1 > > + > > + dma-channels: > > + const: 1 > > If it is const, why do you need it? > Hi Krzysztof: IMO, although it is a single-channel DMAC, the "dma-channels" are still needed for a more comprehensive description of the hardware. Thanks. Binbin > Best regards, > Krzysztof >
On 10/06/2023 07:35, Binbin Zhou wrote: > On Sat, Jun 10, 2023 at 12:49 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 08/06/2023 04:55, Binbin Zhou wrote: >>> Add Loongson LS2X APB DMA controller binding with DT schema >>> format using json-schema. >>> >>> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> >>> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> >> >> >>> +properties: >>> + compatible: >>> + oneOf: >>> + - const: loongson,ls2k1000-apbdma >>> + - items: >>> + - const: loongson,ls2k0500-apbdma >>> + - const: loongson,ls2k1000-apbdma >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + "#dma-cells": >>> + const: 1 >>> + >>> + dma-channels: >>> + const: 1 >> >> If it is const, why do you need it? >> > Hi Krzysztof: > > IMO, although it is a single-channel DMAC, the "dma-channels" are > still needed for a more comprehensive description of the hardware. How does it describe more the hardware if it is obvious and always the same? If so, why you didn't add properties like reg-io-width, dma-requests, clock-frequency, clocks (BTW, this actually is missing), dma-channel-mask and hundreds of others? No, drop, it does not make sense. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/dma/loongson,ls2x-apbdma.yaml b/Documentation/devicetree/bindings/dma/loongson,ls2x-apbdma.yaml new file mode 100644 index 000000000000..8e5643186310 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/loongson,ls2x-apbdma.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/loongson,ls2x-apbdma.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson LS2X APB DMA controller + +description: + The Loongson LS2X APB DMA controller is used for transferring data + between system memory and the peripherals on the APB bus. + +maintainers: + - Binbin Zhou <zhoubinbin@loongson.cn> + +allOf: + - $ref: dma-controller.yaml# + +properties: + compatible: + oneOf: + - const: loongson,ls2k1000-apbdma + - items: + - const: loongson,ls2k0500-apbdma + - const: loongson,ls2k1000-apbdma + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + "#dma-cells": + const: 1 + + dma-channels: + const: 1 + +required: + - compatible + - reg + - interrupts + - "#dma-cells" + - dma-channels + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + dma-controller@1fe00c00 { + compatible = "loongson,ls2k1000-apbdma"; + reg = <0x1fe00c00 0x8>; + interrupt-parent = <&liointc1>; + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + dma-channels = <1>; + }; + +...