Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+30 -16
+29 -16
drivers/bus/ti-sysc.c
··· 73 73 * @clk_enable_quirk: module specific clock enable quirk 74 74 * @clk_disable_quirk: module specific clock disable quirk 75 75 * @reset_done_quirk: module specific reset done quirk 76 + * @module_enable_quirk: module specific enable quirk 76 77 */ 77 78 struct sysc { 78 79 struct device *dev; ··· 99 98 void (*clk_enable_quirk)(struct sysc *sysc); 100 99 void (*clk_disable_quirk)(struct sysc *sysc); 101 100 void (*reset_done_quirk)(struct sysc *sysc); 101 + void (*module_enable_quirk)(struct sysc *sysc); 102 102 }; 103 103 104 104 static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, ··· 615 613 * node but children have "ti,hwmods". These belong to the interconnect 616 614 * target node and are managed by this driver. 617 615 */ 618 - static int sysc_check_one_child(struct sysc *ddata, 619 - struct device_node *np) 616 + static void sysc_check_one_child(struct sysc *ddata, 617 + struct device_node *np) 620 618 { 621 619 const char *name; 622 620 ··· 626 624 627 625 sysc_check_quirk_stdout(ddata, np); 628 626 sysc_parse_dts_quirks(ddata, np, true); 629 - 630 - return 0; 631 627 } 632 628 633 - static int sysc_check_children(struct sysc *ddata) 629 + static void sysc_check_children(struct sysc *ddata) 634 630 { 635 631 struct device_node *child; 636 - int error; 637 632 638 - for_each_child_of_node(ddata->dev->of_node, child) { 639 - error = sysc_check_one_child(ddata, child); 640 - if (error) 641 - return error; 642 - } 643 - 644 - return 0; 633 + for_each_child_of_node(ddata->dev->of_node, child) 634 + sysc_check_one_child(ddata, child); 645 635 } 646 636 647 637 /* ··· 786 792 if (error) 787 793 return error; 788 794 789 - error = sysc_check_children(ddata); 790 - if (error) 791 - return error; 795 + sysc_check_children(ddata); 792 796 793 797 error = sysc_parse_registers(ddata); 794 798 if (error) ··· 929 937 reg |= 1 << regbits->autoidle_shift; 930 938 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); 931 939 } 940 + 941 + if (ddata->module_enable_quirk) 942 + ddata->module_enable_quirk(ddata); 932 943 933 944 return 0; 934 945 } ··· 1246 1251 SYSC_MODULE_QUIRK_I2C), 1247 1252 SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0, 1248 1253 SYSC_MODULE_QUIRK_I2C), 1254 + SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0), 1255 + SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 1256 + SYSC_MODULE_QUIRK_SGX), 1249 1257 SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0, 1250 1258 SYSC_MODULE_QUIRK_WDT), 1251 1259 ··· 1264 1266 SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0x4edb1902, 0xffffffff, 0), 1265 1267 SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0), 1266 1268 SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0), 1269 + SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), 1270 + SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), 1267 1271 SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0), 1268 1272 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0), 1273 + SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0), 1269 1274 SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0), 1270 1275 SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0), 1271 1276 SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff, 0), ··· 1420 1419 sysc_clk_quirk_i2c(ddata, false); 1421 1420 } 1422 1421 1422 + /* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */ 1423 + static void sysc_module_enable_quirk_sgx(struct sysc *ddata) 1424 + { 1425 + int offset = 0xff08; /* OCP_DEBUG_CONFIG */ 1426 + u32 val = BIT(31); /* THALIA_INT_BYPASS */ 1427 + 1428 + sysc_write(ddata, offset, val); 1429 + } 1430 + 1423 1431 /* Watchdog timer needs a disable sequence after reset */ 1424 1432 static void sysc_reset_done_quirk_wdt(struct sysc *ddata) 1425 1433 { ··· 1470 1460 1471 1461 return; 1472 1462 } 1463 + 1464 + if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX) 1465 + ddata->module_enable_quirk = sysc_module_enable_quirk_sgx; 1473 1466 1474 1467 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_WDT) 1475 1468 ddata->reset_done_quirk = sysc_reset_done_quirk_wdt;
+1
include/linux/platform_data/ti-sysc.h
··· 49 49 s8 emufree_shift; 50 50 }; 51 51 52 + #define SYSC_MODULE_QUIRK_SGX BIT(18) 52 53 #define SYSC_MODULE_QUIRK_HDQ1W BIT(17) 53 54 #define SYSC_MODULE_QUIRK_I2C BIT(16) 54 55 #define SYSC_MODULE_QUIRK_WDT BIT(15)