All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr <olekstysh@gmail.com>
To: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [RFC v1 0/5] Introduce SCI-mediator feature
Date: Thu, 16 Dec 2021 02:33:28 +0200	[thread overview]
Message-ID: <c8739251-3e13-2337-0ae8-cfae59397251@gmail.com> (raw)
In-Reply-To: <cover.1639472078.git.oleksii_moisieiev@epam.com>


On 14.12.21 11:34, Oleksii Moisieiev wrote:


Hi Oleksii

> Introducing the feature, called SCI mediator.
> It's purpose is to redirect SCMI requests from the domains to firmware
> (SCP, ATF etc), which controls the power/clock/resets etc.
> The idea is to make SCP firmware (or similar, such as AT-F) responsible for
> control power/clock/resets and provide SCMI interface so controls can be shared
> between the Domains.
> Originally, we've met a problem, that the devices, shared between different
> Domains, can't have an access to HW registers to work with clocks/resets/power
> etc. You have to pass cpg to the Domain, so the devices can access HW directly.
> The solution for this is to move HW controls over power/clock/resets to
> SCP firmware and use Linux-kernel SCMI drivers to pass requests to SCP.
> Xen is responsible for permissions setting, so Domain can access only to
> power/clock/resets which are related to this Domain. Also XEN is the mediator
> which redirects SCMI requests, adding agentID so firmware should know the
> sender.
> SMC is currently used as transport, but this should be configurable.
>
> Here is the high level design:
>
> SCI (System Control Interface) feature can be enabled in xen_config:
>> CONFIG_SCI=y
> Mediator can be configured:
>> CONFIG_SCMI_SMC=y
> Currently, only SCMI_SMC mediator is implemented, which using shared memory
> region to communicate with firmware and SMC as transport.
>
> Xen scmi should be configured in the device-tree.
> Format is the following:
> 	cpu_scp_shm: scp-shmem@0x53FF0000 {
> 		compatible = "arm,scmi-shmem";
> 		reg = <0x0 0x53FF0000 0x0 0x1000>;
> 	};
>
> 	firmware {
> 		scmi {
> 			compatible = "arm,scmi-smc";
> 			arm,smc-id = <0x82000002>;
> 			shmem = <&cpu_scp_shm>;
> 			#address-cells = <1>;
> 			#size-cells = <0>;
>
> 			scmi_power: protocol@11 {
> 				reg = <0x11>;
> 				#power-domain-cells = <1>;
> 			};
>
> 			scmi_clock: protocol@14 {
> 				reg = <0x14>;
> 				#clock-cells = <1>;
> 			};
>
> 			scmi_reset: protocol@16 {
> 				reg = <0x16>;
> 				#reset-cells = <1>;
> 			};
> 		};
> 	};
>
> Where:
> &cpu_scp_shm is the shared memory for scmi buffers;
> 0x53FF0000, size 0x1000 is the platform specific free address, which provide
> space for the communication.
> &scmi node, which should be copied to Dom0 device-tree.
>
> Device configured to use scmi:
> &avb {
> 	scmi_devid = <0>;
> 	clocks = <&scmi_clock 0>;
> 	power-domains = <&scmi_power 0>;
> 	resets = <&scmi_reset 0>;
> };
>
> Where:
> scmi_devid - id from the firmware, which is assigned for AVB.
>
> During initialization, XEN scans probes the first SCI-mediator driver which has
> matching node in the device-tree. If no device-tree was provided, then the
> first registered mediator driver should be probed.
>
> DomX should be configured:
> Device-tree should include the same nodes, described above.
> &cpu_scp_shm should be altered during domain creation. Xen allocates free page
> from the memory region, provided in &cpu_scp_shm in XEN device-tree, so each
> domain should have unique page. Nodes &cpu_scp_shm and /firmware/scmi should be
> copied from partial device-tree to domain device-tree, so kernel can initialize
> scmi driver.
>
> SCI mediator can be enabled in dom.cfg the following way:
>> sci = "scmi_smc"
> which sets scmi_smc to be used for the domain.


Great work! I can imagine this is going to be nice feature once upstreamed.

I am wondering, would the Xen (with the required updates of course) also 
be able to send it's own requests to the SCP? For example, to control 
overall system performance (CPU frequency)

or other let's say important power management task.


