From patchwork Wed Jul 26 08:37:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 706620 Delivered-To: patch@linaro.org Received: by 2002:a5d:464f:0:b0:317:2194:b2bc with SMTP id j15csp841161wrs; Wed, 26 Jul 2023 09:26:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3drU11lelCvI3GuekbvzKJFiQR1P6MvPa/CuzbS2qM8Dwshvem8osHuYde9NLZH+yBoZ4 X-Received: by 2002:adf:fc05:0:b0:317:5c8c:3f17 with SMTP id i5-20020adffc05000000b003175c8c3f17mr1671825wrr.66.1690388797667; Wed, 26 Jul 2023 09:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690388797; cv=none; d=google.com; s=arc-20160816; b=aqWEDIy/+22M8PeCfjntJ+YvTWvpMgr+zSProg4EUpIPDBbF40tEt2ZeuzJ8NAJuPJ Cv7n9K4OpFjZcMexMcXMi/5rlMDMqMYjlE7zFgL+3c4zuWp+B6f2OpuNYUdUopV+IjKl WLwwurP4g5fQctKFZee2CSs7WC+MI8m8Aqp23l0ymleooggl58L1pUSQrr4FvgLYqzZG JIKm7/TnGeaRrgJ2hEdKciXpRAJqkx+YZkgFN/w6jVU8uAZYkeMzaO629Djuz9ZGAuva wVFmguDVzIGaQygXr/AJY89JKLizL7hS84ORb7boYTi0w/GdqctSsMs6E2DyfPZz9UdA QroA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Kj0pLUhJ7q22sSndcBIw7r583E69eUmaYfKjv1esbTM=; fh=m4nYqZzoK9SCykCyJ/rhitDYsGwNiXM0bHxVQp6NtlE=; b=ugdlKCaRUSsNUNZklJCO5fdi3ulZxJtoBbITZGHZJzFlAb+J99raW2q9F4aznGJlS5 rlY9X6OPuNfZJL+F/V2zX7Sr5UrA6XAhItOSA/cW0PSPmKzochqV5ns4bvp67ssNszSY F8JO0rRu9Nq+9lqGiy3Yd6+DpPQCHtocQQpAeAqQ7LofRSUCSlc0e29PrJwHU61dyQao J+6SZ87R9vQflTtyvtfOppeQQDPlz1dGJbXwCwj7lk12wxEJbyPvbe3IM16s74XvYg4W g+30gxd/cXe2lyA+vhSWZEglJOIz1QZAcn4H0JYSI43N6Q7EXqT93wOTnUoKVCc2lK46 U+sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HxlU6rzz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id r16-20020a0560001b9000b0031443be87e1si7353525wru.248.2023.07.26.09.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:26:37 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HxlU6rzz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF0F786862; Wed, 26 Jul 2023 18:26:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HxlU6rzz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DFAFD80422; Wed, 26 Jul 2023 18:25:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A814B86784 for ; Wed, 26 Jul 2023 10:38:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-345d2b936c2so5690595ab.0 for ; Wed, 26 Jul 2023 01:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690360711; x=1690965511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Kj0pLUhJ7q22sSndcBIw7r583E69eUmaYfKjv1esbTM=; b=HxlU6rzznPXGrbbHNN+jVrVdse1kAmpy5AR2RGwbpfEkaAirJW0zki9JE6mtMSNV8R zYOdSQMGT6U/JASfiPN2BWuSIFy3SjaLqwHR8+fj1LWF22BJ4+0oN6JF644AH4mw5bSe s0xAZJki5ABsqitYCxdXiMclOnQANj+QvfWY7DGAl7jXZWwyzSKwnKGb3TuA+vpjdvQg AS3F46N3Bhf/e3J6oXx5t1rDbcBFFQMfgYp6Mc+AoS0RL2ChJlHNaBezgPxGYR55Rong rtoWVTLd8jqxqTiS1dBcvmddpuXKgr6m4QPrQZGIHBSyKUh4B1AUdwNHoOUjHt1JFABH qWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690360711; x=1690965511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Kj0pLUhJ7q22sSndcBIw7r583E69eUmaYfKjv1esbTM=; b=Jy+YVn4viDfRgFZUYJwgMID/MG8nZTWBRfWBBLU8dwyayo30Wlcsi1Y/htK6ASrQhC ElrcH71Enrc9DqYaCvZOInJSjUbx5dz3GheHCzrbIWQl5Q05N10wd7dBCVz1uRVnGzwW vLidiW+7Yt1eYBYBpYU+IJGbBgXM0JUnAHaRgXaer0Bd/Q+KxUSSUGp5ySuQbCk3Ux1B 27S7Yiyp6sYBgIpvrR0aS8PsX3gzTUCoaRTT82QBsLZGL8XBNf3iLS0JQWKo/Tqj5CXi L6wAMCdlYU5cLb+jq1km+6JqFgXBuyl3CrIbLYkQ0fmlUXIiLtK+Yo4F2dR+khsS/NM3 8U5w== X-Gm-Message-State: ABy/qLYuLJTpkq91+M5tsKa8K2kMOQimTpqv55NaI906F5ZelAeWQzdA J+vs/CciktwMePad2ndWQTKidQ== X-Received: by 2002:a92:d1d0:0:b0:345:8a74:761b with SMTP id u16-20020a92d1d0000000b003458a74761bmr1143773ilg.1.1690360711467; Wed, 26 Jul 2023 01:38:31 -0700 (PDT) Received: from laputa.. ([2400:4050:c3e1:100:b3f9:1d29:2d48:cb41]) by smtp.gmail.com with ESMTPSA id 16-20020a17090a191000b00263c6b44dd8sm865986pjg.15.2023.07.26.01.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 01:38:24 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org Cc: etienne.carriere@st.com, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v2 00/12] firmware: scmi: add SCMI base protocol support Date: Wed, 26 Jul 2023 17:37:56 +0900 Message-ID: <20230726083808.140780-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This patch series allows users to access SCMI base protocol provided by SCMI server (platform). It will also be utilized in separate patches in the future to add sanity/validity checks for other protocols. See SCMI specification document v3.2 beta[1] for more details about SCMI base protocol. What is currently not implemented is - SCMI_BASE_NOTIFY_ERRORS command and notification callback mechanism This feature won't be very useful in the current U-Boot environment. [1] https://developer.arm.com/documentation/den0056/e/?lang=en Test ==== The patch series was tested on the following platforms: * sandbox * qemu-arm64 with OPTEE as SCMI server Prerequisite: ============= * This patch series is based on v2023.07-rc and relies on the following patch: [2] https://lists.denx.de/pipermail/u-boot/2023-June/520083.html Patches: ======== Patch#1-#5: Add SCMI base protocol driver Patch#6-#9: Add SCMI base protocol device unit test Patch#10-#12: Add scmi command Change history: =============== v2 (Jul, 26, 2023) * refactor devm_scmi_of_get_channel()/process_msg(), removing uses of ops (patch#1) * use helper functions, removing uses of ops (patch#2,#9,#10) * add more descriptions in scmi command doc (patch#11) * remove 'scmi base' sub-command (patch#10,#12) v1 (Jun, 28, 2023) * initial release AKASHI Takahiro (12): scmi: refactor the code to hide a channel from devices firmware: scmi: implement SCMI base protocol firmware: scmi: move scmi_bind_protocols() backward firmware: scmi: framework for installing additional protocols firmware: scmi: install base protocol to SCMI agent sandbox: remove SCMI base node definition from test.dts firmware: scmi: fake base protocol commands on sandbox test: dm: simplify SCMI unit test on sandbox test: dm: add SCMI base protocol test cmd: add scmi command for SCMI firmware doc: cmd: add documentation for scmi test: dm: add scmi command test arch/sandbox/dts/test.dts | 4 - arch/sandbox/include/asm/scmi_test.h | 7 +- cmd/Kconfig | 9 + cmd/Makefile | 1 + cmd/scmi.c | 334 +++++++++++ doc/usage/cmd/scmi.rst | 126 ++++ drivers/clk/clk_scmi.c | 27 +- drivers/firmware/scmi/Makefile | 1 + drivers/firmware/scmi/base.c | 637 +++++++++++++++++++++ drivers/firmware/scmi/sandbox-scmi_agent.c | 379 +++++++++++- drivers/firmware/scmi/scmi_agent-uclass.c | 367 ++++++++++-- drivers/power/regulator/scmi_regulator.c | 27 +- drivers/reset/reset-scmi.c | 19 +- include/dm/uclass-id.h | 1 + include/scmi_agent-uclass.h | 81 ++- include/scmi_agent.h | 29 +- include/scmi_protocols.h | 345 +++++++++++ test/dm/scmi.c | 226 ++++++-- 18 files changed, 2430 insertions(+), 190 deletions(-) create mode 100644 cmd/scmi.c create mode 100644 doc/usage/cmd/scmi.rst create mode 100644 drivers/firmware/scmi/base.c