linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Few ti-sysc related fixes
@ 2020-10-26 10:58 Tony Lindgren
  2020-10-26 10:58 ` [PATCH 1/4] ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS Tony Lindgren
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-10-26 10:58 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Grygorii Strashko, Keerthy, Nishanth Menon, Peter Ujfalusi,
	Roger Quadros, Suman Anna, Tero Kristo, linux-kernel,
	linux-arm-kernel

Hi,

Here are few fixes for ti-sysc interconnect target module driver related
issues.

Regards,

Tony


Tony Lindgren (4):
  ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS
  ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF
  bus: ti-sysc: Fix reset status check for modules with quirks
  bus: ti-sysc: Fix bogus resetdone warning for cpsw

 arch/arm/mach-omap2/Kconfig           |  3 ++-
 drivers/bus/ti-sysc.c                 | 28 ++++++++++++++++-----------
 include/linux/platform_data/ti-sysc.h |  1 +
 3 files changed, 20 insertions(+), 12 deletions(-)

-- 
2.29.1

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

* [PATCH 1/4] ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS
  2020-10-26 10:58 [PATCH 0/4] Few ti-sysc related fixes Tony Lindgren
@ 2020-10-26 10:58 ` Tony Lindgren
  2020-10-26 10:58 ` [PATCH 2/4] ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF Tony Lindgren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-10-26 10:58 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Grygorii Strashko, Keerthy, Nishanth Menon, Peter Ujfalusi,
	Roger Quadros, Suman Anna, Tero Kristo, linux-kernel,
	linux-arm-kernel

I accidentally misplaced select PM_GENERIC_DOMAINS, it should be
selected for all the SoCs instead.

Fixes: 58cbff023bfa ("soc: ti: omap-prm: Add basic power domain support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -7,7 +7,6 @@ config ARCH_OMAP2
 	depends on ARCH_MULTI_V6
 	select ARCH_OMAP2PLUS
 	select CPU_V6
-	select PM_GENERIC_DOMAINS if PM
 	select SOC_HAS_OMAP2_SDRC
 
 config ARCH_OMAP3
@@ -106,6 +105,7 @@ config ARCH_OMAP2PLUS
 	select OMAP_DM_TIMER
 	select OMAP_GPMC
 	select PINCTRL
+	select PM_GENERIC_DOMAINS if PM
 	select RESET_CONTROLLER
 	select SOC_BUS
 	select TI_SYSC
-- 
2.29.1

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

* [PATCH 2/4] ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF
  2020-10-26 10:58 [PATCH 0/4] Few ti-sysc related fixes Tony Lindgren
  2020-10-26 10:58 ` [PATCH 1/4] ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS Tony Lindgren
