summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank/reset.c
blob: 929ded5951ae703694e189a7fc212e09c6efbf5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
 *
 * GPLv2 only
 */

#include <common.h>
#include <io.h>
#include <restart.h>
#include <init.h>

#include <mach/devices.h>
#include <mach/sysregs.h>

static void __noreturn highbank_restart_soc(struct restart_handler *rst)
{
	hingbank_set_pwr_hard_reset();
	asm("	wfi");

	hang();
}

static int restart_register_feature(void)
{
	restart_handler_register_fn(highbank_restart_soc);

	return 0;
}
coredevice_initcall(restart_register_feature);

void __noreturn poweroff()
{
	shutdown_barebox();

	hingbank_set_pwr_shutdown();
	asm("	wfi");

	while(1);
}