linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7
@ 2020-07-03 16:07 Tony Lindgren
  2020-07-03 16:07 ` [PATCH 1/3] soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data Tony Lindgren
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Tony Lindgren @ 2020-07-03 16:07 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Santosh Shilimkar,
	Suman Anna, Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy

Hi all,

Here are patches to simplify the RTC+DDR PM code for am3 and am4. We want
to do this to drop the RTC related legacy platform data for am3 and am4.
We also drop RTC legacy platform data for dra7.

Please test the RTC+DDR suspend on am437x-gp-evm if possible. I've tested
this series on am437x-sk-evm, but at least currently cannot do RTC+DDR
suspend and is limited to testing retention suspend only.

These patches depend on v5.8-rc3 for earlier suspend and resume related
fixes.

Additionally, for testing the LCD for suspend, the following patch is
needed for the missing omapdrm PM ops:

drm/omap: force runtime PM suspend on system suspend

Regards,

Tony


Tony Lindgren (3):
  soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data
  ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc
  ARM: OMAP2+: Drop legacy platform data for dra7 rtcss

 arch/arm/boot/dts/am33xx-l4.dtsi              |  1 -
 arch/arm/boot/dts/am437x-l4.dtsi              |  3 +-
 arch/arm/boot/dts/am43x-epos-evm.dts          |  4 ++
 arch/arm/boot/dts/dra7-l4.dtsi                |  1 -
 .../omap_hwmod_33xx_43xx_common_data.h        |  2 -
 .../omap_hwmod_33xx_43xx_interconnect_data.c  |  8 ----
 .../omap_hwmod_33xx_43xx_ipblock_data.c       | 37 ---------------
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c    |  1 -
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c    |  8 ----
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c     | 44 -----------------
 arch/arm/mach-omap2/pm33xx-core.c             | 25 ----------
 drivers/soc/ti/pm33xx.c                       | 47 +++++++++++++++++--
 include/linux/platform_data/pm33xx.h          |  3 --
 13 files changed, 47 insertions(+), 137 deletions(-)

-- 
2.27.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data
  2020-07-03 16:07 [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
@ 2020-07-03 16:07 ` Tony Lindgren
  2020-07-03 16:07 ` [PATCH 2/3] ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc Tony Lindgren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2020-07-03 16:07 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Santosh Shilimkar,
	Suman Anna, Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy

We must re-enable the RTC module clock enabled in RTC+DDR suspend, and
pm33xx has been using platform data callbacks for that. Looks like for
retention suspend the RTC module clock must not be re-enabled.

To remove the legacy platform data callbacks, and eventually be able to
drop the RTC legacy platform data, let's manage the RTC module clock
and register range directly in pm33xx.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/pm33xx-core.c    | 25 ---------------
 drivers/soc/ti/pm33xx.c              | 47 +++++++++++++++++++++++++---
 include/linux/platform_data/pm33xx.h |  3 --
 3 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c
--- a/arch/arm/mach-omap2/pm33xx-core.c
+++ b/arch/arm/mach-omap2/pm33xx-core.c
@@ -25,7 +25,6 @@
 #include "control.h"
 #include "clockdomain.h"
 #include "iomap.h"
-#include "omap_hwmod.h"
 #include "pm.h"
 #include "powerdomain.h"
 #include "prm33xx.h"
@@ -36,7 +35,6 @@
 static struct powerdomain *cefuse_pwrdm, *gfx_pwrdm, *per_pwrdm, *mpu_pwrdm;
 static struct clockdomain *gfx_l4ls_clkdm;
 static void __iomem *scu_base;
-static struct omap_hwmod *rtc_oh;
 
 static int (*idle_fn)(u32 wfi_flags);
 
@@ -267,13 +265,6 @@ static struct am33xx_pm_sram_addr *amx3_get_sram_addrs(void)
 		return NULL;
 }
 
-static void __iomem *am43xx_get_rtc_base_addr(void)
-{
-	rtc_oh = omap_hwmod_lookup("rtc");
-
-	return omap_hwmod_get_mpu_rt_va(rtc_oh);
-}
-
 static void am43xx_save_context(void)
 {
 }
@@ -297,16 +288,6 @@ static void am43xx_restore_context(void)
 	writel_relaxed(0x0, AM33XX_L4_WK_IO_ADDRESS(0x44df2e14));
 }
 
-static void am43xx_prepare_rtc_suspend(void)
-{
-	omap_hwmod_enable(rtc_oh);
-}
-
-static void am43xx_prepare_rtc_resume(void)
-{
-	omap_hwmod_idle(rtc_oh);
-}
-
 static struct am33xx_pm_platform_data am33xx_ops = {
 	.init = am33xx_suspend_init,
 	.deinit = amx3_suspend_deinit,
@@ -317,10 +298,7 @@ static struct am33xx_pm_platform_data am33xx_ops = {
 	.get_sram_addrs = amx3_get_sram_addrs,
 	.save_context = am33xx_save_context,
 	.restore_context = am33xx_restore_context,
-	.prepare_rtc_suspend = am43xx_prepare_rtc_suspend,
-	.prepare_rtc_resume = am43xx_prepare_rtc_resume,
 	.check_off_mode_enable = am33xx_check_off_mode_enable,
-	.get_rtc_base_addr = am43xx_get_rtc_base_addr,
 };
 
 static struct am33xx_pm_platform_data am43xx_ops = {
@@ -333,10 +311,7 @@ static struct am33xx_pm_platform_data am43xx_ops = {
 	.get_sram_addrs = amx3_get_sram_addrs,
 	.save_context = am43xx_save_context,
 	.restore_context = am43xx_restore_context,
-	.prepare_rtc_suspend = am43xx_prepare_rtc_suspend,
-	.prepare_rtc_resume = am43xx_prepare_rtc_resume,
 	.check_off_mode_enable = am43xx_check_off_mode_enable,
-	.get_rtc_base_addr = am43xx_get_rtc_base_addr,
 };
 
 static struct am33xx_pm_platform_data *am33xx_pm_get_pdata(void)
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/nvmem-consumer.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/platform_data/pm33xx.h>
 #include <linux/platform_device.h>
 #include <linux/rtc.h>
@@ -39,6 +40,8 @@
 #define GIC_INT_SET_PENDING_BASE 0x200
 #define AM43XX_GIC_DIST_BASE	0x48241000
 
+static void __iomem *rtc_base_virt;
+static struct clk *rtc_fck;
 static u32 rtc_magic_val;
 
 static int (*am33xx_do_wfi_sram)(unsigned long unused);
@@ -90,7 +93,7 @@ static int am33xx_push_sram_idle(void)
 	ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data;
 	ro_sram_data.amx3_pm_sram_data_phys =
 		gen_pool_virt_to_phys(sram_pool_data, ocmcram_location_data);
-	ro_sram_data.rtc_base_virt = pm_ops->get_rtc_base_addr();
+	ro_sram_data.rtc_base_virt = rtc_base_virt;
 
 	/* Save physical address to calculate resume offset during pm init */
 	am33xx_do_wfi_sram_phys = gen_pool_virt_to_phys(sram_pool,
@@ -158,7 +161,7 @@ static struct wkup_m3_wakeup_src rtc_wake_src(void)
 {
 	u32 i;
 
-	i = __raw_readl(pm_ops->get_rtc_base_addr() + 0x44) & 0x40;
+	i = __raw_readl(rtc_base_virt + 0x44) & 0x40;
 
 	if (i) {
 		retrigger_irq = rtc_alarm_wakeup.irq_nr;
@@ -177,13 +180,24 @@ static int am33xx_rtc_only_idle(unsigned long wfi_flags)
 	return 0;
 }
 
+/*
+ * Note that the RTC module clock must be re-enabled only for rtc+ddr suspend.
+ * And looks like the module can stay in SYSC_IDLE_SMART_WKUP mode configured
+ * by the interconnect code just fine for both rtc+ddr suspend and retention
+ * suspend.
+ */
 static int am33xx_pm_suspend(suspend_state_t suspend_state)
 {
 	int i, ret = 0;
 
 	if (suspend_state == PM_SUSPEND_MEM &&
 	    pm_ops->check_off_mode_enable()) {
-		pm_ops->prepare_rtc_suspend();
+		ret = clk_prepare_enable(rtc_fck);
+		if (ret) {
+			dev_err(pm33xx_dev, "Failed to enable clock: %i\n", ret);
+			return ret;
+		}
+
 		pm_ops->save_context();
 		suspend_wfi_flags |= WFI_FLAG_RTC_ONLY;
 		clk_save_context();
@@ -236,7 +250,7 @@ static int am33xx_pm_suspend(suspend_state_t suspend_state)
 	}
 
 	if (suspend_state == PM_SUSPEND_MEM && pm_ops->check_off_mode_enable())
-		pm_ops->prepare_rtc_resume();
+		clk_disable_unprepare(rtc_fck);
 
 	return ret;
 }
@@ -425,14 +439,28 @@ static int am33xx_pm_rtc_setup(void)
 	struct device_node *np;
 	unsigned long val = 0;
 	struct nvmem_device *nvmem;
+	int error;
 
 	np = of_find_node_by_name(NULL, "rtc");
 
 	if (of_device_is_available(np)) {
+		/* RTC interconnect target module clock */
+		rtc_fck = of_clk_get_by_name(np->parent, "fck");
+		if (IS_ERR(rtc_fck))
+			return PTR_ERR(rtc_fck);
+
+		rtc_base_virt = of_iomap(np, 0);
+		if (!rtc_base_virt) {
+			pr_warn("PM: could not iomap rtc");
+			error = -ENODEV;
+			goto err_clk_put;
+		}
+
 		omap_rtc = rtc_class_open("rtc0");
 		if (!omap_rtc) {
 			pr_warn("PM: rtc0 not available");
-			return -EPROBE_DEFER;
+			error = -EPROBE_DEFER;
+			goto err_iounmap;
 		}
 
 		nvmem = devm_nvmem_device_get(&omap_rtc->dev,
@@ -454,6 +482,13 @@ static int am33xx_pm_rtc_setup(void)
 	}
 
 	return 0;
+
+err_iounmap:
+	iounmap(rtc_base_virt);
+err_clk_put:
+	clk_put(rtc_fck);
+
+	return error;
 }
 
 static int am33xx_pm_probe(struct platform_device *pdev)
@@ -544,6 +579,8 @@ static int am33xx_pm_remove(struct platform_device *pdev)
 	suspend_set_ops(NULL);
 	wkup_m3_ipc_put(m3_ipc);
 	am33xx_pm_free_sram();
+	iounmap(rtc_base_virt);
+	clk_put(rtc_fck);
 	return 0;
 }
 
diff --git a/include/linux/platform_data/pm33xx.h b/include/linux/platform_data/pm33xx.h
--- a/include/linux/platform_data/pm33xx.h
+++ b/include/linux/platform_data/pm33xx.h
@@ -54,11 +54,8 @@ struct am33xx_pm_platform_data {
 	void    (*begin_suspend)(void);
 	void    (*finish_suspend)(void);
 	struct  am33xx_pm_sram_addr *(*get_sram_addrs)(void);
-	void __iomem *(*get_rtc_base_addr)(void);
 	void (*save_context)(void);
 	void (*restore_context)(void);
-	void (*prepare_rtc_suspend)(void);
-	void (*prepare_rtc_resume)(void);
 	int (*check_off_mode_enable)(void);
 };
 
-- 
2.27.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc
  2020-07-03 16:07 [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
  2020-07-03 16:07 ` [PATCH 1/3] soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data Tony Lindgren
