From patchwork Wed Nov 13 19:52: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: 13874226 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 AF19E20512C; Wed, 13 Nov 2024 19:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527604; cv=none; b=qL2t3gFrKmGIUsI6I4636BlulPbr5YNe6vCehtnerYDjEDreoCz3BP/ZFeA0ZIIECri9g0M0jf+jH5vqp2Vv5JDGOmQw5eP58vJiBkCF0eTSETAbVumsg8FeAkpRrMUtPXHGO4PqrzV74OTbYmyF2G88HjZ+upfSMrPTjUImG6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527604; c=relaxed/simple; bh=f+l1fy3tazjS2bz5zfkmHyR8xJEa4A4ptXrXxoXVSoo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HGqzxN5wpYDAknRw0a790JrFqz7X7dl2k1AFjPBSzuUz6TPuKz1alkw/KYG7DWFu8sSavl0SmWWwkOLC3biEazxm5gIlK+s+fkbX4nEUtRB5nV2a28o3mLkmWcxerm2lK6PYS2yTVd+PE42zg5YC4A8aVTLlcFIA0LX9/h1zRTM= 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=QLTMpMG1; arc=none smtp.client-ip=209.85.128.51 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="QLTMpMG1" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43152b79d25so61333885e9.1; Wed, 13 Nov 2024 11:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731527600; x=1732132400; 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=ZJohuSDhLv+Ez941jeY7j+hZPem1AM5+WSMU5a11wcU=; b=QLTMpMG1mdFgc8pK9IZQEZFesNgjZO6kfAMIg0Tmk4wBWkKaQuyChGu8UxyMg/0vTe vmKyoylEAuDcs+E+h18Buw5tYK9eg4yy72KX8grVtplEmUvqzdKjVJg3R3MM+eOIyv+p IdWGi5Rdr2U+GMGqasvQafB247IyC+1QOalzLhZiWchqu5n8KJQG0WTH5SgFB7Hhzlch W5b5QrN9+opqb2wGZRatl8bzKfXoiGXFYIfY3DZ286BOxGnob7YBdQGIXxgN1yzs4P5y LCC9rgniV5fAhQDeADwATetNpPgXj2kMmK6BMRzru9MyiWjTpupJaE6M0HV0drZl++Z1 RpCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731527600; x=1732132400; 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=ZJohuSDhLv+Ez941jeY7j+hZPem1AM5+WSMU5a11wcU=; b=ocWhq3RMNBct7oO3GMdHcWP7x7UkRR14UcFbKSXi+SJ5Co9xBBDqTMLoyf5wi145om tpA2U5IzQZDWl6eam1YQ5Cyhcihv9LRnMuPXjky5JOmjyafN0+HVvknGm4gyHmmuTwRJ EItTw/m486qvBIYlY+GeCQb/w3QO1QqwW00FJFRUvJAVGnYifglbkVrhyCUgJiPYIVDz qf76qsiu2BzqR3M2MiTlsYW3p1lWTxQCkkQQhygJKuZxyAyCgUgB77ODyF9rQeXZ3Mhy I1HfzuzXBHuNiPzCsfIw1wKqntDKcPpV8u0PqXw7k+yqc1pQBGokyCvDB6msYGFl0uNk pQmQ== X-Forwarded-Encrypted: i=1; AJvYcCVIVF5nnLuUB7BokfilYNn5NsJAN6vTT9kQ07oJRQ1N+8KM1dvLGRmR+xz16uVtSCfqUzMLVOSGG9ts5og=@vger.kernel.org, AJvYcCVfkBr7PqY4ft+RXeR86xsx9sae1cQ7ABkmsqbkpbRP0sS1xu0PbzCFUteOoDJeSKXTdvpLY8gymfgd@vger.kernel.org, AJvYcCWc+u0Q7Ovrh8Pzc6hYKEkveLc+58q1vJaxbyioWkKEU8Y/pvdu+h0U7erfHlVl4GgOQSpJ9NRteEHJ22Cm@vger.kernel.org X-Gm-Message-State: AOJu0YxzUCLsJrJ56G1vpSAb5eNY48fpUkQTFKp+K9i/Lgea72+Qjc+6 P5XKYFFkNryFVHGz4ilhHzuy6eUd2uPVn1JEp6JFaVJHYXw7Cpm8 X-Google-Smtp-Source: AGHT+IHwi2toH/v6RTvp83UH7M2Jmxcw9HOhI3L1kjcyknLKktTX9f30Gh639+d+i9hlq9WYg//Eow== X-Received: by 2002:a05:600c:5006:b0:431:5c17:d575 with SMTP id 5b1f17b1804b1-432d4aae640mr37829535e9.11.1731527600012; Wed, 13 Nov 2024 11:53:20 -0800 (PST) Received: from playground.localdomain ([86.127.146.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d5503c58sm34633065e9.22.2024.11.13.11.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 11:53:18 -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 v2 1/5] ASoC: dt-bindings: add common binding for NXP CPUs Date: Wed, 13 Nov 2024 14:52:36 -0500 Message-Id: <20241113195240.3699-2-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113195240.3699-1-laurentiumihalcea111@gmail.com> References: <20241113195240.3699-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 CPUs sharing the same programming model (i.e: audio processing with SOF). 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..6d63fcd71154 --- /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 CPU 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 Wed Nov 13 19:52: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: 13874227 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 148B12064EF; Wed, 13 Nov 2024 19:53:23 +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=1731527605; cv=none; b=sJfNKgs44Kziup0iWXW9w/xrXXP2Cuu7POJ8ERSI/vIrb+Lmn9eszRHa/D/R7hq1g9BPJi9K8RtzGw6bBNgC/zNo87O6uKuzdpj7zT9vqa+oj1epcBV/NzKIoEsFWze1NRLLkNwo/4F+nR/EoQ0OELfbe+nvvm3psx6uBqMMbZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527605; c=relaxed/simple; bh=Sv6D/+y3scZijLS9PVRlVeMuXulXudQKBAtm4AEdBT4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aCxwBR1jQwzSnqLlc4IP/POVZZ2ZmnWnzC/whArW/7I27iKa21Nf6brgn4RF+a/NHBwhPUt74Yywsq6JeygP8ai5gHjvxxQYQfQa6jwBBlhnwKxntAKPzD435dc4+8yy4GGj31pSHNaLCC4ucB15I7hDtaDHld0mUqYR07L4SyU= 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=d27nZaZt; 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="d27nZaZt" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so69279445e9.1; Wed, 13 Nov 2024 11:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731527602; x=1732132402; 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=0lQpVT555kI9HxWkbuw1QfCobvJUnpBBYDf2BdIAaRY=; b=d27nZaZtM57nxV5jaR1K0TCXBS41Yji/C63xtsWFMjO8zfkJ2+x3gKvaHfwvMDVl/D xA4e5jAYwH62sKHA2fGo7c/4G+fjasF3nLwPgubFIEzfjoDftAAkhDcaNpADas9n2bce HZOGqMZajWHDY510YFedOZxHi5QsQy27us2qUhXj5LuTjtKyiB0yVfcVWL3/IDVvvkqA LaiRgmr9/cduOhqXe8olI2wFAz3Gho4ndKjE/K7erN5g6NISjWmXMH6hjBspzO+z/rDF mgxcE9LFUflqzwfm/e6xzQ41Xf1oUUABqkTVW4DbX24KP3qBx3kyNe0uiUSR4zBgMPTk iZXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731527602; x=1732132402; 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=0lQpVT555kI9HxWkbuw1QfCobvJUnpBBYDf2BdIAaRY=; b=olhHXhihu5Azez1FhTmtTaeiIazNmCG3FTaC80MzU2bYPDCWbOA5YSwLhxqzkC9qXt JzsCKZax9FV1+IwZadLdMAK0qHdmihSLxIiRrfDVzhKEJs71Cvik7cUd7FWtwaNsQryf ijZc6jJ+iqg5043/Z7JqOoInun1R6JddYRlaf1ceLdblaC63U2xC7g5k3bgCvjLomwTS JcKUthUXNzkS5FKwiwHp5ajP53/krG2r5lSgddHh7eO8guE89g8udijRl7T+gHCJZwrv NPGB5Wh/Hl2lO2On0W/uuhOHlmEG4bCYd4tDlbz4xgfwnskNsv/KMIOWWqf8bkzcJ9Gf 480A== X-Forwarded-Encrypted: i=1; AJvYcCVVoHeXFYgm0K9J6x8GdegVQM0eudWrBTvVWHJ2dgeMlz5N2bARS1w4+pDS75iOt0kz06wydNsXPnJbd/Q=@vger.kernel.org, AJvYcCWR5KqWO7dIh4EPje7Tca1MUjGXPSN3WVe4J6tSeaXxxYRp7mXRFFt2QM6jspJNUq2nswqglANiqT/J@vger.kernel.org, AJvYcCXkxhT1ZMzQyrfO/rcenhhieS0W3vg/97sukoGa7DIR3Xnaci6MMAEKQeLumH4YvDiDiNlBlKk5wEkD3jNw@vger.kernel.org X-Gm-Message-State: AOJu0YxbbXwATO5QKpv4RRETt1Ulpj0ft+zscQqA0dIxwm2wXZWIXdQf hjHAlPo5nZ0F303ZuT6fZsuFfka89LyYnghNLCKXKWGhUPdjQvyk X-Google-Smtp-Source: AGHT+IH2Z2a0/rS9v7IeDir+dpM0VmMRaelsOvWV9gMqaYXP9EFNgflc7dj7yYlfrWcH5bgnnm7i0Q== X-Received: by 2002:a05:600c:3b9e:b0:431:3927:d1bc with SMTP id 5b1f17b1804b1-432b74fcb02mr189488175e9.2.1731527602016; Wed, 13 Nov 2024 11:53:22 -0800 (PST) Received: from playground.localdomain ([86.127.146.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d5503c58sm34633065e9.22.2024.11.13.11.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 11:53: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 v2 2/5] ASoC: dt-bindings: add binding for imx95's CM7 core Date: Wed, 13 Nov 2024 14:52:37 -0500 Message-Id: <20241113195240.3699-3-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113195240.3699-1-laurentiumihalcea111@gmail.com> References: <20241113195240.3699-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. 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..f11e03bbcaba --- /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>; + cpu: port { + /* SAI3-WM8962 link */ + cpu_ep: endpoint { remote-endpoint = <&wm8962_ep>; }; + }; + }; From patchwork Wed Nov 13 19:52: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: 13874228 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 EE70C2076AE; Wed, 13 Nov 2024 19:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527609; cv=none; b=i2WhPGFhbnygM8TeZs5pVFHxXbGO0qdxWPhfJ+rZd3/8Zi3Or9W8cvsmOzIWwE3dzEeiLGiet4sHkwvEClHCNsO01CfXghvxG7UXY18OigSn1OvKscapU8MqC2GO7omvV6m41FlV9iOVA0udRPAEe37TrHOfLk+VgIffrh0Lxjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527609; c=relaxed/simple; bh=cWi8DmSi7C7RoYGebBs9V11KbEf0JwdrdWWSFkvT2/A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZNVS5Gb2KXZQV7YF/03eROhuXjLwgEivKYM6N5541cNQ7mFC/0mNQXTqnzTf2GS5k2yavfHwMUue0g9HMVSWmGyZDseUeLny+y/Tm03YadcRfxj4Ve3oKRJLzvJSHAxEQPhMqF1nbleYbqSe4cgMw+WLo0srmZXV1Sjy87JfIlc= 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=HSOMzs8y; arc=none smtp.client-ip=209.85.221.49 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="HSOMzs8y" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-37d63a79bb6so4759063f8f.0; Wed, 13 Nov 2024 11:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731527604; x=1732132404; 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=HSOMzs8ygp89H5/+VPf6u0MBUiGfeVc1vw0tY2Zybz5ntUp0mImRwQIRtMoS0DdOur k+xtXPyQD/pQncQrkkh1yQ7cksAwfwKqPvmDzRrt1ZdbeFUNa95Ru48WuC7ImAoOSp12 EAZD7UQZcORFxd6hAxFuHUpdzqyJnneF/W5Yw7rBUa5EYCWQ8JcHgYv+HcfjyChTtV11 TpH2v1/3Cj/kaS1cBbpRQp6c6lYLlLr955UbhG4odTNvC8+3F0AD7rG79c2ZQlgMmxq3 SnvtSpmULwSshnlA4qsU3k17qcMLr+08+l4Pb95iMA3g4X5PdpR0SVdMMTOEdZbiaxKN dAFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731527604; x=1732132404; 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=gLqqGtioqEzC+g7emJg4906RDV71a1spiaN4/uo5TlAiN419dPrax3J/ukRIgwp7fr +1sgxDUdCfpFXE3JJ9CNtLT1ntmde4zkdvippwVshl1M9nzsbxBXBalbjvwoKfPTiQY7 YjcYkCM5HE8FswRByqr+KPRg3Rh76odUqj3mE6ZsbWxM7Ysded8j6H5+9Zta642v8n9B qth7eO7byi/SHaLAkPKb+QtbgsYrt1hoNAETvNxaQKWIZFfcAhQCH+Wl5jQR794KpI5v awwR8836AoT3SfGPMbCPqNCUEZVZR5teOZUEP2kWNBOSD2oNMuiLZMD/mu4iuXi6Z51u s3KQ== X-Forwarded-Encrypted: i=1; AJvYcCU0pMunCGOFnL1o5QqN+iUbvuWMnJwHceKf01jS24jBVP/NmN/D9GFCLKvXV9cmLryckOtsDn2l5tkjS4wd@vger.kernel.org, AJvYcCVitaZ7ZCKiqFiMc6/SSsZ0x/ZwFgvXLFXk6jjCg1X+BxuR0RXt/8uGFm1CsawVkyTJ/Qqfni7cumfaT6M=@vger.kernel.org, AJvYcCXX/6achx43Sl2980SLbEFsdXR7FN886XDifJ66x+b7iv6619/w8ZaeklK5Ik82n69yMHPFiv6JN/Jg@vger.kernel.org X-Gm-Message-State: AOJu0YwsMmBCem5GQn7Jkk8aVQDX9br9FaHdnkHlujmxMXnNhqSoYjLx xWDyNa8IU/5wNvQck0z2PeTYYX63VRaXdtlxzvqrxpeIgFJgavOT X-Google-Smtp-Source: AGHT+IEANOLGqOrMck5zuaV/awm4uDnLiNsDYeECS1iqXbhkM7NIIObAN6edW4LT/VwwrIADcKG8Jg== X-Received: by 2002:a5d:5849:0:b0:381:f596:392a with SMTP id ffacd0b85a97d-3820df8884cmr3387252f8f.43.1731527604134; Wed, 13 Nov 2024 11:53:24 -0800 (PST) Received: from playground.localdomain ([86.127.146.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d5503c58sm34633065e9.22.2024.11.13.11.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 11:53: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 v2 3/5] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support Date: Wed, 13 Nov 2024 14:52:38 -0500 Message-Id: <20241113195240.3699-4-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113195240.3699-1-laurentiumihalcea111@gmail.com> References: <20241113195240.3699-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 Wed Nov 13 19:52: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: 13874229 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 02DAF205AC8; Wed, 13 Nov 2024 19:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527610; cv=none; b=k1R+9hGFIho8PNnd0btbPTeJJig2/XnM2JOa8ou0hQtpnJ6pj0CD+r7XaaV9OvpFP9Ja28ZRSoMZcVZ+5UbDGWZQezW9JSTNZnKl2MlI3pdpGNB0YEvRyQ94e/dzLTBAhh/bwbiefkXvR+lIvnfGgwGynVU0VYWBgoJbRLdaQow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527610; c=relaxed/simple; bh=yJXP5G6+KX6wZSm00Do5/7Oji6ODwGE6FTJrlHHDOfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rqgm784qGFg4yT7fOjRYqMy5Rr8eF69TJDzm+dcbwV++tholp/wgHVG4C9qvOoJqU4ZaKxdh1QEnLnNMQ/3a8ja7B9eZVB4Bf331c5lYwnafe6rF7c4snEvIOiLc8OwTtNuLkIKKkFkgdrHl8U6ag+49Od96BXRYXsa9EdfMHbM= 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=NoinyVRo; arc=none smtp.client-ip=209.85.128.48 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="NoinyVRo" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43161e7bb25so59667595e9.2; Wed, 13 Nov 2024 11:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731527606; x=1732132406; 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=NoinyVRojt2twaByWRhyfdUCisR+Rzg8yMjPoev8Z5hk436PEkQCXtyHyBezdUhpol a/Fm75F+/YT+/TLqC24hZuYXGpbmQgImBnTb6wZFyHeYXclkehmu0qUQQe3LEVsANSBF H+kTOkXQozk6tfm3IxavN3a2cU9g/4ZtPsZ6zZRklbWuD58/uxqScjVey9t2axVO+GO8 DKhrhsH92vOO5bSqr7X7+akAP6AlDEDt2ZF4j2T2o9FNdGk/Hs2v6LI1FLgdeU9tFI11 fanI8h2znFeSi9SsfLwkfwBklIgbl9ltl5N3mWwLdnb6IQNA3SGULFHTcJX+iL+5aARf UpJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731527606; x=1732132406; 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=Vr+5JtOEuIoaMgjDrFAp8ZdsKKwB4BMhHH//4hKMfqP3P+WXiJrFMf0whIzXaHa2WA NBeMsxUvZcMlaSPfRJm14cNNOXd0XBUVeohZKqOuYgXQFJQqsB7X655D4halx0dMBrLY lAuNQK2o+hEwZlQxi1Y0BZ3xXksJzHiPdSCjJf1PrIMEMEFx0wRA2qYJoNMWltvt0/a8 N53LfXtV54okIrCJZrDolNMOCRgmFqW14tg+egeeit3QyZfyRxAfIbmg4B8iV3RbaKNY W5o3GmWcaa7i8DnwLJDTZmulN+wNPGwFj2mMHD0lCGNH2HJUyaNDDHTbuobedxHr4awh 9U+A== X-Forwarded-Encrypted: i=1; AJvYcCU55jbG+vKYNMuehjuFOwE7/uKSYw28arJVa/QWOf5dLyINWMaPgtbHRaijLJuKVk1mcIiM+Vr8hh/2CfcM@vger.kernel.org, AJvYcCUoQkoAVkFe0+w+lL0dd8gush8VHFcy31q/QsSHKxTlGtiwKL1XRCiHlek1NIL0n+08wU6PPodlDe4H@vger.kernel.org, AJvYcCVYqeetu+DQgP2bF+voEfm0mueS/ltoQDGLhQI6Msy1l6ZuTZ52zXsTFwJG8K4XnAwLejawyd6FhoTo7iY=@vger.kernel.org X-Gm-Message-State: AOJu0YxLKCegAKzfABqezMVGssnrz4Pwt18Kdl1C69UoGrDkg+9a6NPz fbT9UiHtQKtZTWf5PEVnc91w9E5e7DRoctq2dypT6n3HhQojiJF8 X-Google-Smtp-Source: AGHT+IHDkGjE+BG151uOOvSO50zgIgNCO9RH+HMl6uHiRX3lePeeddimjRMMAgBVVCFvsXxrNxhlpA== X-Received: by 2002:a05:6000:400e:b0:378:e8a9:98c5 with SMTP id ffacd0b85a97d-3820812efafmr6915270f8f.34.1731527606274; Wed, 13 Nov 2024 11:53:26 -0800 (PST) Received: from playground.localdomain ([86.127.146.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d5503c58sm34633065e9.22.2024.11.13.11.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 11:53:25 -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 v2 4/5] ASoC: SOF: imx: add driver for imx95 Date: Wed, 13 Nov 2024 14:52:39 -0500 Message-Id: <20241113195240.3699-5-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113195240.3699-1-laurentiumihalcea111@gmail.com> References: <20241113195240.3699-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 Wed Nov 13 19:52:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Mihalcea X-Patchwork-Id: 13874230 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 ED9D8209670; Wed, 13 Nov 2024 19:53:30 +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=1731527612; cv=none; b=Lzlj73BvrSNkD1oaRhSvutOza+7YLvwlp1yPJQiOIg68vx4zWFE60H6fVeNrQmbWljy5zzqKLnWWPv4WY5ExEbGiZoG0tQd2hW1Q23SWG/DrV5Qi9p6O3YA04EkZBc4AQiXm9JCA01Q4mylhNxTMm2U2lXCk+CaVMZ4gWL6JVY8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731527612; c=relaxed/simple; bh=7K/cyMoay2nX9mxkWcw+cOgGAMlaSf60f/rCoPj0sRw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ks2T6enhcUkEZu9mlGatCgeMtA1/lBQr6MVp93RcoDcxOdxI5nxD36vvG9rrFUlUQt6zgktbcJLRYn4VLSw4AJqnWcTf0pB4qmrsanY0cfZ33DO+6dTCVyGMTSpXY14Hu1/Jj5sFYIGrCEFZFLtBODJupyw8zd6EJbNHeFU9Adc= 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=i5iru88s; 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="i5iru88s" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4315df7b43fso63503505e9.0; Wed, 13 Nov 2024 11:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731527609; x=1732132409; 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=XyiKN4j8ScToVeD29C1kvH+uEOhOz+pcRKy9I30xNm8=; b=i5iru88s2+WRIESm+PvCfNYu9MyghP205HBCYYojrANgev/UzU96H3U4VPo8+oES9J o0A3sMsHnIDaEtmtqWpE61BkzSPxz8A/Adz8Jjm9lQSb8K8OTNJkbu3JRBSSCq7OgyLV bQkW4Rg1Bh+hqJ7MOHozhbYQcEgSUXWik2B9qCyYBGyO4MTjhLw0AcTXUZFqsL0VWyy9 2iS2QWrQshk1tqI4sZtmtcVZSbzv5wiIvwbRMdTVk51IrnZci439pfH8cZnF7yHQZYMP DcYgqIjn5GgJbG+aQK/ipZ8QVV8tE6EnGwa3tZlHgButJ194zDjEi9sPLs0nlTakZZbC HTCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731527609; x=1732132409; 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=XyiKN4j8ScToVeD29C1kvH+uEOhOz+pcRKy9I30xNm8=; b=dcmcTb73W4l+mm7jMyU59OU/3kn5LYqJpWZXT8P13bG+srC6XCpIP2+YbEt827BdO8 SO2EJCTuVoYPE+ZlmMG4gHdDHuJ3H7odyJ6I1hBKAhWatukzCYE1XWoTPoveENA3qaz1 BQPIYjDu+HjxEt01SKSCJp1mzpMqeqwyUuIfxslBJSkrPIzjQtZNkE2VD3yUyyXBIXbT OQS2sOQO2Pm1tUYjji3RS9O8M5AJASjbss8Wrzjo2xgSqVME49rye54Bp0qjqNw1zTxz m6qfS6u6oCO4qmIa5shEwQV8PRqlSJEqD9Fnt/NcBfRaFPM1SQw3mGgqsxeGF+nVYouQ cARA== X-Forwarded-Encrypted: i=1; AJvYcCUfR0mHc+xj6y6MyrD6r9ooNPgM7C6co4AcemCRqpbCv8qStVmM3IHLm84EIjeLuyDx3ql5fhF4+vPBMAFH@vger.kernel.org, AJvYcCVPEulLlH0/x7sIyu8Skeq/m2wNvqTIYJwvSpB5x0g6vNfxtINY4z6uMVrm3qQaUItmORl30NB8Uufs@vger.kernel.org, AJvYcCW2Y2ywuLZvL7tgflE3/l+aoZGFlSNoaMX6emy49PF7G/ppNuXTDFuGtWrCRZTnA5/BpQteTI8nxKRIGKg=@vger.kernel.org X-Gm-Message-State: AOJu0Ywicyy4aBL3rFFSphokLSoC6IQv6363/jnY57LXKvlN1Ox+BqpK ntlZJFVeR6GXZE+h6AMYDHopyblZikm90M6ezQfbZIGOIGTNeOcr X-Google-Smtp-Source: AGHT+IH5pQOH+tdTlfkMOvIS+MQ4+qFU/bkE57iZL/f5drqJXEIAe1r5ZHxHvXGCYhMteIXIcTN3Ww== X-Received: by 2002:a05:600c:5251:b0:431:5a0e:fa2e with SMTP id 5b1f17b1804b1-432b7515a08mr170581965e9.21.1731527608970; Wed, 13 Nov 2024 11:53:28 -0800 (PST) Received: from playground.localdomain ([86.127.146.72]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432d5503c58sm34633065e9.22.2024.11.13.11.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 11:53:28 -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 v2 5/5] arm64: dts: imx: add imx95 dts for sof Date: Wed, 13 Nov 2024 14:52:40 -0500 Message-Id: <20241113195240.3699-6-laurentiumihalcea111@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113195240.3699-1-laurentiumihalcea111@gmail.com> References: <20241113195240.3699-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 | 74 +++++++++++++++++++ 2 files changed, 75 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 42e6482a31cb..0a313133d013 100644 --- a/arch/arm64/boot/dts/freescale/Makefile +++ b/arch/arm64/boot/dts/freescale/Makefile @@ -269,6 +269,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..3fa4c252e355 --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx95-19x19-evk-sof.dts @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2024 NXP + */ + +/dts-v1/; + +#include "imx95-19x19-evk.dts" + +/ { + reserved-memory { + adma_res: memory@86100000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x86100000 0x0 0x100000>; + no-map; + }; + }; + + sound-wm8962 { + status = "disabled"; + }; + + 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"; + }; + + 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>; }; + }; + }; +}; + +&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>; }; + }; +};