diff mbox

[RESEND,1/2] ti: wkup_m3_ipc: Add rtc_only with ddr in self refresh mode support

Message ID 1529572954-22244-1-git-send-email-j-keerthy@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

J, KEERTHY June 21, 2018, 9:22 a.m. UTC
Adds rtc_only support. This needs resume function to shutdown and
reboot the m3.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

This is tested on am437x-gp-evm and target for 4.19

 drivers/soc/ti/wkup_m3_ipc.c | 41 +++++++++++++++++++++++++++++++++++++++++
 include/linux/wkup_m3_ipc.h  |  3 +++
 2 files changed, 44 insertions(+)

Comments

J, KEERTHY July 4, 2018, 4:23 a.m. UTC | #1
On Thursday 21 June 2018 02:52 PM, Keerthy wrote:
> Adds rtc_only support. This needs resume function to shutdown and
> reboot the m3.

A gentle ping on this series.

> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> This is tested on am437x-gp-evm and target for 4.19
> 
>  drivers/soc/ti/wkup_m3_ipc.c | 41 +++++++++++++++++++++++++++++++++++++++++
>  include/linux/wkup_m3_ipc.h  |  3 +++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
> index 369aef5..b732c39 100644
> --- a/drivers/soc/ti/wkup_m3_ipc.c
> +++ b/drivers/soc/ti/wkup_m3_ipc.c
> @@ -329,12 +329,24 @@ static int wkup_m3_finish_low_power(struct wkup_m3_ipc *m3_ipc)
>  	return 0;
>  }
>  
> +/**
> + * wkup_m3_set_rtc_only - Set the rtc_only flag
> + * @wkup_m3_wakeup: struct wkup_m3_wakeup_src * gets assigned the
> + *                  wakeup src value
> + */
> +static void wkup_m3_set_rtc_only(struct wkup_m3_ipc *m3_ipc)
> +{
> +	if (m3_ipc_state)
> +		m3_ipc_state->is_rtc_only = true;
> +}
> +
>  static struct wkup_m3_ipc_ops ipc_ops = {
>  	.set_mem_type = wkup_m3_set_mem_type,
>  	.set_resume_address = wkup_m3_set_resume_address,
>  	.prepare_low_power = wkup_m3_prepare_low_power,
>  	.finish_low_power = wkup_m3_finish_low_power,
>  	.request_pm_status = wkup_m3_request_pm_status,
> +	.set_rtc_only = wkup_m3_set_rtc_only,
>  };
>  
>  /**
> @@ -484,6 +496,32 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_PM
> +static int wkup_m3_ipc_suspend(struct device *dev)
> +{
> +	/*
> +	 * Nothing needs to be done on suspend even with rtc_only flag set
> +	 */
> +	return 0;
> +}
> +
> +static int wkup_m3_ipc_resume(struct device *dev)
> +{
> +	if (m3_ipc_state->is_rtc_only) {
> +		rproc_shutdown(m3_ipc_state->rproc);
> +		rproc_boot(m3_ipc_state->rproc);
> +	}
> +
> +	m3_ipc_state->is_rtc_only = false;
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops wkup_m3_ipc_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(wkup_m3_ipc_suspend, wkup_m3_ipc_resume)
> +};
> +#endif
> +
>  static const struct of_device_id wkup_m3_ipc_of_match[] = {
>  	{ .compatible = "ti,am3352-wkup-m3-ipc", },
>  	{ .compatible = "ti,am4372-wkup-m3-ipc", },
> @@ -497,6 +535,9 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev)
>  	.driver = {
>  		.name = "wkup_m3_ipc",
>  		.of_match_table = wkup_m3_ipc_of_match,
> +#ifdef CONFIG_PM
> +		.pm = &wkup_m3_ipc_pm_ops,
> +#endif
>  	},
>  };
>  
> diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h
> index d6ba7d3..d639df1 100644
> --- a/include/linux/wkup_m3_ipc.h
> +++ b/include/linux/wkup_m3_ipc.h
> @@ -40,6 +40,7 @@ struct wkup_m3_ipc {
>  	struct mbox_chan *mbox;
>  
>  	struct wkup_m3_ipc_ops *ops;
> +	int is_rtc_only;
>  };
>  
>  struct wkup_m3_ipc_ops {
> @@ -48,8 +49,10 @@ struct wkup_m3_ipc_ops {
>  	int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
>  	int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
>  	int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
> +	void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
>  };
>  
>  struct wkup_m3_ipc *wkup_m3_ipc_get(void);
>  void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
> +void wkup_m3_set_rtc_only_mode(void);
>  #endif /* _LINUX_WKUP_M3_IPC_H */
>
Santosh Shilimkar July 4, 2018, 4:37 a.m. UTC | #2
On 7/3/18 9:23 PM, Keerthy wrote:
> 
> 
> On Thursday 21 June 2018 02:52 PM, Keerthy wrote:
>> Adds rtc_only support. This needs resume function to shutdown and
>> reboot the m3.
> 
> A gentle ping on this series.
> 
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>
>> This is tested on am437x-gp-evm and target for 4.19

Am I suppose to pick up this series ?
J, KEERTHY July 4, 2018, 4:41 a.m. UTC | #3
On Wednesday 04 July 2018 10:07 AM, santosh.shilimkar@oracle.com wrote:
> On 7/3/18 9:23 PM, Keerthy wrote:
>>
>>
>> On Thursday 21 June 2018 02:52 PM, Keerthy wrote:
>>> Adds rtc_only support. This needs resume function to shutdown and
>>> reboot the m3.
>>
>> A gentle ping on this series.
>>
>>>
>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>> ---
>>>
>>> This is tested on am437x-gp-evm and target for 4.19
> 
> Am I suppose to pick up this series 

./scripts/get_maintainer.pl
wkm3/0001-ti-wkup_m3_ipc-Add-rtc_only-with-ddr-in-self-refresh.patch

Santosh Shilimkar <ssantosh@kernel.org> (maintainer:TI KEYSTONE
MULTICORE NAVIGATOR DRIVERS)
linux-kernel@vger.kernel.org (open list:TI KEYSTONE MULTICORE NAVIGATOR
DRIVERS)
linux-arm-kernel@lists.infradead.org (moderated list:TI KEYSTONE
MULTICORE NAVIGATOR DRIVERS)

./scripts/get_maintainer.pl
wkm3/0002-soc-ti-wkup_m3_ipc-Add-wkup_m3_request_wake_src.patch

Santosh Shilimkar <ssantosh@kernel.org> (maintainer:TI KEYSTONE
MULTICORE NAVIGATOR DRIVERS)
linux-kernel@vger.kernel.org (open list:TI KEYSTONE MULTICORE NAVIGATOR
DRIVERS)
linux-arm-kernel@lists.infradead.org (moderated list:TI KEYSTONE
MULTICORE NAVIGATOR DRIVERS)

For some reason both patches points you as the Maintainer :-P.

Regards,
Keerthy
Santosh Shilimkar July 4, 2018, 4:48 a.m. UTC | #4
On 7/3/18 9:41 PM, Keerthy wrote:
> 
> 
> On Wednesday 04 July 2018 10:07 AM, santosh.shilimkar@oracle.com wrote:
>> On 7/3/18 9:23 PM, Keerthy wrote:
>>>
>>>
>>> On Thursday 21 June 2018 02:52 PM, Keerthy wrote:
>>>> Adds rtc_only support. This needs resume function to shutdown and
>>>> reboot the m3.
>>>
>>> A gentle ping on this series.
>>>
>>>>
>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>> ---
>>>>
>>>> This is tested on am437x-gp-evm and target for 4.19
>>
>> Am I suppose to pick up this series
> 
[...]

> 
> For some reason both patches points you as the Maintainer :-P.
> 
I was not aware if you wanted me to pick it up. Will add them.

Regards,
Santosh
J, KEERTHY July 4, 2018, 4:49 a.m. UTC | #5
On Wednesday 04 July 2018 10:18 AM, santosh.shilimkar@oracle.com wrote:
> On 7/3/18 9:41 PM, Keerthy wrote:
>>
>>
>> On Wednesday 04 July 2018 10:07 AM, santosh.shilimkar@oracle.com wrote:
>>> On 7/3/18 9:23 PM, Keerthy wrote:
>>>>
>>>>
>>>> On Thursday 21 June 2018 02:52 PM, Keerthy wrote:
>>>>> Adds rtc_only support. This needs resume function to shutdown and
>>>>> reboot the m3.
>>>>
>>>> A gentle ping on this series.
>>>>
>>>>>
>>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>>> ---
>>>>>
>>>>> This is tested on am437x-gp-evm and target for 4.19
>>>
>>> Am I suppose to pick up this series
>>
> [...]
> 
>>
>> For some reason both patches points you as the Maintainer :-P.
>>
> I was not aware if you wanted me to pick it up. Will add them.

Thanks a Lot Santosh :-)

