Commit c6121ddd authored by Sekhar Nori's avatar Sekhar Nori Committed by Russell King

ARM: 7190/1: restart: davinci: use new restart hook

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: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 39214705
...@@ -682,4 +682,5 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM") ...@@ -682,4 +682,5 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = da830_evm_init, .init_machine = da830_evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -1411,4 +1411,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM") ...@@ -1411,4 +1411,5 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = da850_evm_init, .init_machine = da850_evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -357,4 +357,5 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM") ...@@ -357,4 +357,5 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm355_evm_init, .init_machine = dm355_evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -276,4 +276,5 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard") ...@@ -276,4 +276,5 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm355_leopard_init, .init_machine = dm355_leopard_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -618,5 +618,6 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") ...@@ -618,5 +618,6 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = dm365_evm_init, .init_machine = dm365_evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -719,4 +719,5 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM") ...@@ -719,4 +719,5 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_evm_init, .init_machine = davinci_evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -799,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") ...@@ -799,6 +799,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = evm_init, .init_machine = evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
...@@ -808,5 +809,6 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") ...@@ -808,5 +809,6 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = evm_init, .init_machine = evm_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -573,4 +573,5 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808") ...@@ -573,4 +573,5 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = mityomapl138_init, .init_machine = mityomapl138_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -278,4 +278,5 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2") ...@@ -278,4 +278,5 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_ntosd2_init, .init_machine = davinci_ntosd2_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -344,4 +344,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard") ...@@ -344,4 +344,5 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = omapl138_hawk_init, .init_machine = omapl138_hawk_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = da8xx_restart,
MACHINE_END MACHINE_END
...@@ -157,4 +157,5 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR") ...@@ -157,4 +157,5 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = davinci_sffsdr_init, .init_machine = davinci_sffsdr_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = davinci_restart,
MACHINE_END MACHINE_END
...@@ -283,4 +283,5 @@ MACHINE_START(TNETV107X, "TNETV107X EVM") ...@@ -283,4 +283,5 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
.timer = &davinci_timer, .timer = &davinci_timer,
.init_machine = tnetv107x_evm_board_init, .init_machine = tnetv107x_evm_board_init,
.dma_zone_size = SZ_128M, .dma_zone_size = SZ_128M,
.restart = tnetv107x_restart,
MACHINE_END MACHINE_END
...@@ -97,9 +97,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info) ...@@ -97,9 +97,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
local_flush_tlb_all(); local_flush_tlb_all();
flush_cache_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. * We want to check CPU revision early for cpu_is_xxxx() macros.
* IO space mapping must be initialized before we can do that. * IO space mapping must be initialized before we can do that.
......
...@@ -1201,7 +1201,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = { ...@@ -1201,7 +1201,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
.gpio_irq = IRQ_DA8XX_GPIO0, .gpio_irq = IRQ_DA8XX_GPIO0,
.serial_dev = &da8xx_serial_device, .serial_dev = &da8xx_serial_device,
.emac_pdata = &da8xx_emac_pdata, .emac_pdata = &da8xx_emac_pdata,
.reset_device = &da8xx_wdt_device,
}; };
void __init da830_init(void) void __init da830_init(void)
......
...@@ -1121,7 +1121,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = { ...@@ -1121,7 +1121,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
.emac_pdata = &da8xx_emac_pdata, .emac_pdata = &da8xx_emac_pdata,
.sram_dma = DA8XX_ARM_RAM_BASE, .sram_dma = DA8XX_ARM_RAM_BASE,
.sram_len = SZ_8K, .sram_len = SZ_8K,
.reset_device = &da8xx_wdt_device,
}; };
void __init da850_init(void) void __init da850_init(void)
......
...@@ -363,6 +363,11 @@ struct platform_device da8xx_wdt_device = { ...@@ -363,6 +363,11 @@ struct platform_device da8xx_wdt_device = {
.resource = da8xx_watchdog_resources, .resource = da8xx_watchdog_resources,
}; };
void da8xx_restart(char mode, const char *cmd)
{
davinci_watchdog_reset(&da8xx_wdt_device);
}
int __init da8xx_register_watchdog(void) int __init da8xx_register_watchdog(void)
{ {
return platform_device_register(&da8xx_wdt_device); return platform_device_register(&da8xx_wdt_device);
......
...@@ -291,6 +291,11 @@ struct platform_device davinci_wdt_device = { ...@@ -291,6 +291,11 @@ struct platform_device davinci_wdt_device = {
.resource = wdt_resources, .resource = wdt_resources,
}; };
void davinci_restart(char mode, const char *cmd)
{
davinci_watchdog_reset(&davinci_wdt_device);
}
static void davinci_init_wdt(void) static void davinci_init_wdt(void)
{ {
platform_device_register(&davinci_wdt_device); platform_device_register(&davinci_wdt_device);
......
...@@ -853,7 +853,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = { ...@@ -853,7 +853,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
.serial_dev = &dm355_serial_device, .serial_dev = &dm355_serial_device,
.sram_dma = 0x00010000, .sram_dma = 0x00010000,
.sram_len = SZ_32K, .sram_len = SZ_32K,
.reset_device = &davinci_wdt_device,
}; };
void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata) void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
......
...@@ -1083,7 +1083,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { ...@@ -1083,7 +1083,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
.emac_pdata = &dm365_emac_pdata, .emac_pdata = &dm365_emac_pdata,
.sram_dma = 0x00010000, .sram_dma = 0x00010000,
.sram_len = SZ_32K, .sram_len = SZ_32K,
.reset_device = &davinci_wdt_device,
}; };
void __init dm365_init_asp(struct snd_platform_data *pdata) void __init dm365_init_asp(struct snd_platform_data *pdata)
......
...@@ -767,7 +767,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = { ...@@ -767,7 +767,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
.emac_pdata = &dm644x_emac_pdata, .emac_pdata = &dm644x_emac_pdata,
.sram_dma = 0x00008000, .sram_dma = 0x00008000,
.sram_len = SZ_16K, .sram_len = SZ_16K,
.reset_device = &davinci_wdt_device,
}; };
void __init dm644x_init_asp(struct snd_platform_data *pdata) void __init dm644x_init_asp(struct snd_platform_data *pdata)
......
...@@ -854,7 +854,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = { ...@@ -854,7 +854,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
.emac_pdata = &dm646x_emac_pdata, .emac_pdata = &dm646x_emac_pdata,
.sram_dma = 0x10010000, .sram_dma = 0x10010000,
.sram_len = SZ_32K, .sram_len = SZ_32K,
.reset_device = &davinci_wdt_device,
}; };
void __init dm646x_init_mcasp0(struct snd_platform_data *pdata) void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
......
...@@ -77,14 +77,13 @@ struct davinci_soc_info { ...@@ -77,14 +77,13 @@ struct davinci_soc_info {
struct emac_platform_data *emac_pdata; struct emac_platform_data *emac_pdata;
dma_addr_t sram_dma; dma_addr_t sram_dma;
unsigned sram_len; unsigned sram_len;
struct platform_device *reset_device;
void (*reset)(struct platform_device *);
}; };
extern struct davinci_soc_info davinci_soc_info; extern struct davinci_soc_info davinci_soc_info;
extern void davinci_common_init(struct davinci_soc_info *soc_info); extern void davinci_common_init(struct davinci_soc_info *soc_info);
extern void davinci_init_ide(void); 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 */ /* standard place to map on-chip SRAMs; they *may* support DMA */
#define SRAM_VIRT 0xfffe0000 #define SRAM_VIRT 0xfffe0000
......
...@@ -91,6 +91,7 @@ int da8xx_register_cpuidle(void); ...@@ -91,6 +91,7 @@ int da8xx_register_cpuidle(void);
void __iomem * __init da8xx_get_mem_ctlr(void); void __iomem * __init da8xx_get_mem_ctlr(void);
int da850_register_pm(struct platform_device *pdev); int da850_register_pm(struct platform_device *pdev);
int __init da850_register_sata(unsigned long refclkpn); 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 platform_device da8xx_serial_device;
extern struct emac_platform_data da8xx_emac_pdata; extern struct emac_platform_data da8xx_emac_pdata;
......
...@@ -20,8 +20,6 @@ static inline void arch_idle(void) ...@@ -20,8 +20,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd) 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 */ #endif /* __ASM_ARCH_SYSTEM_H */
...@@ -54,6 +54,7 @@ extern struct platform_device tnetv107x_serial_device; ...@@ -54,6 +54,7 @@ extern struct platform_device tnetv107x_serial_device;
extern void __init tnetv107x_init(void); extern void __init tnetv107x_init(void);
extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *); extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *);
extern void __init tnetv107x_irq_init(void); extern void __init tnetv107x_irq_init(void);
void tnetv107x_restart(char mode, const char *cmd);
#endif #endif
......
...@@ -730,6 +730,11 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev) ...@@ -730,6 +730,11 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)
__raw_writel(1, &regs->kick); __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 = { static struct davinci_soc_info tnetv107x_soc_info = {
.io_desc = io_desc, .io_desc = io_desc,
.io_desc_num = ARRAY_SIZE(io_desc), .io_desc_num = ARRAY_SIZE(io_desc),
...@@ -752,8 +757,6 @@ static struct davinci_soc_info tnetv107x_soc_info = { ...@@ -752,8 +757,6 @@ static struct davinci_soc_info tnetv107x_soc_info = {
.gpio_num = TNETV107X_N_GPIO, .gpio_num = TNETV107X_N_GPIO,
.timer_info = &timer_info, .timer_info = &timer_info,
.serial_dev = &tnetv107x_serial_device, .serial_dev = &tnetv107x_serial_device,
.reset = tnetv107x_watchdog_reset,
.reset_device = &tnetv107x_wdt_device,
}; };
void __init tnetv107x_init(void) void __init tnetv107x_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment