mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ARM: restart: lpc32xx: use new restart hook
Hook these platforms restart code into the arm_pm_restart hook rather than using arch_reset(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									114c19b7b5
								
							
						
					
					
						commit
						b23fcd9035
					
				
					 4 changed files with 24 additions and 19 deletions
				
			
		| 
						 | 
					@ -164,7 +164,7 @@ int clk_is_sysclk_mainosc(void)
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * System reset via the watchdog timer
 | 
					 * System reset via the watchdog timer
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void lpc32xx_watchdog_reset(void)
 | 
					static void lpc32xx_watchdog_reset(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* Make sure WDT clocks are enabled */
 | 
						/* Make sure WDT clocks are enabled */
 | 
				
			||||||
	__raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN,
 | 
						__raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN,
 | 
				
			||||||
| 
						 | 
					@ -311,3 +311,23 @@ void __init lpc32xx_map_io(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
 | 
						iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void lpc23xx_restart(char mode, const char *cmd)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						switch (mode) {
 | 
				
			||||||
 | 
						case 's':
 | 
				
			||||||
 | 
						case 'h':
 | 
				
			||||||
 | 
							printk(KERN_CRIT "RESET: Rebooting system\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							lpc32xx_watchdog_reset();
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							/* Do nothing */
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Wait for watchdog to reset system */
 | 
				
			||||||
 | 
						while (1)
 | 
				
			||||||
 | 
							;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,6 +39,8 @@ extern void __init lpc32xx_init_irq(void);
 | 
				
			||||||
extern void __init lpc32xx_map_io(void);
 | 
					extern void __init lpc32xx_map_io(void);
 | 
				
			||||||
extern void __init lpc32xx_serial_init(void);
 | 
					extern void __init lpc32xx_serial_init(void);
 | 
				
			||||||
extern void __init lpc32xx_gpio_init(void);
 | 
					extern void __init lpc32xx_gpio_init(void);
 | 
				
			||||||
 | 
					extern void lpc23xx_restart(char, const char *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Structure used for setting up and querying the PLLS
 | 
					 * Structure used for setting up and querying the PLLS
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,24 +26,6 @@ static void arch_idle(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void arch_reset(char mode, const char *cmd)
 | 
					static inline void arch_reset(char mode, const char *cmd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	extern void lpc32xx_watchdog_reset(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	switch (mode) {
 | 
					 | 
				
			||||||
	case 's':
 | 
					 | 
				
			||||||
	case 'h':
 | 
					 | 
				
			||||||
		printk(KERN_CRIT "RESET: Rebooting system\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		lpc32xx_watchdog_reset();
 | 
					 | 
				
			||||||
		break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		/* Do nothing */
 | 
					 | 
				
			||||||
		break;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Wait for watchdog to reset system */
 | 
					 | 
				
			||||||
	while (1)
 | 
					 | 
				
			||||||
		;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -388,4 +388,5 @@ MACHINE_START(PHY3250, "Phytec 3250 board with the LPC3250 Microcontroller")
 | 
				
			||||||
	.init_irq	= lpc32xx_init_irq,
 | 
						.init_irq	= lpc32xx_init_irq,
 | 
				
			||||||
	.timer		= &lpc32xx_timer,
 | 
						.timer		= &lpc32xx_timer,
 | 
				
			||||||
	.init_machine	= phy3250_board_init,
 | 
						.init_machine	= phy3250_board_init,
 | 
				
			||||||
 | 
						.restart	= lpc23xx_restart,
 | 
				
			||||||
MACHINE_END
 | 
					MACHINE_END
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue