[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Follow up discussion for: [RFC v2] Introduce SCI-mediator feature


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Peng Fan <peng.fan@xxxxxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Mon, 2 Sep 2024 12:38:22 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=sb3KNOKaW6KGLpVEyerzsgVIoITy3hGl7Vo/g4XvKwc=; b=ERAclKP5SuTd+aKuVQr3b7eGew1deBq2ZaUHcPi3o6veWSEerCGTjZvKJ8wrLPIf5hEEyrKhbUNfCv+hh94SR9eGN2oP98R6wAEe1Fbwfs8v6HbaOcC1fOcc0C8fOHJZ2zeMLtHeLq0b5/TFQP2NE7eopprYRNsanoFI9hcqNI0RyhXW8mm8kwJfCoPXUTqunzxVnt59MA86Dj4uPWX1sIjHbQxDGHupHdaIvplvzPHfPNL4/b1zK5in11odsXBOONmJn1me1J+5G7hgjWyLq7gnLpsyI6cShppqDTbrxDLt57FMEUyOAb0jz221xuj8mPSd8OaxCjDDrI0HviOzHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QBXJToNsu9Yt4gEj/ZQVi61CCjqpRP3ikUSq35M7rRBTc5aiMut6pY1RPs6S487ac2UCngNYcZ0BnMTewbdl0zkxWEozcK0wM8wALI9KhJXd2jGUkIEDj1MQNVpskiTuLmEUQ3/5/zHUozkBFECbOkKTBi7kxZXJj/l6GzoGZPnMSSufxNN/iw5EEY5E2bqwD0h0NfTkaNOEaF/X4zL2wVXQZ1lLqT7lSQI6zHUy/WVrPqvvM7JAIgBfk/s9f+QdwfhyQI/XSB/x6OAP5EpupGihcMDFCAnGrVuChDj8idtPpTZrLW4Rq8Qm4ATzhcqAjY27UEr7DRqUfo/9grhYlA==
  • Cc: "julien@xxxxxxx" <julien@xxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>
  • Delivery-date: Mon, 02 Sep 2024 12:38:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHa/TT/0nIgcrSoPES5n7Kbm0YhpA==
  • Thread-topic: Follow up discussion for: [RFC v2] Introduce SCI-mediator feature

Greetings,

After some time we are back to the development of the SCI-Mediator 
feature presented as RFC few years earlier.
Link to the RFC v2: 
https://lore.kernel.org/all/cover.1644341635.git.oleksii_moisieiev@xxxxxxxx/

Last time feature discussion was stalled at the following point:
- Device-tree bindings should be changed to provide proper device-id for 
SCMI devices which is upstreamed in the Linux Kernel by now:
https://patchew.org/linux/20240105130404.301172-1-gatien.chevallier@xxxxxxxxxxx/20240105130404.301172-2-gatien.chevallier@xxxxxxxxxxx/

That's why we went back to the development of the SCMI-Mediator feature. 
Our current setup is Dom0less with Zephyr as Control domain and Linux as 
DomU.

Hereby I want to start a discussion about the correct approach of adding 
scmi nodes to the partial device tree for domain.

Current device-tree configuration we have for Xen and DomU domain are 
the following:

1) Xen device-tree overlay:
&{/} {
         #address-cells = <0x02>;
         #size-cells = <0x01>;

         sram@3ff00000 {
                 compatible = "mmio-sram";
                 reg = <0x00 0x3ff00000 0x10000>;
                 #address-cells = <0x01>;
                 #size-cells = <0x01>;
                 ranges = <0x00 0x00 0x3ff00000 0x10000>;
                 phandle = <0x03>;

                 scmi_shm_0: scmi_shm@0 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x00 0x1000>;
                 };
                 scmi_shm_1: scmi_shm@1 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x1000 0x1000>;
                 };
                 scmi_shm_2: scmi_shm@2 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x2000 0x1000>;
                 };
                 scmi_shm_3: scmi_shm@3 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x3000 0x1000>;
                 };
                 scmi_shm_4: scmi_shm@4 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x4000 0x1000>;
                 };
                 scmi_shm_5: scmi_shm@5 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x5000 0x1000>;
                 };
                 scmi_shm_6: scmi_shm@6 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x6000 0x1000>;
                 };
                 scmi_shm_7: scmi_shm@7 {
                         compatible = "arm,scmi-shmem";
                         reg = <0x7000 0x1000>;
                 };
         };
};
&{/} {
                 domU {
                         compatible = "xen,domain";
                         ...
                         xen,arm_sci = "scmi-smc";
                 };

};
&{/firmware/} {
         scmi: scmi {
                 compatible = "arm,scmi-smc";
                 arm,smc-id = <0x82000002>;
                 #address-cells = <0x01>;
                 #size-cells = <0x00>;
                 #access-controller-cells = <1>;
                 shmem = <&scmi_shm_0>;

                 epam,secondary-agents = <
                 1 0x82000003 &scmi_shm_1
                 2 0x82000004 &scmi_shm_2
                 3 0x82000005 &scmi_shm_3
                 4 0x82000006 &scmi_shm_4
                 5 0x82000007 &scmi_shm_5
                 6 0x82000008 &scmi_shm_6
                 7 0x82000009 &scmi_shm_7
                 >;

                 scmi_reset: protocol@16 {
                         reg = <0x16>;
                         #reset-cells = <0x01>;
                 };

                 scmi_clock: protocol@14 {
                         reg = <0x14>;
                         #clock-cells = <0x01>;
                         phandle = <0x04>;
                 };
         };
};

&pcie1 {
         resets = <&scmi_reset 0>, <&scmi_reset 1>, <&pcie_rescal>;
         access-controllers = <&scmi 1>;
};

As can be seen from overlay Xen reading the following information:
1) Shared memory configuration as a list of shared memory pages. They 
will not go to the Control domain device-tree.
2) SCMI configuration for Agent-id 0, which is Xen itself. This agent is 
responsible to set the device permissions for acces-controller device
3) epam,secondary-agents (name probably should be changed) is the list 
of objects and corresponding shmems and smc-id for agents. Please note 
that all agents will use smc-id 0x82000002
and Xen-Mediator will make a calculation and provide agent-specific 
smc-id for ARM-TF
4) List of scmi protocols and access-controller id, where scmi is 
accss-controller device
5) domU configuration has xen,arm_sci = "scmi-smc" to enable scmi support

- DomU Domain device-tree

/{
         scmi { 

                  scmi_reset: protocol@16 {
                       reg = <0x16>;
                       #reset-cells = <0x01>;
                  };
         };
        passthrough {
        
                 pciex: pcie@1000120000 {
                         compatible = "brcm,bcm2712-pcie";
                         ...
                         resets = <&scmi_reset 1>, &<scmi_reset 2>;
                         ...

                 };
        }
};

Where scmi node (similar to GIC could be either empty node, which will 
be recreated by XEN). Hardcoded device-tree phandle as was done for GIC 
is not supported because for scmi-pinctrl protocol there are no static 
subnode configuration.
During domain creation Xen mediator code will create scmi node with 
existing phandle and create a complete domain device-tree. Xen will use 
original xen device-tree as a base to create scmi nodes. It can use it 
either directly in dom0less mode or tools can read Xen device from hypfs 
to create device tree entries for DomUs.

Similar approach we expect when creating domain using Xen toolstack.


Comments are appreciated.
-- 
Best regards,
Oleksii.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.