Renesas driver updates for v5.4 (take two)

- Improve "always-on" PM Domain handling on SH/R-Mobile SoCs,
   - Automatic errata selection for Cortex-A7/A9,
   - Small fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCXV/SBwAKCRCKwlD9ZEnx
 cGNpAP0ck0BkVTdVsRRG17jo4su3i9Yhq2Weqw9z2s9JkygJvgEAvGsaJPxtq3Pk
 uhjkL67VVDq01sp/0WydkXqY3pErwgI=
 =cmiN
 -----END PGP SIGNATURE-----

Merge tag 'renesas-drivers-for-v5.4-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers

Renesas driver updates for v5.4 (take two)

  - Improve "always-on" PM Domain handling on SH/R-Mobile SoCs,
  - Automatic errata selection for Cortex-A7/A9,
  - Small fixes and improvements.

* tag 'renesas-drivers-for-v5.4-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  soc: renesas: Enable ARM_ERRATA_754322 for affected Cortex-A9
  soc: renesas: Enable ARM_ERRATA_814220 for affected Cortex-A7
  soc: renesas: rmobile-sysc: Set GENPD_FLAG_ALWAYS_ON for always-on domain
  soc: renesas: rcar-sysc: Eliminate local variable gov
  soc: renesas: rcar-sysc: Add goto to of_node_put() before return

Link: https://lore.kernel.org/r/20190823123643.18799-5-geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2019-09-03 20:20:42 +02:00
commit 328790614d
3 changed files with 29 additions and 18 deletions

View File

@ -55,6 +55,7 @@ config ARCH_EMEV2
config ARCH_R7S72100 config ARCH_R7S72100
bool "RZ/A1H (R7S72100)" bool "RZ/A1H (R7S72100)"
select ARM_ERRATA_754322
select PM select PM
select PM_GENERIC_DOMAINS select PM_GENERIC_DOMAINS
select RENESAS_OSTM select RENESAS_OSTM
@ -72,12 +73,14 @@ config ARCH_R8A73A4
bool "R-Mobile APE6 (R8A73A40)" bool "R-Mobile APE6 (R8A73A40)"
select ARCH_RMOBILE select ARCH_RMOBILE
select ARM_ERRATA_798181 if SMP select ARM_ERRATA_798181 if SMP
select ARM_ERRATA_814220
select HAVE_ARM_ARCH_TIMER select HAVE_ARM_ARCH_TIMER
select RENESAS_IRQC select RENESAS_IRQC
config ARCH_R8A7740 config ARCH_R8A7740
bool "R-Mobile A1 (R8A77400)" bool "R-Mobile A1 (R8A77400)"
select ARCH_RMOBILE select ARCH_RMOBILE
select ARM_ERRATA_754322
select RENESAS_INTC_IRQPIN select RENESAS_INTC_IRQPIN
config ARCH_R8A7743 config ARCH_R8A7743
@ -95,20 +98,24 @@ config ARCH_R8A7744
config ARCH_R8A7745 config ARCH_R8A7745
bool "RZ/G1E (R8A77450)" bool "RZ/G1E (R8A77450)"
select ARCH_RCAR_GEN2 select ARCH_RCAR_GEN2
select ARM_ERRATA_814220
select SYSC_R8A7745 select SYSC_R8A7745
config ARCH_R8A77470 config ARCH_R8A77470
bool "RZ/G1C (R8A77470)" bool "RZ/G1C (R8A77470)"
select ARCH_RCAR_GEN2 select ARCH_RCAR_GEN2
select ARM_ERRATA_814220
select SYSC_R8A77470 select SYSC_R8A77470
config ARCH_R8A7778 config ARCH_R8A7778
bool "R-Car M1A (R8A77781)" bool "R-Car M1A (R8A77781)"
select ARCH_RCAR_GEN1 select ARCH_RCAR_GEN1
select ARM_ERRATA_754322
config ARCH_R8A7779 config ARCH_R8A7779
bool "R-Car H1 (R8A77790)" bool "R-Car H1 (R8A77790)"
select ARCH_RCAR_GEN1 select ARCH_RCAR_GEN1
select ARM_ERRATA_754322
select HAVE_ARM_SCU if SMP select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP select HAVE_ARM_TWD if SMP
select SYSC_R8A7779 select SYSC_R8A7779
@ -117,6 +124,7 @@ config ARCH_R8A7790
bool "R-Car H2 (R8A77900)" bool "R-Car H2 (R8A77900)"
select ARCH_RCAR_GEN2 select ARCH_RCAR_GEN2
select ARM_ERRATA_798181 if SMP select ARM_ERRATA_798181 if SMP
select ARM_ERRATA_814220
select I2C select I2C
select SYSC_R8A7790 select SYSC_R8A7790
@ -143,15 +151,18 @@ config ARCH_R8A7793
config ARCH_R8A7794 config ARCH_R8A7794
bool "R-Car E2 (R8A77940)" bool "R-Car E2 (R8A77940)"
select ARCH_RCAR_GEN2 select ARCH_RCAR_GEN2
select ARM_ERRATA_814220
select SYSC_R8A7794 select SYSC_R8A7794
config ARCH_R9A06G032 config ARCH_R9A06G032
bool "RZ/N1D (R9A06G032)" bool "RZ/N1D (R9A06G032)"
select ARCH_RZN1 select ARCH_RZN1
select ARM_ERRATA_814220
config ARCH_SH73A0 config ARCH_SH73A0
bool "SH-Mobile AG5 (R8A73A00)" bool "SH-Mobile AG5 (R8A73A00)"
select ARCH_RMOBILE select ARCH_RMOBILE
select ARM_ERRATA_754322
select HAVE_ARM_SCU if SMP select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP select HAVE_ARM_TWD if SMP
select RENESAS_INTC_IRQPIN select RENESAS_INTC_IRQPIN

