aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-r8a7740.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7740.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 3a6b6fe7b6c0..00c5a707238b 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -517,11 +517,7 @@ static struct platform_device ipmmu_device = {
517 .num_resources = ARRAY_SIZE(ipmmu_resources), 517 .num_resources = ARRAY_SIZE(ipmmu_resources),
518}; 518};
519 519
520static struct platform_device *r8a7740_early_devices[] __initdata = { 520static struct platform_device *r8a7740_devices_dt[] __initdata = {
521 &irqpin0_device,
522 &irqpin1_device,
523 &irqpin2_device,
524 &irqpin3_device,
525 &scif0_device, 521 &scif0_device,
526 &scif1_device, 522 &scif1_device,
527 &scif2_device, 523 &scif2_device,
@@ -532,6 +528,13 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
532 &scif7_device, 528 &scif7_device,
533 &scifb_device, 529 &scifb_device,
534 &cmt10_device, 530 &cmt10_device,
531};
532
533static struct platform_device *r8a7740_early_devices[] __initdata = {
534 &irqpin0_device,
535 &irqpin1_device,
536 &irqpin2_device,
537 &irqpin3_device,
535 &tmu00_device, 538 &tmu00_device,
536 &tmu01_device, 539 &tmu01_device,
537 &tmu02_device, 540 &tmu02_device,
@@ -951,6 +954,8 @@ void __init r8a7740_add_standard_devices(void)
951 /* add devices */ 954 /* add devices */
952 platform_add_devices(r8a7740_early_devices, 955 platform_add_devices(r8a7740_early_devices,
953 ARRAY_SIZE(r8a7740_early_devices)); 956 ARRAY_SIZE(r8a7740_early_devices));
957 platform_add_devices(r8a7740_devices_dt,
958 ARRAY_SIZE(r8a7740_devices_dt));
954 platform_add_devices(r8a7740_late_devices, 959 platform_add_devices(r8a7740_late_devices,
955 ARRAY_SIZE(r8a7740_late_devices)); 960 ARRAY_SIZE(r8a7740_late_devices));
956 961
@@ -972,6 +977,8 @@ void __init r8a7740_add_early_devices(void)
972{ 977{
973 early_platform_add_devices(r8a7740_early_devices, 978 early_platform_add_devices(r8a7740_early_devices,
974 ARRAY_SIZE(r8a7740_early_devices)); 979 ARRAY_SIZE(r8a7740_early_devices));
980 early_platform_add_devices(r8a7740_devices_dt,
981 ARRAY_SIZE(r8a7740_devices_dt));
975 982
976 /* setup early console here as well */ 983 /* setup early console here as well */
977 shmobile_setup_console(); 984 shmobile_setup_console();
@@ -979,33 +986,29 @@ void __init r8a7740_add_early_devices(void)
979 986
980#ifdef CONFIG_USE_OF 987#ifdef CONFIG_USE_OF
981 988
982void __init r8a7740_add_early_devices_dt(void)
983{
984 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
985
986 early_platform_add_devices(r8a7740_early_devices,
987 ARRAY_SIZE(r8a7740_early_devices));
988
989 /* setup early console here as well */
990 shmobile_setup_console();
991}
992
993static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = { 989static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = {
994 { } 990 { }
995}; 991};
996 992
997void __init r8a7740_add_standard_devices_dt(void) 993void __init r8a7740_add_standard_devices_dt(void)
998{ 994{
999 /* clocks are setup late during boot in the case of DT */ 995 platform_add_devices(r8a7740_devices_dt,
1000 r8a7740_clock_init(0); 996 ARRAY_SIZE(r8a7740_devices_dt));
1001
1002 platform_add_devices(r8a7740_early_devices,
1003 ARRAY_SIZE(r8a7740_early_devices));
1004
1005 of_platform_populate(NULL, of_default_bus_match_table, 997 of_platform_populate(NULL, of_default_bus_match_table,
1006 r8a7740_auxdata_lookup, NULL); 998 r8a7740_auxdata_lookup, NULL);
1007} 999}
1008 1000
1001void __init r8a7740_init_delay(void)
1002{
1003 shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
1004};
1005
1006static void __init r8a7740_generic_init(void)
1007{
1008 r8a7740_clock_init(0);
1009 r8a7740_add_standard_devices_dt();
1010}
1011
1009static const char *r8a7740_boards_compat_dt[] __initdata = { 1012static const char *r8a7740_boards_compat_dt[] __initdata = {
1010 "renesas,r8a7740", 1013 "renesas,r8a7740",
1011 NULL, 1014 NULL,
@@ -1013,9 +1016,10 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
1013 1016
1014DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") 1017DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
1015 .map_io = r8a7740_map_io, 1018 .map_io = r8a7740_map_io,
1016 .init_early = r8a7740_add_early_devices_dt, 1019 .init_early = r8a7740_init_delay,
1017 .init_irq = r8a7740_init_irq, 1020 .init_irq = r8a7740_init_irq_of,
1018 .init_machine = r8a7740_add_standard_devices_dt, 1021 .init_machine = r8a7740_generic_init,
1022 .init_time = shmobile_timer_init,
1019 .dt_compat = r8a7740_boards_compat_dt, 1023 .dt_compat = r8a7740_boards_compat_dt,
1020MACHINE_END 1024MACHINE_END
1021 1025