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: 13909865 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 860662063EB for ; Mon, 16 Dec 2024 14:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360678; cv=none; b=aQNjx80H5RrAUn5wmP1CIaR59HGz9ZKCDGcS2C2WNYJWcgxFNteiEXvvEofMLzAMeI9kb4SBnUh6eK7wlvGFkhjYsLE5ealJSQKUjqzwya5oAJoOrw7ZAwSKIWtRvm/8VAU7hu/Pk3mbkscHzBgDRP3W1HY5tMwa7kT3QcByvjY= 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=KiuNH2sK; arc=none smtp.client-ip=209.85.221.54 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="KiuNH2sK" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-38634c35129so3306643f8f.3 for ; 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=lists.linux.dev; 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=KiuNH2sK5JLWd2ZDdM3dtYT1TP/DoWDabBmd4VPuRheBWoE9br3vwe0WhVzBOgIive a7ZDoYvjBchNMNnknpdhgypuyD3CWgRhLCKmN4UNBqnmrR9etL+pzD6d27j8Gfa86WbU r1Fng4xId3fQoRDm7Tx9mbQxUHPYBCchG+1ojh1Y7822BTGzeELHAi3GMbvMMl6bG7/Q QreH/W7VkRLolJN0owaTlEBw+VfZPQfGz1Bi3KCwOCBMpr2Nkq1L+mIy7wH4oBDa/aGc b3swBeGJ8MX1S4GfjhnA9T4+B9PHZQjABhDkA2k68EjeMh7tcpfz6g/wdzXHSjdCgbFc z1rA== 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=gClLojJ8IbE46Uxeu/+toXaTpnCnNzdenuj/tUwcYyeTN/GQWcFtDzGEmoSXnN+uqv 2Mq8dvEOxZyEttVjXVhKeCYIaoeprRiVWHpU6OMtyaxBOA0BiGPVj1sj1zlxNjRVFtt0 Y9PER3zw64eBl3W4wXXObpWTo1qDvzOXAABDKjUebCSC20+ljpQ8zfe27ksuFQ/4hKs5 uGgMbDlY79zBL1375EKCHG2/AW68hwy5e3kIaq5sFec8kQ+DaP8f5iDxtCIA9/mmePvD KauZCU6DaJQV7HrBERtDVkSLM6/jXn1XD0K3TH648uGD1i1wJ8B/0rSr74UmvAxmJfX+ nd+Q== X-Forwarded-Encrypted: i=1; AJvYcCXozi7QUO7icVmfKfC5GGw7uwwmBTObx2uGZ38rpdFdpFmV8XugaAW2h8qFvszutlOn+/s=@lists.linux.dev X-Gm-Message-State: AOJu0Yyn83F/cnwunSmUC8jYlYoSRsIL7Lgu+CiIbb700mKVh4ZbqHCs 85qXEnT9i40r+O1x7xHPsOnexiUF4AhcFyquTR2m/9SwVvSepGc4 X-Gm-Gg: ASbGncvkOlbTAbDq9Wjdf0z/zW1XY0RRhTgOHlLR2LvWIZCzMqKGq/J1dUjjdTxUiwH 79sVtnJCy8pyTZ7Oa3TFL4Ku5LsLS2uCids1ruIV5vTcPrEKNuuWy4Cksw5kvHHwWZjNFmQxMkU i4faFUmjXLKaJdW6Eud/uGOr0CkRnmGBmPcHKC80ysDDtWEuQBGO4TfENQbTYfKv6gE8vsp6Hc0 0aVWWgADNTxXbm9NcnhPtm+Ez2ELi3Hfz4CwFADaKuqnrsNi7DE1xFeTWAq/PJjsBD7GCej55R3 rtvAYP14WkixVWhj 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: imx@lists.linux.dev 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: 13909866 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 354F02066E2 for ; Mon, 16 Dec 2024 14:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360680; cv=none; b=L6NLcuessUHfqfz0GQhinCLPESSpHQ5DNpoeU+AqVOIn6inDnMpkye+sOzuTIZ6BSvOkxlChVb2rde4cuoTzvBRIwJVFd7z//BbE9P5NSYbg7zmGHzom/mkZAFOUIB5HvBsmCWh0yKLMg5uVxIYkNeWxCgk259d4FwWpIwtslJE= 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=Im9riAHe; arc=none smtp.client-ip=209.85.128.41 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="Im9riAHe" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-432d86a3085so27449595e9.2 for ; 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=lists.linux.dev; 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=Im9riAHef2PxAAu0ckz7PqzWCaPKusY8737Tz/SBqiGv7pvlIz884fRQ+1qaEmQqSp Osfk9aaVxmblHdSDL2gVR/XB0VE9BlVPKK72Fk8PDeJpWn5Ay9AhxXy6T2xj5JT0ZOqj gkexYTxtJTwylA2eJ38f21tgbrP/g/9gZgDnoCSmTlv4o8PnktlSEn+9w7YOFrq+ecuH tJPpCS8160dqp5tqMu1ut3oQatgPezM6r2YW6/ftjTuU5aBWGkbVqqudN2cLTy6NBf9y 7TzHy5lrMObGt3WryUwXvw1TtcSKtCDgW6L1e0bht0/3Jvwe4sfIFiDQ6D+2MFBk/0nS R2TQ== 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=ml9WdXWH4sCX7uVprY/GkFYtAR+hS28OVSne1skdKzXNsN2erlPtYCIQL+ys9utrSE dhC/3VDQW8NoHxmVp7D9dJ3myEGC/25HGeR7oHg+wAz2Z/uOBxwTGpBruBWyi2byUehy oaUv6ayp4cX+eSoId33pT4EL2ql7uvvbF0ve6tdKNylYUfgomHAytulQ/evOeMmTfM07 OjjWhUnRAaxL6CXUcBZiXE8SBebSuLclJDRDUkNnf0zvZG5Mp61J6ZnJujz2dzj3+ipz uDVG+Kw9mB09gO8SlPklonQlEQoH/z3pEsYP0ViilKPQG7WwYc4Q9hdEkX6frcxjl9In VrfA== X-Forwarded-Encrypted: i=1; AJvYcCWcHqHMur9dqFd0MZKlHe3WMYX8kmryimfODGyKNSF1Fab2A6Rni71A+WKDWwvNQA/pR+o=@lists.linux.dev X-Gm-Message-State: AOJu0YzA9k1mgI3xUI4NacLOioqRAyIwI1Y2+BPShXiDoNQPSZW51X0b f5l6uLje0QBupsfQQp94BR+v8inf9MMrGvNEpOg2CAfGIxEkv2wu X-Gm-Gg: ASbGncvd3Uba3980KsJbylKOJslESUzHdqiCFss5poICJAqICU5Z6DzyOA+uCfNR0ou uCYYSzVHPV+YQwrle01JyhnpNqz9r1yg3dUn7XJNypCeRojFkrkBCUDzTjbGipw90LiBLCRSPnh bb2agk3NIwYCL4/y4WFZBcHQ8mk+mZw27E0Y73P+XdIDo0MYYcbtccrGByYQyVI+obV++BcNxZQ AxdX/817Fn+yeDbHJMlnDuwcXcst3I0OV4u3YjZE0oj35ADJwFW2JNkCwuRQuSDeSjR6BeunVOQ wnGr+/8EjWeZOMEc 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: imx@lists.linux.dev 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: 13909867 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 4B044206F12 for ; Mon, 16 Dec 2024 14:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360683; cv=none; b=OopsMjPtFLRfiR/Tn6VuYs7A15og+ElQUGI5FVgZrcwaF+NfHWswv7tJEzI98Lmf8Or9i7z6kzdORmuM70niJ4esVQSK/Zs0CkGVoq0hOIe0ZJAYV6v89i3qXxdHuJLrhkiMqi7uV99A+zChp1hdZ68UFAsSw0V7VzcGTWGZi2c= 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=Su1xQCFG; arc=none smtp.client-ip=209.85.128.45 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="Su1xQCFG" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso25872005e9.1 for ; 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=lists.linux.dev; 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=Su1xQCFG15Nccft1MsUkmwReCyXwLVsPJuOGwdLShtabOBtoI0XslGF4Ymls53qma+ YBNUMGSYXtopFQsgp5uFi3dDkNeIFeweJHo9cB4ZipcCaBuJsMtxLkbVP3E8iWzqsMR0 mswbx5vATeNM6CyPg7Ze4+FyMcVtNDx2IdCcUK36VpWYYtea7kid8d9cLY3bIJUlcNQO av17Txo/dWSuNytW9ndqQAXLwvJjVl4cRTJkZcdUrFQw5dsXzJDmx637mrYGbC0UlYII 7GPMVQ7X+o3SR7QVsLUrD9MffRr9wE81RJ2jFTnDJNEKDN+9Sr/cxvKLgSTGQg3E4Ebi e25A== 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=Z4y+RiKexBhEwRQHgQ12m+hGnV6RYwbCdQ+EUutmqjWgqy6WtWTA6GjWNh9+Cszq/o 6Yrf37cPiHEhykbcARlCrKtQ3M+DKM7sXeN+9CJNoh6iCTRUieMxTg3cQvLPjv+tasG7 ABweDSalMzlKF4kux1FKmIAojmeQVur9Uz8yP8diB+G/W375y2va1l5vqQbawSqzMZ4o 7vvq1je85Z7/28pncjtXfCA42xHTddSrtZTI5RyoKETrY9uE68fb8sqSmjNJqfwnvkx0 cGpXZ69n3+3b5Bhw+uafjYIqTCAArSkGngf1P+wig8ZD2UcciB3e77M57ivygayyDDiB waaA== X-Forwarded-Encrypted: i=1; AJvYcCUXXwDXi+whpBak7kT+/a8k6s54jg56sEQNpfZLzrPPdAFZlUOn+pC1HgaGE2BSbgbPm/Y=@lists.linux.dev X-Gm-Message-State: AOJu0Yy5imbZR5/NO5KB46XCgkSH0Ag0fCrt0xuY4Mbr2SfRX92P82z0 SGsWgUbVk0yQtpCES0KOq+UfsrC6WE4nOMWrLixFEY4SJX3+SvR0 X-Gm-Gg: ASbGnctVJOp4T+KEuXBtSCsizCRVtG+D6G6tzrf4UgrlwmLTVSPS4PcN1+vOlp4rSN7 OVYpJdOO+VNQSw9MCQCb3aXIyS9+BuhCeC5VFAZ0LuECqiaVRfIRdBOv62hiAY8uZpS5NrKANVM bzWgaKCUfi8GCx7HY2SOMg06rsMykhI0K4OMVnMO0fQTyxEEthoB4Uk3zUnN2XbArfzJDkKwkLe WQ1Dyk2Mgtc73Yf/FVHbNiNht7aI8WMOOfMppaMhzHisXsKopxETQ8FTpvVGEI9t1dW98dMKRuF GFyWR2Ljw18iKLSo 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: imx@lists.linux.dev 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: 13909868 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 E5C80207666 for ; Mon, 16 Dec 2024 14:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360686; cv=none; b=IGEkIpHIaZUy+e8gNecO1jvVzq3ZnECe6aUrLB4rDJfsXBTGT17xx7TgIo9KqiE/kefmCL4UNrjjupqu6DJruY7baOIzBSzwOEA3cOaf/xfy7wjW86cbvh01/2Ex2FYHCkSaUcHBcLxAwgZEHvn+2sFHlbj9Kkoe+l2odhb68aw= 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=AxbzTrZT; arc=none smtp.client-ip=209.85.128.45 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="AxbzTrZT" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43618283dedso41218695e9.3 for ; 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=lists.linux.dev; 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=AxbzTrZTjlthKrXMuXxyWdWR1FQHDMPlttHr/ltXBWz0DXnQOosma3y3x70rK++0Du 6iho5x581h9B2jwg/r0BVOFzaeA5FrKilSPiU4S/YcsguoIK/DgM3ekDy9lbjdz1YbI5 6guYtVcMYdgBuIqVppQROS8r1rs0LeZFGHkXL1O2UlZjLFrU+zEIeVKpHjU1iyaHKtBC jdh81HCHn/9chx/Ers4Sj9NGETb7O7nRLIW8Lu3Gq2lSuFh1PgZlxKqLdGWhChbGFPAB 8Ce8sRA0PHjDneiMFlTtuNWFZLRJ5gl5bfubjGrtbZ41syg2r958LhIl52EB4eoSB8yp ZupQ== 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=rMRK/MxAbyt4xQbxOYVV5MX8HQ2W8hyZmfzDeuRucOk+bD0TApl7sWtB8vhml+zF1j i21gRRYOC7LKy6QnwOLzSeA8bHmbxbPVMHItSwL+f7NytkxyWIcderuM4JeFdwhikPyo 5H9z4MUw6Hoc4Y0FDGrEUQYlrSBCdNcqq0uJY89yIwDRpzQNo0vCwM38q+KZMi9kf9S+ 36JesbOd3T2O+kEtrmtyP5nntBEsy8QtrpXL+thYAB3zMk3GnZuk9/xqCpe6CEInwL4b mAK/NOznBWU79XP4z+Iy9veXog0sYjBnmNJ2NhBRNahAcW15UtkiB+IBUfyaTS6ZMP8x zP+g== X-Forwarded-Encrypted: i=1; AJvYcCXZqqjBYQPPt20ecVWbVo0Bcw4l7Ck5YEh62qlrOVBSMPVFQ29smiComEHsfQ2uXv0yuj0=@lists.linux.dev X-Gm-Message-State: AOJu0Yw0bwhuWlvLbO6Wlatc0SO8+WnHVhiVS+gA3YmZnjPJ51BuC+rl H6r2EUK4PM5zG6omhPHy98uYSBMImRu6IRzbOT9zAwL2Ts2V2al/ X-Gm-Gg: ASbGncsw2/txOEoE06jPQw4AaGeXA6nOw+ueWUMGKOlonHLkKuWYlPQN6MUULhMqMXw HRWu05U4SmmEH/o7So3QJjDrq2PcHpkNxcC8OL+j225dC+mPvbRK2tU8P+a5dIGmiCQQvqNh9an yIgC8xQnj7VpUukNGmBIwe0kH91YBS0oOJAedqpk822mfsTMfUmiMEUfB6w/WoMo8bKaVFMgtQC 5gy1zrr5QNnyojqtIG0mqWvPZO0JuGE4z1rFqx491UgTIjL1iD7PyytsSDVu+TQ4tyyOb2Dr4hH c3lX1f8+BiRvB6R1 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: imx@lists.linux.dev 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: 13909869 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 1CFFE14A0BC for ; Mon, 16 Dec 2024 14:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360687; cv=none; b=cHfuRUQlPezDHhPEwnBril0ufpVen1qVdStQ/kDCrFYFfAtQktlZ1yf4chs3yx3ebhe+7DiM316+rcA6sDkWa98cAsb/iDcLvs91BGAM9W8VuUnZs9MgO4vewsYx7gXl7L0vZDDIjgm7heskGgNaDShMkcazgK5lsYxuERDoLl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734360687; c=relaxed/simple; bh=AkMTmkKlrQ8VFXVorPrHhF449gun9/lsauN+Wej1SvY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CsiV5zrouO8V0e5idqVNGMPBZMRYmfWPQGptXOwLyhEKeXTrdv3pjheMDzmsJJDxWXFjHo5Fo7B9vH7x6mVvjmcNs2HnqFBtEQVFYfGfyufpX7pedqMIfIO8wB7MSXqIypDuT7f696Mpwbq+4vyzFXveVW0p3DvwEWTf7TaidcA= 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=A0DE1MVX; arc=none smtp.client-ip=209.85.128.47 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="A0DE1MVX" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so41265225e9.1 for ; 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=lists.linux.dev; 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=A0DE1MVXPplYFrmLOabJTtygwAQs+LhFa4U+NNxp2pCmVv72wSDJDXXMXUJUdzjr88 rP1e+FndxrEFx+wm3j5XmJMEBZYHAa5wGqB7+1rQVEFVSovXjN2PQ75LP+qf6zqhELb3 5D2bSgPFqbmiMbupkIVMMCUNc26MvHPBW2LZ0cEv1m6uZ0fAk6SqlC2Rcl2kTwESePOi UzlIVLIhVLQupURlF1hhMX5K67RCzA4WlaO/CKveGtrUd+YUV/fL52aR35ddXJ4gywYX rr+7Gv5DK3heoc9PAAB/xD35o20PnhNP0Bl+rAgy6i6idferRmTbbJT1zkAfsSMpZPZA qfCA== 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=t8TaUUmuOonK2+Uy5JNKcJLoZoPIs8DnzAH0scwgowKNYw/odCXOHz3F0ktWvx8Rtd nDwzW0eHtlpMGyrqAFdOJU0UKj8TcaElKABX37OX5jsCgMq8yp+LWJe0EUeTJtEwL04Q AY475YLR9dUWMMTpWmO2ZumLKzW1EfCsrSz3NwiAhDMbIqQD1+AYgYEU1ROVnkvn7znK t++f57AbORuSwD+LkixqIgKC38yjeuI94IjjZpWwFyWgHXTLwhGQ3Fs3C3rHmHLmF5ku 25cT/5tJ8HL7HR9y9fhvpNBjae6Q6YRSWH3+sCmGSHP74q0jQQXtDVVu1tAbiG7PvXA1 B44Q== X-Forwarded-Encrypted: i=1; AJvYcCWilkEZworay8UgtN6cA91ZeC/bRwlxMmreSbs/OnwvuSfKGn2lsAd25hqGJXBWvEpsH1E=@lists.linux.dev X-Gm-Message-State: AOJu0Yyf3tU8DoQPSiqaV7iwqe+hvkCf4iDRZIwknsWBjRGqIJyJ285P RWeGVeM4rRXdrRBnToaG1VMNF+MIB6z1EPVvH8UrHIHY9xzE4AaB X-Gm-Gg: ASbGncvOENtgltgV1GMTHU5RvoMWxDTHWnCBsnxRH80AO+vefKi2bAtucVAYCxwrdSS XhumaDvAnQQu14H98qu5Lhpp+NjeiVXlzsJzEcGFKEUWQLmobEYPZLW+UHmdyo6uxvvhXnE+tX1 hbeGDG0SuXS3erWFGMmEu/zUtKDtWKFqoJQ5HdZ0tCkHnCpFEtuqxNnR2Q3OpnizCLHny5v1Ooi NIJgqMV5ECpb/U9a5sQyOYgNsQ15OY2tsjrHB9ZvBpXz1Q4/IKGBWNc491+ZZQa5aeSs7ZSEWY2 q82bc87H8w1ZH4Do 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: imx@lists.linux.dev 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>; }; + }; +};