Skip to contentSkip to conversation

bus: ti-sysc: Implement quirk handling for CLKDM_NOAUTO

PATCH In review Tony Lindgren 2 participants 2 messages Dec 10, 2019 – Dec 24, 2019 OMAP2+ support

lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

PATCH 1/1 bus: ti-sysc: Implement quirk handling for CLKDM_NOAUTO

For dra7 dcan and dwc3 instances we need to block clockdomain autoidle. Let's do this with CLKDM_NOAUTO quirk flag and enable it for dcan and dwc3.

Cc Keerthy <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Tero Kristo <[email protected]>
---
 drivers/bus/ti-sysc.c                 | 10 ++++++++--
 include/linux/platform_data/ti-sysc.h |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +8 -2
@@ -473,7 +473,7 @@ static void sysc_clkdm_deny_idle(struct sysc *ddata)
 {
 	struct ti_sysc_platform_data *pdata;
 
-	if (ddata->legacy_mode)
+	if (ddata->legacy_mode || (ddata->cfg.quirks & SYSC_QUIRK_CLKDM_NOAUTO))
 		return;
 
 	pdata = dev_get_platdata(ddata->dev);
@@ -485,7 +485,7 @@ static void sysc_clkdm_allow_idle(struct sysc *ddata)
 {
 	struct ti_sysc_platform_data *pdata;
 
-	if (ddata->legacy_mode)
+	if (ddata->legacy_mode || (ddata->cfg.quirks & SYSC_QUIRK_CLKDM_NOAUTO))
 		return;
 
 	pdata = dev_get_platdata(ddata->dev);
@@ -1245,6 +1245,12 @@ 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, -1, 0x40000000, 0xffffffff,
 		   SYSC_MODULE_QUIRK_AESS),
+	SYSC_QUIRK("dcan", 0x48480000, 0x20, -1, -1, 0xa3170504, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
+	SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -1, 0x500a0200, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
+	SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -1, 0x500a0200, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
 	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff,
 		   SYSC_MODULE_QUIRK_HDQ1W),
 	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
include/linux/platform_data/ti-sysc.h +1 -0
@@ -49,6 +49,7 @@ struct sysc_regbits {
 	s8 emufree_shift;
 };
 
+#define SYSC_QUIRK_CLKDM_NOAUTO		BIT(21)
 #define SYSC_QUIRK_FORCE_MSTANDBY	BIT(20)
 #define SYSC_MODULE_QUIRK_AESS		BIT(19)
 #define SYSC_MODULE_QUIRK_SGX		BIT(18)
Signature · 1 line
2.24.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Tony Lindgren

For dra7 dcan and dwc3 instances we need to block clockdomain autoidle. Let's do this with CLKDM_NOAUTO quirk flag and enable it for dcan and dwc3.

Cc Keerthy <[email protected]>
Cc Roger Quadros <[email protected]>
Cc Tero Kristo <[email protected]>
Quoted 51 lines
---
  drivers/bus/ti-sysc.c                 | 10 ++++++++--
  include/linux/platform_data/ti-sysc.h |  1 +
  2 files changed, 9 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +8 -2
@@ -473,7 +473,7 @@ static void sysc_clkdm_deny_idle(struct sysc *ddata)
  {
  	struct ti_sysc_platform_data *pdata;
 
-	if (ddata->legacy_mode)
+	if (ddata->legacy_mode || (ddata->cfg.quirks & SYSC_QUIRK_CLKDM_NOAUTO))
  		return;
 
  	pdata = dev_get_platdata(ddata->dev);
@@ -485,7 +485,7 @@ static void sysc_clkdm_allow_idle(struct sysc *ddata)
  {
  	struct ti_sysc_platform_data *pdata;
 
-	if (ddata->legacy_mode)
+	if (ddata->legacy_mode || (ddata->cfg.quirks & SYSC_QUIRK_CLKDM_NOAUTO))
  		return;
 
  	pdata = dev_get_platdata(ddata->dev);
@@ -1245,6 +1245,12 @@ 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, -1, 0x40000000, 0xffffffff,
  		   SYSC_MODULE_QUIRK_AESS),
+	SYSC_QUIRK("dcan", 0x48480000, 0x20, -1, -1, 0xa3170504, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
+	SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -1, 0x500a0200, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
+	SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -1, 0x500a0200, 0xffffffff,
+		   SYSC_QUIRK_CLKDM_NOAUTO),
  	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff,
  		   SYSC_MODULE_QUIRK_HDQ1W),
  	SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
include/linux/platform_data/ti-sysc.h +1 -0
@@ -49,6 +49,7 @@ struct sysc_regbits {
  	s8 emufree_shift;
  };
 
+#define SYSC_QUIRK_CLKDM_NOAUTO		BIT(21)
  #define SYSC_QUIRK_FORCE_MSTANDBY	BIT(20)
  #define SYSC_MODULE_QUIRK_AESS		BIT(19)
  #define SYSC_MODULE_QUIRK_SGX		BIT(18)
Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki