aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-07-21 18:05:16 -0400
committerOlof Johansson <olof@lixom.net>2018-07-21 18:05:16 -0400
commit1df88c683ea376a0499e195c2301eb8ce9668b77 (patch)
treec81ce36eaaedde699d09bb748bf5cb17e30c867c
parent85a03fe92ce654d32442a59807fde2cd9fe177b0 (diff)
parent69c04aee3482415cff52061a3ccad4943662e81d (diff)
Merge tag 'imx-drivers-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/drivers
i.MX drivers update for 4.19: - Handle i.MX6SL chip errata ERR006287 in the safest possible way by keeping the DISP domain always-on, because Upon resuming from power gating, the modules in the display power domain (eLCDIF, EPDC, PXP and SPDC) might fail to perform register reads correctly. - Use GENPD_FLAG_ALWAYS_ON flag for i.MX6QP PU ERR009619 handling. It is functionally identical to the exsiting implementation but simpler and slightly faster. * tag 'imx-drivers-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata soc: imx: gpc: Disable 6sl display power gating for ERR006287 Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--drivers/soc/imx/gpc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 32f0748fd067..403f3f2f43bd 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -47,7 +47,6 @@ struct imx_pm_domain {
47 unsigned int reg_offs; 47 unsigned int reg_offs;
48 signed char cntr_pdn_bit; 48 signed char cntr_pdn_bit;
49 unsigned int ipg_rate_mhz; 49 unsigned int ipg_rate_mhz;
50 unsigned int flags;
51}; 50};
52 51
53static inline struct imx_pm_domain * 52static inline struct imx_pm_domain *
@@ -62,9 +61,6 @@ static int imx6_pm_domain_power_off(struct generic_pm_domain *genpd)
62 int iso, iso2sw; 61 int iso, iso2sw;
63 u32 val; 62 u32 val;
64 63
65 if (pd->flags & PGC_DOMAIN_FLAG_NO_PD)
66 return -EBUSY;
67
68 /* Read ISO and ISO2SW power down delays */ 64 /* Read ISO and ISO2SW power down delays */
69 regmap_read(pd->regmap, pd->reg_offs + GPC_PGC_PUPSCR_OFFS, &val); 65 regmap_read(pd->regmap, pd->reg_offs + GPC_PGC_PUPSCR_OFFS, &val);
70 iso = val & 0x3f; 66 iso = val & 0x3f;
@@ -288,26 +284,31 @@ static struct imx_pm_domain imx_gpc_domains[] = {
288struct imx_gpc_dt_data { 284struct imx_gpc_dt_data {
289 int num_domains; 285 int num_domains;
290 bool err009619_present; 286 bool err009619_present;
287 bool err006287_present;
291}; 288};
292 289
293static const struct imx_gpc_dt_data imx6q_dt_data = { 290static const struct imx_gpc_dt_data imx6q_dt_data = {
294 .num_domains = 2, 291 .num_domains = 2,
295 .err009619_present = false, 292 .err009619_present = false,
293 .err006287_present = false,
296}; 294};
297 295
298static const struct imx_gpc_dt_data imx6qp_dt_data = { 296static const struct imx_gpc_dt_data imx6qp_dt_data = {
299 .num_domains = 2, 297 .num_domains = 2,
300 .err009619_present = true, 298 .err009619_present = true,
299 .err006287_present = false,
301}; 300};
302 301
303static const struct imx_gpc_dt_data imx6sl_dt_data = { 302static const struct imx_gpc_dt_data imx6sl_dt_data = {
304 .num_domains = 3, 303 .num_domains = 3,
305 .err009619_present = false, 304 .err009619_present = false,
305 .err006287_present = true,
306}; 306};
307 307
308static const struct imx_gpc_dt_data imx6sx_dt_data = { 308static const struct imx_gpc_dt_data imx6sx_dt_data = {
309 .num_domains = 4, 309 .num_domains = 4,
310 .err009619_present = false, 310 .err009619_present = false,
311 .err006287_present = false,
311}; 312};
312 313
313static const struct of_device_id imx_gpc_dt_ids[] = { 314static const struct of_device_id imx_gpc_dt_ids[] = {
@@ -413,8 +414,13 @@ static int imx_gpc_probe(struct platform_device *pdev)
413 414
414 /* Disable PU power down in normal operation if ERR009619 is present */ 415 /* Disable PU power down in normal operation if ERR009619 is present */
415 if (of_id_data->err009619_present) 416 if (of_id_data->err009619_present)
416 imx_gpc_domains[GPC_PGC_DOMAIN_PU].flags |= 417 imx_gpc_domains[GPC_PGC_DOMAIN_PU].base.flags |=
417 PGC_DOMAIN_FLAG_NO_PD; 418 GENPD_FLAG_ALWAYS_ON;
419
420 /* Keep DISP always on if ERR006287 is present */
421 if (of_id_data->err006287_present)
422 imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY].base.flags |=
423 GENPD_FLAG_ALWAYS_ON;
418 424
419 if (!pgc_node) { 425 if (!pgc_node) {
420 ret = imx_gpc_old_dt_init(&pdev->dev, regmap, 426 ret = imx_gpc_old_dt_init(&pdev->dev, regmap,