History

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

Driver changes for ti-sysc for v5.7 merge window Driver changes for ti-sysc interconnect target module driver mostly to be able to probe display subsystem (DSS) without platform data: - Rename clk_enable/disable quirks to less confusing pre and post reset quirks - Enable module reset to work with modules with no sysconfig register - Also consider non-existing module register when matching quirks - Don't warn with nested ti-sysc devices - Implement basic SoC revision handling - Detect DSS related devices - Implement DSS reset quirks Note that there is also a DSS driver specific probe fix to allow probing devices configured for interconnect target module data that was agreed to be merged along with the ti-sysc driver changes. And then there also changes to handle RTC, EDMA and PRUSS: - Add module unlock quirk for RTC - Detect EDMA modules - Add support for handling PRUSS * tag 'omap-for-v5.7/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Add support for PRUSS SYSC type dt-bindings: bus: ti-sysc: Add support for PRUSS SYSC type bus: ti-sysc: Detect EDMA and set quirk flags for tptc bus: ti-sysc: Fix wrong offset for display subsystem reset quirk bus: ti-sysc: Implement display subsystem reset quirk bus: ti-sysc: Detect display subsystem related devices bus: ti-sysc: Handle module unlock quirk needed for some RTC bus: ti-sysc: Implement SoC revision handling bus: ti-sysc: Don't warn about legacy property for nested ti-sysc devices bus: ti-sysc: Consider non-existing registers too when matching quirks bus: ti-sysc: Improve reset to work with modules with no sysconfig bus: ti-sysc: Rename clk related quirks to pre_reset and post_reset quirks bus: ti-sysc: Fix 1-wire reset quirk drm/omap: Prepare DSS for probing without legacy platform data

Arnd Bergmann committed 6 years ago

Commit f22940b2 parents 5fc0458 b2745d97 files · +571 −101Browse files

Unified · Split

7 files
  1. Documentation/devicetree/bindings/bus/ti-sysc.txt +1 −0
  2. arch/arm/mach-omap2/pdata-quirks.c +6 −0
  3. drivers/bus/ti-sysc.c +516 −90
  4. drivers/gpu/drm/omapdrm/dss/dss.c +22 −3
  5. drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c +17 −8
  6. include/dt-bindings/bus/ti-sysc.h +4 −0
  7. include/linux/platform_data/ti-sysc.h +5 −0
