* @max_msgs: Maximum number of messages that can be pending
* simultaneously in the system
* @max_msg_size: Maximum size of data per message that can be handled.
- * @rm_type_map: RM resource type mapping structure.
*/
struct ti_sci_desc {
u8 default_host_id;
int max_rx_timeout_ms;
int max_msgs;
int max_msg_size;
- struct ti_sci_rm_type_map *rm_type_map;
};
/**
return ret;
}
-static int ti_sci_get_resource_type(struct ti_sci_info *info, u16 dev_id,
- u16 *type)
-{
- struct ti_sci_rm_type_map *rm_type_map = info->desc->rm_type_map;
- bool found = false;
- int i;
-
- /* If map is not provided then assume dev_id is used as type */
- if (!rm_type_map) {
- *type = dev_id;
- return 0;
- }
-
- for (i = 0; rm_type_map[i].dev_id; i++) {
- if (rm_type_map[i].dev_id == dev_id) {
- *type = rm_type_map[i].type;
- found = true;
- break;
- }
- }
-
- if (!found)
- return -EINVAL;
-
- return 0;
-}
-
/**
* ti_sci_get_resource_range - Helper to get a range of resources assigned
* to a host. Resource is uniquely identified by
struct ti_sci_msg_req_get_resource_range req;
struct ti_sci_xfer *xfer;
struct ti_sci_info *info;
- u16 type;
int ret = 0;
if (IS_ERR(handle))
return ret;
}
- ret = ti_sci_get_resource_type(info, dev_id, &type);
- if (ret) {
- dev_err(dev, "rm type lookup failed for %u\n", dev_id);
- goto fail;
- }
-
req.secondary_host = s_host;
- req.type = type & MSG_RM_RESOURCE_TYPE_MASK;
+ req.type = dev_id & MSG_RM_RESOURCE_TYPE_MASK;
req.subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK;
ret = ti_sci_do_xfer(info, xfer);
struct udevice *dev, u32 dev_id, char *of_prop)
{
u32 resource_subtype;
- u16 resource_type;
struct ti_sci_resource *res;
bool valid_set = false;
int sets, i, ret;
if (!res->desc)
return ERR_PTR(-ENOMEM);
- ret = ti_sci_get_resource_type(handle_to_ti_sci_info(handle), dev_id,
- &resource_type);
- if (ret) {
- dev_err(dev, "No valid resource type for %u\n", dev_id);
- return ERR_PTR(-EINVAL);
- }
-
ret = dev_read_u32_array(dev, of_prop, temp, res->sets);
if (ret)
return ERR_PTR(-EINVAL);
&res->desc[i].num);
if (ret) {
dev_dbg(dev, "type %d subtype %d not allocated for host %d\n",
- resource_type, resource_subtype,
+ dev_id, resource_subtype,
handle_to_ti_sci_info(handle)->host_id);
res->desc[i].start = 0;
res->desc[i].num = 0;
valid_set = true;
dev_dbg(dev, "res type = %d, subtype = %d, start = %d, num = %d\n",
- resource_type, resource_subtype, res->desc[i].start,
+ dev_id, resource_subtype, res->desc[i].start,
res->desc[i].num);
res->desc[i].res_map =
/* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
.max_msgs = 20,
.max_msg_size = 64,
- .rm_type_map = NULL,
};
/* Description for AM654 */
/* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
.max_msgs = 20,
.max_msg_size = 60,
- .rm_type_map = NULL,
};
static const struct udevice_id ti_sci_ids[] = {