Skip to content

Commit

Permalink
ARM: imx: deconstruct mxc_rnga initialization
Browse files Browse the repository at this point in the history
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 <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Shawn Guo committed Jun 28, 2016
1 parent 6f98cb2 commit c9ee949
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 61 deletions.
4 changes: 0 additions & 4 deletions arch/arm/mach-imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ config MXC_USE_EPIT
uses the same clocks as the GPT. Anyway, on some systems the GPT
may be in use for other purposes.

config ARCH_HAS_RNGA
bool

config HAVE_IMX_ANATOP
bool

Expand Down Expand Up @@ -90,7 +87,6 @@ config SOC_IMX27
config SOC_IMX31
bool
select CPU_V6
select IMX_HAVE_PLATFORM_MXC_RNGA
select MXC_AVIC
select SMP_ON_UP if SMP

Expand Down
4 changes: 0 additions & 4 deletions arch/arm/mach-imx/devices/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC
config IMX_HAVE_PLATFORM_MXC_NAND
bool

config IMX_HAVE_PLATFORM_MXC_RNGA
bool
select ARCH_HAS_RNGA

config IMX_HAVE_PLATFORM_MXC_RTC
bool

Expand Down
53 changes: 0 additions & 53 deletions arch/arm/mach-imx/devices/platform-mxc_rnga.c

This file was deleted.

12 changes: 12 additions & 0 deletions arch/arm/mach-imx/imx31-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ static void __init imx31_dt_timer_init(void)
mx31_clocks_init_dt();
}

/* FIXME: replace with DT binding */
static const struct resource imx31_rnga_res[] __initconst = {
DEFINE_RES_MEM(MX31_RNGA_BASE_ADDR, SZ_16K),
};

static void __init imx31_dt_mach_init(void)
{
platform_device_register_simple("mxc_rnga", -1, imx31_rnga_res,
ARRAY_SIZE(imx31_rnga_res));
}

DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
.map_io = mx31_map_io,
.init_early = imx31_init_early,
.init_irq = mx31_init_irq,
.init_time = imx31_dt_timer_init,
.init_machine = imx31_dt_mach_init,
.dt_compat = imx31_dt_board_compat,
MACHINE_END
6 changes: 6 additions & 0 deletions arch/arm/mach-imx/mm-imx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ static const struct resource imx31_audmux_res[] __initconst = {
DEFINE_RES_MEM(MX31_AUDMUX_BASE_ADDR, SZ_16K),
};

static const struct resource imx31_rnga_res[] __initconst = {
DEFINE_RES_MEM(MX31_RNGA_BASE_ADDR, SZ_16K),
};

void __init imx31_soc_init(void)
{
int to_version = mx31_revision() >> 4;
Expand Down Expand Up @@ -195,6 +199,8 @@ void __init imx31_soc_init(void)

platform_device_register_simple("imx31-audmux", 0, imx31_audmux_res,
ARRAY_SIZE(imx31_audmux_res));
platform_device_register_simple("mxc_rnga", -1, imx31_rnga_res,
ARRAY_SIZE(imx31_rnga_res));
}
#endif /* ifdef CONFIG_SOC_IMX31 */

Expand Down

0 comments on commit c9ee949

Please sign in to comment.