@ 2020-10-26 10:58 ` Tony Lindgren
  2020-10-26 10:58 ` [PATCH 3/4] bus: ti-sysc: Fix reset status check for modules with quirks Tony Lindgren
  2020-10-26 10:58 ` [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw Tony Lindgren
  3 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-10-26 10:58 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Grygorii Strashko, Keerthy, Nishanth Menon, Peter Ujfalusi,
	Roger Quadros, Suman Anna, Tero Kristo, linux-kernel,
	linux-arm-kernel

We should select also PM_GENERIC_DOMAINS_OF in addition to
PM_GENERIC_DOMAINS to have device tree based PM domain providers
enabled.

Fixes: 58cbff023bfa ("soc: ti: omap-prm: Add basic power domain support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -106,6 +106,7 @@ config ARCH_OMAP2PLUS
 	select OMAP_GPMC
 	select PINCTRL
 	select PM_GENERIC_DOMAINS if PM
+	select PM_GENERIC_DOMAINS_OF if PM
 	select RESET_CONTROLLER
 	select SOC_BUS
 	select TI_SYSC
-- 
2.29.1

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

* [PATCH 3/4] bus: ti-sysc: Fix reset status check for modules with quirks
  2020-10-26 10:58 [PATCH 0/4] Few ti-sysc related fixes Tony Lindgren
  2020-10-26 10:58 ` [PATCH 1/4] ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS Tony Lindgren
  2020-10-26 10:58 ` [PATCH 2/4] ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF Tony Lindgren
@ 2020-10-26 10:58 ` Tony Lindgren
  2020-10-26 10:58 ` [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw Tony Lindgren
  3 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-10-26 10:58 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Grygorii Strashko, Keerthy, Nishanth Menon, Peter Ujfalusi,
	Roger Quadros, Suman Anna, Tero Kristo, linux-kernel,
	linux-arm-kernel

Commit d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and
wait for softreset bit") started showing a "OCP softreset timed out"
warning on enable if the interconnect target module is not out of reset.
This caused the warning to be often triggered for i2c and hdq while the
devices are working properly.

Turns out that some interconnect target modules seem to have an unusable
reset status bits unless the module specific reset quirks are activated.

Let's just skip the reset status check for those modules as we only want
to activate the reset quirks when doing a reset, and not on enable. This
way we don't see the bogus "OCP softreset timed out" warnings during boot.

Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c                 | 24 +++++++++++++++---------
 include/linux/platform_data/ti-sysc.h |  1 +
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -970,9 +970,15 @@ static int sysc_enable_module(struct device *dev)
 			return error;
 		}
 	}
-	error = sysc_wait_softreset(ddata);
-	if (error)
-		dev_warn(ddata->dev, "OCP softreset timed out\n");
+	/*
+	 * Some modules like i2c and hdq1w have unusable reset status unless
+	 * the module reset quirk is enabled. Skip status check on enable.
+	 */
+	if (!(ddata->cfg.quirks & SYSC_MODULE_QUIRK_ENA_RESETDONE)) {
+		error = sysc_wait_softreset(ddata);
+		if (error)
+			dev_warn(ddata->dev, "OCP softreset timed out\n");
+	}
 	if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET)
 		sysc_disable_opt_clocks(ddata);
 
@@ -1373,17 +1379,17 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
 	SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50030200, 0xffffffff,
 		   SYSC_QUIRK_OPT_CLKS_NEEDED),
 	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff,
-		   SYSC_MODULE_QUIRK_HDQ1W),
+		   SYSC_MODULE_QUIRK_HDQ1W | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
-		   SYSC_MODULE_QUIRK_HDQ1W),
+		   SYSC_MODULE_QUIRK_HDQ1W | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000036, 0x000000ff,
-		   SYSC_MODULE_QUIRK_I2C),
+		   SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x0000003c, 0x000000ff,
-		   SYSC_MODULE_QUIRK_I2C),
+		   SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000040, 0x000000ff,
-		   SYSC_MODULE_QUIRK_I2C),
+		   SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0,
-		   SYSC_MODULE_QUIRK_I2C),
+		   SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE),
 	SYSC_QUIRK("gpu", 0x50000000, 0x14, -ENODEV, -ENODEV, 0x00010201, 0xffffffff, 0),
 	SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff,
 		   SYSC_MODULE_QUIRK_SGX),
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -50,6 +50,7 @@ struct sysc_regbits {
 	s8 emufree_shift;
 };
 
+#define SYSC_MODULE_QUIRK_ENA_RESETDONE	BIT(25)
 #define SYSC_MODULE_QUIRK_PRUSS		BIT(24)
 #define SYSC_MODULE_QUIRK_DSS_RESET	BIT(23)
 #define SYSC_MODULE_QUIRK_RTC_UNLOCK	BIT(22)
-- 
2.29.1

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

* [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw
  2020-10-26 10:58 [PATCH 0/4] Few ti-sysc related fixes Tony Lindgren
                   ` (2 preceding siblings ...)
  2020-10-26 10:58 ` [PATCH 3/4] bus: ti-sysc: Fix reset status check for modules with quirks Tony Lindgren
@ 2020-10-26 10:58 ` Tony Lindgren
  2020-10-30 18:15   ` Grygorii Strashko
  3 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-10-26 10:58 UTC (permalink / raw)
  To: linux-omap
  Cc: Andrew F . Davis, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Grygorii Strashko, Keerthy, Nishanth Menon, Peter Ujfalusi,
	Roger Quadros, Suman Anna, Tero Kristo, linux-kernel,
	linux-arm-kernel

The cpsw SOFT_RESET register is cleard when out of reset so let's
add SYSS_QUIRK_RESETDONE_INVERTED flag for cpsw. Otherwise we will
get bogus "OCP softreset timed out" warnings on boot.

Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -1364,6 +1364,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
 	/* Quirks that need to be set based on detected module */
 	SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,
 		   SYSC_MODULE_QUIRK_AESS),
+	SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,
+		   0xffff00f0, SYSS_QUIRK_RESETDONE_INVERTED),
 	SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
 		   SYSC_QUIRK_CLKDM_NOAUTO),
 	SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,
@@ -1423,8 +1425,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
 	SYSC_QUIRK("atl", 0, 0, -ENODEV, -ENODEV, 0x0a070100, 0xffffffff, 0),
 	SYSC_QUIRK("cm", 0, 0, -ENODEV, -ENODEV, 0x40000301, 0xffffffff, 0),
 	SYSC_QUIRK("control", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0),
-	SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,
-		   0xffff00f0, 0),
 	SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 0),
 	SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0x4edb1902, 0xffffffff, 0),
 	SYSC_QUIRK("dispc", 0x4832a400, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0),
-- 
2.29.1

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

* Re: [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw
  2020-10-26 10:58 ` [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw Tony Lindgren
@ 2020-10-30 18:15   ` Grygorii Strashko
  2020-10-31  7:11     ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Grygorii Strashko @ 2020-10-30 18:15 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman, Keerthy,
	Nishanth Menon, Peter Ujfalusi, Roger Quadros, Suman Anna,
	Tero Kristo, linux-kernel, linux-arm-kernel

Hi Tony,

On 26/10/2020 12:58, Tony Lindgren wrote:
> The cpsw SOFT_RESET register is cleard when out of reset so let's
> add SYSS_QUIRK_RESETDONE_INVERTED flag for cpsw. Otherwise we will
> get bogus "OCP softreset timed out" warnings on boot.

Not sure if this quirk based approach is right way to move forward here.

The cpsw/cpgmac is "ti,sysc-omap4-simple" which means sysc_omap4_simple, which,
in turn, has .srst_shift = -ENODEV.

And above should be enough to avoid both sysc_reset() and sysc_wait_softreset() for such modules.


> 
> Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>   drivers/bus/ti-sysc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -1364,6 +1364,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
>   	/* Quirks that need to be set based on detected module */
>   	SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,
>   		   SYSC_MODULE_QUIRK_AESS),
> +	SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,
> +		   0xffff00f0, SYSS_QUIRK_RESETDONE_INVERTED),
>   	SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
>   		   SYSC_QUIRK_CLKDM_NOAUTO),
>   	SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,
> @@ -1423,8 +1425,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
>   	SYSC_QUIRK("atl", 0, 0, -ENODEV, -ENODEV, 0x0a070100, 0xffffffff, 0),
>   	SYSC_QUIRK("cm", 0, 0, -ENODEV, -ENODEV, 0x40000301, 0xffffffff, 0),
>   	SYSC_QUIRK("control", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0),
> -	SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,
> -		   0xffff00f0, 0),
>   	SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 0),
>   	SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0x4edb1902, 0xffffffff, 0),
>   	SYSC_QUIRK("dispc", 0x4832a400, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0),
> 

-- 
Best regards,
grygorii

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

* Re: [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw
  2020-10-30 18:15   ` Grygorii Strashko
@ 2020-10-31  7:11     ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-10-31  7:11 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: linux-omap, Dave Gerlach, Faiz Abbas, Greg Kroah-Hartman,
	Keerthy, Nishanth Menon, Peter Ujfalusi, Roger Quadros,
	Suman Anna, Tero Kristo, linux-kernel, linux-arm-kernel

* Grygorii Strashko <grygorii.strashko@ti.com> [201030 18:15]:
> Hi Tony,
> 
> On 26/10/2020 12:58, Tony Lindgren wrote:
> > The cpsw SOFT_RESET register is cleard when out of reset so let's
> > add SYSS_QUIRK_RESETDONE_INVERTED flag for cpsw. Otherwise we will
> > get bogus "OCP softreset timed out" warnings on boot.
> 
> Not sure if this quirk based approach is right way to move forward here.
> 
> The cpsw/cpgmac is "ti,sysc-omap4-simple" which means sysc_omap4_simple, which,
> in turn, has .srst_shift = -ENODEV.
> 
> And above should be enough to avoid both sysc_reset() and sysc_wait_softreset() for such modules.

That sounds like a much better fix indeed, I'll take a look.

Thanks,

Tony

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

end of thread, other threads:[~2020-10-31  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 10:58 [PATCH 0/4] Few ti-sysc related fixes Tony Lindgren
2020-10-26 10:58 ` [PATCH 1/4] ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS Tony Lindgren
2020-10-26 10:58 ` [PATCH 2/4] ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF Tony Lindgren
2020-10-26 10:58 ` [PATCH 3/4] bus: ti-sysc: Fix reset status check for modules with quirks Tony Lindgren
2020-10-26 10:58 ` [PATCH 4/4] bus: ti-sysc: Fix bogus resetdone warning for cpsw Tony Lindgren
2020-10-30 18:15   ` Grygorii Strashko
2020-10-31  7:11     ` Tony Lindgren

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).