blob: 5d3e7d7283721699fe771ff900f17517b8f16d5f [file] [log] [blame]
Jacky Bai4d93d1d2020-07-02 14:39:58 +08001/*
2 * Copyright 2021-2024 NXP
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <assert.h>
7#include <stdint.h>
8
9#include <drivers/scmi-msg.h>
10#include <drivers/scmi.h>
11
12#include <platform_def.h>
13
14#define SMT_BUFFER_BASE 0x2201f000
15#define SMT_BUFFER0_BASE SMT_BUFFER_BASE
16#define SMT_BUFFER1_BASE (SMT_BUFFER_BASE + 0x200)
17
18static struct scmi_msg_channel scmi_channel[] = {
19 [0] = {
20 .shm_addr = SMT_BUFFER0_BASE,
21 .shm_size = SMT_BUF_SLOT_SIZE,
22 },
23};
24
25struct scmi_msg_channel *plat_scmi_get_channel(unsigned int agent_id)
26{
27 assert(agent_id < ARRAY_SIZE(scmi_channel));
28
29 return &scmi_channel[agent_id];
30}
31
32static const char vendor[] = "NXP";
33static const char sub_vendor[] = "";
34
35const char *plat_scmi_vendor_name(void)
36{
37 return vendor;
38}
39
40const char *plat_scmi_sub_vendor_name(void)
41{
42 return sub_vendor;
43}
44
45/* Currently supporting Clocks and Reset Domains */
46static const uint8_t plat_protocol_list[] = {
47 SCMI_PROTOCOL_ID_POWER_DOMAIN,
48 SCMI_PROTOCOL_ID_SENSOR,
49 0U /* Null termination */
50};
51
52size_t plat_scmi_protocol_count(void)
53{
54 return ARRAY_SIZE(plat_protocol_list) - 1U;
55}
56
57const uint8_t *plat_scmi_protocol_list(unsigned int agent_id __unused)
58{
59 return plat_protocol_list;
60}
61
62void imx8ulp_init_scmi_server(void)
63{
64 size_t i;
65
66 for (i = 0U; i < ARRAY_SIZE(scmi_channel); i++) {
67 scmi_smt_init_agent_channel(&scmi_channel[i]);
68 }
69}