aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-09-25 15:26:52 -0400
committerOlof Johansson <olof@lixom.net>2018-09-25 15:26:52 -0400
commit260c9ca90246fb317e1361fa2d513bd307decd68 (patch)
tree3c734d94178991ede5e0186d8433eb5f4b39de2b
parent5bc45db5d2a7bf6eac577174e3634f58f867bb2f (diff)
parent7bcfe20d0d8b647879629798fa57e39905d6cded (diff)
Merge tag 'drivers_soc_for_4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into next/drivers
soc: driver soc update for v4.20 - Enable host-id as an optional dt property - Fix minor typo in knav driver * tag 'drivers_soc_for_4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: soc: ti: fix spelling mistake "instace" -> "instance" firmware: ti_sci: Provide host-id as an optional dt parameter Documentation: dt: keystone: ti-sci: Add optional host-id parameter Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/devicetree/bindings/arm/keystone/ti,sci.txt4
-rw-r--r--drivers/firmware/ti_sci.c24
-rw-r--r--drivers/soc/ti/knav_dma.c4
-rw-r--r--drivers/soc/ti/knav_qmss.h6
4 files changed, 29 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt b/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
index 31f5f9a104cc..b56a02c10ae6 100644
--- a/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
+++ b/Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
@@ -45,11 +45,15 @@ Optional Properties:
45 debug_messages - Map the Debug message region 45 debug_messages - Map the Debug message region
46- reg: register space corresponding to the debug_messages 46- reg: register space corresponding to the debug_messages
47- ti,system-reboot-controller: If system reboot can be triggered by SoC reboot 47- ti,system-reboot-controller: If system reboot can be triggered by SoC reboot
48- ti,host-id: Integer value corresponding to the host ID assigned by Firmware
49 for identification of host processing entities such as virtual
50 machines
48 51
49Example (K2G): 52Example (K2G):
50------------- 53-------------
51 pmmc: pmmc { 54 pmmc: pmmc {
52 compatible = "ti,k2g-sci"; 55 compatible = "ti,k2g-sci";
56 ti,host-id = <2>;
53 mbox-names = "rx", "tx"; 57 mbox-names = "rx", "tx";
54 mboxes= <&msgmgr &msgmgr_proxy_pmmc_rx>, 58 mboxes= <&msgmgr &msgmgr_proxy_pmmc_rx>,
55 <&msgmgr &msgmgr_proxy_pmmc_tx>; 59 <&msgmgr &msgmgr_proxy_pmmc_tx>;
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 7fa744793bc5..69ed1464175c 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -66,14 +66,14 @@ struct ti_sci_xfers_info {
66 66
67/** 67/**
68 * struct ti_sci_desc - Description of SoC integration 68 * struct ti_sci_desc - Description of SoC integration
69 * @host_id: Host identifier representing the compute entity 69 * @default_host_id: Host identifier representing the compute entity
70 * @max_rx_timeout_ms: Timeout for communication with SoC (in Milliseconds) 70 * @max_rx_timeout_ms: Timeout for communication with SoC (in Milliseconds)
71 * @max_msgs: Maximum number of messages that can be pending 71 * @max_msgs: Maximum number of messages that can be pending
72 * simultaneously in the system 72 * simultaneously in the system
73 * @max_msg_size: Maximum size of data per message that can be handled. 73 * @max_msg_size: Maximum size of data per message that can be handled.
74 */ 74 */
75struct ti_sci_desc { 75struct ti_sci_desc {
76 u8 host_id; 76 u8 default_host_id;
77 int max_rx_timeout_ms; 77 int max_rx_timeout_ms;
78 int max_msgs; 78 int max_msgs;
79 int max_msg_size; 79 int max_msg_size;
@@ -94,6 +94,7 @@ struct ti_sci_desc {
94 * @chan_rx: Receive mailbox channel 94 * @chan_rx: Receive mailbox channel
95 * @minfo: Message info 95 * @minfo: Message info
96 * @node: list head 96 * @node: list head
97 * @host_id: Host ID
97 * @users: Number of users of this instance 98 * @users: Number of users of this instance
98 */ 99 */
99struct ti_sci_info { 100struct ti_sci_info {
@@ -110,6 +111,7 @@ struct ti_sci_info {
110 struct mbox_chan *chan_rx; 111 struct mbox_chan *chan_rx;
111 struct ti_sci_xfers_info minfo; 112 struct ti_sci_xfers_info minfo;
112 struct list_head node; 113 struct list_head node;
114 u8 host_id;
113 /* protected by ti_sci_list_mutex */ 115 /* protected by ti_sci_list_mutex */
114 int users; 116 int users;
115 117
@@ -370,7 +372,7 @@ static struct ti_sci_xfer *ti_sci_get_one_xfer(struct ti_sci_info *info,
370 372
371 hdr->seq = xfer_id; 373 hdr->seq = xfer_id;
372 hdr->type = msg_type; 374 hdr->type = msg_type;
373 hdr->host = info->desc->host_id; 375 hdr->host = info->host_id;
374 hdr->flags = msg_flags; 376 hdr->flags = msg_flags;
375 377
376 return xfer; 378 return xfer;
@@ -1793,7 +1795,7 @@ static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
1793 1795
1794/* Description for K2G */ 1796/* Description for K2G */
1795static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = { 1797static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
1796 .host_id = 2, 1798 .default_host_id = 2,
1797 /* Conservative duration */ 1799 /* Conservative duration */
1798 .max_rx_timeout_ms = 1000, 1800 .max_rx_timeout_ms = 1000,
1799 /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */ 1801 /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
@@ -1819,6 +1821,7 @@ static int ti_sci_probe(struct platform_device *pdev)
1819 int ret = -EINVAL; 1821 int ret = -EINVAL;
1820 int i; 1822 int i;
1821 int reboot = 0; 1823 int reboot = 0;
1824 u32 h_id;
1822 1825
1823 of_id = of_match_device(ti_sci_of_match, dev); 1826 of_id = of_match_device(ti_sci_of_match, dev);
1824 if (!of_id) { 1827 if (!of_id) {
@@ -1833,6 +1836,19 @@ static int ti_sci_probe(struct platform_device *pdev)
1833 1836
1834 info->dev = dev; 1837 info->dev = dev;
1835 info->desc = desc; 1838 info->desc = desc;
1839 ret = of_property_read_u32(dev->of_node, "ti,host-id", &h_id);
1840 /* if the property is not present in DT, use a default from desc */
1841 if (ret < 0) {
1842 info->host_id = info->desc->default_host_id;
1843 } else {
1844 if (!h_id) {
1845 dev_warn(dev, "Host ID 0 is reserved for firmware\n");
1846 info->host_id = info->desc->default_host_id;
1847 } else {
1848 info->host_id = h_id;
1849 }
1850 }
1851
1836 reboot = of_property_read_bool(dev->of_node, 1852 reboot = of_property_read_bool(dev->of_node,
1837 "ti,system-reboot-controller"); 1853 "ti,system-reboot-controller");
1838 INIT_LIST_HEAD(&info->node); 1854 INIT_LIST_HEAD(&info->node);
diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index 224d7ddeeb76..23f09dce23e0 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -438,7 +438,7 @@ void *knav_dma_open_channel(struct device *dev, const char *name,
438 438
439 chan_num = of_channel_match_helper(dev->of_node, name, &instance); 439 chan_num = of_channel_match_helper(dev->of_node, name, &instance);
440 if (chan_num < 0) { 440 if (chan_num < 0) {
441 dev_err(kdev->dev, "No DMA instace with name %s\n", name); 441 dev_err(kdev->dev, "No DMA instance with name %s\n", name);
442 return (void *)-EINVAL; 442 return (void *)-EINVAL;
443 } 443 }
444 444
@@ -461,7 +461,7 @@ void *knav_dma_open_channel(struct device *dev, const char *name,
461 } 461 }
462 } 462 }
463 if (!found) { 463 if (!found) {
464 dev_err(kdev->dev, "No DMA instace with name %s\n", instance); 464 dev_err(kdev->dev, "No DMA instance with name %s\n", instance);
465 return (void *)-EINVAL; 465 return (void *)-EINVAL;
466 } 466 }
467 467
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index 3efc47e82973..7c128132799e 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -240,14 +240,14 @@ struct knav_pool {
240}; 240};
241 241
242/** 242/**
243 * struct knav_queue_inst: qmss queue instace properties 243 * struct knav_queue_inst: qmss queue instance properties
244 * @descs: descriptor pointer 244 * @descs: descriptor pointer
245 * @desc_head, desc_tail, desc_count: descriptor counters 245 * @desc_head, desc_tail, desc_count: descriptor counters
246 * @acc: accumulator channel pointer 246 * @acc: accumulator channel pointer
247 * @kdev: qmss device pointer 247 * @kdev: qmss device pointer
248 * @range: range info 248 * @range: range info
249 * @qmgr: queue manager info 249 * @qmgr: queue manager info
250 * @id: queue instace id 250 * @id: queue instance id
251 * @irq_num: irq line number 251 * @irq_num: irq line number
252 * @notify_needed: notifier needed based on queue type 252 * @notify_needed: notifier needed based on queue type
253 * @num_notifiers: total notifiers 253 * @num_notifiers: total notifiers
@@ -274,7 +274,7 @@ struct knav_queue_inst {
274/** 274/**
275 * struct knav_queue: qmss queue properties 275 * struct knav_queue: qmss queue properties
276 * @reg_push, reg_pop, reg_peek: push, pop queue registers 276 * @reg_push, reg_pop, reg_peek: push, pop queue registers
277 * @inst: qmss queue instace properties 277 * @inst: qmss queue instance properties
278 * @notifier_fn: notifier function 278 * @notifier_fn: notifier function
279 * @notifier_fn_arg: notifier function argument 279 * @notifier_fn_arg: notifier function argument
280 * @notifier_enabled: notier enabled for a give queue 280 * @notifier_enabled: notier enabled for a give queue