lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220411222204.96860-2-povik+lin@cutebit.org>
Date:   Tue, 12 Apr 2022 00:22:03 +0200
From:   Martin Povišer <povik+lin@...ebit.org>
To:     Hector Martin <marcan@...can.st>, Sven Peter <sven@...npeter.dev>,
        Vinod Koul <vkoul@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>
Cc:     Alyssa Rosenzweig <alyssa@...enzweig.io>,
        linux-arm-kernel@...ts.infradead.org, dmaengine@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Mark Kettenis <kettenis@...nbsd.org>,
        Martin Povišer <povik+lin@...ebit.org>
Subject: [PATCH v2 1/2] dt-bindings: dma: Add Apple ADMAC

Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio
samples on SoCs from the "Apple Silicon" family.

Signed-off-by: Martin Povišer <povik+lin@...ebit.org>
---

After the v1 discussion, I dropped the apple,internal-irq-destination
property and instead the index of the usable interrupt is now signified
by prepending -1 entries to the interrupts= list. This works when I do
it like this:

  interrupt-parent = <&aic>;
  interrupts = <AIC_IRQ 0xffffffff 0>,
               <AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>;

I would find it neat to do it like this:

  interrupts-extended = <0xffffffff>,
                        <&aic AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>;

but unfortunately the kernel doesn't pick up on it:

[    0.767964] apple-admac 238200000.dma-controller: error -6: IRQ index 0 not found
[    0.773943] apple-admac 238200000.dma-controller: error -6: IRQ index 1 not found
[    0.780154] apple-admac 238200000.dma-controller: error -6: IRQ index 2 not found
[    0.786367] apple-admac 238200000.dma-controller: error -6: IRQ index 3 not found
[    0.788592] apple-admac 238200000.dma-controller: error -6: no usable interrupt

 .../devicetree/bindings/dma/apple,admac.yaml  | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/apple,admac.yaml

diff --git a/Documentation/devicetree/bindings/dma/apple,admac.yaml b/Documentation/devicetree/bindings/dma/apple,admac.yaml
new file mode 100644
index 000000000000..bbd5eaf5f709
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/apple,admac.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/apple,admac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple Audio DMA Controller (ADMAC)
+
+description: |
+  Apple's Audio DMA Controller (ADMAC) is used to fetch and store audio samples
+  on SoCs from the "Apple Silicon" family.
+
+  The controller has been seen with up to 24 channels. Even-numbered channels
+  are TX-only, odd-numbered are RX-only. Individual channels are coupled to
+  fixed device endpoints.
+
+maintainers:
+  - Martin Povišer <povik+lin@...ebit.org>
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - apple,t6000-admac
+          - apple,t8103-admac
+      - const: apple,admac
+
+  reg:
+    maxItems: 1
+
+  '#dma-cells':
+    const: 1
+    description:
+      Clients specify single cell with channel number.
+
+  dma-channels:
+    maximum: 24
+
+  interrupts:
+    minItems: 1
+    maxItems: 4
+
+required:
+  - compatible
+  - reg
+  - '#dma-cells'
+  - dma-channels
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/apple-aic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    admac: dma-controller@...200000 {
+      compatible = "apple,t8103-admac", "apple,admac";
+      reg = <0x38200000 0x34000>;
+      dma-channels = <24>;
+      interrupt-parent = <&aic>;
+      interrupts = <AIC_IRQ 0xffffffff 0>,
+                   <AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>;
+      #dma-cells = <1>;
+    };
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