ARM: 7190/1: restart: davinci: use new restart hook
authorSekhar Nori <nsekhar@ti.com>
Mon, 5 Dec 2011 10:29:46 +0000 (11:29 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:57:09 +0000 (12:57 +0000)
Rather than using DaVinci specific davinci_soc_info based
restart hook, use the restart hook available in the machine
descriptor instead.

Tested on DM365 and AM18x EVMs.

v2:
Changed to use restart hook in machine descriptor
per Russell's comment.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
26 files changed:
arch/arm/mach-davinci/board-da830-evm.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm355-leopard.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-neuros-osd2.c
arch/arm/mach-davinci/board-omapl138-hawk.c
arch/arm/mach-davinci/board-sffsdr.c
arch/arm/mach-davinci/board-tnetv107x-evm.c
arch/arm/mach-davinci/common.c
arch/arm/mach-davinci/da830.c
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/devices.c
arch/arm/mach-davinci/dm355.c
arch/arm/mach-davinci/dm365.c
arch/arm/mach-davinci/dm644x.c
arch/arm/mach-davinci/dm646x.c
arch/arm/mach-davinci/include/mach/common.h
arch/arm/mach-davinci/include/mach/da8xx.h
arch/arm/mach-davinci/include/mach/system.h
arch/arm/mach-davinci/include/mach/tnetv107x.h
arch/arm/mach-davinci/tnetv107x.c

index 11c3db985285880ac7a2f22b13b51ff677fcae46..dc1afe5be20cc3d305c178faaec0bfd1633e4e3f 100644 (file)
@@ -682,4 +682,5 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
        .timer          = &davinci_timer,
        .init_machine   = da830_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 6659a90dbcadafffdc6ae4988f1a1c6148a955b5..f8a682f60a4208defb9daeae1c4d105b4ed09230 100644 (file)
@@ -1411,4 +1411,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
        .timer          = &davinci_timer,
        .init_machine   = da850_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 4e0e707c313d7b9e51f87acbece9b3e0af3a97f3..275341f159fb6ee6cc0ddef2ca04bf14349eb913 100644 (file)
@@ -357,4 +357,5 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
        .timer        = &davinci_timer,
        .init_machine = dm355_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index ff2d2413279a26482411dcbb8728266b93e8bbe4..e99db28181ae8ad518a08dfafbb57fa6de4d09f0 100644 (file)
@@ -276,4 +276,5 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
        .timer        = &davinci_timer,
        .init_machine = dm355_leopard_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index 46e1f4173b9735c622c8a95c5c9a605782c1eda6..346e1de2f5a857ac16fb9c2ecb5b85af9c4537d9 100644 (file)
@@ -618,5 +618,6 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
        .timer          = &davinci_timer,
        .init_machine   = dm365_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
index 0cf8abf78d33d878acd1dbf3480e7d92403e2c66..a64b49cfedcad5f495ac2e360751e045036ca2cd 100644 (file)
@@ -719,4 +719,5 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
        .timer        = &davinci_timer,
        .init_machine = davinci_evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index 635bf7740157bb7ea88b94580c98ead839f44068..64017558860bd0c127a9c5178d8aacd47229a62f 100644 (file)
@@ -799,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
        .timer        = &davinci_timer,
        .init_machine = evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
 MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
@@ -808,5 +809,6 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
        .timer        = &davinci_timer,
        .init_machine = evm_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
 
index 3cfff555e8f22a842eb75f3614d5e5605eaf642b..672d820e2aa4c73d93fe128cd233d99ae2fa8eaa 100644 (file)
@@ -573,4 +573,5 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
        .timer          = &davinci_timer,
        .init_machine   = mityomapl138_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index e5f231aefee428bfd26cde4b4b05d7de45627992..6c4a16415d476f58fbdadb88308cb803a9019956 100644 (file)
@@ -278,4 +278,5 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
        .timer          = &davinci_timer,
        .init_machine = davinci_ntosd2_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index c6701e4a795c3da5ebe3a14f1d2e770e8a6231aa..e7c0c7c534937132929cf4cdd760fb4c63f4118b 100644 (file)
@@ -344,4 +344,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
        .timer          = &davinci_timer,
        .init_machine   = omapl138_hawk_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = da8xx_restart,
 MACHINE_END
index 5dd4da9d23083e83010725df9a83bee61e9f2b06..0b136a831c59563100312646d0b1b1324e8c4e20 100644 (file)
@@ -157,4 +157,5 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
        .timer        = &davinci_timer,
        .init_machine = davinci_sffsdr_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = davinci_restart,
 MACHINE_END
index f69e40a29e0256005801d46756529dadb3e1d5db..5f14e30b00d896a79c83ded76929543c956fb93f 100644 (file)
@@ -283,4 +283,5 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
        .timer          = &davinci_timer,
        .init_machine   = tnetv107x_evm_board_init,
        .dma_zone_size  = SZ_128M,
+       .restart        = tnetv107x_restart,
 MACHINE_END
index 865ffe5899ac4eb2864176542a150c3ca2524a87..cb9b2e47510c8de2118bd80364f4b60b4308e07b 100644 (file)
@@ -97,9 +97,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
        local_flush_tlb_all();
        flush_cache_all();
 
-       if (!davinci_soc_info.reset)
-               davinci_soc_info.reset = davinci_watchdog_reset;
-
        /*
         * We want to check CPU revision early for cpu_is_xxxx() macros.
         * IO space mapping must be initialized before we can do that.
index a6bf5dcaef1341863d614412fe3bc29275f44a47..deee5c2da7546b987be46b596b00bef4bbf04d1f 100644 (file)
@@ -1201,7 +1201,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
        .gpio_irq               = IRQ_DA8XX_GPIO0,
        .serial_dev             = &da8xx_serial_device,
        .emac_pdata             = &da8xx_emac_pdata,
-       .reset_device           = &da8xx_wdt_device,
 };
 
 void __init da830_init(void)
index b047f87022785477ffafc8336bfd438f27e51ae9..0ed7fdb64efbf5211a8e5b8fc19bc5cf56fc3b97 100644 (file)
@@ -1121,7 +1121,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
        .emac_pdata             = &da8xx_emac_pdata,
        .sram_dma               = DA8XX_ARM_RAM_BASE,
        .sram_len               = SZ_8K,
-       .reset_device           = &da8xx_wdt_device,
 };
 
 void __init da850_init(void)
index 68def71888685b0277b1dacab25bd5bfaef1c09e..42dbf3dc11abe780592cb07ddc72651e5a30c259 100644 (file)
@@ -363,6 +363,11 @@ struct platform_device da8xx_wdt_device = {
        .resource       = da8xx_watchdog_resources,
 };
 
+void da8xx_restart(char mode, const char *cmd)
+{
+       davinci_watchdog_reset(&da8xx_wdt_device);
+}
+
 int __init da8xx_register_watchdog(void)
 {
        return platform_device_register(&da8xx_wdt_device);
index 806a2f02b9808abf870ac9b9b0e1c77d99e60bb4..50c0156b42628db2402967054430dcce027004bf 100644 (file)
@@ -291,6 +291,11 @@ struct platform_device davinci_wdt_device = {
        .resource       = wdt_resources,
 };
 
+void davinci_restart(char mode, const char *cmd)
+{
+       davinci_watchdog_reset(&davinci_wdt_device);
+}
+
 static void davinci_init_wdt(void)
 {
        platform_device_register(&davinci_wdt_device);
index fe520d4167a2c34d3cc794ed3e836049bc926594..19667cfc5de0ec9ed10829a97ba225f7d2143037 100644 (file)
@@ -853,7 +853,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
        .serial_dev             = &dm355_serial_device,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
index 679e168dce34e55f4c711d12c01eab4300174bac..f15b435cc655c79003607cde11e599938cb05129 100644 (file)
@@ -1083,7 +1083,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
        .emac_pdata             = &dm365_emac_pdata,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm365_init_asp(struct snd_platform_data *pdata)
index 3470983aa343c6a9d30a0b50cdcd3570cd6882e0..0800f9cf33bbb0e2c0bf03dd1ce8fb4e34cb8d30 100644 (file)
@@ -767,7 +767,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
        .emac_pdata             = &dm644x_emac_pdata,
        .sram_dma               = 0x00008000,
        .sram_len               = SZ_16K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm644x_init_asp(struct snd_platform_data *pdata)
index af27c130595fb6897cb104253ad157f567d53f04..00f774394b167808a9d9adc2096fa7f94b20f4bf 100644 (file)
@@ -854,7 +854,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
        .emac_pdata             = &dm646x_emac_pdata,
        .sram_dma               = 0x10010000,
        .sram_len               = SZ_32K,
-       .reset_device           = &davinci_wdt_device,
 };
 
 void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
index a57cba21e21e1e150a949971deda4f46f38c50d7..5cd39a4e0c966d4823d2c438edf8376216f35ae6 100644 (file)
@@ -77,14 +77,13 @@ struct davinci_soc_info {
        struct emac_platform_data       *emac_pdata;
        dma_addr_t                      sram_dma;
        unsigned                        sram_len;
-       struct platform_device          *reset_device;
-       void                            (*reset)(struct platform_device *);
 };
 
 extern struct davinci_soc_info davinci_soc_info;
 
 extern void davinci_common_init(struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
+void davinci_restart(char mode, const char *cmd);
 
 /* standard place to map on-chip SRAMs; they *may* support DMA */
 #define SRAM_VIRT      0xfffe0000
index eaca7d8b9d68fb61c75f5da8dd7d6e787da8ef8c..ee3461d7ec1b9e1302f3bab314ee656200468d6e 100644 (file)
@@ -91,6 +91,7 @@ int da8xx_register_cpuidle(void);
 void __iomem * __init da8xx_get_mem_ctlr(void);
 int da850_register_pm(struct platform_device *pdev);
 int __init da850_register_sata(unsigned long refclkpn);
+void da8xx_restart(char mode, const char *cmd);
 
 extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;
index e65629c20769047ec4900d89f3bee1e09ac552fc..6bd1dc06db27b1b96ee2e990e08b7aec0ba6bf3c 100644 (file)
@@ -20,8 +20,6 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-       if (davinci_soc_info.reset)
-               davinci_soc_info.reset(davinci_soc_info.reset_device);
 }
 
 #endif /* __ASM_ARCH_SYSTEM_H */
