From patchwork Fri Apr 12 10:47:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13627583 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2057.outbound.protection.outlook.com [40.107.241.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D6B13611A for ; Fri, 12 Apr 2024 10:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712918362; cv=fail; b=gGsZdnYEYBd+qMSr4Hd3P+iQFUQPw4k7Qz+gC1DG92pTSZM5eOOfQlX4PuYy7CII5ClhGMJPntG3Dl+LKcZxcWKZb4NQyt/wj+dpxxwPLuEEwsRmJmDTY47x6r2M82cf/IUuPV2vgiyLYuNIsLDFmKb3Et5DYaL+Fwk3MQmNo2Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712918362; c=relaxed/simple; bh=6yyXhWvNixHa2zUsDLll+uJ47f/KwcBvyL8EziSlrLo=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=HVZNZt4hO3nhvBYe6C+X8bxlCYGhB0LvHqVBZ3bcBYkFyslSppnKj2brsBXBOhmF8Sp+/p/Bp/XXS4RQAJEg/vOnXrxiWwY/hDEmHAgMoHeDME1cSBQZ3QvzgzAc0vfCW+m+Zs7ZOs1n+cA7NJn9JWZChxwpldZ5gBaqneXwejI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=SZ/V1cWb; arc=fail smtp.client-ip=40.107.241.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="SZ/V1cWb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XPw1IuSEG+tdVqhPA89vU8C22gV0sdhvnnTO3zA4QCmmJCUDpv4wMrsF/Lmo2FA0iL8i4VgYhVW7j3UhGaeLOpQIcxtTO60PAmLs6Xty7gAo+MtmJ3Kkf0bjL3my3qJv1zCRoi80HTTwkSEnIC5TpGOBApW0gatW5OUpuFSuefOLLIzhxs64PzA8gkRldW/agWY0g6W50+dsvlivIF2MfDlRWCLkqq7TixIRw069LFgfdBxM5AWMCs9GRRNgwCDnYxZuljtYTSh0qDhqO7NBTtrxX+eozOx96kglDD1cN9RqcpmEOVna+2ouE6nMtR81Lu+xSZib92PngiGS++Ciyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lGcWfAe1DmMqICbKuntNjhNkpxKonnPoCvBw6vbQPDM=; b=Ki6mXsQTC8Ub8QeJlAPG8axDSOgTxza4Pbxsp4ycjYy9V5rvKNsu545OO/XZurdvAyoONLsHP6uMvkqs5tJIvL/p+pME0Z33mh626Y0UBh7YR03ZYGkzcULbDI2WsfUm7iCX0HNXxvEa0nseUV7o9sSVIW2bmJVAMH5fWIMF9rtdFhj9E0SavP3nxcRBOLbzY1q0f9moemhETMd1D/wfx91jT1vaDz3b97IZqgTKxjcSjwzJa6d8bX7Qy+XB/i/q6ppybYXGLKechCepMKDz3PQV8px1dYYOWuIsurcKkpzW3x2Nyywi3MdVvCYXQIpfOjWp6ZAxTWgXHMOY8JFUbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lGcWfAe1DmMqICbKuntNjhNkpxKonnPoCvBw6vbQPDM=; b=SZ/V1cWbOod5vw1Yts8iAG6XS1AhMp8QmnkcyoDo5g2o5lR557sy7WPA2IMmbG3wbT454vLGcf33SARMD0JUKWz8NrsfLRArR37+7ZUCD47bdHFqkCle4N3JdYklCZeuH4TEBcJgeRHYiYA4uvuCEUdI0vpqV6gBkCvT5RZc21c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PA4PR04MB9416.eurprd04.prod.outlook.com (2603:10a6:102:2ab::21) by VI2PR04MB10147.eurprd04.prod.outlook.com (2603:10a6:800:21e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.56; Fri, 12 Apr 2024 10:39:16 +0000 Received: from PA4PR04MB9416.eurprd04.prod.outlook.com ([fe80::9d65:d883:afbd:7f54]) by PA4PR04MB9416.eurprd04.prod.outlook.com ([fe80::9d65:d883:afbd:7f54%3]) with mapi id 15.20.7409.039; Fri, 12 Apr 2024 10:39:16 +0000 From: "Peng Fan (OSS)" Subject: [PATCH v3 0/6] firmware: support i.MX95 SCMI BBM/MISC Extenstion Date: Fri, 12 Apr 2024 18:47:06 +0800 Message-Id: <20240412-imx95-bbm-misc-v2-v3-0-4380a4070980@nxp.com> X-B4-Tracking: v=1; b=H4sIACoRGWYC/32NQQ6DIBBFr2Jm3WnoFIx05T0aFwpYZwEaaAyN4 e6lHqDJ37yf/PcPSC6yS/BoDohu58RrqHC/NGCWMbwcsq0MJEgKKRSyz1rhNHn0nAzuhJNy2pI crZEEdbdFN3M+nc+h8sLpvcbPebHTr/1nqxGoZ6NvXdup1lAf8nY1q4ehlPIFRlfj6bAAAAA= To: Jonathan Corbet , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Cristian Marussi Cc: Peng Fan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1712918849; l=4715; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=6yyXhWvNixHa2zUsDLll+uJ47f/KwcBvyL8EziSlrLo=; b=McT066kEwNvv3XG3N8fIod2jOjL+/W2S49YEAJ4ExwDPp205lyG1yEXebc52e/JKivd/tcMkX JmnvgtS2fsPCyj7ta3gEb6/TZi83ZL3ispGEtjgucLgc1E8Gv+29Afh X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR06CA0243.apcprd06.prod.outlook.com (2603:1096:4:ac::27) To PA4PR04MB9416.eurprd04.prod.outlook.com (2603:10a6:102:2ab::21) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9416:EE_|VI2PR04MB10147:EE_ X-MS-Office365-Filtering-Correlation-Id: dbe552f2-cefd-4c3b-2443-08dc5adcccd9 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GXv8Sqi7xlYP8ri4V6D9ySveG9FFTNwMvXnJQPY3Outq3Tlh1w0l+hWr5fGuUlZ+JZw2yz05bZ0izE1QutAhYbXj5K2f3hV+7WKXlCYGt7qCASo2DAH9GDjlnNsksm/q+SiYGLy5DIijFsYzBqtz8p8mcXSyJ9xybfevUZmjxbpIVaOstVNS5oqsZjZuxhYnr0bH/gHEb5PsHPvu+uMAM+DeovhwUwkqBKsN3X/t38S9pjjvCd1ZW7geNdknPnV1KZDwDRZxaw4NmWONkihkw3l/A07OkyhMoAIlfIl46pQc8OAgVcwkEcBfeHXxSXxxMj7MYffL1wKo636M6qG1qQ+RphdLXFiljPQh60xlFkrXwA9c8jNiJm9A7qyVkmSuDD3+DwaLEdwDbNxD+gDmAHA1dp8lUE4Nn5tFSBlDWTKe7i1mM+l/niHEmxXtmo896dgtFtXtKaO0GcBS29i1AgBzncQd1YszzhwXuQD+yqTB39ynK/6l/O0Gvb4e3cisaWnZ0fgVQf+CawkKjq3gov1N7/OH0PSA8PsGhYy5tKFz6aEk90b1rsLnM56wDwpPZPKIDm0P17xpkjqLxFXgHrSq1m7bdbMqY/lf7JAiBpIk/tWWRFtbyyhK6IjWeEII8jdo22g8fyGdCoebVuRGnUFZFhE5Oxx37hssmK2VDFzff/EgdGnYzHmU9hXKW07HnuOzo3qi9fyHADEVOnwMcAeF5t2eBsxE8NoIVFE7oVAT1KK9U4CscEuVYTyv4lBL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR04MB9416.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(52116005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkC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s6K1zonsEghzrEfY5iLEKfd7eTEbzfHQg9U11cKZS1FZi3avBfYl3?= =?utf-8?q?wC/QThQAUsyFhRRv5xB0IZqbPqfk/6oVt0QyHDfGVX+gS96uyiaB6G+KTzdlyJ5cz?= =?utf-8?q?Hn2rRs7c8NBY2Vy+ttnzpMmd0S0q1pX1G5v14heYhQHmtlXB7nlfwAmpO00YSyRYw?= =?utf-8?q?TxfFA9D2+jUYAWjFgTc7M7StgYlqzdqY+wMpZkraqLcNd1gUHc5/Qlz+TteFlZPfU?= =?utf-8?q?mV/WKvQU0w++j26YTzJJlkiXFCthtGd3K9lCPLHToWYsdCOrk5jxKjnlkGu3CA5p7?= =?utf-8?q?y9WrLP+MbCN2fhj1K/1sb31Z0TR7EvMNp5zAvk+CdLUlNGVkPs8Y6dc41bC7WEoZv?= =?utf-8?q?9stke8Nj35Bw3EEyYKF0rMo26GJdZI/hlwZXPpG8WBjYxfNqazfoeuF1CXBQ2BdnM?= =?utf-8?q?ubNYqtfDOkQ5n1i7/zDE45hGOWwcev4TF54wpm3M6edZ/Pmp5pBqodBDbFuL7Mn9W?= =?utf-8?q?XhKfF4/uyGasgw12HenrHrvqaX/rsumYNh7j1h7bVNnJ8imfxvSdIA1uNK4pWjMJF?= =?utf-8?q?jwgVchh/u1AMZl2rcZJaBK1qGUDPho65ustTzQHyizaxEsWq9mDVp6jUcOajXduK9?= =?utf-8?q?iSjLTgag7dURjudTMYkVMz0TyfEAP5fiA0n5ngZgjRa6DujeFfffuwqt1UQ89BnAc?= =?utf-8?q?jbQftf9HP7mB?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbe552f2-cefd-4c3b-2443-08dc5adcccd9 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9416.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 10:39:15.8450 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jd2cBiIqK3b5WVeRGvo2tXdkkXS+HYrLSK6VxAZRqy1jshJSbsMu/7yr2SN9JW84di4e7c05bTHOAxecDXx9gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10147 i.MX95 System Manager Firmware source: https://github.com/nxp-imx/imx-sm To generate html from the repo: make html i.MX95 System Manager Firmware support vendor extension protocol: - Battery Backed Module(BBM) Protocol This protocol is intended provide access to the battery-backed module. This contains persistent storage (GPR), an RTC, and the ON/OFF button. The protocol can also provide access to similar functions implemented via external board components. The BBM protocol provides functions to: - Describe the protocol version. - Discover implementation attributes. - Read/write GPR - Discover the RTCs available in the system. - Read/write the RTC time in seconds and ticks - Set an alarm (per LM) in seconds - Get notifications on RTC update, alarm, or rollover. - Get notification on ON/OFF button activity. - MISC Protocol for misc settings This includes controls that are misc settings/actions that must be exposed from the SM to agents. They are device specific and are usually define to access bit fields in various mix block control modules, IOMUX_GPR, and other GPR/CSR owned by the SM. This protocol supports the following functions: - Describe the protocol version. - Discover implementation attributes. - Set/Get a control. - Initiate an action on a control. - Obtain platform (i.e. SM) build information. - Obtain ROM passover data. - Read boot/shutdown/reset information for the LM or the system. This patchset is to support the two protocols and users that use the protocols. The upper protocol infomation is also included in patch 1 Signed-off-by: Peng Fan To: Jonathan Corbet To: Shawn Guo To: Sascha Hauer To: Pengutronix Kernel Team To: Fabio Estevam To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Sudeep Holla To: Cristian Marussi To: Peng Fan Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Changes in v3: - Update cover letter and patch commit log to include more information. - Add documentation for BBM and MISC protocols under Documentation/firmware-guide/nxp. Not sure if this is a good place. - Fix the bindings, hope I have addressed the issues. Drop imx,scmi.yaml. Add nxp,imx95-scmi.yaml for NXP vendor protocol properties. Add constraints, add nxp prefix for NXP vendor properties. Use anyOf in arm,scmi.yaml to ref vendor yaml. - Use cpu_to_le32 per Cristian - Link to v2: https://lore.kernel.org/r/20240405-imx95-bbm-misc-v2-v2-0-9fc9186856c2@nxp.com Changes in v2: - Sorry for late update since v1. - Add a new patch 1 - Address imx,scmi.yaml issues - Address comments for imx-sm-bbm.c and imx-sm-misc.c - I not add vendor id since related patches not landed in linux-next. - Link to v1: https://lore.kernel.org/r/20240202-imx95-bbm-misc-v1-0-3cb743020933@nxp.com --- Peng Fan (6): Documentation: firmware-guide: add NXP i.MX95 SCMI documentation dt-bindings: firmware: add i.MX95 SCMI Extension protocol firmware: arm_scmi: add initial support for i.MX BBM protocol firmware: arm_scmi: add initial support for i.MX MISC protocol firmware: imx: support BBM module firmware: imx: add i.MX95 MISC driver .../devicetree/bindings/firmware/arm,scmi.yaml | 21 + .../bindings/firmware/nxp,imx95-scmi.yaml | 36 + Documentation/firmware-guide/index.rst | 10 + Documentation/firmware-guide/nxp/imx95-scmi.rst | 877 +++++++++++++++++++++ Documentation/firmware-guide/nxp/index.rst | 10 + drivers/firmware/arm_scmi/Kconfig | 20 + drivers/firmware/arm_scmi/Makefile | 2 + drivers/firmware/arm_scmi/imx-sm-bbm.c | 378 +++++++++ drivers/firmware/arm_scmi/imx-sm-misc.c | 305 +++++++ drivers/firmware/imx/Makefile | 2 + drivers/firmware/imx/sm-bbm.c | 317 ++++++++ drivers/firmware/imx/sm-misc.c | 92 +++ include/linux/firmware/imx/sm.h | 33 + include/linux/scmi_imx_protocol.h | 62 ++ 14 files changed, 2165 insertions(+) --- base-commit: 9ed46da14b9b9b2ad4edb3b0c545b6dbe5c00d39 change-id: 20240405-imx95-bbm-misc-v2-b5e9d24adc42 Best regards,