2009-06-23 13:46:15 +00:00
|
|
|
/*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
2009-10-27 18:57:35 +00:00
|
|
|
* @brief Basic clock, sdram and timer handling for S3C24xx CPUs
|
2009-06-23 13:46:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <common.h>
|
|
|
|
#include <init.h>
|
2011-09-22 17:02:57 +00:00
|
|
|
#include <io.h>
|
2012-01-02 11:43:51 +00:00
|
|
|
#include <mach/s3c-iomap.h>
|
2012-01-02 11:43:55 +00:00
|
|
|
#include <mach/s3c-generic.h>
|
2012-01-02 11:44:01 +00:00
|
|
|
|
2012-01-02 11:43:59 +00:00
|
|
|
#define S3C_WTCON (S3C_WATCHDOG_BASE)
|
|
|
|
#define S3C_WTDAT (S3C_WATCHDOG_BASE + 0x04)
|
|
|
|
#define S3C_WTCNT (S3C_WATCHDOG_BASE + 0x08)
|
|
|
|
|
2010-03-30 08:16:47 +00:00
|
|
|
void __noreturn reset_cpu(unsigned long addr)
|
2009-06-23 13:46:15 +00:00
|
|
|
{
|
|
|
|
/* Disable watchdog */
|
2012-01-02 11:43:59 +00:00
|
|
|
writew(0x0000, S3C_WTCON);
|
2009-06-23 13:46:15 +00:00
|
|
|
|
|
|
|
/* Initialize watchdog timer count register */
|
2012-01-02 11:43:59 +00:00
|
|
|
writew(0x0001, S3C_WTCNT);
|
2009-06-23 13:46:15 +00:00
|
|
|
|
|
|
|
/* Enable watchdog timer; assert reset at timer timeout */
|
2012-01-02 11:43:59 +00:00
|
|
|
writew(0x0021, S3C_WTCON);
|
2009-06-23 13:46:15 +00:00
|
|
|
|
|
|
|
/* loop forever and wait for reset to happen */
|
|
|
|
while(1)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(reset_cpu);
|