Skip to content

Commit 6aed5a0

Browse files
committed
Merge branch 'watchdog-fix' into fixes
2 parents 0af3e1a + c7d8669 commit 6aed5a0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/bus/ti-sysc.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {
7474
* @clk_disable_quirk: module specific clock disable quirk
7575
* @reset_done_quirk: module specific reset done quirk
7676
* @module_enable_quirk: module specific enable quirk
77+
* @module_disable_quirk: module specific disable quirk
7778
*/
7879
struct sysc {
7980
struct device *dev;
@@ -100,6 +101,7 @@ struct sysc {
100101
void (*clk_disable_quirk)(struct sysc *sysc);
101102
void (*reset_done_quirk)(struct sysc *sysc);
102103
void (*module_enable_quirk)(struct sysc *sysc);
104+
void (*module_disable_quirk)(struct sysc *sysc);
103105
};
104106

105107
static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
@@ -959,6 +961,9 @@ static int sysc_disable_module(struct device *dev)
959961
if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV)
960962
return 0;
961963

964+
if (ddata->module_disable_quirk)
965+
ddata->module_disable_quirk(ddata);
966+
962967
regbits = ddata->cap->regbits;
963968
reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
964969

@@ -1248,6 +1253,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
12481253
SYSC_MODULE_QUIRK_SGX),
12491254
SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
12501255
SYSC_MODULE_QUIRK_WDT),
1256+
/* Watchdog on am3 and am4 */
1257+
SYSC_QUIRK("wdt", 0x44e35000, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
1258+
SYSC_MODULE_QUIRK_WDT | SYSC_QUIRK_SWSUP_SIDLE),
12511259

12521260
#ifdef DEBUG
12531261
SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0),
@@ -1440,14 +1448,14 @@ static void sysc_reset_done_quirk_wdt(struct sysc *ddata)
14401448
!(val & 0x10), 100,
14411449
MAX_MODULE_SOFTRESET_WAIT);
14421450
if (error)
1443-
dev_warn(ddata->dev, "wdt disable spr failed\n");
1451+
dev_warn(ddata->dev, "wdt disable step1 failed\n");
14441452

1445-
sysc_write(ddata, wps, 0x5555);
1453+
sysc_write(ddata, spr, 0x5555);
14461454
error = readl_poll_timeout(ddata->module_va + wps, val,
14471455
!(val & 0x10), 100,
14481456
MAX_MODULE_SOFTRESET_WAIT);
14491457
if (error)
1450-
dev_warn(ddata->dev, "wdt disable wps failed\n");
1458+
dev_warn(ddata->dev, "wdt disable step2 failed\n");
14511459
}
14521460

14531461
static void sysc_init_module_quirks(struct sysc *ddata)
@@ -1471,8 +1479,10 @@ static void sysc_init_module_quirks(struct sysc *ddata)
14711479
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX)
14721480
ddata->module_enable_quirk = sysc_module_enable_quirk_sgx;
14731481

1474-
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_WDT)
1482+
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_WDT) {
14751483
ddata->reset_done_quirk = sysc_reset_done_quirk_wdt;
1484+
ddata->module_disable_quirk = sysc_reset_done_quirk_wdt;
1485+
}
14761486
}
14771487

14781488
static int sysc_clockdomain_init(struct sysc *ddata)

0 commit comments

Comments
 (0)