>
> Oleksii Moisieiev (5):
>    xen/arm: add support for Renesas R-Car Gen3 platform
>    xen/arm: add generic SCI mediator framework
>    xen/arm: introduce SCMI-SMC mediator driver
>    tools/arm: add "scmi_smc" option to xl.cfg
>    xen/arm: add SCI mediator support for DomUs
>
>   MAINTAINERS                       |   6 +
>   docs/man/xl.cfg.5.pod.in          |  22 +
>   tools/include/libxl.h             |   5 +
>   tools/include/xenctrl.h           |   3 +
>   tools/include/xenguest.h          |   2 +
>   tools/libs/ctrl/xc_domain.c       |  23 +
>   tools/libs/guest/xg_dom_arm.c     |   5 +-
>   tools/libs/light/libxl_arm.c      | 122 ++++-
>   tools/libs/light/libxl_create.c   |  54 +-
>   tools/libs/light/libxl_dom.c      |   1 +
>   tools/libs/light/libxl_internal.h |   4 +
>   tools/libs/light/libxl_types.idl  |   6 +
>   tools/xl/xl_parse.c               |   9 +
>   xen/arch/arm/Kconfig              |  10 +
>   xen/arch/arm/Makefile             |   1 +
>   xen/arch/arm/domain.c             |  24 +
>   xen/arch/arm/domain_build.c       |  11 +
>   xen/arch/arm/domctl.c             |  15 +
>   xen/arch/arm/platforms/Makefile   |   1 +
>   xen/arch/arm/platforms/rcar3.c    |  47 ++
>   xen/arch/arm/sci/Kconfig          |  10 +
>   xen/arch/arm/sci/Makefile         |   2 +
>   xen/arch/arm/sci/sci.c            | 128 +++++
>   xen/arch/arm/sci/scmi_smc.c       | 795 ++++++++++++++++++++++++++++++
>   xen/arch/arm/setup.c              |   1 +
>   xen/arch/arm/xen.lds.S            |   7 +
>   xen/include/asm-arm/domain.h      |   4 +
>   xen/include/asm-arm/sci/sci.h     | 162 ++++++
>   xen/include/public/arch-arm.h     |  11 +
>   xen/include/public/domctl.h       |   9 +
>   30 files changed, 1485 insertions(+), 15 deletions(-)
>   create mode 100644 xen/arch/arm/platforms/rcar3.c
>   create mode 100644 xen/arch/arm/sci/Kconfig
>   create mode 100644 xen/arch/arm/sci/Makefile
>   create mode 100644 xen/arch/arm/sci/sci.c
>   create mode 100644 xen/arch/arm/sci/scmi_smc.c
>   create mode 100644 xen/include/asm-arm/sci/sci.h
>
-- 
Regards,