@ 2020-07-03 16:07 ` Tony Lindgren
  2020-07-03 16:07 ` [PATCH 3/3] ARM: OMAP2+: Drop legacy platform data for dra7 rtcss Tony Lindgren
  2020-08-18  8:29 ` [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
  3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2020-07-03 16:07 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Santosh Shilimkar,
	Suman Anna, Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy

We can now probe devices with ti-sysc interconnect driver and dts
data. Let's drop the related platform data and custom ti,hwmods
dts property.

As we're just dropping data, and the early platform data init
is based on the custom ti,hwmods property, we want to drop both
the platform data and ti,hwmods property in a single patch.

Note that we also must tag rtc as disabled on am43x-epos-evm as
it's not accessible according to commit 4321dc8dff35 ("ARM: AM43XX:
hwmod: Add rtc hwmod"). And we must keep RTC enabled for rtcwake
to work now that we've removed the custom platfor code for
re-enabling the RTC on suspend.

Keerthy <j-keerthy@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/am33xx-l4.dtsi              |  1 -
 arch/arm/boot/dts/am437x-l4.dtsi              |  3 +-
 arch/arm/boot/dts/am43x-epos-evm.dts          |  4 ++
 .../omap_hwmod_33xx_43xx_common_data.h        |  2 -
 .../omap_hwmod_33xx_43xx_interconnect_data.c  |  8 ----
 .../omap_hwmod_33xx_43xx_ipblock_data.c       | 37 -------------------
 arch/arm/mach-omap2/omap_hwmod_33xx_data.c    |  1 -
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c    |  8 ----
 8 files changed, 5 insertions(+), 59 deletions(-)

diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi
--- a/arch/arm/boot/dts/am33xx-l4.dtsi
+++ b/arch/arm/boot/dts/am33xx-l4.dtsi
@@ -413,7 +413,6 @@ target-module@39000 {			/* 0x44e39000, ap 33 02.0 */
 
 		target-module@3e000 {			/* 0x44e3e000, ap 35 60.0 */
 			compatible = "ti,sysc-omap4-simple", "ti,sysc";
-			ti,hwmods = "rtc";
 			reg = <0x3e074 0x4>,
 			      <0x3e078 0x4>;
 			reg-names = "rev", "sysc";
diff --git a/arch/arm/boot/dts/am437x-l4.dtsi b/arch/arm/boot/dts/am437x-l4.dtsi
--- a/arch/arm/boot/dts/am437x-l4.dtsi
+++ b/arch/arm/boot/dts/am437x-l4.dtsi
@@ -409,9 +409,8 @@ target-module@39000 {			/* 0x44e39000, ap 32 02.0 */
 			ranges = <0x0 0x39000 0x1000>;
 		};
 
-		target-module@3e000 {			/* 0x44e3e000, ap 34 60.0 */
+		rtc_target: target-module@3e000 {	/* 0x44e3e000, ap 34 60.0 */
 			compatible = "ti,sysc-omap4-simple", "ti,sysc";
-			ti,hwmods = "rtc";
 			reg = <0x3e074 0x4>,
 			      <0x3e078 0x4>;
 			reg-names = "rev", "sysc";
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -833,6 +833,10 @@ &epwmss0 {
 	status = "okay";
 };
 
+&rtc_target {
+	status = "disabled";
+};
+
 &tscadc {
 	status = "okay";
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
@@ -26,7 +26,6 @@ extern struct omap_hwmod_ocp_if am33xx_mpu__prcm;
 extern struct omap_hwmod_ocp_if am33xx_l3_s__l3_main;
 extern struct omap_hwmod_ocp_if am33xx_gfx__l3_main;
 extern struct omap_hwmod_ocp_if am33xx_l3_main__gfx;
-extern struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc;
 extern struct omap_hwmod_ocp_if am33xx_l3_s__gpmc;
 extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer2;
 extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc;
@@ -43,7 +42,6 @@ extern struct omap_hwmod am33xx_ocmcram_hwmod;
 extern struct omap_hwmod am33xx_smartreflex0_hwmod;
 extern struct omap_hwmod am33xx_smartreflex1_hwmod;
 extern struct omap_hwmod am33xx_gpmc_hwmod;
-extern struct omap_hwmod am33xx_rtc_hwmod;
 
 extern struct omap_hwmod_class am33xx_emif_hwmod_class;
 extern struct omap_hwmod_class am33xx_l4_hwmod_class;
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
@@ -90,14 +90,6 @@ struct omap_hwmod_ocp_if am33xx_l3_main__gfx = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-/* l4 wkup -> rtc */
-struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc = {
-	.master		= &am33xx_l4_wkup_hwmod,
-	.slave		= &am33xx_rtc_hwmod,
-	.clk		= "clkdiv32k_ick",
-	.user		= OCP_USER_MPU,
-};
-
 /* l3s cfg -> gpmc */
 struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = {
 	.master		= &am33xx_l3_s_hwmod,
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -26,7 +26,6 @@
 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
 #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
-#define PRCM_FLAGS(oh, flag) ((oh).prcm.omap4.flags = (flag))
 
 /*
  * 'l3' class
@@ -274,47 +273,12 @@ struct omap_hwmod am33xx_gpmc_hwmod = {
 	},
 };
 
-
-/*
- * 'rtc' class
- * rtc subsystem
- */
-static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
-	.rev_offs	= 0x0074,
-	.sysc_offs	= 0x0078,
-	.sysc_flags	= SYSC_HAS_SIDLEMODE,
-	.idlemodes	= (SIDLE_FORCE | SIDLE_NO |
-			  SIDLE_SMART | SIDLE_SMART_WKUP),
-	.sysc_fields	= &omap_hwmod_sysc_type3,
-};
-
-static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
-	.name		= "rtc",
-	.sysc		= &am33xx_rtc_sysc,
-	.unlock		= &omap_hwmod_rtc_unlock,
-	.lock		= &omap_hwmod_rtc_lock,
-};
-
-struct omap_hwmod am33xx_rtc_hwmod = {
-	.name		= "rtc",
-	.class		= &am33xx_rtc_hwmod_class,
-	.clkdm_name	= "l4_rtc_clkdm",
-	.main_clk	= "clk_32768_ck",
-	.prcm		= {
-		.omap4	= {
-			.modulemode	= MODULEMODE_SWCTRL,
-		},
-	},
-};
-
 static void omap_hwmod_am33xx_clkctrl(void)
 {
 	CLKCTRL(am33xx_smartreflex0_hwmod,
 		AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_smartreflex1_hwmod,
 		AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
-	CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
-	PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
@@ -343,7 +307,6 @@ static void omap_hwmod_am43xx_clkctrl(void)
 		AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_smartreflex1_hwmod,
 		AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
-	CLKCTRL(am33xx_rtc_hwmod, AM43XX_CM_RTC_RTC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET);
 	CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -283,7 +283,6 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
 	&am33xx_l4_wkup__control,
 	&am33xx_l4_wkup__smartreflex0,
 	&am33xx_l4_wkup__smartreflex1,
-	&am33xx_l4_wkup__rtc,
 	&am33xx_l3_s__gpmc,
 	&am33xx_l3_main__ocmc,
 	NULL,
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -216,11 +216,6 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
 	NULL,
 };
 
-static struct omap_hwmod_ocp_if *am43xx_rtc_hwmod_ocp_ifs[] __initdata = {
-	&am33xx_l4_wkup__rtc,
-	NULL,
-};
-
 int __init am43xx_hwmod_init(void)
 {
 	int ret;
@@ -229,8 +224,5 @@ int __init am43xx_hwmod_init(void)
 	omap_hwmod_init();
 	ret = omap_hwmod_register_links(am43xx_hwmod_ocp_ifs);
 
-	if (!ret && of_machine_is_compatible("ti,am4372"))
-		ret = omap_hwmod_register_links(am43xx_rtc_hwmod_ocp_ifs);
-
 	return ret;
 }
-- 
2.27.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] ARM: OMAP2+: Drop legacy platform data for dra7 rtcss
  2020-07-03 16:07 [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
  2020-07-03 16:07 ` [PATCH 1/3] soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data Tony Lindgren
  2020-07-03 16:07 ` [PATCH 2/3] ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc Tony Lindgren
@ 2020-07-03 16:07 ` Tony Lindgren
  2020-08-18  8:29 ` [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
  3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2020-07-03 16:07 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Santosh Shilimkar,
	Suman Anna, Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy

We can now probe devices with ti-sysc interconnect driver and dts
data. Let's drop the related platform data and custom ti,hwmods
dts property.

As we're just dropping data, and the early platform data init
is based on the custom ti,hwmods property, we want to drop both
the platform data and ti,hwmods property in a single patch.

Cc: Keerthy <j-keerthy@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/dra7-l4.dtsi            |  1 -
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 44 -----------------------
 2 files changed, 45 deletions(-)

diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
--- a/arch/arm/boot/dts/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/dra7-l4.dtsi
@@ -3561,7 +3561,6 @@ timer16: timer@0 {
 
 		rtctarget: target-module@38000 {			/* 0x48838000, ap 29 12.0 */
 			compatible = "ti,sysc-omap4-simple", "ti,sysc";
-			ti,hwmods = "rtcss";
 			reg = <0x38074 0x4>,
 			      <0x38078 0x4>;
 			reg-names = "rev", "sysc";
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -418,41 +418,6 @@ static struct omap_hwmod dra7xx_qspi_hwmod = {
 	},
 };
 
-/*
- * 'rtcss' class
- *
- */
-static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
-	.rev_offs	= 0x0074,
-	.sysc_offs	= 0x0078,
-	.sysc_flags	= SYSC_HAS_SIDLEMODE,
-	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
-			   SIDLE_SMART_WKUP),
-	.sysc_fields	= &omap_hwmod_sysc_type3,
-};
-
-static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
-	.name	= "rtcss",
-	.sysc	= &dra7xx_rtcss_sysc,
-	.unlock	= &omap_hwmod_rtc_unlock,
-	.lock	= &omap_hwmod_rtc_lock,
-};
-
-/* rtcss */
-static struct omap_hwmod dra7xx_rtcss_hwmod = {
-	.name		= "rtcss",
-	.class		= &dra7xx_rtcss_hwmod_class,
-	.clkdm_name	= "rtc_clkdm",
-	.main_clk	= "sys_32k_ck",
-	.prcm = {
-		.omap4 = {
-			.clkctrl_offs = DRA7XX_CM_RTC_RTCSS_CLKCTRL_OFFSET,
-			.context_offs = DRA7XX_RM_RTC_RTCSS_CONTEXT_OFFSET,
-			.modulemode   = MODULEMODE_SWCTRL,
-		},
-	},
-};
-
 /*
  * 'sata' class
  *
@@ -797,14 +762,6 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__qspi = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-/* l4_per3 -> rtcss */
-static struct omap_hwmod_ocp_if dra7xx_l4_per3__rtcss = {
-	.master		= &dra7xx_l4_per3_hwmod,
-	.slave		= &dra7xx_rtcss_hwmod,
-	.clk		= "l4_root_clk_div",
-	.user		= OCP_USER_MPU | OCP_USER_SDMA,
-};
-
 /* l4_cfg -> sata */
 static struct omap_hwmod_ocp_if dra7xx_l4_cfg__sata = {
 	.master		= &dra7xx_l4_cfg_hwmod,
@@ -930,7 +887,6 @@ static struct omap_hwmod_ocp_if *dra72x_hwmod_ocp_ifs[] __initdata = {
 };
 
 static struct omap_hwmod_ocp_if *rtc_hwmod_ocp_ifs[] __initdata = {
-	&dra7xx_l4_per3__rtcss,
 	NULL,
 };
 
-- 
2.27.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7
  2020-07-03 16:07 [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
                   ` (2 preceding siblings ...)
  2020-07-03 16:07 ` [PATCH 3/3] ARM: OMAP2+: Drop legacy platform data for dra7 rtcss Tony Lindgren
@ 2020-08-18  8:29 ` Tony Lindgren
  2020-08-19 17:21   ` santosh.shilimkar
  3 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2020-08-18  8:29 UTC (permalink / raw)
  To: linux-omap, Santosh Shilimkar
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Suman Anna,
	Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy

Hi Santosh,

* Tony Lindgren <tony@atomide.com> [200703 19:08]:
> Hi all,
> 
> Here are patches to simplify the RTC+DDR PM code for am3 and am4. We want
> to do this to drop the RTC related legacy platform data for am3 and am4.
> We also drop RTC legacy platform data for dra7.
> 
> Please test the RTC+DDR suspend on am437x-gp-evm if possible. I've tested
> this series on am437x-sk-evm, but at least currently cannot do RTC+DDR
> suspend and is limited to testing retention suspend only.
> 
> These patches depend on v5.8-rc3 for earlier suspend and resume related
> fixes.
> 
> Additionally, for testing the LCD for suspend, the following patch is
> needed for the missing omapdrm PM ops:
> 
> drm/omap: force runtime PM suspend on system suspend

Here's another series that was getting too late for v5.9 that I'd like to
queue for v5.10. Care to take a look and ack if it looks OK?

Regards,

Tony


> Tony Lindgren (3):
>   soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data
>   ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc
>   ARM: OMAP2+: Drop legacy platform data for dra7 rtcss
> 
>  arch/arm/boot/dts/am33xx-l4.dtsi              |  1 -
>  arch/arm/boot/dts/am437x-l4.dtsi              |  3 +-
>  arch/arm/boot/dts/am43x-epos-evm.dts          |  4 ++
>  arch/arm/boot/dts/dra7-l4.dtsi                |  1 -
>  .../omap_hwmod_33xx_43xx_common_data.h        |  2 -
>  .../omap_hwmod_33xx_43xx_interconnect_data.c  |  8 ----
>  .../omap_hwmod_33xx_43xx_ipblock_data.c       | 37 ---------------
>  arch/arm/mach-omap2/omap_hwmod_33xx_data.c    |  1 -
>  arch/arm/mach-omap2/omap_hwmod_43xx_data.c    |  8 ----
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c     | 44 -----------------
>  arch/arm/mach-omap2/pm33xx-core.c             | 25 ----------
>  drivers/soc/ti/pm33xx.c                       | 47 +++++++++++++++++--
>  include/linux/platform_data/pm33xx.h          |  3 --
>  13 files changed, 47 insertions(+), 137 deletions(-)
> 
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7
  2020-08-18  8:29 ` [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
@ 2020-08-19 17:21   ` santosh.shilimkar
  0 siblings, 0 replies; 6+ messages in thread
From: santosh.shilimkar @ 2020-08-19 17:21 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap, Santosh Shilimkar
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Suman Anna,
	Tero Kristo, linux-kernel, linux-arm-kernel, Keerthy



On 8/18/20 1:29 AM, Tony Lindgren wrote:
> Hi Santosh,
> 
> * Tony Lindgren <tony@atomide.com> [200703 19:08]:
>> Hi all,
>>
>> Here are patches to simplify the RTC+DDR PM code for am3 and am4. We want
>> to do this to drop the RTC related legacy platform data for am3 and am4.
>> We also drop RTC legacy platform data for dra7.
>>
>> Please test the RTC+DDR suspend on am437x-gp-evm if possible. I've tested
>> this series on am437x-sk-evm, but at least currently cannot do RTC+DDR
>> suspend and is limited to testing retention suspend only.
>>
>> These patches depend on v5.8-rc3 for earlier suspend and resume related
>> fixes.
>>
>> Additionally, for testing the LCD for suspend, the following patch is
>> needed for the missing omapdrm PM ops:
>>
>> drm/omap: force runtime PM suspend on system suspend
> 
> Here's another series that was getting too late for v5.9 that I'd like to
> queue for v5.10. Care to take a look and ack if it looks OK?
> 
Just finished going through the patches. If the suspend continue to work
with this update then its good to go.

FWIW,
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-19 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 16:07 [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
2020-07-03 16:07 ` [PATCH 1/3] soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data Tony Lindgren
2020-07-03 16:07 ` [PATCH 2/3] ARM: OMAP2+: Drop legacy platform data for am3 and am4 rtc Tony Lindgren
2020-07-03 16:07 ` [PATCH 3/3] ARM: OMAP2+: Drop legacy platform data for dra7 rtcss Tony Lindgren
2020-08-18  8:29 ` [PATCH 0/3] Simplify PM for am3/4, drop RTC pdata for am3/4/dra7 Tony Lindgren
2020-08-19 17:21   ` santosh.shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).