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

Rcar gen4 v2.7 v4x scmi base #21

Open
wants to merge 10 commits into
base: rcar_gen4_v2.7_v4x-scmi
Choose a base branch
from

Conversation

GrygiriiS
Copy link

@GrygiriiS GrygiriiS commented Oct 7, 2024

Add basic SCMI server support for Renesas rcar gen4 V4H platform.

The SCMI is controlled by option SCMI_SERVER_SUPPORT and enabled by default.

SCMI build options:
- RCAR_SCMI_SHMEM_BASE the SCMI shmem base address. Now set to 0x47ff0000
- SCMI_NUM_AGENTS number of Agents (default 8)
- RCAR_SIP_SMC_SCMI == 0x82000002

Linux kernel:
https://github.com/GrygiriiS/linux/tree/gen4-v5.10.147-rcar-5.2.0.rc17_scmi_pd

Linux kernel log:

[    0.000000] Linux version 5.10.147+ (grygorii@epuakyiw0a98) (aarch64-zephyr-elf-gcc (Zephyr SDK 0.16.3) 12.2.0, GNU ld (Zephyr SDK 0.16.3) 2.38) #86 SMP PREEMPT Fri Oct 4 18:51:49 EEST 2024
...
[    0.109686] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    0.109734] arm-scmi firmware:scmi: SCMI Protocol v2.0 'EPAM:' Firmware version 0x0
[    0.109800] arm-scmi firmware:scmi: SCMI protocol 17 not implemented
[    0.109805] arm-scmi firmware:scmi: SCMI protocol 22 not implemented

Linux CFG:

+CONFIG_ARM_SCMI_PROTOCOL=y
+CONFIG_COMMON_CLK_SCMI=y
+CONFIG_SENSORS_ARM_SCMI=y
+CONFIG_IIO_SCMI=y

Linux DT:

+       scmi_shm_0: sram@47ff0000 {
+               compatible = "arm,scmi-shmem";
+               reg = <0x0 0x47ff0000 0x0 0x1000>;
+       };
+
+       firmware {
+               scmi: scmi {
+                       compatible = "arm,scmi-smc";
+                       arm,smc-id = <0x82000002>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #access-controller-cells = <1>;
+                       shmem = <&scmi_shm_0>;
+
+                       scmi_pd: protocol@11 {
+                               reg = <0x11>;
+                               #power-domain-cells = <1>;
+                       };
+
+                       scmi_reset: protocol@16 {
+                               reg = <0x16>;
+                               #reset-cells = <1>;
+                       };
+               };
+       };

etienne-lms and others added 10 commits September 27, 2024 12:22
Corrects the size of the SCMI response payload when querying the list
of the supported protocol. This response payload size depends on the
number of protocols enumerated by the response.

Change-Id: Ib01eb5cec6c6656dfd7d88ccdd5a720c1deee7a3
Reported-by: Nicolas Frattaroli <[email protected]>
Signed-off-by: Etienne Carriere <[email protected]>
(cherry picked from commit d323f0c)
Corrects the function reporting the SCMI protocols supported by the
platform to not assume 8 protocol IDs at most can be returned. Indeed
the number of protocol IDs returned depends on the SCMI output buffer
size.

Change-Id: Idafbe02d2b25b3bcacaf25977c560c0ac5bb8d62
Signed-off-by: Etienne Carriere <[email protected]>
(cherry picked from commit cad90b5)
Fix compilation error when scmi base in enabled.
The following compilation error is visible:
drivers/scmi-msg/base.c: In function 'discover_list_protocols':
include/lib/utils_def.h:70:20: error: comparison of distinct
 pointer types lacks a cast [-Werror]
   70 |         (void)(&_x == &_y);             \
      |                    ^~
drivers/scmi-msg/base.c:154:25: note: in expansion of macro 'MIN'
  154 |                 count = MIN(count - a2p->skip,
 msg->out_size - sizeof(p2a));

Change-Id: I79e60d4bc9c4f6e78a76099a36ebf4fe5212a7d1
Signed-off-by: Michal Simek <[email protected]>
(cherry picked from commit 7c38934)
Pass "start_idx" to plat_scmi_clock_rates_array.
This parameter is required to obtain the rate table
a second time.

Signed-off-by: XiaoDong Huang <[email protected]>
Change-Id: I97c6751e7d34c839ced8f22bddc39fb534978cc4
(cherry picked from commit ca9d6ed)
LF-4715-1 drivers: scmi-msg: add sensor support

Add scmi sensor support

Signed-off-by: Peng Fan <[email protected]>
Signed-off-by: Jacky Bai <[email protected]>
Change-Id: I810e270b138bf5486b32df121056bfa5103c129f
(cherry picked from commit e63819f)
Existing SCMI code already has parts for support multiple agents. Extend
this by providing:

- plat_scmi_agent_count() function that returns the number of agents
supported by a platform.
- plat_scmi_agent_get_name() function that returns agent name.

And ensure proper agent_count passed to the agents in
SCMI_PROTOCOL_ATTRIBUTES message.

Change-Id: I60374842f6fbf457c5da6459161ead301920cfd2
Signed-off-by: Volodymyr Babchuk <[email protected]>
Signed-off-by: Grygorii Strashko <[email protected]>
Reviewed-by: Oleksii Moisieiev <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
This call provides basic information about an agent.

Change-Id: I857ca7f09bd85679e4743e81cd0762d865e6072a
Signed-off-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Oleksii Moisieiev <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
Implement BASE_SET_DEVICE_PERMISSIONS and
BASE_RESET_AGENT_CONFIGURATION calls. Add platform-specific callback
that return number of SCMI devices, array with device permission and a
function to reset a SCMI device to a default state.

Change-Id: Idd0e17b95649102c5b8a46c8fb41cbee730dc7d6
Signed-off-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Oleksii Moisieiev <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
Add platform plat_scmi_rstd_permitted() callback to check SCMI Agent access
permissions for Reset domain.

Signed-off-by: Grygorii Strashko <[email protected]>
Reviewed-by: Oleksii Moisieiev <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
This patch adds basic SCMI server support to Renesas rcar gen4.
The SCMI is controled by option SCMI_SERVER_SUPPORT and enabled by default.

SCMI build options:
- RCAR_SCMI_SHMEM_BASE the SCMI shmem base address
- SCMI_NUM_AGENTS number of Agents (default 8)

Signed-off-by: Grygorii Strashko <[email protected]>
@GrygiriiS
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants