| 
									
										
										
										
											2010-10-14 17:19:11 +02:00
										 |  |  | /* | 
					
						
							|  |  |  |  * reset AT91SAM9G20 as per errata | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * (C) BitBox Ltd 2010 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * unless the SDRAM is cleanly shutdown before we hit the | 
					
						
							|  |  |  |  * reset register it can be left driving the data bus and | 
					
						
							|  |  |  |  * killing the chance of a subsequent boot from NAND | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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/linkage.h> | 
					
						
							|  |  |  | #include <mach/hardware.h> | 
					
						
							| 
									
										
										
										
											2012-02-13 12:58:53 +08:00
										 |  |  | #include <mach/at91_ramc.h> | 
					
						
							| 
									
										
										
										
											2012-10-30 08:11:24 +08:00
										 |  |  | #include "at91_rstc.h" | 
					
						
							| 
									
										
										
										
											2010-10-14 17:19:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			.arm | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-03 09:53:29 +00:00
										 |  |  | 			.globl	at91sam9_alt_restart
 | 
					
						
							| 
									
										
										
										
											2010-10-14 17:19:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-13 12:58:53 +08:00
										 |  |  | at91sam9_alt_restart:	ldr	r0, =at91_ramc_base		@ preload constants
 | 
					
						
							|  |  |  | 			ldr	r0, [r0] | 
					
						
							|  |  |  | 			ldr	r4, =at91_rstc_base | 
					
						
							|  |  |  | 			ldr	r1, [r4] | 
					
						
							| 
									
										
										
										
											2010-10-14 17:19:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			mov	r2, #1 | 
					
						
							|  |  |  | 			mov	r3, #AT91_SDRAMC_LPCB_POWER_DOWN | 
					
						
							|  |  |  | 			ldr	r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			.balign	32				@ align to cache line
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			str	r2, [r0, #AT91_SDRAMC_TR]	@ disable SDRAM access
 | 
					
						
							|  |  |  | 			str	r3, [r0, #AT91_SDRAMC_LPR]	@ power down SDRAM
 | 
					
						
							| 
									
										
										
										
											2011-11-18 01:25:52 +08:00
										 |  |  | 			str	r4, [r1, #AT91_RSTC_CR]		@ reset processor
 | 
					
						
							| 
									
										
										
										
											2010-10-14 17:19:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			b	. |