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.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 3d5eacaba3e6..8894e1b7ab0e 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -36,6 +36,7 @@
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39#include <asm/hardware/cache-l2x0.h>
39 40
40#include "common.h" 41#include "common.h"
41#include "dma-register.h" 42#include "dma-register.h"
@@ -311,10 +312,6 @@ static struct platform_device ipmmu_device = {
311 .num_resources = ARRAY_SIZE(ipmmu_resources), 312 .num_resources = ARRAY_SIZE(ipmmu_resources),
312}; 313};
313 314
314static struct platform_device *r8a7740_devices_dt[] __initdata = {
315 &cmt1_device,
316};
317
318static struct platform_device *r8a7740_early_devices[] __initdata = { 315static struct platform_device *r8a7740_early_devices[] __initdata = {
319 &scif0_device, 316 &scif0_device,
320 &scif1_device, 317 &scif1_device,
@@ -331,6 +328,7 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
331 &irqpin3_device, 328 &irqpin3_device,
332 &tmu0_device, 329 &tmu0_device,
333 &ipmmu_device, 330 &ipmmu_device,
331 &cmt1_device,
334}; 332};
335 333
336/* DMA */ 334/* DMA */
@@ -747,6 +745,19 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
747 745
748void __init r8a7740_add_standard_devices(void) 746void __init r8a7740_add_standard_devices(void)
749{ 747{
748 static struct pm_domain_device domain_devices[] __initdata = {
749 { "A3SP", &scif0_device },
750 { "A3SP", &scif1_device },
751 { "A3SP", &scif2_device },
752 { "A3SP", &scif3_device },
753 { "A3SP", &scif4_device },
754 { "A3SP", &scif5_device },
755 { "A3SP", &scif6_device },
756 { "A3SP", &scif7_device },
757 { "A3SP", &scif8_device },
758 { "A3SP", &i2c1_device },
759 };
760
750 /* I2C work-around */ 761 /* I2C work-around */
751 r8a7740_i2c_workaround(&i2c0_device); 762 r8a7740_i2c_workaround(&i2c0_device);
752 r8a7740_i2c_workaround(&i2c1_device); 763 r8a7740_i2c_workaround(&i2c1_device);
@@ -756,31 +767,18 @@ void __init r8a7740_add_standard_devices(void)
756 /* add devices */ 767 /* add devices */
757 platform_add_devices(r8a7740_early_devices, 768 platform_add_devices(r8a7740_early_devices,
758 ARRAY_SIZE(r8a7740_early_devices)); 769 ARRAY_SIZE(r8a7740_early_devices));
759 platform_add_devices(r8a7740_devices_dt,
760 ARRAY_SIZE(r8a7740_devices_dt));
761 platform_add_devices(r8a7740_late_devices, 770 platform_add_devices(r8a7740_late_devices,
762 ARRAY_SIZE(r8a7740_late_devices)); 771 ARRAY_SIZE(r8a7740_late_devices));
763 772
764 /* add devices to PM domain */ 773 /* add devices to PM domain */
765 774 rmobile_add_devices_to_domains(domain_devices,
766 rmobile_add_device_to_domain("A3SP", &scif0_device); 775 ARRAY_SIZE(domain_devices));
767 rmobile_add_device_to_domain("A3SP", &scif1_device);
768 rmobile_add_device_to_domain("A3SP", &scif2_device);
769 rmobile_add_device_to_domain("A3SP", &scif3_device);
770 rmobile_add_device_to_domain("A3SP", &scif4_device);
771 rmobile_add_device_to_domain("A3SP", &scif5_device);
772 rmobile_add_device_to_domain("A3SP", &scif6_device);
773 rmobile_add_device_to_domain("A3SP", &scif7_device);
774 rmobile_add_device_to_domain("A3SP", &scif8_device);
775 rmobile_add_device_to_domain("A3SP", &i2c1_device);
776} 776}
777 777
778void __init r8a7740_add_early_devices(void) 778void __init r8a7740_add_early_devices(void)
779{ 779{
780 early_platform_add_devices(r8a7740_early_devices, 780 early_platform_add_devices(r8a7740_early_devices,
781 ARRAY_SIZE(r8a7740_early_devices)); 781 ARRAY_SIZE(r8a7740_early_devices));
782 early_platform_add_devices(r8a7740_devices_dt,
783 ARRAY_SIZE(r8a7740_devices_dt));
784 782
785 /* setup early console here as well */ 783 /* setup early console here as well */
786 shmobile_setup_console(); 784 shmobile_setup_console();
@@ -788,13 +786,6 @@ void __init r8a7740_add_early_devices(void)
788 786
789#ifdef CONFIG_USE_OF 787#ifdef CONFIG_USE_OF
790 788
791void __init r8a7740_add_standard_devices_dt(void)
792{
793 platform_add_devices(r8a7740_devices_dt,
794 ARRAY_SIZE(r8a7740_devices_dt));
795 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
796}
797
798void __init r8a7740_init_irq_of(void) 789void __init r8a7740_init_irq_of(void)
799{ 790{
800 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); 791 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
@@ -827,8 +818,20 @@ void __init r8a7740_init_irq_of(void)
827 818
828static void __init r8a7740_generic_init(void) 819static void __init r8a7740_generic_init(void)
829{ 820{
830 r8a7740_clock_init(0); 821 r8a7740_meram_workaround();
831 r8a7740_add_standard_devices_dt(); 822
823#ifdef CONFIG_CACHE_L2X0
824 /* Shared attribute override enable, 32K*8way */
825 l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
826#endif
827 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
828}
829
830#define RESCNT2 IOMEM(0xe6188020)
831static void r8a7740_restart(enum reboot_mode mode, const char *cmd)
832{
833 /* Do soft power on reset */
834 writel(1 << 31, RESCNT2);
832} 835}
833 836
834static const char *r8a7740_boards_compat_dt[] __initdata = { 837static const char *r8a7740_boards_compat_dt[] __initdata = {
@@ -843,6 +846,7 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
843 .init_machine = r8a7740_generic_init, 846 .init_machine = r8a7740_generic_init,
844 .init_late = shmobile_init_late, 847 .init_late = shmobile_init_late,
845 .dt_compat = r8a7740_boards_compat_dt, 848 .dt_compat = r8a7740_boards_compat_dt,
849 .restart = r8a7740_restart,
846MACHINE_END 850MACHINE_END
847 851
848#endif /* CONFIG_USE_OF */ 852#endif /* CONFIG_USE_OF */