Skip to content

Commit c9ee949

Browse files
arndbShawn Guo
authored andcommitted
ARM: imx: deconstruct mxc_rnga initialization
The rnga platform device is initialized for all imx31 machines from its own initcall, but is never initialized anywhere else. This moves the platform device creation into both the imx31 dt and non-dt machine init sequences, which has basically the exact same effect as before, but makes it more obvious what is going on, while reducing the amount of code and removing the last user of cpu_is_mx31(). Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 6f98cb2 commit c9ee949

File tree

5 files changed

+18
-61
lines changed

5 files changed

+18
-61
lines changed

arch/arm/mach-imx/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ config MXC_USE_EPIT
4444
uses the same clocks as the GPT. Anyway, on some systems the GPT
4545
may be in use for other purposes.
4646

47-
config ARCH_HAS_RNGA
48-
bool
49-
5047
config HAVE_IMX_ANATOP
5148
bool
5249

@@ -90,7 +87,6 @@ config SOC_IMX27
9087
config SOC_IMX31
9188
bool
9289
select CPU_V6
93-
select IMX_HAVE_PLATFORM_MXC_RNGA
9490
select MXC_AVIC
9591
select SMP_ON_UP if SMP
9692

arch/arm/mach-imx/devices/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC
5757
config IMX_HAVE_PLATFORM_MXC_NAND
5858
bool
5959

60-
config IMX_HAVE_PLATFORM_MXC_RNGA
61-
bool
62-
select ARCH_HAS_RNGA
63-
6460
config IMX_HAVE_PLATFORM_MXC_RTC
6561
bool
6662

arch/arm/mach-imx/devices/platform-mxc_rnga.c

Lines changed: 0 additions & 53 deletions
This file was deleted.

arch/arm/mach-imx/imx31-dt.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,22 @@ static void __init imx31_dt_timer_init(void)
2828
mx31_clocks_init_dt();
2929
}
3030

31+
/* FIXME: replace with DT binding */
32+
static const struct resource imx31_rnga_res[] __initconst = {
33+
DEFINE_RES_MEM(MX31_RNGA_BASE_ADDR, SZ_16K),
34+
};
35+
36+
static void __init imx31_dt_mach_init(void)
37+
{
38+
platform_device_register_simple("mxc_rnga", -1, imx31_rnga_res,
39+
ARRAY_SIZE(imx31_rnga_res));
40+
}
41+
3142
DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
3243
.map_io = mx31_map_io,
3344
.init_early = imx31_init_early,
3445
.init_irq = mx31_init_irq,
3546
.init_time = imx31_dt_timer_init,
47+
.init_machine = imx31_dt_mach_init,
3648
.dt_compat = imx31_dt_board_compat,
3749
MACHINE_END

arch/arm/mach-imx/mm-imx3.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ static const struct resource imx31_audmux_res[] __initconst = {
167167
DEFINE_RES_MEM(MX31_AUDMUX_BASE_ADDR, SZ_16K),
168168
};
169169

170+
static const struct resource imx31_rnga_res[] __initconst = {
171+
DEFINE_RES_MEM(MX31_RNGA_BASE_ADDR, SZ_16K),
172+
};
173+
170174
void __init imx31_soc_init(void)
171175
{
172176
int to_version = mx31_revision() >> 4;
@@ -195,6 +199,8 @@ void __init imx31_soc_init(void)
195199

196200
platform_device_register_simple("imx31-audmux", 0, imx31_audmux_res,
197201
ARRAY_SIZE(imx31_audmux_res));
202+
platform_device_register_simple("mxc_rnga", -1, imx31_rnga_res,
203+
ARRAY_SIZE(imx31_rnga_res));
198204
}
199205
#endif /* ifdef CONFIG_SOC_IMX31 */
200206

0 commit comments

Comments
 (0)