> 
> Regards,
> Santosh
diff mbox

Patch

diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 369aef5..b732c39 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -329,12 +329,24 @@  static int wkup_m3_finish_low_power(struct wkup_m3_ipc *m3_ipc)
 	return 0;
 }
 
+/**
+ * wkup_m3_set_rtc_only - Set the rtc_only flag
+ * @wkup_m3_wakeup: struct wkup_m3_wakeup_src * gets assigned the
+ *                  wakeup src value
+ */
+static void wkup_m3_set_rtc_only(struct wkup_m3_ipc *m3_ipc)
+{
+	if (m3_ipc_state)
+		m3_ipc_state->is_rtc_only = true;
+}
+
 static struct wkup_m3_ipc_ops ipc_ops = {
 	.set_mem_type = wkup_m3_set_mem_type,
 	.set_resume_address = wkup_m3_set_resume_address,
 	.prepare_low_power = wkup_m3_prepare_low_power,
 	.finish_low_power = wkup_m3_finish_low_power,
 	.request_pm_status = wkup_m3_request_pm_status,
+	.set_rtc_only = wkup_m3_set_rtc_only,
 };
 
 /**
@@ -484,6 +496,32 @@  static int wkup_m3_ipc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int wkup_m3_ipc_suspend(struct device *dev)
+{
+	/*
+	 * Nothing needs to be done on suspend even with rtc_only flag set
+	 */
+	return 0;
+}
+
+static int wkup_m3_ipc_resume(struct device *dev)
+{
+	if (m3_ipc_state->is_rtc_only) {
+		rproc_shutdown(m3_ipc_state->rproc);
+		rproc_boot(m3_ipc_state->rproc);
+	}
+
+	m3_ipc_state->is_rtc_only = false;
+
+	return 0;
+}
+
+static const struct dev_pm_ops wkup_m3_ipc_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(wkup_m3_ipc_suspend, wkup_m3_ipc_resume)
+};
+#endif
+
 static const struct of_device_id wkup_m3_ipc_of_match[] = {
 	{ .compatible = "ti,am3352-wkup-m3-ipc", },
 	{ .compatible = "ti,am4372-wkup-m3-ipc", },
@@ -497,6 +535,9 @@  static int wkup_m3_ipc_remove(struct platform_device *pdev)
 	.driver = {
 		.name = "wkup_m3_ipc",
 		.of_match_table = wkup_m3_ipc_of_match,
+#ifdef CONFIG_PM
+		.pm = &wkup_m3_ipc_pm_ops,
+#endif
 	},
 };
 
diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h
index d6ba7d3..d639df1 100644
--- a/include/linux/wkup_m3_ipc.h
+++ b/include/linux/wkup_m3_ipc.h
@@ -40,6 +40,7 @@  struct wkup_m3_ipc {
 	struct mbox_chan *mbox;
 
 	struct wkup_m3_ipc_ops *ops;
+	int is_rtc_only;
 };
 
 struct wkup_m3_ipc_ops {
@@ -48,8 +49,10 @@  struct wkup_m3_ipc_ops {
 	int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
 	int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
 	int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
+	void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
 };
 
 struct wkup_m3_ipc *wkup_m3_ipc_get(void);
 void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
+void wkup_m3_set_rtc_only_mode(void);
 #endif /* _LINUX_WKUP_M3_IPC_H */