| 
									
										
										
										
											2006-01-09 17:05:41 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2007-02-05 11:42:07 +01:00
										 |  |  |  * arch/arm/mach-at91/at91rm9200.c | 
					
						
							| 
									
										
										
										
											2006-01-09 17:05:41 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  *  Copyright (C) 2005 SAN People | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <linux/module.h>
 | 
					
						
							| 
									
										
										
										
											2013-10-11 09:37:45 +02:00
										 |  |  | #include <linux/clk/at91_pmc.h>
 | 
					
						
							| 
									
										
										
										
											2006-01-09 17:05:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <asm/mach/map.h>
 | 
					
						
							| 
									
										
										
										
											2012-03-28 18:30:01 +01:00
										 |  |  | #include <asm/system_misc.h>
 | 
					
						
							| 
									
										
										
										
											2008-08-05 16:14:15 +01:00
										 |  |  | #include <mach/at91_st.h>
 | 
					
						
							| 
									
										
										
										
											2013-11-14 10:49:19 +01:00
										 |  |  | #include <mach/hardware.h>
 | 
					
						
							| 
									
										
										
										
											2006-01-09 17:05:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-23 15:28:34 +08:00
										 |  |  | #include "soc.h"
 | 
					
						
							| 
									
										
										
										
											2006-06-19 15:26:51 +01:00
										 |  |  | #include "generic.h"
 | 
					
						
							| 
									
										
										
										
											2006-09-27 10:50:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-02 10:21:36 -04:00
										 |  |  | static void at91rm9200_idle(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * Disable the processor clock.  The processor will be automatically | 
					
						
							|  |  |  | 	 * re-enabled by an interrupt or by a reset. | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2011-11-25 09:59:46 +08:00
										 |  |  | 	at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 
					
						
							| 
									
										
										
										
											2011-08-02 10:21:36 -04:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-08 16:01:40 -07:00
										 |  |  | static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) | 
					
						
							| 
									
										
										
										
											2006-11-30 10:01:47 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	 * Perform a hardware reset with the use of the Watchdog timer. | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2012-02-20 11:07:39 +01:00
										 |  |  | 	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1); | 
					
						
							|  |  |  | 	at91_st_write(AT91_ST_CR, AT91_ST_WDRST); | 
					
						
							| 
									
										
										
										
											2006-11-30 10:01:47 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-09-27 10:50:59 +01:00
										 |  |  | /* --------------------------------------------------------------------
 | 
					
						
							|  |  |  |  *  AT91RM9200 processor initialization | 
					
						
							|  |  |  |  * -------------------------------------------------------------------- */ | 
					
						
							| 
									
										
										
										
											2011-04-23 15:28:34 +08:00
										 |  |  | static void __init at91rm9200_map_io(void) | 
					
						
							| 
									
										
										
										
											2006-09-27 10:50:59 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	/* Map peripherals */ | 
					
						
							| 
									
										
										
										
											2011-05-10 03:20:09 +08:00
										 |  |  | 	at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); | 
					
						
							| 
									
										
										
										
											2011-04-28 20:19:32 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2006-09-27 10:50:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-24 18:20:28 +08:00
										 |  |  | static void __init at91rm9200_initialize(void) | 
					
						
							| 
									
										
										
										
											2011-04-28 20:19:32 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-08-02 10:21:36 -04:00
										 |  |  | 	arm_pm_idle = at91rm9200_idle; | 
					
						
							| 
									
										
										
										
											2011-11-03 09:53:29 +00:00
										 |  |  | 	arm_pm_restart = at91rm9200_restart; | 
					
						
							| 
									
										
										
										
											2006-01-09 17:05:41 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-09-27 13:23:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-22 13:24:09 +00:00
										 |  |  | AT91_SOC_START(at91rm9200) | 
					
						
							| 
									
										
										
										
											2011-04-23 15:28:34 +08:00
										 |  |  | 	.map_io = at91rm9200_map_io, | 
					
						
							|  |  |  | 	.init = at91rm9200_initialize, | 
					
						
							| 
									
										
										
										
											2012-08-16 17:36:55 +08:00
										 |  |  | AT91_SOC_END |