From patchwork Fri Oct 13 16:49:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 1848438 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cutebit.org header.i=@cutebit.org header.a=rsa-sha256 header.s=mail header.b=hAdic2C8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=devicetree+bounces-8559-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S6XYq1gGtz1ypX for ; Sat, 14 Oct 2023 03:50:23 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CE049B20B02 for ; Fri, 13 Oct 2023 16:50:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D8281CAA2; Fri, 13 Oct 2023 16:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="hAdic2C8" X-Original-To: devicetree@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF26121A01 for ; Fri, 13 Oct 2023 16:50:17 +0000 (UTC) Received: from hutie.ust.cz (hutie.ust.cz [IPv6:2a03:3b40:fe:f0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005C6B7; Fri, 13 Oct 2023 09:50:15 -0700 (PDT) From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1697215810; bh=Zz8k/vmZ3NGYYQQPdxfPH4QZU0TH/TxEf+ATJmTjL7A=; h=From:To:Cc:Subject:Date; b=hAdic2C8HcMkOI+fxprcLO8c4u0x8x+m8k8xEjpvFolJB+VM3EIaZmVyTakYQDNas D0LOl7xZ3qK+kq3272moX0ZlXHjv3QegAKrkltDToL8igO5+iPwnqMi0VhFn2TntVi 1wJwVJ0jJw6dGlkVTsBv9wEiLyOxICu+YW0Ns50w= To: =?utf-8?q?Martin_Povi=C5=A1er?= , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: asahi@lists.linux.dev, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] Apple SIO driver Date: Fri, 13 Oct 2023 18:49:34 +0200 Message-Id: <20231013164936.60718-1-povik+lin@cutebit.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Hi, on v2 of this driver we had discussion over the device_config op not following the dmaengine spec. I came up with a lazy solution I am happy with. See sio_device_config for details. Changes since v2: https://lore.kernel.org/asahi/CAEg-Je8_f_hZ3VyBg+8tK8uobWNaEqCwp==2JhV6jVpPYXj_Pg@mail.gmail.com/T/#t - do requested formatting fixes - fix device_config up to spec in a lazy way Changes since v1: https://lore.kernel.org/asahi/20230712133806.4450-1-povik+lin@cutebit.org/T/#t - move to using virt-dma - drop redundant cookie field from `sio_tx` - use DECLARE_BITMAP for `allocated` in sio_tagdata Original cover letter from v1 follows. --- Hi all, see attached a driver for the SIO coprocessor found on recent Apple SoCs. This coprocessor provides general DMA services, it can feed many peripherals but so far it seems it will only be useful for audio output over HDMI/DisplayPort. So the driver here only supports the DMA_CYCLIC mode of transactions with the focus being on audio. There's a downstream prototype ALSA driver the DMA driver is being tested against. Some of the boilerplate code in implementing the dmaengine interface was lifted from apple-admac.c. Among other things these two drivers have in common that they implement the DMA_CYCLIC regime on top of hardware/coprocessor layer supporting linear transactions only. The binding schema saw two RFC rounds before and has a reviewed-by from Rob. https://lore.kernel.org/asahi/167693643966.613996.10372170526471864080.robh@kernel.org Best regards, Martin Martin PoviĊĦer (2): dt-bindings: dma: apple,sio: Add schema dmaengine: apple-sio: Add Apple SIO driver .../devicetree/bindings/dma/apple,sio.yaml | 111 +++ MAINTAINERS | 2 + drivers/dma/Kconfig | 11 + drivers/dma/Makefile | 1 + drivers/dma/apple-sio.c | 907 ++++++++++++++++++ 5 files changed, 1032 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/apple,sio.yaml create mode 100644 drivers/dma/apple-sio.c