aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2018-07-16 14:06:05 -0400
committerJassi Brar <jaswinder.singh@linaro.org>2018-08-03 09:27:41 -0400
commit89c976c2f3fc02b95ae0a4a35dc3373ec8bfbdcb (patch)
treec43c56603777472b2c88e2192ee33aeacbf4c3c5 /drivers/mailbox
parent8e56086292094290600edd7c526841df14b201ca (diff)
mailbox: ti-msgmgr: Move the memory region name to descriptor
For newer generation of the hardware, the naming of the region is decided at integration level and there could be additional regions as well. Hence move the region naming to be described from compatible descriptor. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/ti-msgmgr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
index 7d2eb4b359ba..7167cc708f44 100644
--- a/drivers/mailbox/ti-msgmgr.c
+++ b/drivers/mailbox/ti-msgmgr.c
@@ -48,6 +48,8 @@ struct ti_msgmgr_valid_queue_desc {
48 * @tx_polled: Do I need to use polled mechanism for tx 48 * @tx_polled: Do I need to use polled mechanism for tx
49 * @tx_poll_timeout_ms: Timeout in ms if polled 49 * @tx_poll_timeout_ms: Timeout in ms if polled
50 * @valid_queues: List of Valid queues that the processor can access 50 * @valid_queues: List of Valid queues that the processor can access
51 * @data_region_name: Name of the proxy data region
52 * @status_region_name: Name of the proxy status region
51 * @num_valid_queues: Number of valid queues 53 * @num_valid_queues: Number of valid queues
52 * 54 *
53 * This structure is used in of match data to describe how integration 55 * This structure is used in of match data to describe how integration
@@ -63,6 +65,8 @@ struct ti_msgmgr_desc {
63 bool tx_polled; 65 bool tx_polled;
64 int tx_poll_timeout_ms; 66 int tx_poll_timeout_ms;
65 const struct ti_msgmgr_valid_queue_desc *valid_queues; 67 const struct ti_msgmgr_valid_queue_desc *valid_queues;
68 const char *data_region_name;
69 const char *status_region_name;
66 int num_valid_queues; 70 int num_valid_queues;
67}; 71};
68 72
@@ -531,6 +535,8 @@ static const struct ti_msgmgr_desc k2g_desc = {
531 .queue_count = 64, 535 .queue_count = 64,
532 .max_message_size = 64, 536 .max_message_size = 64,
533 .max_messages = 128, 537 .max_messages = 128,
538 .data_region_name = "queue_proxy_region",
539 .status_region_name = "queue_state_debug_region",
534 .data_first_reg = 16, 540 .data_first_reg = 16,
535 .data_last_reg = 31, 541 .data_last_reg = 31,
536 .status_cnt_mask = Q_STATE_ENTRY_COUNT_MASK, 542 .status_cnt_mask = Q_STATE_ENTRY_COUNT_MASK,
@@ -582,13 +588,13 @@ static int ti_msgmgr_probe(struct platform_device *pdev)
582 inst->desc = desc; 588 inst->desc = desc;
583 589
584 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 590 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
585 "queue_proxy_region"); 591 desc->data_region_name);
586 inst->queue_proxy_region = devm_ioremap_resource(dev, res); 592 inst->queue_proxy_region = devm_ioremap_resource(dev, res);
587 if (IS_ERR(inst->queue_proxy_region)) 593 if (IS_ERR(inst->queue_proxy_region))
588 return PTR_ERR(inst->queue_proxy_region); 594 return PTR_ERR(inst->queue_proxy_region);
589 595
590 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 596 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
591 "queue_state_debug_region"); 597 desc->status_region_name);
592 inst->queue_state_debug_region = devm_ioremap_resource(dev, res); 598 inst->queue_state_debug_region = devm_ioremap_resource(dev, res);
593 if (IS_ERR(inst->queue_state_debug_region)) 599 if (IS_ERR(inst->queue_state_debug_region))
594 return PTR_ERR(inst->queue_state_debug_region); 600 return PTR_ERR(inst->queue_state_debug_region);