change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / cpu / armv7 / sc9630 / reset.c
1 /*
2  * (C) Copyright 2002
3  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4  * Marius Groeger <mgroeger@sysgo.de>
5  *
6  * (C) Copyright 2002
7  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8  * Alex Zuepke <azu@sysgo.de>
9  *
10  * (C) Copyright 2002
11  * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
12  *
13  * (C) Copyright 2009
14  * Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
15  *
16  * See file CREDITS for list of people who contributed to this
17  * project.
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License as
21  * published by the Free Software Foundation; either version 2 of
22  * the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32  * MA 02111-1307 USA
33  */
34
35 #include <common.h>
36 #include <asm/io.h>
37 #include <asm/arch/sci_types.h>
38 #include <asm/arch/chip_drv_config_extern.h>
39 #include <asm/arch/ldo.h>
40 #include <asm/arch/sprd_reg.h>
41 /*
42  * Reset the cpu by setting up the watchdog timer and let it time out
43  */
44 void reset_cpu (ulong ignored)
45 {
46         start_watchdog(5);
47         while (1) ;
48 }
49
50 void rtc_clean_all_int(void);
51 void power_down_cpu(ulong ignored)
52 {
53 #if defined(CONFIG_SPX15)
54         LDO_TurnOffAllLDO();
55 #else
56         int v = 0;
57         v = ANA_REG_GET(ANA_REG_GLB_POR_SRC_FLAG);
58         printf("power on src = 0x%.8x\n", v);
59         v = 0x1000000;
60         while (v--); // log delay
61
62         rtc_clean_all_int();
63 #if defined(CONFIG_ARCH_SCX35L)
64         sci_adi_set(ANA_REG_GLB_DCDC_SLP_CTRL0,  BIT_PWR_OFF_SEQ_EN); //auto poweroff by chip
65 #else
66         sci_adi_set(ANA_REG_GLB_MP_PWR_CTRL0,  BIT_PWR_OFF_SEQ_EN); //auto poweroff by chip
67 #endif
68         while(1);
69 #endif
70
71
72 }