Oleksandr Tyshchenko



  parent reply	other threads:[~2021-12-16  0:34 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  9:34 [RFC v1 0/5] Introduce SCI-mediator feature Oleksii Moisieiev
2021-12-14  9:34 ` [RFC v1 1/5] xen/arm: add support for Renesas R-Car Gen3 platform Oleksii Moisieiev
2021-12-15  6:38   ` Oleksandr Andrushchenko
2021-12-15 20:08     ` Oleksii Moisieiev
2021-12-15  9:39   ` Julien Grall
2021-12-17 10:48     ` Oleksii Moisieiev
2021-12-15  9:57   ` Oleksandr Tyshchenko
2021-12-17 10:52     ` Oleksii Moisieiev
2021-12-14  9:34 ` [RFC v1 2/5] xen/arm: add generic SCI mediator framework Oleksii Moisieiev
2021-12-17  2:45   ` Stefano Stabellini
2021-12-17 12:50     ` Oleksii Moisieiev
2021-12-14  9:34 ` [RFC v1 3/5] xen/arm: introduce SCMI-SMC mediator driver Oleksii Moisieiev
2021-12-17 11:35   ` Oleksandr
2021-12-17 13:23     ` Oleksii Moisieiev
2021-12-17 13:37       ` Julien Grall
2021-12-17 13:58         ` Oleksii Moisieiev
2021-12-17 16:38           ` Julien Grall
2021-12-20 15:41             ` Oleksii Moisieiev
2021-12-24 14:42               ` Julien Grall
2021-12-24 17:02                 ` Oleksii Moisieiev
2022-01-03 13:14                   ` Julien Grall
2022-01-06 13:53                     ` Oleksii Moisieiev
2022-01-06 14:02                       ` Julien Grall
2022-01-06 15:43                         ` Oleksii Moisieiev
2022-01-06 16:04                           ` Julien Grall
2022-01-06 16:28                             ` Oleksii Moisieiev
2022-01-19 10:37                             ` Oleksii Moisieiev
2022-01-20  2:10                               ` Stefano Stabellini
2022-01-20 10:25                                 ` Oleksii Moisieiev
2021-12-18  2:14   ` Stefano Stabellini
2021-12-20 18:12     ` Oleksii Moisieiev
2021-12-21  0:52       ` Stefano Stabellini
2021-12-21 20:03         ` Oleksii Moisieiev
2021-12-21 21:22           ` Stefano Stabellini
2021-12-22 11:04             ` Oleksii Moisieiev
2021-12-23  2:23               ` Stefano Stabellini
2021-12-23 18:45                 ` Volodymyr Babchuk
2021-12-23 19:06                 ` Oleksii Moisieiev
2021-12-24  0:16                   ` Stefano Stabellini
2021-12-24 13:29                     ` Julien Grall
2021-12-24 13:59                       ` Oleksii Moisieiev
2021-12-24 14:28                         ` Julien Grall
2021-12-24 16:49                           ` Oleksii Moisieiev
2022-01-03 14:23                             ` Julien Grall
2022-01-06 15:19                               ` Oleksii Moisieiev
2021-12-24 14:07                     ` Oleksii Moisieiev
2022-01-19 12:04                 ` Oleksii Moisieiev
2022-01-20  1:28                   ` Stefano Stabellini
2022-01-20 10:21                     ` Oleksii Moisieiev
2022-01-20 22:29                       ` Stefano Stabellini
2022-01-21 15:07                         ` Oleksii Moisieiev
2022-01-21 20:49                           ` Stefano Stabellini
2022-01-24 18:22                             ` Oleksii Moisieiev
2022-01-24 19:06                               ` Stefano Stabellini
2022-01-24 19:26                                 ` Julien Grall
2022-01-24 22:14                                   ` Stefano Stabellini
2022-01-25 14:35                                     ` Oleksii Moisieiev
2022-01-25 21:19                                       ` Stefano Stabellini
2022-01-27 18:11                                         ` Oleksii Moisieiev
2022-01-27 21:18                                           ` Stefano Stabellini
2021-12-14  9:34 ` [RFC v1 4/5] tools/arm: add "scmi_smc" option to xl.cfg Oleksii Moisieiev
2021-12-15 21:51   ` Oleksandr
2021-12-17 11:00     ` Oleksii Moisieiev
2021-12-21  0:54   ` Stefano Stabellini
2021-12-22 10:24     ` Oleksii Moisieiev
2021-12-23  2:23       ` Stefano Stabellini
2021-12-23 19:13         ` Oleksii Moisieiev
2021-12-21 13:27   ` Anthony PERARD
2021-12-22 12:20     ` Oleksii Moisieiev
2021-12-14  9:34 ` [RFC v1 5/5] xen/arm: add SCI mediator support for DomUs Oleksii Moisieiev
2021-12-14  9:41   ` Jan Beulich
2021-12-16 17:36     ` Oleksii Moisieiev
2021-12-17  7:12       ` Jan Beulich
2021-12-17  7:16         ` Jan Beulich
2021-12-17 13:40           ` Oleksii Moisieiev
2021-12-16  0:04   ` Oleksandr
2021-12-17 12:15     ` Oleksii Moisieiev
2021-12-21 14:45       ` Anthony PERARD
2021-12-21 21:39         ` Stefano Stabellini
2021-12-22  9:24           ` Julien Grall
2021-12-22 11:17             ` Volodymyr Babchuk
2021-12-22 11:30               ` Julien Grall
2021-12-22 12:34                 ` Volodymyr Babchuk
2021-12-22 13:49                   ` Julien Grall
2021-12-23  2:23                     ` Stefano Stabellini
2021-12-23 19:06                       ` Stefano Stabellini
2021-12-24 13:30                         ` Julien Grall
2022-01-19  9:40                           ` Oleksii Moisieiev
2022-01-20  1:53                             ` Stefano Stabellini
2022-01-20 10:27                               ` Oleksii Moisieiev
2021-12-23 19:11                       ` Oleksii Moisieiev
2021-12-21  1:37   ` Stefano Stabellini
2021-12-22 13:41     ` Oleksii Moisieiev
2021-12-16  0:33 ` Oleksandr [this message]
2021-12-17 12:24   ` [RFC v1 0/5] Introduce SCI-mediator feature Oleksii Moisieiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8739251-3e13-2337-0ae8-cfae59397251@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Oleksii_Moisieiev@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.