Commit 05323998 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Simon Horman

soc: renesas: rcar-sysc: Move SYSC interrupt config to rcar-sysc driver

On R-Car H1 and Gen2, the SYSC interrupt registers are always configured
using hardcoded values in platform code. For R-Car Gen2, values are
provided for H2 and M2-W only, other SoCs are not yet supported, and
never will be.

Move this configuration from SoC-specific platform code to the
rcar_sysc_init() wrapper, so it can be skipped if the SYSC is configured
from DT. This would be the case not only for H1, H2, and M2-W using a
modern DTS, but also for other R-Car Gen2 SoCs not supported by the
platform code, relying purely on DT.

There is no longer a need to return the mapped register block, hence
make the function return void.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarUlrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent b1e52287
...@@ -23,11 +23,7 @@ ...@@ -23,11 +23,7 @@
static void __init r8a7779_sysc_init(void) static void __init r8a7779_sysc_init(void)
{ {
void __iomem *base = rcar_sysc_init(0xffd85000); rcar_sysc_init(0xffd85000, 0x0131000e);
/* enable all interrupt sources, but do not use interrupt handler */
iowrite32(0x0131000e, base + SYSCIER);
iowrite32(0, base + SYSCIMR);
} }
#else /* CONFIG_PM || CONFIG_SMP */ #else /* CONFIG_PM || CONFIG_SMP */
......
...@@ -37,11 +37,7 @@ ...@@ -37,11 +37,7 @@
static void __init rcar_gen2_sysc_init(u32 syscier) static void __init rcar_gen2_sysc_init(u32 syscier)
{ {
void __iomem *base = rcar_sysc_init(0xe6180000); rcar_sysc_init(0xe6180000, syscier);
/* enable all interrupt sources, but do not use interrupt handler */
iowrite32(syscier, base + SYSCIER);
iowrite32(0, base + SYSCIMR);
} }
#else /* CONFIG_SMP */ #else /* CONFIG_SMP */
......
...@@ -400,10 +400,14 @@ static int __init rcar_sysc_pd_init(void) ...@@ -400,10 +400,14 @@ static int __init rcar_sysc_pd_init(void)
} }
early_initcall(rcar_sysc_pd_init); early_initcall(rcar_sysc_pd_init);
void __iomem * __init rcar_sysc_init(phys_addr_t base) void __init rcar_sysc_init(phys_addr_t base, u32 syscier)
{ {
if (rcar_sysc_pd_init()) if (!rcar_sysc_pd_init())
rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); return;
return rcar_sysc_base; rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE);
/* enable all interrupt sources, but do not use interrupt handler */
iowrite32(syscier, rcar_sysc_base + SYSCIER);
iowrite32(0, rcar_sysc_base + SYSCIMR);
} }
...@@ -11,6 +11,6 @@ struct rcar_sysc_ch { ...@@ -11,6 +11,6 @@ struct rcar_sysc_ch {
int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch); int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch);
int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch); int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch);
void __iomem *rcar_sysc_init(phys_addr_t base); void rcar_sysc_init(phys_addr_t base, u32 syscier);
#endif /* __LINUX_SOC_RENESAS_RCAR_SYSC_H__ */ #endif /* __LINUX_SOC_RENESAS_RCAR_SYSC_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment