From patchwork Mon Dec 16 14:50:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13909851 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DCEE2063EC; Mon, 16 Dec 2024 14:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360678; cv=none; b=bnEp9Z8Oi6wCHZQO9FqNE3OIst+Qx9zZy9UXLuNrj/8MS98NJ60ed0UqR8GqDWj9BE8Tm8bdQ/37gCNQvkk/5omMf5WmIZScVH7sycbVAj+jm3xmlaSxXgrQP8G0VwA6sPtjQDbU9YHZCFHMpikeI3q4QxJPfWaSRmbXA5zgqE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360678; c=relaxed/simple; bh=kAz5cBPcgesyVW4NY2ucqWfgWBRYVqzqd6e6WZNwbSE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F/xd+vCyLOP0HXAnMqhytAkNpsYtfjfRvYHocms5xYq/6SZm6HMgQ2RJll4n+DRSfiZ9xeUhsyNM3igVO/DCdfZzYWrj5Tkd+9PTy2YbVW+VySri0IunjtDNjbir/0VDILIYmnpIHDcEKMdLffT8V6Pcy4zGI09wdWmp4hWzJEE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g65hfis3; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g65hfis3" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3863c36a731so3020635f8f.1; Mon, 16 Dec 2024 06:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734360675; x=1734965475; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FZR22IhRUpX/Fq7KGPdPODk7QFLwb+WURrRAPPoxEH0=; b=g65hfis3bDjnJT8+9bR1NZpWIhYDm4epXF4ONEQIPZ6vOup8B0vVP2LGKsLBmtLTYo wP5H1Gi0Onkay8jbnQaUvGMe8+F7L4Fy0un+WIAeuM9TSO7wnwwC+O7QEXEclBbkqAjU TVVGif9089mec6/95xsahHjGDxXsYaOC66BN30bWYTxyQAX2yy6tsCKLftZLbXLS3zuh EddS6iXPWV1JXsgwI4ij4mPP7Ol76Ykd5naCAtRC8MESs/c98jAMoM7Ff5mj5HtYM2BK +iw1SDENXV6bZz3jyU6WeAqj+vJnxybIc77xjlJ+8vYFLDjaI8ab2/VRLioPFEi3wIYS yL3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734360675; x=1734965475; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FZR22IhRUpX/Fq7KGPdPODk7QFLwb+WURrRAPPoxEH0=; b=KAea2aBKndzOlIDHUGQz8+esjp6yW9ucDUeL0LqWAt0gNNjvibyUIwV32NrlFaAOOn hr3xoNXC93O1vVisziIGuIjqlxAxYu/LIPCq2BhD74Vi/5RdDiy4DbapsbkRa1HbA4pt hWK6NkMPp4VA2e4cj0o5kJSRqNlpZ+JO+Kamr+IIrOSr3ac/cg3xVHtOkl40U7wpXdue LboGZJuhO8fJx4qA4KacoBBkuj0PB8aphZXMgXbkzbNQ/NeF+CJxScX2v6TMtbwdHsDQ JV7rsN72urLrwUwWmod9FURFqrJkFt01YHuFSDULYOxILeS4Jcjy1w2khdQ6D/673Va0 xkfQ== X-Forwarded-Encrypted: i=1; AJvYcCUjhtIeCwQN7fu2SSM4hpEYWf1NY3CWXhgtceOxq4EN/kCepEjRZjfIKG4acfMldJlmFoIlrqrJTsLiCh3f@vger.kernel.org, AJvYcCVLWCh5E2yGbCNK6sGH3bLzbfqqUaZMBtKnyAtV3/NaGSXAffkz8SEr6+12Tq4l93irlFebxzAJGJe/M2g=@vger.kernel.org, AJvYcCWaQDGcjFCuMUCDduQtmKVj/PEfk7iNCKakIQL7KsV4/4dEZd/4+8Er1V2MfW7CcWiU8aHaXWyOSD9R@vger.kernel.org X-Gm-Message-State: AOJu0YwmyBxTrxhelsCGM4VJkQGU5uHY2FfHg3RlCktTNubm27PhVCYv EzDQgbRnnEZUqM1kE36yYip71hik/bi+MvGt+nluXfwVXBJNR9kK X-Gm-Gg: ASbGncsmn5PorhuGjuRckayrsQsvRzOBaxSyzTfDCslXodME/PrZs/TrtugRVANui2a 3+EguOu/5Z4E5rRMu4TmkObCYqA3ucxGRKy6zZZ3N1Dd7sD32yR5NfRoBjCiREwpT498vvX7u1j 9EC0Krz1H89GejNlAcKov51BRiL8E2VIVPxpJKYIlwc31cEMIGp9eE1q34fuDeaInokswU1ssMp f7WGcXzgDPHyrT3TYH/bFazXZgjRLWM1BlR0RXLU58IlkTC4mjbR8jUSBoHa4jjqFuL7TxOJc4N qfLsIm/os0vIDPUn X-Google-Smtp-Source: AGHT+IHzN/5NhLTul0WIKF2FfViCsMY2uCJdEVicfsfHV8smpoFeZ1z55RS+AV0S1OCL0ZcqZxbh/A== X-Received: by 2002:a5d:6c6c:0:b0:385:e1f5:476f with SMTP id ffacd0b85a97d-3888e0b9bcbmr8246013f8f.39.1734360674752; Mon, 16 Dec 2024 06:51:14 -0800 (PST) Received: from playground.localdomain ([92.120.5.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362559ed6csm141616455e9.24.2024.12.16.06.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 06:51:14 -0800 (PST) From: Laurentiu Mihalcea To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Daniel Baluta , Mark Brown , Kuninori Morimoto , Takashi Iwai , Bard Liao , Peter Ujfalusi , Jaroslav Kysela , Frank Li Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/5] ASoC: dt-bindings: add common binding for NXP audio processors Date: Mon, 16 Dec 2024 09:50:35 -0500 Message-Id: <20241216145039.3074-2-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> References: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Laurentiu Mihalcea Add common binding for NXP audio processors with Sound Open Firmware (SOF) support. Signed-off-by: Laurentiu Mihalcea --- .../bindings/sound/fsl,sof-cpu.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml diff --git a/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml new file mode 100644 index 000000000000..1958afceba75 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/fsl,sof-cpu.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/fsl,sof-cpu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP audio processor common properties + +maintainers: + - Daniel Baluta + +properties: + reg: + maxItems: 1 + + mboxes: + maxItems: 4 + + mbox-names: + items: + - const: txdb0 + - const: txdb1 + - const: rxdb0 + - const: rxdb1 + + memory-region: + maxItems: 1 + +required: + - reg + - mboxes + - mbox-names + - memory-region + +additionalProperties: true From patchwork Mon Dec 16 14:50:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13909852 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B4A42066E4; Mon, 16 Dec 2024 14:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360680; cv=none; b=DZj+efxA4ItMuMPbHcfBr92on/2Q9LsMsAtVyQhjD4EnnteJpPUnrURXMiTYe5t/HpXWqzkXTPBC46tubsMzC/yh0tCcUd6fbrmphBG3T+SMbsPZhjyNm6iL+edZ4RA8IT/et0PNfcaOhOx1TQ3W6RdQdRbHDykLNzG6ReQd8pI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360680; c=relaxed/simple; bh=C7U+gX2HAtTNvw4HTYyQ8sKcsL6nRwW9xlRDEvE3Fus=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SJIvGZcktqYCRa6ZBUr+lk5ZO9ChiUu7WPV5XyxdUilrBomQM95ZuOQlWmbj3eoaCfQEWolazqtZGbrfyciwMUPys0UPuBn7DV+/b6/RwNKeYHvFmkZ9BQ19NeJooYDuaw81Xb/g/7wnaLUmpA3Ms0ytOArxNLigQA6Q99sEDDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WHX6x5tE; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WHX6x5tE" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-432d86a3085so27449605e9.2; Mon, 16 Dec 2024 06:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734360677; x=1734965477; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NhaNNKCxtrPXfELgw/KHgSRSl1aX9JDfH4/Rbi26Vsk=; b=WHX6x5tE7g/bbs+9AwKeF2gCs+/yDlExSWn4ZOpSLwKL04e891yZm3uYKuf27eMpDi frK2+CPZ99rZM/arvzokrmtJGqKL/KLYQzK1b5jAhm5BWV9Ra3cV8ZMG3R7o9Fle8wvu yUkuqQPVgFNz3ky2FjDPdw27bxvok5Iuyf7tAc963HtgRBIc0xkzZBywwiZtWIUA45CJ SnzmSrCXZlY8PKcoo9Orluq7ZFotMbTRak2/5IGgT3jdDuaLiopUKz96uvFnMnBkxrwi RbUIX7a16v4hreQjA6X3CWXySe+HtODW3RFxMftYKkHum7o9zC3PSRhxl8QjPCYgCpEU DcxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734360677; x=1734965477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhaNNKCxtrPXfELgw/KHgSRSl1aX9JDfH4/Rbi26Vsk=; b=Z3O8IDhJAwBNVNImxEXrCVDV0EdSbTgk9C3k3noXinEmqYy/x0lzcsjg7DCmpgYbWA mV32SCVz9vL4fKYtCGP24xOqu4DgQmEvCYJGhxlRLk+pma2AXizL+ild0eQ4eWiN6UTX YW4C7fJtAxmpfzUkNcq4/EOM02SJD0iB8Q2mo2PC9AYnZwZIxtbpCAFV0Kwx984QChS1 G0O9q4rmyf/1NX5VVFKmfKS6Wtea3Br5Ae3JSGZifC0XSRLc6GXW9lfNbCxs9kZXyp29 f++QlyXrAQjVhyje0nCM9cqWdYwzfRAsThYvQe6lc0daTle83JslFnKiry90FKRYbbdp 8qog== X-Forwarded-Encrypted: i=1; AJvYcCU1bq7X/zko+E01bXHyZZWUVHxgs2sQe+WtHHgFhOpuaSaGS9l+k3Dhdqn1NzeShoUIRtZuYF6me9XgNCA=@vger.kernel.org, AJvYcCUmp3TTVbK+xJYz3rpcb0STWNj/O2O/iJuLGblP0tby9Vuwh3ytlUkf5F3OqC3K1cdw9PvjlHgB8lrR@vger.kernel.org, AJvYcCXdT7sQay/YppBGZymXAhvhhsY/tG6+nDX+YDmx8PS/s0EN48m3EQ9Ywcm1czETIV3rf2pzabicYtvbX3ek@vger.kernel.org X-Gm-Message-State: AOJu0YwvgYUHextLtS2sG0tNfn/sg7BUxVFDIrbFTG/HSMpOOTplirGN Oqsrd+AbUNbttCGqe/sWlT8Pj7WoeDkPuDEJHG7fgPu4mtmiSiZK X-Gm-Gg: ASbGncteQuxPA/7sEkZoP6yDIqTq/JtXsy5NrUB8BERQOw9YTim2sEbZ3TjHahJovgo gMOkBpiY4Tql1Nyzx7sKfRonQeCeh2cU7WfZECxbqcH/MZKFG6RNKQlVKmoVXymnMgrIET7Ll8z Z1XTSMaXHzAfpfRxXFV28BEwXm0svywfPrAfijdIHP1/QGndtgtUY6afvKe6oJwyhHnQq9R4Fti aa/tiYDFqV5sYqqA46ojvA9iRrOeVkGUyPGEL4frhc+1RFdu+DucdZ2FtufXJoECl4vAdJy4ZKo ZnavaDWosdYQQ+PZ X-Google-Smtp-Source: AGHT+IHp+aRH9ApI2wBs86oXmAT5Zyw16hcSyU7ofzYQJ6VdNQwOe2b+SoQNW7hpWBoCfEejVt7Ieg== X-Received: by 2002:a05:600c:1da7:b0:42a:a6d2:3270 with SMTP id 5b1f17b1804b1-4362aa9dd6dmr112072165e9.21.1734360677203; Mon, 16 Dec 2024 06:51:17 -0800 (PST) Received: from playground.localdomain ([92.120.5.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362559ed6csm141616455e9.24.2024.12.16.06.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 06:51:16 -0800 (PST) From: Laurentiu Mihalcea To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Daniel Baluta , Mark Brown , Kuninori Morimoto , Takashi Iwai , Bard Liao , Peter Ujfalusi , Jaroslav Kysela , Frank Li Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/5] ASoC: dt-bindings: support imx95's CM7 core Date: Mon, 16 Dec 2024 09:50:36 -0500 Message-Id: <20241216145039.3074-3-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> References: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Laurentiu Mihalcea Add binding for imx95's CM7 core, used for audio processing. Signed-off-by: Laurentiu Mihalcea --- .../bindings/sound/fsl,imx95-cm7-sof.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml diff --git a/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml new file mode 100644 index 000000000000..cc1eb358f288 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/fsl,imx95-cm7-sof.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/fsl,imx95-cm7-sof.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP imx95 CM7 core + +maintainers: + - Daniel Baluta + +description: NXP imx95 CM7 core used for audio processing + +allOf: + - $ref: fsl,sof-cpu.yaml# + +properties: + compatible: + const: fsl,imx95-cm7-sof + + port: + description: SAI3 port + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - port + +unevaluatedProperties: false + +examples: + - | + cm7-cpu@80000000 { + compatible = "fsl,imx95-cm7-sof"; + reg = <0x80000000 0x6100000>; + mboxes = <&mu7 2 0>, <&mu7 2 1>, <&mu7 3 0>, <&mu7 3 1>; + mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1"; + memory-region = <&adma_res>; + port { + /* SAI3-WM8962 link */ + endpoint { remote-endpoint = <&wm8962_ep>; }; + }; + }; From patchwork Mon Dec 16 14:50:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13909853 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5468C206F13; Mon, 16 Dec 2024 14:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360683; cv=none; b=MBfTmH96inodUbk1DpTS4fFKU2UcokCrUd61QP51lKQpctElQUmGO1xx3lUJD2U2r64dnXoElbRZn+0kXg0vmAjnAmrBOIRGK1AWpTBRb8SjOLkc7VnYIM1BitesHHfnCdS329vjikQU+mqN+1cJ5UtikGY2aP3BGqknNrG4GOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360683; c=relaxed/simple; bh=cWi8DmSi7C7RoYGebBs9V11KbEf0JwdrdWWSFkvT2/A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WVMwBkIraI+/55B2SGFHam3XTzFp2G7nlLiYpLDbgA27QCL29Hl6heoSTJIGWUtUbN4Oq/rhlZ70lcQOoHNxe8LGtPa7ApoNEDXMH4+K8A6q2XDOUrc9h8mLrgYIhQT0AnRuK61IIhqt7IUwAQWdgaNafMlxiATqdXBfzV7CpjM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FwjHKa4z; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FwjHKa4z" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso25871995e9.1; Mon, 16 Dec 2024 06:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734360679; x=1734965479; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3O9xjwYbMuKJBMh8JPk0dRAP4OjyngOz+BP2VQZxpdg=; b=FwjHKa4z9bVQ00W0B9aJz17tVCt3Gyp2YMWylEm6vpuwUPQcFNYjinZlimamqvHfGy sFR/ywTmtjwfh7t8O9bnLclPPhoUEulw4XaeyO5npijcOpA18H+cPI4Bdl1BDWabiOVZ QFj1dhz4GZ6tXhI9e76BQZYgzM764OU/4Y0QsJ3gYE8d3gbVtt7NeGaMoH1l0bh4r/xg vL8lIWuHUp/FAVzBV0/Bf1oniuy58grKH5X4nGInaUpL67+ClRFweFAh1F2mjs9NL7Rz rx43sVk7KNxwtJIBULhEB8fZaOZhSGlZv765hXO+MP6vBBdgfZ64uGJ8/q9caE/FUUkV 6m6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734360679; x=1734965479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3O9xjwYbMuKJBMh8JPk0dRAP4OjyngOz+BP2VQZxpdg=; b=h0VQAQAMAXxLA8zCHIooNTASzNoqU2FVNoJyjC4Pa9VbL/72I2LQ4cZXg9z6mVMSRI /vU1uW6fRMDq0DjncYU1o1V/zGoS0Cjpo4BRmf9MzESIZcv1xfQrkEeZN+Hyxbb1DDc+ 1a4TvNqVOcm+PXsP2oNjvPLiYYIs91utCap9JXuQuWq9p7/sNQv+FZGJswFkbx3RYlQB y/0/kvvOmnvKLBvMDmo6sy8cIszTpDfmjsG8NtSiCz0SzcrdBalndMkNp48CIJIGRH+Z 32SEIZRBENE7l1+HChSn8rTjHkGXgI42lhnC/BGT9dklg4tZZb1SqQXDKvpDdRlRquK0 Bstw== X-Forwarded-Encrypted: i=1; AJvYcCUXnLpkzBR2q5qlGAiEt4pFKTk2sfjEKYY8BgRowQrnYaNq8xbgDOAliSVOIHuQ6BvKL9ThDaPKXY2xcfLv@vger.kernel.org, AJvYcCVL6zR89n1oS5o50SVU99QTYrR4Lofzcm+sRe7EzwfwTtodxo3AtKvRfDnSgzQuQ56WrmwPoYATrMarUjc=@vger.kernel.org, AJvYcCVUVb/872CTRpDnzc9b6ATLVnOYaDIN+1hR1GXlPPj88RFNWjFfBzGojLLYPHw3ovOfNgTV4NI2h/tx@vger.kernel.org X-Gm-Message-State: AOJu0Yzkmf39G3n+JBKposxpv47Vz9J9Z30yE+/63JtGzGK6W709/g8H oZZYqRuqaSYF3ku0rllLjX98i+IMyUrzaiIqV3dFNz9zkBmrlG7b X-Gm-Gg: ASbGncvfupZV2aCeOGljn6KLwdopCQ9mRrDmPsVWkBrCzj4Cvjmo08TBNXwGqoEZaF3 pAKAblWvb7bK7oO8IOSU5/JC2q+1HzTGBZ45lyJ39nGZtpZmSIDxIuomgWW4PR0k2jxTwmLxJ8J 2SKghs72DC+JlPUFK+plJHgl2xE9yY5P/n4UUTvOVA+Ua/e/QtN+8PBjP1YZODBD9izbkgNmBN7 8pUwoIZyQPGxrg2VLcKW231B8RCJhlbX6QpNSZyws/CgURVj2FDEbljK3ZaIVgSnoujkpyxyYAL 7qMls7rtBPLLBDMH X-Google-Smtp-Source: AGHT+IFA3RNClGg885yiYlISYsYOJeTw1Fd1eRv96uL8DaVCl3QiM+cW2wRgxshrWVj5DiQhXeuZ5w== X-Received: by 2002:a05:600c:1c09:b0:435:edb0:5d27 with SMTP id 5b1f17b1804b1-436230bfd93mr136287915e9.9.1734360679587; Mon, 16 Dec 2024 06:51:19 -0800 (PST) Received: from playground.localdomain ([92.120.5.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362559ed6csm141616455e9.24.2024.12.16.06.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 06:51:19 -0800 (PST) From: Laurentiu Mihalcea To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Daniel Baluta , Mark Brown , Kuninori Morimoto , Takashi Iwai , Bard Liao , Peter Ujfalusi , Jaroslav Kysela , Frank Li Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/5] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support Date: Mon, 16 Dec 2024 09:50:37 -0500 Message-Id: <20241216145039.3074-4-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> References: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Laurentiu Mihalcea Introduce the 'widgets' property, allowing the creation of widgets from 4 template widgets: Microphone, Line, Headphone, and Speaker. Also introduce the 'hp-det-gpios' property, which allows using headphone detection using the specified GPIO. Signed-off-by: Laurentiu Mihalcea --- .../devicetree/bindings/sound/audio-graph-card2.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml index f943f90d8b15..94588353f852 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml @@ -37,6 +37,10 @@ properties: codec2codec: type: object description: Codec to Codec node + hp-det-gpios: + $ref: audio-graph.yaml#/properties/hp-det-gpios + widgets: + $ref: audio-graph.yaml#/properties/widgets required: - compatible From patchwork Mon Dec 16 14:50:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13909854 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3745207665; Mon, 16 Dec 2024 14:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360686; cv=none; b=UCYUKfYpNL2FPy6K/69diqjT9OreKX8jx9CXAjN8PBia/CZjLgJlAZPTcQ0sO9Bgk0Yt3ipG1KqAmPNyZZYJDAY52aKT5+NC/LZvFEQsBhZH92lF2G+EArVeHxPcvzlV8g3PxmUFEjuisOTyos42h2Yt6AaGvHFNM1VSsEhPnNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360686; c=relaxed/simple; bh=yJXP5G6+KX6wZSm00Do5/7Oji6ODwGE6FTJrlHHDOfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ha3jxzB//dRmLNzXzO7LNxS692IeIB6QXjdQ3HkXIaHbvrIvUHKFUF3bEuwdtfX88pjosjqbCLNDB0ijrBEH0kZRIwp9ruB8RANiPnY3rdntqTw5jVGW/I4tRMdPTrodT/1cynZCwOaR0eTPKphRwzYnTLeiHXddDsJPyJqikxE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iCEqaWuy; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iCEqaWuy" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4362f61757fso30056475e9.2; Mon, 16 Dec 2024 06:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734360682; x=1734965482; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RJ8qCqZxQls27G5FvgYB3jPJTXzsMgq7re3gkn2j14I=; b=iCEqaWuyVce/2Cw58gi/B33YRVw7VSfw7B04u1XimMxyRjDRLjnqM7u0iSCSv1l8Rr is/wgxW3kGE9zmxnBWFO44sJGF8DsHGCXAq8m9SUt4Rwkxp3E1TA1FD4+APQkpxjObHE oZrcUul/2TSV7yUcT4LdyfxMgiigTCoW0GpVLeGYcNCTPlDaNnrXH3uEIy1NGNn19rg4 ToZ59eUXXumF0A6FaEYgp4jSZRm2sA/sr5/89AJnNvu+fdncI9Fp/BC1uSuRkAuqqWtq +zXEyY4/iohLVpUDcVeo9rz7+ez7zg3yeubAgTHDRly7r28V6cXLdQzeiqR4HeLTgoi+ ngKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734360682; x=1734965482; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RJ8qCqZxQls27G5FvgYB3jPJTXzsMgq7re3gkn2j14I=; b=NNz8OlCpEgRF60td18P1SC18JsbM7S0c7EJHJJd277/9KWDRBnTsHrOfCO/n31yq6K lihw7oW4WzTlu45AEM7INLFSr0kK4vouC6xggptkHVoprhUwJJWZNnTVGmiwFNXXJzzV mRSOGmG5Ri9ZXNN4V1sQ9hxybUpX/ncFHJcFXaU3hhjvi27ot3csGtCq7E+dxW/6bFzL oG4Tc3Rd4qZNn1hWpJB5p6iqf8tdPUXUbI6R0aGeSGGe3L2M9DGPoowz9sxEq2T055oC U5qTioJIOQaSfzJzewjVbdncWwqDQWwbL57gQGuvyE74Pr9hf49gQmJOPhQGEnoDVgtc icRw== X-Forwarded-Encrypted: i=1; AJvYcCUAUSOXes4NzCbDx0mqex7Po1NehItDn/S2Rw2LPHRFZ/Jk4k0P6HuKR9fBLNq6YvPcZ95LcO3NBBaPlqn5@vger.kernel.org, AJvYcCWo2Wuba5wm1kYXQ+fsPEclFUiKCfYPFwtVs+bbpUfQkU/76r0K22Uxk53TDVPH0h2Pp+WLm1wZz7Qnl1o=@vger.kernel.org, AJvYcCXf/ip61OQr8TNHJpI4czHNqEbw57DQ4y+NmtTfQSXApCBY0MU8tYpcKjX/gDCFcDLFc+Di30xylgVj@vger.kernel.org X-Gm-Message-State: AOJu0Yx4GVsLz9jUDJNJdVlXozy6n24OVwZmmEf391ce+t6/1E++8S0r Hf61ojPiyRu/d0rnWDJaUA1Y+w9e/hLval3peCMF6jPEGeoCCG74 X-Gm-Gg: ASbGnctQhzbKSM+BSxXjJEJHb6IS0NV3vyCsz9YLvj3qcZcl6OJAJo5ueRuBBeXg3D/ 5jzXUcSgeaeeZf5nFsBFshD1g86GLbELREqifBDehYWrc06QYb1A/K99tYCc2UJabZd5JW9isxj NBszmyrFC6hnnKIEinZiDBiFuvPbmH3TLFZwz+qzkAoGMnrz4isb5BfG/9IKZVKp399/0nMz77M z1CEXeQOxLhtGZ4YMbyPXEcYuiYj4VwdsBiEBNzFSLxQRl5HO2ftkTTMzYFv+fz+NCEqp++NQ/t HljvdfWqLMcYHFSG X-Google-Smtp-Source: AGHT+IFKB+Xuh9xi8JLEAnc5T/rN0BHOtvzUXAgyd6cHABTq1Afej3DUhbobYMZsGyN7l6dIwCHBFg== X-Received: by 2002:a05:600c:a14:b0:435:32e:8270 with SMTP id 5b1f17b1804b1-4362aa3bcdcmr123530085e9.14.1734360681963; Mon, 16 Dec 2024 06:51:21 -0800 (PST) Received: from playground.localdomain ([92.120.5.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362559ed6csm141616455e9.24.2024.12.16.06.51.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 06:51:21 -0800 (PST) From: Laurentiu Mihalcea To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Daniel Baluta , Mark Brown , Kuninori Morimoto , Takashi Iwai , Bard Liao , Peter Ujfalusi , Jaroslav Kysela , Frank Li Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/5] ASoC: SOF: imx: add driver for imx95 Date: Mon, 16 Dec 2024 09:50:38 -0500 Message-Id: <20241216145039.3074-5-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> References: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Laurentiu Mihalcea Add SOF driver for imx95. Signed-off-by: Laurentiu Mihalcea --- sound/soc/sof/imx/Kconfig | 8 + sound/soc/sof/imx/Makefile | 2 + sound/soc/sof/imx/imx95.c | 401 +++++++++++++++++++++++++++++++++++++ 3 files changed, 411 insertions(+) create mode 100644 sound/soc/sof/imx/imx95.c diff --git a/sound/soc/sof/imx/Kconfig b/sound/soc/sof/imx/Kconfig index 4751b04d5e6f..51a70a193533 100644 --- a/sound/soc/sof/imx/Kconfig +++ b/sound/soc/sof/imx/Kconfig @@ -50,4 +50,12 @@ config SND_SOC_SOF_IMX8ULP Say Y if you have such a device. If unsure select "N". +config SND_SOC_SOF_IMX95 + tristate "SOF support for i.MX95" + depends on IMX_DSP + help + This adds support for Sound Open Firmware for NXP i.MX95 platforms. + Say Y if you have such a device. + If unsure select "N". + endif ## SND_SOC_SOF_IMX_TOPLEVEL diff --git a/sound/soc/sof/imx/Makefile b/sound/soc/sof/imx/Makefile index be0bf0736dfa..715ac3798668 100644 --- a/sound/soc/sof/imx/Makefile +++ b/sound/soc/sof/imx/Makefile @@ -2,10 +2,12 @@ snd-sof-imx8-y := imx8.o snd-sof-imx8m-y := imx8m.o snd-sof-imx8ulp-y := imx8ulp.o +snd-sof-imx95-y := imx95.o snd-sof-imx-common-y := imx-common.o obj-$(CONFIG_SND_SOC_SOF_IMX8) += snd-sof-imx8.o obj-$(CONFIG_SND_SOC_SOF_IMX8M) += snd-sof-imx8m.o obj-$(CONFIG_SND_SOC_SOF_IMX8ULP) += snd-sof-imx8ulp.o +obj-$(CONFIG_SND_SOC_SOF_IMX95) += snd-sof-imx95.o obj-$(CONFIG_SND_SOC_SOF_IMX_COMMON) += imx-common.o diff --git a/sound/soc/sof/imx/imx95.c b/sound/soc/sof/imx/imx95.c new file mode 100644 index 000000000000..5a0e44f5bd48 --- /dev/null +++ b/sound/soc/sof/imx/imx95.c @@ -0,0 +1,401 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "../sof-of-dev.h" +#include "../ops.h" + +#define IMX_SIP_SRC 0xC2000005 +#define IMX_SIP_SRC_M_RESET_ADDR_SET 0x03 + +#define IMX95_CPU_VEC_FLAGS_BOOT BIT(29) + +#define IMX_SIP_LMM 0xC200000F +#define IMX_SIP_LMM_BOOT 0x0 +#define IMX_SIP_LMM_SHUTDOWN 0x1 + +#define IMX95_M7_LM_ID 0x1 + +#define MBOX_DSPBOX_OFFSET 0x1000 +#define MBOX_WINDOW_OFFSET 0x6000000 + +struct imx95_priv { + struct platform_device *ipc_dev; + struct imx_dsp_ipc *ipc_handle; + resource_size_t bootaddr; +}; + +static void imx95_ipc_handle_reply(struct imx_dsp_ipc *ipc) +{ + unsigned long flags; + struct snd_sof_dev *sdev = imx_dsp_get_data(ipc); + + spin_lock_irqsave(&sdev->ipc_lock, flags); + snd_sof_ipc_process_reply(sdev, 0); + spin_unlock_irqrestore(&sdev->ipc_lock, flags); +} + +static void imx95_ipc_handle_request(struct imx_dsp_ipc *ipc) +{ + snd_sof_ipc_msgs_rx(imx_dsp_get_data(ipc)); +} + +static struct imx_dsp_ops ipc_ops = { + .handle_reply = imx95_ipc_handle_reply, + .handle_request = imx95_ipc_handle_request, +}; + +static int imx95_disable_enable_core(bool enable) +{ + struct arm_smccc_res res; + + if (enable) + arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_BOOT, IMX95_M7_LM_ID, + 0, 0, 0, 0, 0, &res); + else + arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_SHUTDOWN, IMX95_M7_LM_ID, + 0, 0, 0, 0, 0, &res); + + return res.a0; +} + +static int imx95_run(struct snd_sof_dev *sdev) +{ + return imx95_disable_enable_core(true); +} + +static int imx95_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) +{ + struct imx95_priv *priv = sdev->pdata->hw_pdata; + + sof_mailbox_write(sdev, sdev->host_box.offset, + msg->msg_data, msg->msg_size); + + imx_dsp_ring_doorbell(priv->ipc_handle, 0); + + return 0; +} + +static int imx95_get_mailbox_offset(struct snd_sof_dev *sdev) +{ + return MBOX_DSPBOX_OFFSET + MBOX_WINDOW_OFFSET; +} + +static int imx95_get_bar_index(struct snd_sof_dev *sdev, u32 type) +{ + switch (type) { + case SOF_FW_BLK_TYPE_SRAM: + return type; + default: + return -EINVAL; + } +} + +static int imx95_get_window_offset(struct snd_sof_dev *sdev, u32 id) +{ + return MBOX_WINDOW_OFFSET; +} + +static int imx95_set_power_state(struct snd_sof_dev *sdev, + const struct sof_dsp_power_state *target_state) +{ + sdev->dsp_power_state = *target_state; + + return 0; +} + +static int imx95_suspend_resume(struct snd_sof_dev *sdev, bool suspend) +{ + struct imx95_priv *priv; + int ret, i; + + priv = sdev->pdata->hw_pdata; + + if (suspend) { + ret = imx95_disable_enable_core(false); + if (ret) { + dev_err(sdev->dev, "failed to stop core\n"); + return ret; + } + } + + for (i = 0; i < DSP_MU_CHAN_NUM; i++) { + if (suspend) + imx_dsp_free_channel(priv->ipc_handle, i); + else + imx_dsp_request_channel(priv->ipc_handle, i); + } + + return 0; +} + +static int imx95_runtime_resume(struct snd_sof_dev *sdev) +{ + int ret; + const struct sof_dsp_power_state target_state = { + .state = SOF_DSP_PM_D0, + }; + + ret = imx95_suspend_resume(sdev, false); + if (ret < 0) { + dev_err(sdev->dev, "failed to runtime resume: %d\n", ret); + return ret; + } + + return snd_sof_dsp_set_power_state(sdev, &target_state); +} + +static int imx95_resume(struct snd_sof_dev *sdev) +{ + int ret; + const struct sof_dsp_power_state target_state = { + .state = SOF_DSP_PM_D0, + }; + + ret = imx95_suspend_resume(sdev, false); + if (ret < 0) { + dev_err(sdev->dev, "failed to resume: %d\n", ret); + return ret; + } + + if (pm_runtime_suspended(sdev->dev)) { + pm_runtime_disable(sdev->dev); + pm_runtime_set_active(sdev->dev); + pm_runtime_mark_last_busy(sdev->dev); + pm_runtime_enable(sdev->dev); + pm_runtime_idle(sdev->dev); + } + + return snd_sof_dsp_set_power_state(sdev, &target_state); +} + +static int imx95_runtime_suspend(struct snd_sof_dev *sdev) +{ + int ret; + const struct sof_dsp_power_state target_state = { + .state = SOF_DSP_PM_D3, + }; + + ret = imx95_suspend_resume(sdev, true); + if (ret < 0) { + dev_err(sdev->dev, "failed to runtime suspend: %d\n", ret); + return ret; + } + + return snd_sof_dsp_set_power_state(sdev, &target_state); +} + +static int imx95_suspend(struct snd_sof_dev *sdev, unsigned int target_state) +{ + int ret; + const struct sof_dsp_power_state target_power_state = { + .state = target_state, + }; + + if (!pm_runtime_suspended(sdev->dev)) { + ret = imx95_suspend_resume(sdev, true); + if (ret < 0) { + dev_err(sdev->dev, "failed to suspend: %d\n", ret); + return ret; + } + } + + return snd_sof_dsp_set_power_state(sdev, &target_power_state); +} + +static struct snd_soc_dai_driver imx95_dai[] = { + { + .name = "sai3", + .playback = { + .channels_min = 1, + .channels_max = 32, + }, + .capture = { + .channels_min = 1, + .channels_max = 32, + }, + }, +}; + +static int imx95_probe(struct snd_sof_dev *sdev) +{ + struct platform_device *pdev; + struct imx95_priv *priv; + struct resource *res; + struct arm_smccc_res smc_ret; + int ret; + + pdev = container_of(sdev->dev, struct platform_device, dev); + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return dev_err_probe(&pdev->dev, -ENOMEM, "failed to alloc priv\n"); + + sdev->pdata->hw_pdata = priv; + + /* map SRAM */ + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return dev_err_probe(&pdev->dev, -ENODEV, + "failed to fetch SRAM region\n"); + + sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + if (IS_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM])) + return dev_err_probe(&pdev->dev, + PTR_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM]), + "failed to map SRAM region\n"); + + sdev->mmio_bar = SOF_FW_BLK_TYPE_SRAM; + sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; + sdev->dsp_box.offset = MBOX_DSPBOX_OFFSET + MBOX_WINDOW_OFFSET; + priv->bootaddr = res->start; + + ret = of_reserved_mem_device_init(sdev->dev); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to bind DMA region\n"); + + priv->ipc_dev = platform_device_register_data(&pdev->dev, "imx-dsp", + PLATFORM_DEVID_NONE, + pdev, sizeof(*pdev)); + if (IS_ERR(priv->ipc_dev)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->ipc_dev), + "failed to create IPC device\n"); + + priv->ipc_handle = dev_get_drvdata(&priv->ipc_dev->dev); + if (!priv->ipc_handle) { + ret = -EPROBE_DEFER; + dev_err(&pdev->dev, "failed to fetch ipc handle\n"); + goto err_unregister_ipc_dev; + } + + priv->ipc_handle->ops = &ipc_ops; + imx_dsp_set_data(priv->ipc_handle, sdev); + + /* set core boot reset address */ + arm_smccc_smc(IMX_SIP_SRC, IMX_SIP_SRC_M_RESET_ADDR_SET, priv->bootaddr, + IMX95_CPU_VEC_FLAGS_BOOT, 0, 0, 0, 0, &smc_ret); + if ((int)smc_ret.a0 < 0) { + ret = smc_ret.a0; + dev_err(&pdev->dev, "failed to set boot address: %d", ret); + goto err_unregister_ipc_dev; + } + + return 0; + +err_unregister_ipc_dev: + platform_device_unregister(priv->ipc_dev); + + return ret; +} + +static void imx95_remove(struct snd_sof_dev *sdev) +{ + struct imx95_priv *priv; + + priv = sdev->pdata->hw_pdata; + + if (imx95_disable_enable_core(false)) + dev_err(sdev->dev, "failed to stop core\n"); + + platform_device_unregister(priv->ipc_dev); +} + +static const struct snd_sof_dsp_ops sof_imx95_ops = { + .probe = imx95_probe, + .remove = imx95_remove, + + /* mandatory "DSP" ops */ + .run = imx95_run, + .block_read = sof_block_read, + .block_write = sof_block_write, + .send_msg = imx95_send_msg, + .load_firmware = snd_sof_load_firmware_memcpy, + .ipc_msg_data = sof_ipc_msg_data, + + .mailbox_read = sof_mailbox_read, + .mailbox_write = sof_mailbox_write, + + .get_mailbox_offset = imx95_get_mailbox_offset, + .get_bar_index = imx95_get_bar_index, + .get_window_offset = imx95_get_window_offset, + + .pcm_open = sof_stream_pcm_open, + .pcm_close = sof_stream_pcm_close, + .set_stream_data_offset = sof_set_stream_data_offset, + + .runtime_suspend = imx95_runtime_suspend, + .runtime_resume = imx95_runtime_resume, + + .resume = imx95_resume, + .suspend = imx95_suspend, + + .set_power_state = imx95_set_power_state, + + .drv = imx95_dai, + .num_drv = ARRAY_SIZE(imx95_dai), + + .hw_info = SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_BATCH | + SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, +}; + +static struct snd_sof_of_mach sof_imx95_machs[] = { + { + .compatible = "fsl,imx95-19x19-evk", + .sof_tplg_filename = "sof-imx95-wm8962.tplg", + .drv_name = "asoc-audio-graph-card2", + }, + { + }, +}; + +static struct sof_dev_desc sof_of_imx95_desc = { + .of_machines = sof_imx95_machs, + .ipc_supported_mask = BIT(SOF_IPC_TYPE_3), + .ipc_default = SOF_IPC_TYPE_3, + .default_fw_path = { + [SOF_IPC_TYPE_3] = "imx/sof", + }, + .default_tplg_path = { + [SOF_IPC_TYPE_3] = "imx/sof-tplg", + }, + .default_fw_filename = { + [SOF_IPC_TYPE_3] = "sof-imx95.ri", + }, + .ops = &sof_imx95_ops, +}; + +static const struct of_device_id sof_of_imx95_ids[] = { + { .compatible = "fsl,imx95-cm7-sof", .data = &sof_of_imx95_desc }, + { }, +}; +MODULE_DEVICE_TABLE(of, sof_of_imx95_ids); + +static struct platform_driver snd_sof_of_imx95_driver = { + .probe = sof_of_probe, + .remove = sof_of_remove, + .driver = { + .name = "sof-audio-of-imx95", + .pm = &sof_of_pm, + .of_match_table = sof_of_imx95_ids, + }, +}; +module_platform_driver(snd_sof_of_imx95_driver); + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_DESCRIPTION("SOF support for i.MX95 platforms"); +MODULE_AUTHOR("Laurentiu Mihalcea "); From patchwork Mon Dec 16 14:50:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13909855 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41B67207A1D; Mon, 16 Dec 2024 14:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360688; cv=none; b=QGQsPlrbMDkBsgeZAAX91lAlHc5sSMZD32POISSjWnYgI19tkr88i6Ayo9fw17ns0HlvvQVyqUMtEIG9MZJhGL9ud+fWThSxtnZz16HKUXobrigrwUcIv5B97LXVWZzm5pjgtqftYfZ2y66BIwIGQQv4ah4a3i026jmOYyOiXmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360688; c=relaxed/simple; bh=AkMTmkKlrQ8VFXVorPrHhF449gun9/lsauN+Wej1SvY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Cu20Jre5gKYE5CTSC0UAhN00s18E+q+nfnXdO7BkAC7Hn6Xw/M1niwrFYN84YbtIMRjBSM3/KL4oovM0+0rHd7ahUdHH7tb78o1VGdxDyCCEEF5Bj1Uh0gHI+PdxOunildb3QOIZpxNXl2Iljomt0Zadz4ZH8Jb5hPQ1jU7iJcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JtgtOEt6; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JtgtOEt6" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4362f61757fso30056925e9.2; Mon, 16 Dec 2024 06:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734360684; x=1734965484; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAAKa/iJbcg0hE8bXqvcJeWPfM0/EwIS0mrbbFrulwU=; b=JtgtOEt6eSbfTqAjyslnwMKAHDjhx7IXBmhC4Z5tAfd9+2/s8xLsKn9+BMimHuChHI vHJbIe/iSrbdKY7Hh+pktleVNq9te/mLgbPy1w9HQsteLAyMQWwwYt5+8sYds3zuIqN/ A3iUutayo4x28BxqUNVx1jw3TGIsSphIewsHi0Ni9XH0SjwweWvyjm4mFRQ4j8OGHsBO hEU8rmxR6twT1AQo4mZ92xWapkxVm/G3KDaxblYwKjodjtdGH7JJTGx0+kV8WRAhF8ey gC0ATWXzUC1obzQLAaJDyTGH7IY6YAyJ2v7P3SvHPaeQfnHdSRGzi0kXymlTr8q3CueK RYlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734360684; x=1734965484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EAAKa/iJbcg0hE8bXqvcJeWPfM0/EwIS0mrbbFrulwU=; b=pJ9EtJy3E1p+Ri4TKK79+GFXKMrohAkfKI+YqQrnqfu5AM9igWBWHjkpO8r5i8+Icp IqtDam1KedjCBmdDv1aZDtm8Wx2xMad52Pou3sFVp4T0mLbCHcwHzM+XjevhyrDJMNWR GppTFkGN9PzFPkldCK8GevuUkqkYeNX6qIhFO4rMfG64yltZbGdWQ9c7k/JSCKM0vWK7 8Sji8cgbK3zZyMl9kmaLg0nxZQb6jlhmnVW+OpAupWa+MVtetZ3y27ZEjl6lRMOnelYX VabYAsE6rOjZSBi91YBgLhVgrpDNpapsgl0XYssCOGt60HwVNiqih1ZZyHZVEexmA8Bd jNRA== X-Forwarded-Encrypted: i=1; AJvYcCU7ElhV8kE6tuNPF8v54W2DgyZWg8x2mUhivM1ag84fyahqmigib9DLmG/j2V9EYmFEGsC4arlI7Dpb5ZI=@vger.kernel.org, AJvYcCWg+WsBdo5y46QAs8s0BDESoBiUXUFilKr/2hhvGgUcF9YVwBOtHgON7TWvFAvEckihtDMYXc8IZ963@vger.kernel.org, AJvYcCXgdDOB1HSSf3M93PN3x6TkdcQFX7ZNT0lhw1z1PGEqPvW+pZWMnif18tJ0loZ9Ysl1VUZcra3PC7SG60sz@vger.kernel.org X-Gm-Message-State: AOJu0YzP1NaMoP83pi/rj8NWMRp5iNtMo+WSOYHyDDSAwfHCdLdfhTWS Trt3EWBzlbS3i4fV/pKnYALV1z13ZhEsUTAfbOTMqwjZvVCUDGwaS/AlGHEb X-Gm-Gg: ASbGncvNgCjotCRwbYviOMTsQIDyx71dsveDa68WVgFNF42d3BY7XHdjXVtFD2CqAmm D0o7i29t2SUv7ny0bwbn4iPn0wlCPqb4pJdcOV7WP9LUTR8sd9VWt6SvAbXBcg1EzR+zIrEdMqP JgrzLI6nfl3obwc9hoLqNDSt0MkTnSufzRqSPwkktT+Wg5o1I5xUJ+GDxy9VJsmJJVMnNZ6Uryv UvaawIT3kMlxxVfudtklUX2n4iN9jlRat8M4QiAhXEM24L3yozmIPa+ymz2qpXnAWOEAvouLH74 GNEOLDkpDTpGH9yt X-Google-Smtp-Source: AGHT+IF6mGQ66zqt23wxmdgyvCpFmx39WbIi+8c7emJk9Jb285zsFEtWpp62qxObMAzNXGOH9H4hJg== X-Received: by 2002:a05:600c:a011:b0:434:f819:251a with SMTP id 5b1f17b1804b1-4362aa3a029mr127042805e9.9.1734360684343; Mon, 16 Dec 2024 06:51:24 -0800 (PST) Received: from playground.localdomain ([92.120.5.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362559ed6csm141616455e9.24.2024.12.16.06.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 06:51:23 -0800 (PST) From: Laurentiu Mihalcea To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Daniel Baluta , Mark Brown , Kuninori Morimoto , Takashi Iwai , Bard Liao , Peter Ujfalusi , Jaroslav Kysela , Frank Li Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/5] arm64: dts: imx: add imx95 dts for sof Date: Mon, 16 Dec 2024 09:50:39 -0500 Message-Id: <20241216145039.3074-6-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> References: <20241216145039.3074-1-laurentiumihalcea111@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Laurentiu Mihalcea Add imx95 DTS for SOF usage. Signed-off-by: Laurentiu Mihalcea --- arch/arm64/boot/dts/freescale/Makefile | 1 + .../dts/freescale/imx95-19x19-evk-sof.dts | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/imx95-19x19-evk-sof.dts diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile index 839432153cc7..27f64e333e4b 100644 --- a/arch/arm64/boot/dts/freescale/Makefile +++ b/arch/arm64/boot/dts/freescale/Makefile @@ -282,6 +282,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx93-tqma9352-mba93xxca.dtb dtb-$(CONFIG_ARCH_MXC) += imx93-tqma9352-mba93xxla.dtb dtb-$(CONFIG_ARCH_MXC) += imx93-var-som-symphony.dtb dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-evk.dtb +dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-evk-sof.dtb imx8mm-kontron-dl-dtbs := imx8mm-kontron-bl.dtb imx8mm-kontron-dl.dtbo diff --git a/arch/arm64/boot/dts/freescale/imx95-19x19-evk-sof.dts b/arch/arm64/boot/dts/freescale/imx95-19x19-evk-sof.dts new file mode 100644 index 000000000000..8eef83d7bdd7 --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx95-19x19-evk-sof.dts @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2024 NXP + */ + +/dts-v1/; + +#include "imx95-19x19-evk.dts" + +/ { + sof_cpu: cm7-cpu@80000000 { + compatible = "fsl,imx95-cm7-sof"; + reg = <0x0 0x80000000 0x0 0x6100000>; + memory-region = <&adma_res>; + mboxes = <&mu7 2 0>, <&mu7 2 1>, <&mu7 3 0>, <&mu7 3 1>; + mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1"; + cpu: port { + cpu_ep: endpoint { remote-endpoint = <&codec_ep>; }; + }; + }; + + reserved-memory { + adma_res: memory@86100000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x86100000 0x0 0x100000>; + no-map; + }; + }; + + sof-sound-wm8962 { + compatible = "audio-graph-card2"; + links = <&cpu>; + label = "wm8962-audio"; + hp-det-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hp>; + widgets = + "Headphone", "Headphones", + "Microphone", "Headset Mic"; + routing = + "Headphones", "HPOUTL", + "Headphones", "HPOUTR", + "Headset Mic", "MICBIAS", + "IN3R", "Headset Mic", + "IN1R", "Headset Mic"; + }; + + sound-wm8962 { + status = "disabled"; + }; + +}; + +&edma2 { + dma-channel-mask = <0xc0000000>, <0x0>; +}; + +&sai3 { + status = "disabled"; +}; + +&wm8962 { + assigned-clocks = <&scmi_clk IMX95_CLK_AUDIOPLL1_VCO>, + <&scmi_clk IMX95_CLK_AUDIOPLL2_VCO>, + <&scmi_clk IMX95_CLK_AUDIOPLL1>, + <&scmi_clk IMX95_CLK_AUDIOPLL2>, + <&scmi_clk IMX95_CLK_SAI3>; + assigned-clock-parents = <0>, <0>, <0>, <0>, <&scmi_clk IMX95_CLK_AUDIOPLL1>; + assigned-clock-rates = <3932160000>, <3612672000>, + <393216000>, <361267200>, + <12288000>; + port { + codec_ep: endpoint { remote-endpoint = <&cpu_ep>; }; + }; +};