more ti-sysc driver changes for omap variants for v5.4

Few changes mostly to deal with sgx SoC glue quirk for omap36xx that
 is needed for the related sgx SoC glue dts branch. The other changes
 are to simplify sysc_check_one_child() sysc_check_children() to be void
 functions, and detect d2d module when debugging is enabled.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAl1kCukRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXNGSg//aGJnfbZAf98HNJMo/6rnY88pxf/smR9W
 YdIjP4DbqIq//W0VvfhI/QlnsGPcgBNn8ir6c3U8dyEAsYDl5HgOWqZHRClDlnBv
 ISGniT7oQBRleJheGzAOk8axbsF3T6cpIt9TjBl0I8GbSii7DIla80m+pI5FEUx7
 HspyxiN2yyvkhN47FzrVAOJvYGw7ceri0YkVqiMk7IqKNcw6jVXA0yqqfJNU+EqG
 4oFa+kt0RdkbxIsujWNYiN3r8RGET61lBb0nTFH39nu9VwDqNjiW69lNY+mvxL6F
 yohSKrKxrpaWPQ8FxUzqBECxUMSiN/iK12I3A+Jg+vvs7cjoLbHvQHj7KGPiCWH8
 qNek9KTpMnH06k2UbulWZ/8GCuzgBKIt+0fXzSovaVqzT/PrdjW9dN3AJ5H7ip/F
 EzkzJoxAF5PTaUAIxVsDfTpQGr/H2TXzSYpJc50iWTPTC7DIc7B0U+gNqN+TAIWN
 AEFoEk2U/e3Hyl+aFaqaY7+YoJOOkWz6qJk/5zXwNhl7b7qfrF6uhcfkQCqP6/ht
 cAPgz4FFiZINMPWnzt9srQxmC5gNj2i565t3NQ7gfv10XNGsxI0/6XhnmfOq8myE
 Pdzv6XlfZWFSz9TvQwFGoQzcGxxo94jtJ9rioPia5op1flx2cOZ09mzAZE/Bx5cL
 +ATlPBMxQjo=
 =UBeA
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v5.4/ti-sysc-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/late

more ti-sysc driver changes for omap variants for v5.4

Few changes mostly to deal with sgx SoC glue quirk for omap36xx that
is needed for the related sgx SoC glue dts branch. The other changes
are to simplify sysc_check_one_child() sysc_check_children() to be void
functions, and detect d2d module when debugging is enabled.

* tag 'omap-for-v5.4/ti-sysc-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  bus: ti-sysc: Detect d2d when debug is enabled
  bus: ti-sysc: Add module enable quirk for SGX on omap36xx
  bus: ti-sysc: Change return types of functions

Link: https://lore.kernel.org/r/pull-1567016893-318461@atomide.com-2
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2019-09-04 17:20:41 +02:00
commit 30d8bb9003
2 changed files with 30 additions and 16 deletions

View File

@ -73,6 +73,7 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {
* @clk_enable_quirk: module specific clock enable quirk
* @clk_disable_quirk: module specific clock disable quirk
* @reset_done_quirk: module specific reset done quirk
* @module_enable_quirk: module specific enable quirk
*/
struct sysc {
struct device *dev;
@ -98,6 +99,7 @@ struct sysc {
void (*clk_enable_quirk)(struct sysc *sysc);
void (*clk_disable_quirk)(struct sysc *sysc);
void (*reset_done_quirk)(struct sysc *sysc);
void (*module_enable_quirk)(struct sysc *sysc);
};
static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
@ -613,8 +615,8 @@ static void sysc_check_quirk_stdout(struct sysc *ddata,
* node but children have "ti,hwmods". These belong to the interconnect
* target node and are managed by this driver.
*/
static int sysc_check_one_child(struct sysc *ddata,
struct device_node *np)
static void sysc_check_one_child(struct sysc *ddata,
struct device_node *np)
{
const char *name;
@ -624,22 +626,14 @@ static int sysc_check_one_child(struct sysc *ddata,
sysc_check_quirk_stdout(ddata, np);
sysc_parse_dts_quirks(ddata, np, true);
return 0;
}
static int sysc_check_children(struct sysc *ddata)
static void sysc_check_children(struct sysc *ddata)
{
struct device_node *child;
int error;
for_each_child_of_node(ddata->dev->of_node, child) {
error = sysc_check_one_child(ddata, child);
if (error)
return error;
}
return 0;
for_each_child_of_node(ddata->dev->of_node, child)
sysc_check_one_child(ddata, child);
}
/*
@ -792,9 +786,7 @@ static int sysc_map_and_check_registers(struct sysc *ddata)
if (error)
return error;
error = sysc_check_children(ddata);
if (error)
return error;
sysc_check_children(ddata);
error = sysc_parse_registers(ddata);
if (error)
@ -938,6 +930,9 @@ set_autoidle:
sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
}
if (ddata->module_enable_quirk)
ddata->module_enable_quirk(ddata);
return 0;
}
@ -1251,6 +1246,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_MODULE_QUIRK_I2C),
SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0,
SYSC_MODULE_QUIRK_I2C),
SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0),
SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff,
SYSC_MODULE_QUIRK_SGX),
SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
SYSC_MODULE_QUIRK_WDT),
@ -1266,8 +1264,11 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0x4edb1902, 0xffffffff, 0),
SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0),
SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0),
SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0),
SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0),
SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0),
SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0),
SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0),
SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff, 0),
@ -1419,6 +1420,15 @@ static void sysc_clk_disable_quirk_i2c(struct sysc *ddata)
sysc_clk_quirk_i2c(ddata, false);
}
/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */
static void sysc_module_enable_quirk_sgx(struct sysc *ddata)
{
int offset = 0xff08; /* OCP_DEBUG_CONFIG */
u32 val = BIT(31); /* THALIA_INT_BYPASS */
sysc_write(ddata, offset, val);
}
/* Watchdog timer needs a disable sequence after reset */
static void sysc_reset_done_quirk_wdt(struct sysc *ddata)
{
@ -1461,6 +1471,9 @@ static void sysc_init_module_quirks(struct sysc *ddata)
return;
}
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX)
ddata->module_enable_quirk = sysc_module_enable_quirk_sgx;
if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_WDT)
ddata->reset_done_quirk = sysc_reset_done_quirk_wdt;
}

View File

@ -49,6 +49,7 @@ struct sysc_regbits {
s8 emufree_shift;
};
#define SYSC_MODULE_QUIRK_SGX BIT(18)
#define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
#define SYSC_MODULE_QUIRK_I2C BIT(16)
#define SYSC_MODULE_QUIRK_WDT BIT(15)