summaryrefslogblamecommitdiffstats
path: root/arch/arm/mach-vexpress/reset.c
blob: 01cd01e6df9c860c4fc16ad5cf8c8eb63b630b0a (plain) (tree)
1
2
3
4
5
6
7
8
9
10







                                                                             

                    





                             
                                                                      



                                                        
               
 


                                         
                                                                   



                                              
/*
 * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
 *
 * GPLv2 only
 */

#include <common.h>
#include <io.h>
#include <init.h>
#include <restart.h>
#include <linux/amba/sp805.h>

#include <mach/devices.h>

void __iomem *v2m_wdt_base;

static void __noreturn vexpress_reset_soc(struct restart_handler *rst)
{
	writel(LOAD_MIN, v2m_wdt_base + WDTLOAD);
	writeb(RESET_ENABLE, v2m_wdt_base + WDTCONTROL);

	hang();
}

static int restart_register_feature(void)
{
	restart_handler_register_fn("soc-wdt", vexpress_reset_soc);

	return 0;
}
coredevice_initcall(restart_register_feature);