firmware: ti_sci: Remove inline keyword from functions
[platform/kernel/u-boot.git] / drivers / firmware / ti_sci.c
index a2beb00..facc070 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/soc/ti/ti_sci_protocol.h>
 
 #include "ti_sci.h"
+#include "ti_sci_static_data.h"
 
 /* List of all TI SCI devices active in system */
 static LIST_HEAD(ti_sci_list);
@@ -133,8 +134,11 @@ static struct ti_sci_xfer *ti_sci_setup_one_xfer(struct ti_sci_info *info,
        if (rx_message_size > info->desc->max_msg_size ||
            tx_message_size > info->desc->max_msg_size ||
            (rx_message_size > 0 && rx_message_size < sizeof(*hdr)) ||
-           tx_message_size < sizeof(*hdr))
+           tx_message_size < sizeof(*hdr)) {
+               dev_err(info->dev, "TI-SCI message transfer size not sane\n");
                return ERR_PTR(-ERANGE);
+       }
+
 
        info->seq = ~info->seq;
        xfer->tx_message.buf = buf;
@@ -160,7 +164,7 @@ static struct ti_sci_xfer *ti_sci_setup_one_xfer(struct ti_sci_info *info,
  *        return corresponding error, else if all goes well,
  *        return 0.
  */
-static inline int ti_sci_get_response(struct ti_sci_info *info,
+static int ti_sci_get_response(struct ti_sci_info *info,
                                      struct ti_sci_xfer *xfer,
                                      struct mbox_chan *chan)
 {
@@ -214,7 +218,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info,
  *
  * Return: 0 if all went fine, else return appropriate error.
  */
-static inline int ti_sci_do_xfer(struct ti_sci_info *info,
+static int ti_sci_do_xfer(struct ti_sci_info *info,
                                 struct ti_sci_xfer *xfer)
 {
        struct k3_sec_proxy_msg *msg = &xfer->tx_message;
@@ -281,15 +285,12 @@ static int ti_sci_cmd_get_revision(struct ti_sci_handle *handle)
                                     sizeof(*rev_info));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox communication fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        rev_info = (struct ti_sci_msg_resp_version *)xfer->tx_message.buf;
 
@@ -309,7 +310,7 @@ static int ti_sci_cmd_get_revision(struct ti_sci_handle *handle)
  *
  * Return: true if the response was an ACK, else returns false.
  */
-static inline bool ti_sci_is_response_ack(void *r)
+static bool ti_sci_is_response_ack(void *r)
 {
        struct ti_sci_msg_hdr *hdr = r;
 
@@ -347,7 +348,6 @@ static int cmd_set_board_config_using_msg(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.boardcfgp_high = (addr >> 32) & 0xffffffff;
@@ -355,10 +355,8 @@ static int cmd_set_board_config_using_msg(const struct ti_sci_handle *handle,
        req.boardcfg_size = size;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -508,17 +506,14 @@ static int ti_sci_set_device_state(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.id = id;
        req.state = state;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -563,7 +558,6 @@ static int ti_sci_set_device_state_no_wait(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), 0);
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.id = id;
@@ -571,7 +565,7 @@ static int ti_sci_set_device_state_no_wait(const struct ti_sci_handle *handle,
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret)
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+               return ret;
 
        return ret;
 }
@@ -612,16 +606,13 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.id = id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_device_state *)xfer->tx_message.buf;
        if (!ti_sci_is_response_ack(resp))
@@ -900,17 +891,14 @@ static int ti_sci_cmd_set_device_resets(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.id = id;
        req.resets = reset_state;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -970,7 +958,6 @@ static int ti_sci_set_clock_state(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
@@ -978,10 +965,8 @@ static int ti_sci_set_clock_state(const struct ti_sci_handle *handle,
        req.request_state = state;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1028,17 +1013,14 @@ static int ti_sci_cmd_get_clock_state(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
        req.clk_id = clk_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_clock_state *)xfer->tx_message.buf;
 
@@ -1244,7 +1226,6 @@ static int ti_sci_cmd_clk_set_parent(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
@@ -1252,10 +1233,8 @@ static int ti_sci_cmd_clk_set_parent(const struct ti_sci_handle *handle,
        req.parent_id = parent_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1297,17 +1276,14 @@ static int ti_sci_cmd_clk_get_parent(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
        req.clk_id = clk_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->tx_message.buf;
 
@@ -1352,17 +1328,14 @@ static int ti_sci_cmd_clk_get_num_parents(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
        req.clk_id = clk_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_clock_num_parents *)
                                                        xfer->tx_message.buf;
@@ -1417,7 +1390,6 @@ static int ti_sci_cmd_clk_get_match_freq(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
@@ -1427,10 +1399,8 @@ static int ti_sci_cmd_clk_get_match_freq(const struct ti_sci_handle *handle,
        req.max_freq_hz = max_freq;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_query_clock_freq *)xfer->tx_message.buf;
 
@@ -1482,7 +1452,6 @@ static int ti_sci_cmd_clk_set_freq(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
@@ -1492,10 +1461,8 @@ static int ti_sci_cmd_clk_set_freq(const struct ti_sci_handle *handle,
        req.max_freq_hz = max_freq;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1537,17 +1504,14 @@ static int ti_sci_cmd_clk_get_freq(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.dev_id = dev_id;
        req.clk_id = clk_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_clock_freq *)xfer->tx_message.buf;
 
@@ -1585,15 +1549,13 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle)
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
+       req.domain = 0;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1639,7 +1601,6 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -1648,10 +1609,8 @@ static int ti_sci_get_resource_range(const struct ti_sci_handle *handle,
        req.subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp = (struct ti_sci_msg_resp_get_resource_range *)xfer->tx_message.buf;
        if (!ti_sci_is_response_ack(resp)) {
@@ -1667,6 +1626,34 @@ fail:
        return ret;
 }
 
+static int __maybe_unused
+ti_sci_cmd_get_resource_range_static(const struct ti_sci_handle *handle,
+                                    u32 dev_id, u8 subtype,
+                                    u16 *range_start, u16 *range_num)
+{
+       struct ti_sci_resource_static_data *data;
+       int i = 0;
+
+       while (1) {
+               data = &rm_static_data[i];
+
+               if (!data->dev_id)
+                       return -EINVAL;
+
+               if (data->dev_id != dev_id || data->subtype != subtype) {
+                       i++;
+                       continue;
+               }
+
+               *range_start = data->range_start;
+               *range_num = data->range_num;
+
+               return 0;
+       }
+
+       return -EINVAL;
+}
+
 /**
  * ti_sci_cmd_get_resource_range - Get a range of resources assigned to host
  *                                that is same as ti sci interface host.
@@ -1739,15 +1726,12 @@ static int ti_sci_cmd_query_msmc(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_query_msmc *)xfer->tx_message.buf;
 
@@ -1790,16 +1774,13 @@ static int ti_sci_cmd_proc_request(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1837,16 +1818,13 @@ static int ti_sci_cmd_proc_release(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1887,17 +1865,14 @@ static int ti_sci_cmd_proc_handover(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
        req.host_id = host_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1940,7 +1915,6 @@ static int ti_sci_cmd_set_proc_boot_cfg(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
@@ -1951,10 +1925,8 @@ static int ti_sci_cmd_set_proc_boot_cfg(const struct ti_sci_handle *handle,
        req.config_flags_clear = config_flags_clear;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -1996,7 +1968,6 @@ static int ti_sci_cmd_set_proc_boot_ctrl(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
@@ -2004,10 +1975,8 @@ static int ti_sci_cmd_set_proc_boot_ctrl(const struct ti_sci_handle *handle,
        req.control_flags_clear = control_flags_clear;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -2050,7 +2019,6 @@ static int ti_sci_cmd_proc_auth_boot_image(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.cert_addr_low = *image_addr & TISCI_ADDR_LOW_MASK;
@@ -2058,10 +2026,8 @@ static int ti_sci_cmd_proc_auth_boot_image(const struct ti_sci_handle *handle,
                                TISCI_ADDR_HIGH_SHIFT;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_proc_auth_boot_image *)xfer->tx_message.buf;
 
@@ -2105,16 +2071,13 @@ static int ti_sci_cmd_get_proc_boot_status(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_resp_get_proc_boot_status *)
                                                        xfer->tx_message.buf;
@@ -2195,7 +2158,6 @@ ti_sci_proc_wait_boot_status_no_wait(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), 0);
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.processor_id = proc_id;
@@ -2210,7 +2172,7 @@ ti_sci_proc_wait_boot_status_no_wait(const struct ti_sci_handle *handle,
 
        ret = ti_sci_do_xfer(info, xfer);
        if (ret)
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+               return ret;
 
        return ret;
 }
@@ -2310,7 +2272,6 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
                return ret;
        }
        req.valid_params = valid_params;
@@ -2324,10 +2285,8 @@ static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
        req.order_id = order_id;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp = (struct ti_sci_msg_rm_ring_cfg_resp *)xfer->tx_message.buf;
 
@@ -2359,7 +2318,6 @@ static int ti_sci_cmd_rm_psil_pair(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "RM_PSIL:Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.nav_id = nav_id;
@@ -2367,10 +2325,8 @@ static int ti_sci_cmd_rm_psil_pair(const struct ti_sci_handle *handle,
        req.dst_thread = dst_thread;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "RM_PSIL:Mbox send fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
        ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
@@ -2402,7 +2358,6 @@ static int ti_sci_cmd_rm_psil_unpair(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "RM_PSIL:Message alloc failed(%d)\n", ret);
                return ret;
        }
        req.nav_id = nav_id;
@@ -2410,10 +2365,8 @@ static int ti_sci_cmd_rm_psil_unpair(const struct ti_sci_handle *handle,
        req.dst_thread = dst_thread;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "RM_PSIL:Mbox send fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
        ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
@@ -2446,7 +2399,6 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
                return ret;
        }
        req.valid_params = params->valid_params;
@@ -2466,12 +2418,13 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(
        req.tx_orderid = params->tx_orderid;
        req.fdepth = params->fdepth;
        req.tx_sched_priority = params->tx_sched_priority;
+       req.tx_burst_size = params->tx_burst_size;
+       req.tx_tdtype = params->tx_tdtype;
+       req.extended_ch_type = params->extended_ch_type;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp =
              (struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp *)xfer->tx_message.buf;
@@ -2504,7 +2457,6 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -2526,10 +2478,8 @@ static int ti_sci_cmd_rm_udmap_rx_ch_cfg(
        req.rx_ignore_long = params->rx_ignore_long;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp =
              (struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp *)xfer->tx_message.buf;
@@ -2562,8 +2512,6 @@ static int ti_sci_cmd_rm_udmap_rx_flow_cfg(
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "RX_FL_CFG: Message alloc failed(%d)\n",
-                       ret);
                return ret;
        }
 
@@ -2591,10 +2539,8 @@ static int ti_sci_cmd_rm_udmap_rx_flow_cfg(
        req.rx_ps_location = params->rx_ps_location;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "RX_FL_CFG: Mbox send fail %d\n", ret);
+       if (ret)
                goto fail;
-       }
 
        resp =
               (struct ti_sci_msg_rm_udmap_flow_cfg_resp *)xfer->tx_message.buf;
@@ -2633,7 +2579,6 @@ static int ti_sci_cmd_set_fwl_region(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -2648,10 +2593,8 @@ static int ti_sci_cmd_set_fwl_region(const struct ti_sci_handle *handle,
        req.end_address = region->end_address;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
 
@@ -2689,7 +2632,6 @@ static int ti_sci_cmd_get_fwl_region(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -2698,10 +2640,8 @@ static int ti_sci_cmd_get_fwl_region(const struct ti_sci_handle *handle,
        req.n_permission_regs = region->n_permission_regs;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_fwl_get_firewall_region_resp *)xfer->tx_message.buf;
 
@@ -2749,7 +2689,6 @@ static int ti_sci_cmd_change_fwl_owner(const struct ti_sci_handle *handle,
                                     (u32 *)&req, sizeof(req), sizeof(*resp));
        if (IS_ERR(xfer)) {
                ret = PTR_ERR(xfer);
-               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
                return ret;
        }
 
@@ -2758,10 +2697,8 @@ static int ti_sci_cmd_change_fwl_owner(const struct ti_sci_handle *handle,
        req.owner_index = owner->owner_index;
 
        ret = ti_sci_do_xfer(info, xfer);
-       if (ret) {
-               dev_err(info->dev, "Mbox send fail %d\n", ret);
+       if (ret)
                return ret;
-       }
 
        resp = (struct ti_sci_msg_fwl_change_owner_info_resp *)xfer->tx_message.buf;
 
@@ -3012,6 +2949,58 @@ static int ti_sci_probe(struct udevice *dev)
        return ret;
 }
 
+/**
+ * ti_sci_dm_probe() - Basic probe for DM to TIFS SCI
+ * @dev:       corresponding system controller interface device
+ *
+ * Return: 0 if all goes good, else appropriate error message.
+ */
+static __maybe_unused int ti_sci_dm_probe(struct udevice *dev)
+{
+       struct ti_sci_rm_core_ops *rm_core_ops;
+       struct ti_sci_rm_udmap_ops *udmap_ops;
+       struct ti_sci_rm_ringacc_ops *rops;
+       struct ti_sci_rm_psil_ops *psilops;
+       struct ti_sci_ops *ops;
+       struct ti_sci_info *info;
+       int ret;
+
+       debug("%s(dev=%p)\n", __func__, dev);
+
+       info = dev_get_priv(dev);
+       info->desc = (void *)dev_get_driver_data(dev);
+
+       ret = ti_sci_of_to_info(dev, info);
+       if (ret) {
+               dev_err(dev, "%s: Probe failed with error %d\n", __func__, ret);
+               return ret;
+       }
+
+       info->dev = dev;
+       info->seq = 0xA;
+
+       list_add_tail(&info->list, &ti_sci_list);
+
+       ops = &info->handle.ops;
+
+       rm_core_ops = &ops->rm_core_ops;
+       rm_core_ops->get_range = ti_sci_cmd_get_resource_range_static;
+
+       rops = &ops->rm_ring_ops;
+       rops->config = ti_sci_cmd_ring_config;
+
+       psilops = &ops->rm_psil_ops;
+       psilops->pair = ti_sci_cmd_rm_psil_pair;
+       psilops->unpair = ti_sci_cmd_rm_psil_unpair;
+
+       udmap_ops = &ops->rm_udmap_ops;
+       udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg;
+       udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg;
+       udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg;
+
+       return ret;
+}
+
 /*
  * ti_sci_get_free_resource() - Get a free resource from TISCI resource.
  * @res:       Pointer to the TISCI resource
@@ -3149,6 +3138,14 @@ static const struct ti_sci_desc ti_sci_pmmc_am654_desc = {
        .max_msg_size = 60,
 };
 
+/* Description for J721e DM to DMSC communication */
+static const struct ti_sci_desc ti_sci_dm_j721e_desc = {
+       .default_host_id = 3,
+       .max_rx_timeout_ms = 10000,
+       .max_msgs = 20,
+       .max_msg_size = 60,
+};
+
 static const struct udevice_id ti_sci_ids[] = {
        {
                .compatible = "ti,k2g-sci",
@@ -3161,10 +3158,28 @@ static const struct udevice_id ti_sci_ids[] = {
        { /* Sentinel */ },
 };
 
+static __maybe_unused const struct udevice_id ti_sci_dm_ids[] = {
+       {
+               .compatible = "ti,j721e-dm-sci",
+               .data = (ulong)&ti_sci_dm_j721e_desc
+       },
+       { /* Sentinel */ },
+};
+
 U_BOOT_DRIVER(ti_sci) = {
        .name = "ti_sci",
        .id = UCLASS_FIRMWARE,
        .of_match = ti_sci_ids,
        .probe = ti_sci_probe,
-       .priv_auto_alloc_size = sizeof(struct ti_sci_info),
+       .priv_auto      = sizeof(struct ti_sci_info),
+};
+
+#if IS_ENABLED(CONFIG_K3_DM_FW)
+U_BOOT_DRIVER(ti_sci_dm) = {
+       .name = "ti_sci_dm",
+       .id = UCLASS_FIRMWARE,
+       .of_match = ti_sci_dm_ids,
+       .probe = ti_sci_dm_probe,
+       .priv_auto = sizeof(struct ti_sci_info),
 };
+#endif