index 89c1fdc63c0b3924379798a7cc9552fa40d899ef..83e5926f3c46966f29b01c227d343a64dc12a7da 100644 (file)
@@ -54,6 +54,7 @@ extern struct platform_device tnetv107x_serial_device;
 extern void __init tnetv107x_init(void);
 extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *);
 extern void __init tnetv107x_irq_init(void);
+void tnetv107x_restart(char mode, const char *cmd);
 
 #endif
 
index 409bb869c7c766c071bf9838375b2df1410b14f3..dc1a209b9b66624fdfa8f748e237b682e3cec18a 100644 (file)
@@ -730,6 +730,11 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)
        __raw_writel(1, &regs->kick);
 }
 
+void tnetv107x_restart(char mode, const char *cmd)
+{
+       tnetv107x_watchdog_reset(&tnetv107x_wdt_device);
+}
+
 static struct davinci_soc_info tnetv107x_soc_info = {
        .io_desc                = io_desc,
        .io_desc_num            = ARRAY_SIZE(io_desc),
@@ -752,8 +757,6 @@ static struct davinci_soc_info tnetv107x_soc_info = {
        .gpio_num               = TNETV107X_N_GPIO,
        .timer_info             = &timer_info,
        .serial_dev             = &tnetv107x_serial_device,
-       .reset                  = tnetv107x_watchdog_reset,
-       .reset_device           = &tnetv107x_wdt_device,
 };
 
 void __init tnetv107x_init(void)