Documentation/devicetree/bindings/bus/ti-sysc.txt+1−0
@@ -38,6 +38,7 @@ Required standard properties: · 37 unmodified lines
38 "ti,sysc-dra7-mcasp"38 "ti,sysc-dra7-mcasp"
39 "ti,sysc-usb-host-fs"39 "ti,sysc-usb-host-fs"
40 "ti,sysc-dra7-mcan"40 "ti,sysc-dra7-mcan"
41 "ti,sysc-pruss"
41 42
42- reg shall have register areas implemented for the interconnect43- reg shall have register areas implemented for the interconnect
43 target module in question such as revision, sysc and syss44 target module in question such as revision, sysc and syss
arch/arm/mach-omap2/pdata-quirks.c+6−0
@@ -397,10 +397,16 @@ static int ti_sysc_shutdown_module(struct device *dev, · 396 unmodified lines
397 return omap_hwmod_shutdown(cookie->data);397 return omap_hwmod_shutdown(cookie->data);
398}398}
399 399
400static bool ti_sysc_soc_type_gp(void)
401{
402 return omap_type() == OMAP2_DEVICE_TYPE_GP;
403}
404
400static struct of_dev_auxdata omap_auxdata_lookup[];405static struct of_dev_auxdata omap_auxdata_lookup[];
401 406
402static struct ti_sysc_platform_data ti_sysc_pdata = {407static struct ti_sysc_platform_data ti_sysc_pdata = {
403 .auxdata = omap_auxdata_lookup,408 .auxdata = omap_auxdata_lookup,
409 .soc_type_gp = ti_sysc_soc_type_gp,
404 .init_clockdomain = ti_sysc_clkdm_init,410 .init_clockdomain = ti_sysc_clkdm_init,
405 .clkdm_deny_idle = ti_sysc_clkdm_deny_idle,411 .clkdm_deny_idle = ti_sysc_clkdm_deny_idle,
406 .clkdm_allow_idle = ti_sysc_clkdm_allow_idle,412 .clkdm_allow_idle = ti_sysc_clkdm_allow_idle,
drivers/bus/ti-sysc.c+516−90
@@ -7,6 +7,7 @@ · 6 unmodified lines
7#include <linux/clk.h>7#include <linux/clk.h>
8#include <linux/clkdev.h>8#include <linux/clkdev.h>
9#include <linux/delay.h>9#include <linux/delay.h>
10#include <linux/list.h>
10#include <linux/module.h>11#include <linux/module.h>
11#include <linux/platform_device.h>12#include <linux/platform_device.h>
12#include <linux/pm_domain.h>13#include <linux/pm_domain.h>
@@ -15,15 +16,47 @@ · 2 unmodified lines
15#include <linux/of_address.h>16#include <linux/of_address.h>
16#include <linux/of_platform.h>17#include <linux/of_platform.h>
17#include <linux/slab.h>18#include <linux/slab.h>
19#include <linux/sys_soc.h>
18#include <linux/iopoll.h>20#include <linux/iopoll.h>
19 21
20#include <linux/platform_data/ti-sysc.h>22#include <linux/platform_data/ti-sysc.h>
21 23
22#include <dt-bindings/bus/ti-sysc.h>24#include <dt-bindings/bus/ti-sysc.h>
23 25
26#define DIS_ISP BIT(2)
27#define DIS_IVA BIT(1)
28#define DIS_SGX BIT(0)
29
30#define SOC_FLAG(match, flag) { .machine = match, .data = (void *)(flag), }
31
24#define MAX_MODULE_SOFTRESET_WAIT 1000032#define MAX_MODULE_SOFTRESET_WAIT 10000
25 33
26static const char * const reg_names[] = { "rev", "sysc", "syss", };34enum sysc_soc {
35 SOC_UNKNOWN,
36 SOC_2420,
37 SOC_2430,
38 SOC_3430,
39 SOC_3630,
40 SOC_4430,
41 SOC_4460,
42 SOC_4470,
43 SOC_5430,
44 SOC_AM3,
45 SOC_AM4,
46 SOC_DRA7,
47};
48
49struct sysc_address {
50 unsigned long base;
51 struct list_head node;
52};
53
54struct sysc_soc_info {
55 unsigned long general_purpose:1;
56 enum sysc_soc soc;
57 struct mutex list_lock; /* disabled modules list lock */
58 struct list_head disabled_modules;
59};
27 60
28enum sysc_clocks {61enum sysc_clocks {
29 SYSC_FCK,62 SYSC_FCK,
@@ -39,6 +72,8 @@ enum sysc_clocks { · 9 unmodified lines
39 SYSC_MAX_CLOCKS,72 SYSC_MAX_CLOCKS,
40};73};
41 74
75static struct sysc_soc_info *sysc_soc;
76static const char * const reg_names[] = { "rev", "sysc", "syss", };
42static const char * const clock_names[SYSC_MAX_CLOCKS] = {77static const char * const clock_names[SYSC_MAX_CLOCKS] = {
43 "fck", "ick", "opt0", "opt1", "opt2", "opt3", "opt4",78 "fck", "ick", "opt0", "opt1", "opt2", "opt3", "opt4",
44 "opt5", "opt6", "opt7",79 "opt5", "opt6", "opt7",
@@ -70,11 +105,13 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = { · 25 unmodified lines
70 * @child_needs_resume: runtime resume needed for child on resume from suspend105 * @child_needs_resume: runtime resume needed for child on resume from suspend
71 * @disable_on_idle: status flag used for disabling modules with resets106 * @disable_on_idle: status flag used for disabling modules with resets
72 * @idle_work: work structure used to perform delayed idle on a module107 * @idle_work: work structure used to perform delayed idle on a module
73 * @clk_enable_quirk: module specific clock enable quirk108 * @pre_reset_quirk: module specific pre-reset quirk
74 * @clk_disable_quirk: module specific clock disable quirk109 * @post_reset_quirk: module specific post-reset quirk
75 * @reset_done_quirk: module specific reset done quirk110 * @reset_done_quirk: module specific reset done quirk
76 * @module_enable_quirk: module specific enable quirk111 * @module_enable_quirk: module specific enable quirk
77 * @module_disable_quirk: module specific disable quirk112 * @module_disable_quirk: module specific disable quirk
113 * @module_unlock_quirk: module specific sysconfig unlock quirk
114 * @module_lock_quirk: module specific sysconfig lock quirk
78 */115 */
79struct sysc {116struct sysc {
80 struct device *dev;117 struct device *dev;
@@ -97,11 +134,13 @@ struct sysc { · 16 unmodified lines
97 unsigned int needs_resume:1;134 unsigned int needs_resume:1;
98 unsigned int child_needs_resume:1;135 unsigned int child_needs_resume:1;
99 struct delayed_work idle_work;136 struct delayed_work idle_work;
100 void (*clk_enable_quirk)(struct sysc *sysc);137 void (*pre_reset_quirk)(struct sysc *sysc);
101 void (*clk_disable_quirk)(struct sysc *sysc);138 void (*post_reset_quirk)(struct sysc *sysc);
102 void (*reset_done_quirk)(struct sysc *sysc);139 void (*reset_done_quirk)(struct sysc *sysc);
103 void (*module_enable_quirk)(struct sysc *sysc);140 void (*module_enable_quirk)(struct sysc *sysc);
104 void (*module_disable_quirk)(struct sysc *sysc);141 void (*module_disable_quirk)(struct sysc *sysc);
142 void (*module_unlock_quirk)(struct sysc *sysc);
143 void (*module_lock_quirk)(struct sysc *sysc);
105};144};
106 145
107static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,146static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
@@ -624,7 +663,7 @@ static void sysc_check_one_child(struct sysc *ddata, · 516 unmodified lines
624 const char *name;663 const char *name;
625 664
626 name = of_get_property(np, "ti,hwmods", NULL);665 name = of_get_property(np, "ti,hwmods", NULL);
627 if (name)666 if (name && !of_device_is_compatible(np, "ti,sysc"))
628 dev_warn(ddata->dev, "really a child ti,hwmods property?");667 dev_warn(ddata->dev, "really a child ti,hwmods property?");
629 668
630 sysc_check_quirk_stdout(ddata, np);669 sysc_check_quirk_stdout(ddata, np);
@@ -861,6 +900,22 @@ static void sysc_show_registers(struct sysc *ddata) · 230 unmodified lines
861 buf);900 buf);
862}901}
863 902
903/**
904 * sysc_write_sysconfig - handle sysconfig quirks for register write
905 * @ddata: device driver data
906 * @value: register value
907 */
908static void sysc_write_sysconfig(struct sysc *ddata, u32 value)
909{
910 if (ddata->module_unlock_quirk)
911 ddata->module_unlock_quirk(ddata);
912
913 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], value);
914
915 if (ddata->module_lock_quirk)
916 ddata->module_lock_quirk(ddata);
917}
918
864#define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1)919#define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1)
865#define SYSC_CLOCACT_ICK 2920#define SYSC_CLOCACT_ICK 2
866 921
@@ -907,7 +962,7 @@ static int sysc_enable_module(struct device *dev) · 40 unmodified lines
907 962
908 reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);963 reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);
909 reg |= best_mode << regbits->sidle_shift;964 reg |= best_mode << regbits->sidle_shift;
910 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);965 sysc_write_sysconfig(ddata, reg);
911 966
912set_midle:967set_midle:
913 /* Set MIDLE mode */968 /* Set MIDLE mode */
@@ -926,14 +981,14 @@ set_midle: · 12 unmodified lines
926 981
927 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);982 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);
928 reg |= best_mode << regbits->midle_shift;983 reg |= best_mode << regbits->midle_shift;
929 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);984 sysc_write_sysconfig(ddata, reg);
930 985
931set_autoidle:986set_autoidle:
932 /* Autoidle bit must enabled separately if available */987 /* Autoidle bit must enabled separately if available */
933 if (regbits->autoidle_shift >= 0 &&988 if (regbits->autoidle_shift >= 0 &&
934 ddata->cfg.sysc_val & BIT(regbits->autoidle_shift)) {989 ddata->cfg.sysc_val & BIT(regbits->autoidle_shift)) {
935 reg |= 1 << regbits->autoidle_shift;990 reg |= 1 << regbits->autoidle_shift;
936 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);991 sysc_write_sysconfig(ddata, reg);
937 }992 }
938 993
939 if (ddata->module_enable_quirk)994 if (ddata->module_enable_quirk)
@@ -991,7 +1046,7 @@ static int sysc_disable_module(struct device *dev) · 51 unmodified lines
991 1046
992 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);1047 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);
993 reg |= best_mode << regbits->midle_shift;1048 reg |= best_mode << regbits->midle_shift;
994 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);1049 sysc_write_sysconfig(ddata, reg);
995 1050
996set_sidle:1051set_sidle:
997 /* Set SIDLE mode */1052 /* Set SIDLE mode */
@@ -1014,7 +1069,7 @@ set_sidle: · 16 unmodified lines
1014 if (regbits->autoidle_shift >= 0 &&1069 if (regbits->autoidle_shift >= 0 &&
1015 ddata->cfg.sysc_val & BIT(regbits->autoidle_shift))1070 ddata->cfg.sysc_val & BIT(regbits->autoidle_shift))
1016 reg |= 1 << regbits->autoidle_shift;1071 reg |= 1 << regbits->autoidle_shift;
1017 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);1072 sysc_write_sysconfig(ddata, reg);
1018 1073
1019 return 0;1074 return 0;
1020}1075}
@@ -1216,16 +1271,16 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 195 unmodified lines
1216 SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_OPT_CLKS_IN_RESET),1271 SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_OPT_CLKS_IN_RESET),
1217 SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff,1272 SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff,
1218 SYSC_QUIRK_LEGACY_IDLE),1273 SYSC_QUIRK_LEGACY_IDLE),
1219 SYSC_QUIRK("smartreflex", 0, -1, 0x24, -1, 0x00000000, 0xffffffff,1274 SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff,
1220 SYSC_QUIRK_LEGACY_IDLE),1275 SYSC_QUIRK_LEGACY_IDLE),
1221 SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff,1276 SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff,
1222 SYSC_QUIRK_LEGACY_IDLE),1277 SYSC_QUIRK_LEGACY_IDLE),
1223 SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff,1278 SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff,
1224 0),1279 0),
1225 /* Some timers on omap4 and later */1280 /* Some timers on omap4 and later */
1226 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x50002100, 0xffffffff,1281 SYSC_QUIRK("timer", 0, 0, 0x10, -ENODEV, 0x50002100, 0xffffffff,
1227 0),1282 0),
1228 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff,1283 SYSC_QUIRK("timer", 0, 0, 0x10, -ENODEV, 0x4fff1301, 0xffff00ff,
1229 0),1284 0),
1230 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff,1285 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff,
1231 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),1286 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
@@ -1238,19 +1293,27 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 6 unmodified lines
1238 SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),1293 SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
1239 1294
1240 /* Quirks that need to be set based on the module address */1295 /* Quirks that need to be set based on the module address */
1241 SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -1, 0x50000800, 0xffffffff,1296 SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff,
1242 SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT |1297 SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT |
1243 SYSC_QUIRK_SWSUP_SIDLE),1298 SYSC_QUIRK_SWSUP_SIDLE),
1244 1299
1245 /* Quirks that need to be set based on detected module */1300 /* Quirks that need to be set based on detected module */
1246 SYSC_QUIRK("aess", 0, 0, 0x10, -1, 0x40000000, 0xffffffff,1301 SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,
1247 SYSC_MODULE_QUIRK_AESS),1302 SYSC_MODULE_QUIRK_AESS),
1248 SYSC_QUIRK("dcan", 0x48480000, 0x20, -1, -1, 0xa3170504, 0xffffffff,1303 SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
1249 SYSC_QUIRK_CLKDM_NOAUTO),1304 SYSC_QUIRK_CLKDM_NOAUTO),
1250 SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -1, 0x500a0200, 0xffffffff,1305 SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,
1306 SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET),
1307 SYSC_QUIRK("dss", 0x58000000, 0, -ENODEV, 0x14, 0x00000040, 0xffffffff,
1308 SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET),
1309 SYSC_QUIRK("dss", 0x58000000, 0, -ENODEV, 0x14, 0x00000061, 0xffffffff,
1310 SYSC_QUIRK_OPT_CLKS_IN_RESET | SYSC_MODULE_QUIRK_DSS_RESET),
1311 SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff,
1251 SYSC_QUIRK_CLKDM_NOAUTO),1312 SYSC_QUIRK_CLKDM_NOAUTO),
1252 SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -1, 0x500a0200, 0xffffffff,1313 SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff,
1253 SYSC_QUIRK_CLKDM_NOAUTO),1314 SYSC_QUIRK_CLKDM_NOAUTO),
1315 SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50030200, 0xffffffff,
1316 SYSC_QUIRK_OPT_CLKS_NEEDED),
1254 SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff,1317 SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff,
1255 SYSC_MODULE_QUIRK_HDQ1W),1318 SYSC_MODULE_QUIRK_HDQ1W),
1256 SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,1319 SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
@@ -1263,71 +1326,91 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 6 unmodified lines
1263 SYSC_MODULE_QUIRK_I2C),1326 SYSC_MODULE_QUIRK_I2C),
1264 SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0,1327 SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0,
1265 SYSC_MODULE_QUIRK_I2C),1328 SYSC_MODULE_QUIRK_I2C),
1266 SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0),1329 SYSC_QUIRK("gpu", 0x50000000, 0x14, -ENODEV, -ENODEV, 0x00010201, 0xffffffff, 0),
1267 SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff,1330 SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff,
1268 SYSC_MODULE_QUIRK_SGX),1331 SYSC_MODULE_QUIRK_SGX),
1332 SYSC_QUIRK("rtc", 0, 0x74, 0x78, -ENODEV, 0x4eb01908, 0xffff00f0,
1333 SYSC_MODULE_QUIRK_RTC_UNLOCK),
1334 SYSC_QUIRK("tptc", 0, 0, 0x10, -ENODEV, 0x40006c00, 0xffffefff,
1335 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
1336 SYSC_QUIRK("tptc", 0, 0, -ENODEV, -ENODEV, 0x40007c00, 0xffffffff,
1337 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
1269 SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,1338 SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,
1270 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),1339 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
1271 SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -1, 0x4ea2080d, 0xffffffff,1340 SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -ENODEV, 0x4ea2080d, 0xffffffff,
1272 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),1341 SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
1273 SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,1342 SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
1274 SYSC_MODULE_QUIRK_WDT),1343 SYSC_MODULE_QUIRK_WDT),
1344 /* PRUSS on am3, am4 and am5 */
1345 SYSC_QUIRK("pruss", 0, 0x26000, 0x26004, -ENODEV, 0x47000000, 0xff000000,
1346 SYSC_MODULE_QUIRK_PRUSS),
1275 /* Watchdog on am3 and am4 */1347 /* Watchdog on am3 and am4 */
1276 SYSC_QUIRK("wdt", 0x44e35000, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,1348 SYSC_QUIRK("wdt", 0x44e35000, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0,
1277 SYSC_MODULE_QUIRK_WDT | SYSC_QUIRK_SWSUP_SIDLE),1349 SYSC_MODULE_QUIRK_WDT | SYSC_QUIRK_SWSUP_SIDLE),
1278 1350
1279#ifdef DEBUG1351#ifdef DEBUG
1280 SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0),1352 SYSC_QUIRK("adc", 0, 0, 0x10, -ENODEV, 0x47300001, 0xffffffff, 0),
1281 SYSC_QUIRK("atl", 0, 0, -1, -1, 0x0a070100, 0xffffffff, 0),1353 SYSC_QUIRK("atl", 0, 0, -ENODEV, -ENODEV, 0x0a070100, 0xffffffff, 0),
1282 SYSC_QUIRK("cm", 0, 0, -1, -1, 0x40000301, 0xffffffff, 0),1354 SYSC_QUIRK("cm", 0, 0, -ENODEV, -ENODEV, 0x40000301, 0xffffffff, 0),
1283 SYSC_QUIRK("control", 0, 0, 0x10, -1, 0x40000900, 0xffffffff, 0),1355 SYSC_QUIRK("control", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0),
1284 SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,1356 SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902,
1285 0xffff00f0, 0),1357 0xffff00f0, 0),
1286 SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0xa3170504, 0xffffffff, 0),1358 SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 0),
1287 SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0x4edb1902, 0xffffffff, 0),1359 SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0x4edb1902, 0xffffffff, 0),
1288 SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0),1360 SYSC_QUIRK("dispc", 0x4832a400, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0),
1289 SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0),1361 SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0),
1362 SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x00000051, 0xffffffff, 0),
1363 SYSC_QUIRK("dmic", 0, 0, 0x10, -ENODEV, 0x50010000, 0xffffffff, 0),
1364 SYSC_QUIRK("dsi", 0x58004000, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0),
1365 SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0),
1366 SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0),
1367 SYSC_QUIRK("dsi", 0x58009000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0),
1368 SYSC_QUIRK("dwc3", 0, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff, 0),
1290 SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),1369 SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
1291 SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),1370 SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
1292 SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0),1371 SYSC_QUIRK("epwmss", 0, 0, 0x4, -ENODEV, 0x47400001, 0xffffffff, 0),
1293 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0),1372 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -ENODEV, 0, 0, 0),
1294 SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0),1373 SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff, 0),
1374 SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50031d00, 0xffffffff, 0),
1295 SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0),1375 SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0),
1296 SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0),1376 SYSC_QUIRK("iss", 0, 0, 0x10, -ENODEV, 0x40000101, 0xffffffff, 0),
1297 SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff, 0),1377 SYSC_QUIRK("lcdc", 0, 0, 0x54, -ENODEV, 0x4f201000, 0xffffffff, 0),
1298 SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44306302, 0xffffffff, 0),1378 SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44306302, 0xffffffff, 0),
1299 SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44307b02, 0xffffffff, 0),1379 SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44307b02, 0xffffffff, 0),
1300 SYSC_QUIRK("mcbsp", 0, -1, 0x8c, -1, 0, 0, 0),1380 SYSC_QUIRK("mcbsp", 0, -ENODEV, 0x8c, -ENODEV, 0, 0, 0),
1301 SYSC_QUIRK("mcspi", 0, 0, 0x10, -1, 0x40300a0b, 0xffff00ff, 0),1381 SYSC_QUIRK("mcspi", 0, 0, 0x10, -ENODEV, 0x40300a0b, 0xffff00ff, 0),
1302 SYSC_QUIRK("mcspi", 0, 0, 0x110, 0x114, 0x40300a0b, 0xffffffff, 0),1382 SYSC_QUIRK("mcspi", 0, 0, 0x110, 0x114, 0x40300a0b, 0xffffffff, 0),
1303 SYSC_QUIRK("mailbox", 0, 0, 0x10, -1, 0x00000400, 0xffffffff, 0),1383 SYSC_QUIRK("mailbox", 0, 0, 0x10, -ENODEV, 0x00000400, 0xffffffff, 0),
1304 SYSC_QUIRK("m3", 0, 0, -1, -1, 0x5f580105, 0x0fff0f00, 0),1384 SYSC_QUIRK("m3", 0, 0, -ENODEV, -ENODEV, 0x5f580105, 0x0fff0f00, 0),
1305 SYSC_QUIRK("ocp2scp", 0, 0, 0x10, 0x14, 0x50060005, 0xfffffff0, 0),1385 SYSC_QUIRK("ocp2scp", 0, 0, 0x10, 0x14, 0x50060005, 0xfffffff0, 0),
1306 SYSC_QUIRK("ocp2scp", 0, 0, -1, -1, 0x50060007, 0xffffffff, 0),1386 SYSC_QUIRK("ocp2scp", 0, 0, -ENODEV, -ENODEV, 0x50060007, 0xffffffff, 0),
1307 SYSC_QUIRK("padconf", 0, 0, 0x10, -1, 0x4fff0800, 0xffffffff, 0),1387 SYSC_QUIRK("padconf", 0, 0, 0x10, -ENODEV, 0x4fff0800, 0xffffffff, 0),
1308 SYSC_QUIRK("padconf", 0, 0, -1, -1, 0x40001100, 0xffffffff, 0),1388 SYSC_QUIRK("padconf", 0, 0, -ENODEV, -ENODEV, 0x40001100, 0xffffffff, 0),
1309 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000100, 0xffffffff, 0),1389 SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x40000100, 0xffffffff, 0),
1310 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x00004102, 0xffffffff, 0),1390 SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x00004102, 0xffffffff, 0),
1311 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000400, 0xffffffff, 0),1391 SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x40000400, 0xffffffff, 0),
1312 SYSC_QUIRK("scm", 0, 0, 0x10, -1, 0x40000900, 0xffffffff, 0),1392 SYSC_QUIRK("rfbi", 0x4832a800, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
1313 SYSC_QUIRK("scm", 0, 0, -1, -1, 0x4e8b0100, 0xffffffff, 0),1393 SYSC_QUIRK("rfbi", 0x58002000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
1314 SYSC_QUIRK("scm", 0, 0, -1, -1, 0x4f000100, 0xffffffff, 0),1394 SYSC_QUIRK("scm", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0),
1315 SYSC_QUIRK("scm", 0, 0, -1, -1, 0x40000900, 0xffffffff, 0),1395 SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4e8b0100, 0xffffffff, 0),
1316 SYSC_QUIRK("scrm", 0, 0, -1, -1, 0x00000010, 0xffffffff, 0),1396 SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4f000100, 0xffffffff, 0),
1317 SYSC_QUIRK("sdio", 0, 0, 0x10, -1, 0x40202301, 0xffff0ff0, 0),1397 SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x40000900, 0xffffffff, 0),
1398 SYSC_QUIRK("scrm", 0, 0, -ENODEV, -ENODEV, 0x00000010, 0xffffffff, 0),
1399 SYSC_QUIRK("sdio", 0, 0, 0x10, -ENODEV, 0x40202301, 0xffff0ff0, 0),
1318 SYSC_QUIRK("sdio", 0, 0x2fc, 0x110, 0x114, 0x31010000, 0xffffffff, 0),1400 SYSC_QUIRK("sdio", 0, 0x2fc, 0x110, 0x114, 0x31010000, 0xffffffff, 0),
1319 SYSC_QUIRK("sdma", 0, 0, 0x2c, 0x28, 0x00010900, 0xffffffff, 0),1401 SYSC_QUIRK("sdma", 0, 0, 0x2c, 0x28, 0x00010900, 0xffffffff, 0),
1320 SYSC_QUIRK("slimbus", 0, 0, 0x10, -1, 0x40000902, 0xffffffff, 0),1402 SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40000902, 0xffffffff, 0),
1321 SYSC_QUIRK("slimbus", 0, 0, 0x10, -1, 0x40002903, 0xffffffff, 0),1403 SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40002903, 0xffffffff, 0),
1322 SYSC_QUIRK("spinlock", 0, 0, 0x10, -1, 0x50020000, 0xffffffff, 0),1404 SYSC_QUIRK("spinlock", 0, 0, 0x10, -ENODEV, 0x50020000, 0xffffffff, 0),
1323 SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -1, 0x00000020, 0xffffffff, 0),1405 SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -ENODEV, 0x00000020, 0xffffffff, 0),
1324 SYSC_QUIRK("rtc", 0, 0x74, 0x78, -1, 0x4eb01908, 0xffff00f0, 0),1406 SYSC_QUIRK("timer32k", 0, 0, 0x4, -ENODEV, 0x00000060, 0xffffffff, 0),
1325 SYSC_QUIRK("timer32k", 0, 0, 0x4, -1, 0x00000060, 0xffffffff, 0),1407 SYSC_QUIRK("tpcc", 0, 0, -ENODEV, -ENODEV, 0x40014c00, 0xffffffff, 0),
1326 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0),1408 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0),
1327 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0),1409 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0),
1328 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0),1410 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0),
1329 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -1, 0x50700101, 0xffffffff, 0),1411 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff, 0),
1330 SYSC_QUIRK("vfpe", 0, 0, 0x104, -1, 0x4d001200, 0xffffffff, 0),1412 SYSC_QUIRK("venc", 0x58003000, 0, -ENODEV, -ENODEV, 0x00000002, 0xffffffff, 0),
1413 SYSC_QUIRK("vfpe", 0, 0, 0x104, -ENODEV, 0x4d001200, 0xffffffff, 0),
1331#endif1414#endif
1332};1415};
1333 1416
@@ -1349,16 +1432,13 @@ static void sysc_init_early_quirks(struct sysc *ddata) · 15 unmodified lines
1349 if (q->base != ddata->module_pa)1432 if (q->base != ddata->module_pa)
1350 continue;1433 continue;
1351 1434
1352 if (q->rev_offset >= 0 &&1435 if (q->rev_offset != ddata->offsets[SYSC_REVISION])
1353 q->rev_offset != ddata->offsets[SYSC_REVISION])
1354 continue;1436 continue;
1355 1437
1356 if (q->sysc_offset >= 0 &&1438 if (q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG])
1357 q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG])
1358 continue;1439 continue;
1359 1440
1360 if (q->syss_offset >= 0 &&1441 if (q->syss_offset != ddata->offsets[SYSC_SYSSTATUS])
1361 q->syss_offset != ddata->offsets[SYSC_SYSSTATUS])
1362 continue;1442 continue;
1363 1443
1364 ddata->name = q->name;1444 ddata->name = q->name;
@@ -1378,16 +1458,13 @@ static void sysc_init_revision_quirks(struct sysc *ddata) · 13 unmodified lines
1378 if (q->base && q->base != ddata->module_pa)1458 if (q->base && q->base != ddata->module_pa)
1379 continue;1459 continue;
1380 1460
1381 if (q->rev_offset >= 0 &&1461 if (q->rev_offset != ddata->offsets[SYSC_REVISION])
1382 q->rev_offset != ddata->offsets[SYSC_REVISION])
1383 continue;1462 continue;
1384 1463
1385 if (q->sysc_offset >= 0 &&1464 if (q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG])
1386 q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG])
1387 continue;1465 continue;
1388 1466
1389 if (q->syss_offset >= 0 &&1467 if (q->syss_offset != ddata->offsets[SYSC_SYSSTATUS])
1390 q->syss_offset != ddata->offsets[SYSC_SYSSTATUS])
1391 continue;1468 continue;
1392 1469
1393 if (q->revision == ddata->revision ||1470 if (q->revision == ddata->revision ||
@@ -1399,8 +1476,130 @@ static void sysc_init_revision_quirks(struct sysc *ddata) · 5 unmodified lines
1399 }1476 }
1400}1477}
1401 1478
1479/*
1480 * DSS needs dispc outputs disabled to reset modules. Returns mask of
1481 * enabled DSS interrupts. Eventually we may be able to do this on
1482 * dispc init rather than top-level DSS init.
1483 */
1484static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset,
1485 bool disable)
1486{
1487 bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false;
1488 const int lcd_en_mask = BIT(0), digit_en_mask = BIT(1);
1489 int manager_count;
1490 bool framedonetv_irq;
1491 u32 val, irq_mask = 0;
1492
1493 switch (sysc_soc->soc) {
1494 case SOC_2420 ... SOC_3630:
1495 manager_count = 2;
1496 framedonetv_irq = false;
1497 break;
1498 case SOC_4430 ... SOC_4470:
1499 manager_count = 3;
1500 break;
1501 case SOC_5430:
1502 case SOC_DRA7:
1503 manager_count = 4;
1504 break;
1505 case SOC_AM4:
1506 manager_count = 1;
1507 break;
1508 case SOC_UNKNOWN:
1509 default:
1510 return 0;
1511 };
1512
1513 /* Remap the whole module range to be able to reset dispc outputs */
1514 devm_iounmap(ddata->dev, ddata->module_va);
1515 ddata->module_va = devm_ioremap(ddata->dev,
1516 ddata->module_pa,
1517 ddata->module_size);
1518 if (!ddata->module_va)
1519 return -EIO;
1520
1521 /* DISP_CONTROL */
1522 val = sysc_read(ddata, dispc_offset + 0x40);
1523 lcd_en = val & lcd_en_mask;
1524 digit_en = val & digit_en_mask;
1525 if (lcd_en)
1526 irq_mask |= BIT(0); /* FRAMEDONE */
1527 if (digit_en) {
1528 if (framedonetv_irq)
1529 irq_mask |= BIT(24); /* FRAMEDONETV */
1530 else
1531 irq_mask |= BIT(2) | BIT(3); /* EVSYNC bits */
1532 }
1533 if (disable & (lcd_en | digit_en))
1534 sysc_write(ddata, dispc_offset + 0x40,
1535 val & ~(lcd_en_mask | digit_en_mask));
1536
1537 if (manager_count <= 2)
1538 return irq_mask;
1539
1540 /* DISPC_CONTROL2 */
1541 val = sysc_read(ddata, dispc_offset + 0x238);
1542 lcd2_en = val & lcd_en_mask;
1543 if (lcd2_en)
1544 irq_mask |= BIT(22); /* FRAMEDONE2 */
1545 if (disable && lcd2_en)
1546 sysc_write(ddata, dispc_offset + 0x238,
1547 val & ~lcd_en_mask);
1548
1549 if (manager_count <= 3)
1550 return irq_mask;
1551
1552 /* DISPC_CONTROL3 */
1553 val = sysc_read(ddata, dispc_offset + 0x848);
1554 lcd3_en = val & lcd_en_mask;
1555 if (lcd3_en)
1556 irq_mask |= BIT(30); /* FRAMEDONE3 */
1557 if (disable && lcd3_en)
1558 sysc_write(ddata, dispc_offset + 0x848,
1559 val & ~lcd_en_mask);
1560
1561 return irq_mask;
1562}
1563
1564/* DSS needs child outputs disabled and SDI registers cleared for reset */
1565static void sysc_pre_reset_quirk_dss(struct sysc *ddata)
1566{
1567 const int dispc_offset = 0x1000;
1568 int error;
1569 u32 irq_mask, val;
1570
1571 /* Get enabled outputs */
1572 irq_mask = sysc_quirk_dispc(ddata, dispc_offset, false);
1573 if (!irq_mask)
1574 return;
1575
1576 /* Clear IRQSTATUS */
1577 sysc_write(ddata, dispc_offset + 0x18, irq_mask);
1578
1579 /* Disable outputs */
1580 val = sysc_quirk_dispc(ddata, dispc_offset, true);
1581
1582 /* Poll IRQSTATUS */
1583 error = readl_poll_timeout(ddata->module_va + dispc_offset + 0x18,
1584 val, val != irq_mask, 100, 50);
1585 if (error)
1586 dev_warn(ddata->dev, "%s: timed out %08x !+ %08x\n",
1587 __func__, val, irq_mask);
1588
1589 if (sysc_soc->soc == SOC_3430) {
1590 /* Clear DSS_SDI_CONTROL */
1591 sysc_write(ddata, 0x44, 0);
1592
1593 /* Clear DSS_PLL_CONTROL */
1594 sysc_write(ddata, 0x48, 0);
1595 }
1596
1597 /* Clear DSS_CONTROL to switch DSS clock sources to PRCM if not */
1598 sysc_write(ddata, 0x40, 0);
1599}
1600
1402/* 1-wire needs module's internal clocks enabled for reset */1601/* 1-wire needs module's internal clocks enabled for reset */
1403static void sysc_clk_enable_quirk_hdq1w(struct sysc *ddata)1602static void sysc_pre_reset_quirk_hdq1w(struct sysc *ddata)
1404{1603{
1405 int offset = 0x0c; /* HDQ_CTRL_STATUS */1604 int offset = 0x0c; /* HDQ_CTRL_STATUS */
1406 u16 val;1605 u16 val;
@@ -1418,7 +1617,7 @@ static void sysc_module_enable_quirk_aess(struct sysc *ddata) · 11 unmodified lines
1418 sysc_write(ddata, offset, 1);1617 sysc_write(ddata, offset, 1);
1419}1618}
1420 1619
1421/* I2C needs extra enable bit toggling for reset */1620/* I2C needs to be disabled for reset */
1422static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)1621static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)
1423{1622{
1424 int offset;1623 int offset;
@@ -1439,14 +1638,48 @@ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable) · 14 unmodified lines
1439 sysc_write(ddata, offset, val);1638 sysc_write(ddata, offset, val);
1440}1639}
1441 1640
1442static void sysc_clk_enable_quirk_i2c(struct sysc *ddata)1641static void sysc_pre_reset_quirk_i2c(struct sysc *ddata)
1642{
1643 sysc_clk_quirk_i2c(ddata, false);
1644}
1645
1646static void sysc_post_reset_quirk_i2c(struct sysc *ddata)
1443{1647{
1444 sysc_clk_quirk_i2c(ddata, true);1648 sysc_clk_quirk_i2c(ddata, true);
1445}1649}
1446 1650
1447static void sysc_clk_disable_quirk_i2c(struct sysc *ddata)1651/* RTC on am3 and 4 needs to be unlocked and locked for sysconfig */
1652static void sysc_quirk_rtc(struct sysc *ddata, bool lock)
1448{1653{
1449 sysc_clk_quirk_i2c(ddata, false);1654 u32 val, kick0_val = 0, kick1_val = 0;
1655 unsigned long flags;
1656 int error;
1657
1658 if (!lock) {
1659 kick0_val = 0x83e70b13;
1660 kick1_val = 0x95a4f1e0;
1661 }
1662
1663 local_irq_save(flags);
1664 /* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */
1665 error = readl_poll_timeout(ddata->module_va + 0x44, val,
1666 !(val & BIT(0)), 100, 50);
1667 if (error)
1668 dev_warn(ddata->dev, "rtc busy timeout\n");
1669 /* Now we have ~15 microseconds to read/write various registers */
1670 sysc_write(ddata, 0x6c, kick0_val);
1671 sysc_write(ddata, 0x70, kick1_val);
1672 local_irq_restore(flags);
1673}
1674
1675static void sysc_module_unlock_quirk_rtc(struct sysc *ddata)
1676{
1677 sysc_quirk_rtc(ddata, false);
1678}
1679
1680static void sysc_module_lock_quirk_rtc(struct sysc *ddata)
1681{
1682 sysc_quirk_rtc(ddata, true);
1450}1683}
1451 1684
1452/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */1685/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */
@@ -1482,20 +1715,30 @@ static void sysc_reset_done_quirk_wdt(struct sysc *ddata) · 29 unmodified lines
1482 dev_warn(ddata->dev, "wdt disable step2 failed\n");1715 dev_warn(ddata->dev, "wdt disable step2 failed\n");
1483}1716}
1484 1717
1718/* PRUSS needs to set MSTANDBY_INIT inorder to idle properly */
1719static void sysc_module_disable_quirk_pruss(struct sysc *ddata)
1720{
1721 u32 reg;
1722
1723 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
1724 reg |= SYSC_PRUSS_STANDBY_INIT;
1725 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
1726}
1727
1485static void sysc_init_module_quirks(struct sysc *ddata)1728static void sysc_init_module_quirks(struct sysc *ddata)
1486{1729{
1487 if (ddata->legacy_mode || !ddata->name)1730 if (ddata->legacy_mode || !ddata->name)
1488 return;1731 return;
1489 1732
1490 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) {1733 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) {
1491 ddata->clk_enable_quirk = sysc_clk_enable_quirk_hdq1w;1734 ddata->pre_reset_quirk = sysc_pre_reset_quirk_hdq1w;
1492 1735
1493 return;1736 return;
1494 }1737 }
1495 1738
1496 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_I2C) {1739 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_I2C) {
1497 ddata->clk_enable_quirk = sysc_clk_enable_quirk_i2c;1740 ddata->pre_reset_quirk = sysc_pre_reset_quirk_i2c;
1498 ddata->clk_disable_quirk = sysc_clk_disable_quirk_i2c;1741 ddata->post_reset_quirk = sysc_post_reset_quirk_i2c;
1499 1742
1500 return;1743 return;
1501 }1744 }
@@ -1503,6 +1746,16 @@ static void sysc_init_module_quirks(struct sysc *ddata) · 1 unmodified line
1503 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_AESS)1746 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_AESS)
1504 ddata->module_enable_quirk = sysc_module_enable_quirk_aess;1747 ddata->module_enable_quirk = sysc_module_enable_quirk_aess;
1505 1748
1749 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_DSS_RESET)
1750 ddata->pre_reset_quirk = sysc_pre_reset_quirk_dss;
1751
1752 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_RTC_UNLOCK) {
1753 ddata->module_unlock_quirk = sysc_module_unlock_quirk_rtc;
1754 ddata->module_lock_quirk = sysc_module_lock_quirk_rtc;
1755
1756 return;
1757 }
1758
1506 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX)1759 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX)
1507 ddata->module_enable_quirk = sysc_module_enable_quirk_sgx;1760 ddata->module_enable_quirk = sysc_module_enable_quirk_sgx;
1508 1761
@@ -1510,6 +1763,9 @@ static void sysc_init_module_quirks(struct sysc *ddata) · 1 unmodified line
1510 ddata->reset_done_quirk = sysc_reset_done_quirk_wdt;1763 ddata->reset_done_quirk = sysc_reset_done_quirk_wdt;
1511 ddata->module_disable_quirk = sysc_reset_done_quirk_wdt;1764 ddata->module_disable_quirk = sysc_reset_done_quirk_wdt;
1512 }1765 }
1766
1767 if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_PRUSS)
1768 ddata->module_disable_quirk = sysc_module_disable_quirk_pruss;
1513}1769}
1514 1770
1515static int sysc_clockdomain_init(struct sysc *ddata)1771static int sysc_clockdomain_init(struct sysc *ddata)
@@ -1571,7 +1827,7 @@ static int sysc_reset(struct sysc *ddata) · 55 unmodified lines
1571 sysc_offset = ddata->offsets[SYSC_SYSCONFIG];1827 sysc_offset = ddata->offsets[SYSC_SYSCONFIG];
1572 syss_offset = ddata->offsets[SYSC_SYSSTATUS];1828 syss_offset = ddata->offsets[SYSC_SYSSTATUS];
1573 1829
1574 if (ddata->legacy_mode || sysc_offset < 0 ||1830 if (ddata->legacy_mode ||
1575 ddata->cap->regbits->srst_shift < 0 ||1831 ddata->cap->regbits->srst_shift < 0 ||
1576 ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)1832 ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
1577 return 0;1833 return 0;
@@ -1583,19 +1839,21 @@ static int sysc_reset(struct sysc *ddata) · 5 unmodified lines
1583 else1839 else
1584 syss_done = ddata->cfg.syss_mask;1840 syss_done = ddata->cfg.syss_mask;
1585 1841
1586 if (ddata->clk_disable_quirk)1842 if (ddata->pre_reset_quirk)
1587 ddata->clk_disable_quirk(ddata);1843 ddata->pre_reset_quirk(ddata);
1588 1844
1589 sysc_val = sysc_read_sysconfig(ddata);1845 if (sysc_offset >= 0) {
1590 sysc_val |= sysc_mask;1846 sysc_val = sysc_read_sysconfig(ddata);
1591 sysc_write(ddata, sysc_offset, sysc_val);1847 sysc_val |= sysc_mask;
1848 sysc_write(ddata, sysc_offset, sysc_val);
1849 }
1592 1850
1593 if (ddata->cfg.srst_udelay)1851 if (ddata->cfg.srst_udelay)
1594 usleep_range(ddata->cfg.srst_udelay,1852 usleep_range(ddata->cfg.srst_udelay,
1595 ddata->cfg.srst_udelay * 2);1853 ddata->cfg.srst_udelay * 2);
1596 1854
1597 if (ddata->clk_enable_quirk)1855 if (ddata->post_reset_quirk)
1598 ddata->clk_enable_quirk(ddata);1856 ddata->post_reset_quirk(ddata);
1599 1857
1600 /* Poll on reset status */1858 /* Poll on reset status */
1601 if (syss_offset >= 0) {1859 if (syss_offset >= 0) {
@@ -2313,6 +2571,16 @@ static const struct sysc_capabilities sysc_dra7_mcan = { · 711 unmodified lines
2313 .mod_quirks = SYSS_QUIRK_RESETDONE_INVERTED,2571 .mod_quirks = SYSS_QUIRK_RESETDONE_INVERTED,
2314};2572};
2315 2573
2574/*
2575 * PRUSS found on some AM33xx, AM437x and AM57xx SoCs
2576 */
2577static const struct sysc_capabilities sysc_pruss = {
2578 .type = TI_SYSC_PRUSS,
2579 .sysc_mask = SYSC_PRUSS_STANDBY_INIT | SYSC_PRUSS_SUB_MWAIT,
2580 .regbits = &sysc_regbits_omap4_simple,
2581 .mod_quirks = SYSC_MODULE_QUIRK_PRUSS,
2582};
2583
2316static int sysc_init_pdata(struct sysc *ddata)2584static int sysc_init_pdata(struct sysc *ddata)
2317{2585{
2318 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);2586 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
@@ -2386,6 +2654,154 @@ static void ti_sysc_idle(struct work_struct *work) · 67 unmodified lines
2386 pm_runtime_put_sync(ddata->dev);2654 pm_runtime_put_sync(ddata->dev);
2387}2655}
2388 2656
2657/*
2658 * SoC model and features detection. Only needed for SoCs that need
2659 * special handling for quirks, no need to list others.
2660 */
2661static const struct soc_device_attribute sysc_soc_match[] = {
2662 SOC_FLAG("OMAP242*", SOC_2420),
2663 SOC_FLAG("OMAP243*", SOC_2430),
2664 SOC_FLAG("OMAP3[45]*", SOC_3430),
2665 SOC_FLAG("OMAP3[67]*", SOC_3630),
2666 SOC_FLAG("OMAP443*", SOC_4430),
2667 SOC_FLAG("OMAP446*", SOC_4460),
2668 SOC_FLAG("OMAP447*", SOC_4470),
2669 SOC_FLAG("OMAP54*", SOC_5430),
2670 SOC_FLAG("AM433", SOC_AM3),
2671 SOC_FLAG("AM43*", SOC_AM4),
2672 SOC_FLAG("DRA7*", SOC_DRA7),
2673
2674 { /* sentinel */ },
2675};
2676
2677/*
2678 * List of SoCs variants with disabled features. By default we assume all
2679 * devices in the device tree are available so no need to list those SoCs.
2680 */
2681static const struct soc_device_attribute sysc_soc_feat_match[] = {
2682 /* OMAP3430/3530 and AM3517 variants with some accelerators disabled */
2683 SOC_FLAG("AM3505", DIS_SGX),
2684 SOC_FLAG("OMAP3525", DIS_SGX),
2685 SOC_FLAG("OMAP3515", DIS_IVA | DIS_SGX),
2686 SOC_FLAG("OMAP3503", DIS_ISP | DIS_IVA | DIS_SGX),
2687
2688 /* OMAP3630/DM3730 variants with some accelerators disabled */
2689 SOC_FLAG("AM3703", DIS_IVA | DIS_SGX),
2690 SOC_FLAG("DM3725", DIS_SGX),
2691 SOC_FLAG("OMAP3611", DIS_ISP | DIS_IVA | DIS_SGX),
2692 SOC_FLAG("OMAP3615/AM3715", DIS_IVA),
2693 SOC_FLAG("OMAP3621", DIS_ISP),
2694
2695 { /* sentinel */ },
2696};
2697
2698static int sysc_add_disabled(unsigned long base)
2699{
2700 struct sysc_address *disabled_module;
2701
2702 disabled_module = kzalloc(sizeof(*disabled_module), GFP_KERNEL);
2703 if (!disabled_module)
2704 return -ENOMEM;
2705
2706 disabled_module->base = base;
2707
2708 mutex_lock(&sysc_soc->list_lock);
2709 list_add(&disabled_module->node, &sysc_soc->disabled_modules);
2710 mutex_unlock(&sysc_soc->list_lock);
2711
2712 return 0;
2713}
2714
2715/*
2716 * One time init to detect the booted SoC and disable unavailable features.
2717 * Note that we initialize static data shared across all ti-sysc instances
2718 * so ddata is only used for SoC type. This can be called from module_init
2719 * once we no longer need to rely on platform data.
2720 */
2721static int sysc_init_soc(struct sysc *ddata)
2722{
2723 const struct soc_device_attribute *match;
2724 struct ti_sysc_platform_data *pdata;
2725 unsigned long features = 0;
2726
2727 if (sysc_soc)
2728 return 0;
2729
2730 sysc_soc = kzalloc(sizeof(*sysc_soc), GFP_KERNEL);
2731 if (!sysc_soc)
2732 return -ENOMEM;
2733
2734 mutex_init(&sysc_soc->list_lock);
2735 INIT_LIST_HEAD(&sysc_soc->disabled_modules);
2736 sysc_soc->general_purpose = true;
2737
2738 pdata = dev_get_platdata(ddata->dev);
2739 if (pdata && pdata->soc_type_gp)
2740 sysc_soc->general_purpose = pdata->soc_type_gp();
2741
2742 match = soc_device_match(sysc_soc_match);
2743 if (match && match->data)
2744 sysc_soc->soc = (int)match->data;
2745
2746 match = soc_device_match(sysc_soc_feat_match);
2747 if (!match)
2748 return 0;
2749
2750 if (match->data)
2751 features = (unsigned long)match->data;
2752
2753 /*
2754 * Add disabled devices to the list based on the module base.
2755 * Note that this must be done before we attempt to access the
2756 * device and have module revision checks working.
2757 */
2758 if (features & DIS_ISP)
2759 sysc_add_disabled(0x480bd400);
2760 if (features & DIS_IVA)
2761 sysc_add_disabled(0x5d000000);
2762 if (features & DIS_SGX)
2763 sysc_add_disabled(0x50000000);
2764
2765 return 0;
2766}
2767
2768static void sysc_cleanup_soc(void)
2769{
2770 struct sysc_address *disabled_module;
2771 struct list_head *pos, *tmp;
2772
2773 if (!sysc_soc)
2774 return;
2775
2776 mutex_lock(&sysc_soc->list_lock);
2777 list_for_each_safe(pos, tmp, &sysc_soc->disabled_modules) {
2778 disabled_module = list_entry(pos, struct sysc_address, node);
2779 list_del(pos);
2780 kfree(disabled_module);
2781 }
2782 mutex_unlock(&sysc_soc->list_lock);
2783}
2784
2785static int sysc_check_disabled_devices(struct sysc *ddata)
2786{
2787 struct sysc_address *disabled_module;
2788 struct list_head *pos;
2789 int error = 0;
2790
2791 mutex_lock(&sysc_soc->list_lock);
2792 list_for_each(pos, &sysc_soc->disabled_modules) {
2793 disabled_module = list_entry(pos, struct sysc_address, node);
2794 if (ddata->module_pa == disabled_module->base) {
2795 dev_dbg(ddata->dev, "module disabled for this SoC\n");
2796 error = -ENODEV;
2797 break;
2798 }
2799 }
2800 mutex_unlock(&sysc_soc->list_lock);
2801
2802 return error;
2803}
2804
2389static const struct of_device_id sysc_match_table[] = {2805static const struct of_device_id sysc_match_table[] = {
2390 { .compatible = "simple-bus", },2806 { .compatible = "simple-bus", },
2391 { /* sentinel */ },2807 { /* sentinel */ },
@@ -2404,6 +2820,10 @@ static int sysc_probe(struct platform_device *pdev) · 12 unmodified lines
2404 ddata->dev = &pdev->dev;2820 ddata->dev = &pdev->dev;
2405 platform_set_drvdata(pdev, ddata);2821 platform_set_drvdata(pdev, ddata);
2406 2822
2823 error = sysc_init_soc(ddata);
2824 if (error)
2825 return error;
2826
2407 error = sysc_init_match(ddata);2827 error = sysc_init_match(ddata);
2408 if (error)2828 if (error)
2409 return error;2829 return error;
@@ -2434,6 +2854,10 @@ static int sysc_probe(struct platform_device *pdev) · 24 unmodified lines
2434 2854
2435 sysc_init_early_quirks(ddata);2855 sysc_init_early_quirks(ddata);
2436 2856
2857 error = sysc_check_disabled_devices(ddata);
2858 if (error)
2859 return error;
2860
2437 error = sysc_get_clocks(ddata);2861 error = sysc_get_clocks(ddata);
2438 if (error)2862 if (error)
2439 return error;2863 return error;
@@ -2538,6 +2962,7 @@ static const struct of_device_id sysc_match[] = { · 98 unmodified lines
2538 { .compatible = "ti,sysc-usb-host-fs",2962 { .compatible = "ti,sysc-usb-host-fs",
2539 .data = &sysc_omap4_usb_host_fs, },2963 .data = &sysc_omap4_usb_host_fs, },
2540 { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },2964 { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
2965 { .compatible = "ti,sysc-pruss", .data = &sysc_pruss, },
2541 { },2966 { },
2542};2967};
2543MODULE_DEVICE_TABLE(of, sysc_match);2968MODULE_DEVICE_TABLE(of, sysc_match);
@@ -2564,6 +2989,7 @@ static void __exit sysc_exit(void) · 20 unmodified lines
2564{2989{
2565 bus_unregister_notifier(&platform_bus_type, &sysc_nb);2990 bus_unregister_notifier(&platform_bus_type, &sysc_nb);
2566 platform_driver_unregister(&sysc_driver);2991 platform_driver_unregister(&sysc_driver);
2992 sysc_cleanup_soc();
2567}2993}
2568module_exit(sysc_exit);2994module_exit(sysc_exit);
2569 2995
drivers/gpu/drm/omapdrm/dss/dss.c+22−3
@@ -1339,9 +1339,15 @@ static int dss_component_compare(struct device *dev, void *data) · 1338 unmodified lines
1339 return dev == child;1339 return dev == child;
1340}1340}
1341 1341
1342struct dss_component_match_data {
1343 struct device *dev;
1344 struct component_match **match;
1345};
1346
1342static int dss_add_child_component(struct device *dev, void *data)1347static int dss_add_child_component(struct device *dev, void *data)
1343{1348{
1344 struct component_match **match = data;1349 struct dss_component_match_data *cmatch = data;
1350 struct component_match **match = cmatch->match;
1345 1351
1346 /*1352 /*
1347 * HACK1353 * HACK
@@ -1352,7 +1358,17 @@ static int dss_add_child_component(struct device *dev, void *data) · 4 unmodified lines
1352 if (strstr(dev_name(dev), "rfbi"))1358 if (strstr(dev_name(dev), "rfbi"))
1353 return 0;1359 return 0;
1354 1360
1355 component_match_add(dev->parent, match, dss_component_compare, dev);1361 /*
1362 * Handle possible interconnect target modules defined within the DSS.
1363 * The DSS components can be children of an interconnect target module
1364 * after the device tree has been updated for the module data.
1365 * See also omapdss_boot_init() for compatible fixup.
1366 */
1367 if (strstr(dev_name(dev), "target-module"))
1368 return device_for_each_child(dev, cmatch,
1369 dss_add_child_component);
1370
1371 component_match_add(cmatch->dev, match, dss_component_compare, dev);
1356 1372
1357 return 0;1373 return 0;
1358}1374}
@@ -1395,6 +1411,7 @@ static int dss_probe_hardware(struct dss_device *dss) · 36 unmodified lines
1395static int dss_probe(struct platform_device *pdev)1411static int dss_probe(struct platform_device *pdev)
1396{1412{
1397 const struct soc_device_attribute *soc;1413 const struct soc_device_attribute *soc;
1414 struct dss_component_match_data cmatch;
1398 struct component_match *match = NULL;1415 struct component_match *match = NULL;
1399 struct resource *dss_mem;1416 struct resource *dss_mem;
1400 struct dss_device *dss;1417 struct dss_device *dss;
@@ -1472,7 +1489,9 @@ static int dss_probe(struct platform_device *pdev) · 71 unmodified lines
1472 1489
1473 omapdss_gather_components(&pdev->dev);1490 omapdss_gather_components(&pdev->dev);
1474 1491
1475 device_for_each_child(&pdev->dev, &match, dss_add_child_component);1492 cmatch.dev = &pdev->dev;
1493 cmatch.match = &match;
1494 device_for_each_child(&pdev->dev, &cmatch, dss_add_child_component);
1476 1495
1477 r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match);1496 r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match);
1478 if (r)1497 if (r)
drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c+17−8
@@ -183,9 +183,24 @@ static const struct of_device_id omapdss_of_fixups_whitelist[] __initconst = { · 182 unmodified lines
183 {},183 {},
184};184};
185 185
186static void __init omapdss_find_children(struct device_node *np)
187{
188 struct device_node *child;
189
190 for_each_available_child_of_node(np, child) {
191 if (!of_find_property(child, "compatible", NULL))
192 continue;
193
194 omapdss_walk_device(child, true);
195
196 if (of_device_is_compatible(child, "ti,sysc"))
197 omapdss_find_children(child);
198 }
199}
200
186static int __init omapdss_boot_init(void)201static int __init omapdss_boot_init(void)
187{202{
188 struct device_node *dss, *child;203 struct device_node *dss;
189 204
190 INIT_LIST_HEAD(&dss_conv_list);205 INIT_LIST_HEAD(&dss_conv_list);
191 206
@@ -195,13 +210,7 @@ static int __init omapdss_boot_init(void) · 3 unmodified lines
195 return 0;210 return 0;
196 211
197 omapdss_walk_device(dss, true);212 omapdss_walk_device(dss, true);
198 213 omapdss_find_children(dss);
199 for_each_available_child_of_node(dss, child) {
200 if (!of_find_property(child, "compatible", NULL))
201 continue;
202
203 omapdss_walk_device(child, true);
204 }
205 214
206 while (!list_empty(&dss_conv_list)) {215 while (!list_empty(&dss_conv_list)) {
207 struct dss_conv_node *n;216 struct dss_conv_node *n;
include/dt-bindings/bus/ti-sysc.h+4−0
@@ -18,6 +18,10 @@ · 17 unmodified lines
18 18
19#define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4)19#define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4)
20 20
21/* PRUSS sysc found on AM33xx/AM43xx/AM57xx */
22#define SYSC_PRUSS_SUB_MWAIT (1 << 5)
23#define SYSC_PRUSS_STANDBY_INIT (1 << 4)
24
21/* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */25/* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */
22#define SYSC_IDLE_FORCE 026#define SYSC_IDLE_FORCE 0
23#define SYSC_IDLE_NO 127#define SYSC_IDLE_NO 1
include/linux/platform_data/ti-sysc.h+5−0
@@ -17,6 +17,7 @@ enum ti_sysc_module_type { · 16 unmodified lines
17 TI_SYSC_OMAP4_MCASP,17 TI_SYSC_OMAP4_MCASP,
18 TI_SYSC_OMAP4_USB_HOST_FS,18 TI_SYSC_OMAP4_USB_HOST_FS,
19 TI_SYSC_DRA7_MCAN,19 TI_SYSC_DRA7_MCAN,
20 TI_SYSC_PRUSS,
20};21};
21 22
22struct ti_sysc_cookie {23struct ti_sysc_cookie {
@@ -49,6 +50,9 @@ struct sysc_regbits { · 26 unmodified lines
49 s8 emufree_shift;50 s8 emufree_shift;
50};51};
51 52
53#define SYSC_MODULE_QUIRK_PRUSS BIT(24)
54#define SYSC_MODULE_QUIRK_DSS_RESET BIT(23)
55#define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22)
52#define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)56#define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)
53#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)57#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)
54#define SYSC_MODULE_QUIRK_AESS BIT(19)58#define SYSC_MODULE_QUIRK_AESS BIT(19)
@@ -141,6 +145,7 @@ struct clk; · 86 unmodified lines
141 145
142struct ti_sysc_platform_data {146struct ti_sysc_platform_data {
143 struct of_dev_auxdata *auxdata;147 struct of_dev_auxdata *auxdata;
148 bool (*soc_type_gp)(void);
144 int (*init_clockdomain)(struct device *dev, struct clk *fck,149 int (*init_clockdomain)(struct device *dev, struct clk *fck,
145 struct clk *ick, struct ti_sysc_cookie *cookie);150 struct clk *ick, struct ti_sysc_cookie *cookie);
146 void (*clkdm_deny_idle)(struct device *dev,151 void (*clkdm_deny_idle)(struct device *dev,