Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing SCMI-mediator feature. #216

Open
wants to merge 14 commits into
base: xen-4.19-xt0.1
Choose a base branch
from

Commits on Oct 8, 2024

  1. access-controller: introduces access-controller framework

    access-controllers are generic binding from the Linux Kernel
    for service/hardware that allow device partitioning.
    In Xen it is used to provide SCMI device ID for the SCMI server.
    This mechanism is used in BASE_SET_DEVICE_PERMISSIONS to
    set permissions for Agents.
    
    Signed-off-by: Volodymyr Babchuk <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    lorc authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    b86b3fc View commit details
    Browse the repository at this point in the history
  2. domain_build: ignore arm,scmi-shmem device when building dom0

    Assign arm,scmi-shmem compatible device device to Xen. This was done
    to prevent copying this node to the Dom0 device tree. arm,scmi-shmem
    node will be created for Domain-0 after assigning agent-id by the SCMI.
    
    Signed-off-by: Volodymyr Babchuk <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    lorc authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    9e577cc View commit details
    Browse the repository at this point in the history
  3. xen/arm: add generic SCI mediator framework

    This patch adds the basic framework for SCI mediator.
    SCI is System Control Interface, which is designed to redirect
    requests from the Domains to Firmware. This will allow the devices,
    passed-through to the different Domains, to access to the System Controls
    (such as clocks/resets etc) by sending requests to the firmware.
    Xen mediates requests between the Domains and the Firmware, also it is
    responsible for permission handling during Domain crateion.
    
    SCI mediator register itself with REGISTER_SCI_MEDIATOR() macro.
    
    At run-time, during initialization, framework calls probe for the first
    matching device in the device-tree. When no device-tree is present - the
    first registered mediator should be probed.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Signed-off-by: Ihor Usyk <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    iusyk authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    d432383 View commit details
    Browse the repository at this point in the history
  4. xen/arm: introduce SCMI-SMC mediator driver

    This is the implementation of SCI interface, called SCMI-SMC driver,
    which works as the mediator between XEN Domains and Firmware (SCP, ATF etc).
    This allows devices from the Domains to work with clocks, resets and
    power-domains without access to CPG.
    
    Originally, cpg should be passed to the domain so it can work with
    power-domains/clocks/resets etc. Considering that cpg can't be split between
    the Domains, we get the limitation that the devices, which are using
    power-domains/clocks/resets etc, couldn't be split between the domains.
    The solution is to move the power-domain/clock/resets etc to the
    Firmware (such as SCP firmware or ATF) and provide interface for the
    Domains. XEN should have an entity, caled SCI-Mediator, which is
    responsible for messages redirection between Domains and Firmware and
    for permission handling.
    
    The following features are implemented:
    - request SCMI channels from ATF and pass channels to Domains;
    - set device permissions for Domains based on the Domain partial
    device-tree. Devices with permissions are able to work with clocks,
    resets and power-domains via SCMI;
    - redirect scmi messages from Domains to ATF.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Signed-off-by: Ihor Usyk <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    iusyk authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    6e8c286 View commit details
    Browse the repository at this point in the history
  5. xen/device_tree: add description to the dt_find_node_by_phandle

    dt_find_node_by_phandle definition lacks description comment.
    Add function description to the public call.
    
    Signed-off-by: Ihor Usyk <[email protected]>
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    iusyk authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    bb2ecac View commit details
    Browse the repository at this point in the history
  6. sci: enable SCMI/SCI for dom0less build

    This feature introduces SCMI support for Dom0less domains.
    During domain creation the following configration is expected:
    Partial device-tree example:
    
    / {
    	firmware {
    		scmi {
    			scmi_reset: protocol@19 {
    			};
    			scmi_pinctrl: protocol@19 {
    				sdio_mux: mux {
    				};
    			};
    		};
    	};
    	passthrough {
    		sdio {
    			pinctrl-0 = <&sdio_mux>;
    			resets = <&scmi_reset 0x1>;
    		};
    	};
    };
    
    Xen parses partial device three and gather nodes that are actually
    used. This can be determined by phandle in partial-device tree for
    this node. The next step is to create "scmi" node in Domain
    device-tree and copy protocol information from Xen device tree
    according to the setup provided in partial device-tree. Information
    will be copied only for the nodes that are used by passthrough devices.
    
    Signed-off-by: Volodymyr Babchuk <[email protected]>
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Grygorii Strashko <[email protected]>
    lorc authored and oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    35ba024 View commit details
    Browse the repository at this point in the history
  7. libs: libxenhypfs - handle blob properties

    libxenhypfs will return blob properties as is. This output can be used
    to retrieve information from the hypfs. Caller is responsible for
    parsing property value.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    1f25534 View commit details
    Browse the repository at this point in the history
  8. xen/arm: Export host device-tree to hypfs

    If enabled, host device-tree will be exported to hypfs and can be
    accessed through /devicetree path.
    Exported device-tree has the same format, as the device-tree
    exported to the sysfs by the Linux kernel.
    This is useful when XEN toolstack needs an access to the host device-tree.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    3dd9385 View commit details
    Browse the repository at this point in the history
  9. tools/arm: add "arm_sci" option to xl.cfg

    This enumeration sets SCI type for the domain. Currently there is
    two possible options: either 'none' or 'scmi_smc'.
    
    'none' is the default value and it disables SCI support at all.
    
    'scmi_smc' enables access to the Firmware from the domains using SCMI
    protocol and SMC as transport.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    ed181f2 View commit details
    Browse the repository at this point in the history
  10. xen: arch: scmi_smc: remove memory mapping for hardware domain

    Mapping for the hardware domain should be done during domain
    construciton as it is done for other domains.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    9d0ae68 View commit details
    Browse the repository at this point in the history
  11. xen: domain_build: Integration of the SCMI mediator to Domain-0

    Integration of the SCMI-Mediator feature to the Domain-0 construction
    process. It includes shared memory node creation and mapping with
    phandle update on the scmi node.
    When creating hardware domain there is a need to set correct phandle
    to the "shmem" property on the scmi node. Shared memory node is
    generated while scmi node is copied as is from Xen device-tree.
    Correct shmem phandle is set during domain device-tree processing.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    81bc6dd View commit details
    Browse the repository at this point in the history
  12. xen: device_tree: Assign devices to the Domain-0 during build

    Assgin devices to the access-controller during Domain-0 build.
    This registers devices in the SCMI server for the Domain-0.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    159fd14 View commit details
    Browse the repository at this point in the history
  13. xen: scmi_dt_maker: Fix code style minor issue

    Remove space before function definition.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    88b2546 View commit details
    Browse the repository at this point in the history
  14. xen/arm: add SCI mediator support for DomUs

    Integration of the SCMI mediator with xen libs:
    - add hypercalls to aquire SCI channel and set device permissions
    for DomUs;
    - add SCMI_SMC nodes to DomUs device-tree based on partial device-tree;
    - SCI requests redirection from DomUs to Firmware.
    
    Signed-off-by: Oleksii Moisieiev <[email protected]>
    Reviewed-by: Volodymyr Babchuk <[email protected]>
    oleksiimoisieiev committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    07a7f97 View commit details
    Browse the repository at this point in the history