View File

@ -200,7 +200,6 @@ static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
{ {
struct generic_pm_domain *genpd = &pd->genpd; struct generic_pm_domain *genpd = &pd->genpd;
const char *name = pd->genpd.name; const char *name = pd->genpd.name;
struct dev_power_governor *gov = &simple_qos_governor;
int error; int error;
if (pd->flags & PD_CPU) { if (pd->flags & PD_CPU) {
@ -254,7 +253,7 @@ static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
rcar_sysc_power(&pd->ch, true); rcar_sysc_power(&pd->ch, true);
finalize: finalize:
error = pm_genpd_init(genpd, gov, false); error = pm_genpd_init(genpd, &simple_qos_governor, false);
if (error) if (error)
pr_err("Failed to init PM domain %s: %d\n", name, error); pr_err("Failed to init PM domain %s: %d\n", name, error);
@ -346,7 +345,7 @@ static int __init rcar_sysc_pd_init(void)
if (info->init) { if (info->init) {
error = info->init(); error = info->init();
if (error) if (error)
return error; goto out_put;
} }
has_cpg_mstp = of_find_compatible_node(NULL, NULL, has_cpg_mstp = of_find_compatible_node(NULL, NULL,

View File

@ -48,12 +48,8 @@ struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d)
static int rmobile_pd_power_down(struct generic_pm_domain *genpd) static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
{ {
struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd); struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd);
unsigned int mask; unsigned int mask = BIT(rmobile_pd->bit_shift);
if (rmobile_pd->bit_shift == ~0)
return -EBUSY;
mask = BIT(rmobile_pd->bit_shift);
if (rmobile_pd->suspend) { if (rmobile_pd->suspend) {
int ret = rmobile_pd->suspend(); int ret = rmobile_pd->suspend();
@ -80,14 +76,10 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd) static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd)
{ {
unsigned int mask; unsigned int mask = BIT(rmobile_pd->bit_shift);
unsigned int retry_count; unsigned int retry_count;
int ret = 0; int ret = 0;
if (rmobile_pd->bit_shift == ~0)
return 0;
mask = BIT(rmobile_pd->bit_shift);
if (__raw_readl(rmobile_pd->base + PSTR) & mask) if (__raw_readl(rmobile_pd->base + PSTR) & mask)
return ret; return ret;
@ -122,11 +114,15 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
struct dev_power_governor *gov = rmobile_pd->gov; struct dev_power_governor *gov = rmobile_pd->gov;
genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP;
genpd->power_off = rmobile_pd_power_down; genpd->attach_dev = cpg_mstp_attach_dev;
genpd->power_on = rmobile_pd_power_up; genpd->detach_dev = cpg_mstp_detach_dev;
genpd->attach_dev = cpg_mstp_attach_dev;
genpd->detach_dev = cpg_mstp_detach_dev; if (!(genpd->flags & GENPD_FLAG_ALWAYS_ON)) {
__rmobile_pd_power_up(rmobile_pd); genpd->power_off = rmobile_pd_power_down;
genpd->power_on = rmobile_pd_power_up;
__rmobile_pd_power_up(rmobile_pd);
}
pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
} }
@ -270,6 +266,11 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
break; break;
case PD_NORMAL: case PD_NORMAL:
if (pd->bit_shift == ~0) {
/* Top-level always-on domain */
pr_debug("PM domain %s is always-on domain\n", name);
pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
}
break; break;
} }