* [PATCH v2 1/3] firmware: ti_sci: rm: Add support for tx_tdtype parameter for tx channel
2020-02-04 15:27 [PATCH v2 0/3] firmware: ti_sci: tx_tdtype and export ti_sci_do_xfer() Peter Ujfalusi
@ 2020-02-04 15:27 ` Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 2/3] firmware: ti_sci: Export devm_ti_sci_get_of_resource for modules Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 3/3] firmware: ti_sci: Correct the timeout type in ti_sci_do_xfer() Peter Ujfalusi
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2020-02-04 15:27 UTC (permalink / raw)
To: nm, t-kristo, ssantosh, santosh.shilimkar
Cc: linux-arm-kernel, linux-kernel, lokeshvutla, grygorii.strashko
The system controller's resource manager have support for configuring the
TDTYPE of TCHAN_CFG register on j721e.
With this parameter the teardown completion can be controlled:
TDTYPE == 0: Return without waiting for peer to complete the teardown
TDTYPE == 1: Wait for peer to complete the teardown
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/firmware/ti_sci.c | 1 +
drivers/firmware/ti_sci.h | 7 +++++++
include/linux/soc/ti/ti_sci_protocol.h | 2 ++
3 files changed, 10 insertions(+)
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 4126be9e3216..f13e4a96f3b7 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2412,6 +2412,7 @@ static int ti_sci_cmd_rm_udmap_tx_ch_cfg(const struct ti_sci_handle *handle,
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;
ret = ti_sci_do_xfer(info, xfer);
if (ret) {
diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h
index f0d068c03944..255327171dae 100644
--- a/drivers/firmware/ti_sci.h
+++ b/drivers/firmware/ti_sci.h
@@ -910,6 +910,7 @@ struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
* 12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
* 13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
* 14 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_burst_size
+ * 15 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_tdtype
*
* @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
*
@@ -973,6 +974,11 @@ struct rm_ti_sci_msg_udmap_rx_flow_opt_cfg {
*
* @tx_burst_size: UDMAP transmit channel burst size configuration to be
* programmed into the tx_burst_size field of the TCHAN_TCFG register.
+ *
+ * @tx_tdtype: UDMAP transmit channel teardown type configuration to be
+ * programmed into the tdtype field of the TCHAN_TCFG register:
+ * 0 - Return immediately
+ * 1 - Wait for completion message from remote peer
*/
struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
struct ti_sci_msg_hdr hdr;
@@ -994,6 +1000,7 @@ struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
u16 fdepth;
u8 tx_sched_priority;
u8 tx_burst_size;
+ u8 tx_tdtype;
} __packed;
/**
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
index 9531ec823298..f3aed0b91564 100644
--- a/include/linux/soc/ti/ti_sci_protocol.h
+++ b/include/linux/soc/ti/ti_sci_protocol.h
@@ -342,6 +342,7 @@ struct ti_sci_msg_rm_udmap_tx_ch_cfg {
#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID BIT(11)
#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID BIT(12)
#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID BIT(13)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_TDTYPE_VALID BIT(15)
u16 nav_id;
u16 index;
u8 tx_pause_on_err;
@@ -359,6 +360,7 @@ struct ti_sci_msg_rm_udmap_tx_ch_cfg {
u16 fdepth;
u8 tx_sched_priority;
u8 tx_burst_size;
+ u8 tx_tdtype;
};
/**
--
Peter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/3] firmware: ti_sci: Export devm_ti_sci_get_of_resource for modules
2020-02-04 15:27 [PATCH v2 0/3] firmware: ti_sci: tx_tdtype and export ti_sci_do_xfer() Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 1/3] firmware: ti_sci: rm: Add support for tx_tdtype parameter for tx channel Peter Ujfalusi
@ 2020-02-04 15:27 ` Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 3/3] firmware: ti_sci: Correct the timeout type in ti_sci_do_xfer() Peter Ujfalusi
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2020-02-04 15:27 UTC (permalink / raw)
To: nm, t-kristo, ssantosh, santosh.shilimkar
Cc: linux-arm-kernel, linux-kernel, lokeshvutla, grygorii.strashko
Allow devm_ti_sci_get_of_resource() to be usable from modules.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Tero Kristo <t-kristo@ti.com>
---
drivers/firmware/ti_sci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index f13e4a96f3b7..3d8241cb6921 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -3332,6 +3332,7 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
return ERR_PTR(-EINVAL);
}
+EXPORT_SYMBOL_GPL(devm_ti_sci_get_of_resource);
static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
void *cmd)
--
Peter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 3/3] firmware: ti_sci: Correct the timeout type in ti_sci_do_xfer()
2020-02-04 15:27 [PATCH v2 0/3] firmware: ti_sci: tx_tdtype and export ti_sci_do_xfer() Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 1/3] firmware: ti_sci: rm: Add support for tx_tdtype parameter for tx channel Peter Ujfalusi
2020-02-04 15:27 ` [PATCH v2 2/3] firmware: ti_sci: Export devm_ti_sci_get_of_resource for modules Peter Ujfalusi
@ 2020-02-04 15:27 ` Peter Ujfalusi
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2020-02-04 15:27 UTC (permalink / raw)
To: nm, t-kristo, ssantosh, santosh.shilimkar
Cc: linux-arm-kernel, linux-kernel, lokeshvutla, grygorii.strashko
msecs_to_jiffies() returns 'unsigned long' and the timeout parameter for
wait_for_completion_timeout() is also 'unsigned long'
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Tero Kristo <t-kristo@ti.com>
---
drivers/firmware/ti_sci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 3d8241cb6921..361a82817c1f 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -422,7 +422,7 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info,
struct ti_sci_xfer *xfer)
{
int ret;
- int timeout;
+ unsigned long timeout;
struct device *dev = info->dev;
ret = mbox_send_message(info->chan_tx, &xfer->tx_message);
--
Peter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 4+ messages in thread