| Welcome to AT91SAM Community Forum http://www.at91.com/samphpbb/ |
|
| AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] http://www.at91.com/samphpbb/viewtopic.php?f=12&t=18497 |
Page 2 of 2 |
| Author: | jlehman [ Thu May 06, 2010 7:21 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Does anyone have examples of the hw reset and watchdog code required to fix this problem? Thanks |
|
| Author: | sazproliphix [ Thu May 06, 2010 8:05 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Does this help?: This function is referred to in my previous post in this thread. #include <linux/linkage.h> #include <asm/assembler.h> .balign 64 ENTRY(power_down_reset) powerdownnow: mrs r0, cpsr orr r0, r0, #0x80 //128 Disable interrupts msr cpsr_c, r0 ldr r0, =0xFEFFEA10 ldr r1, =1 //SDRAM controller self refresh str r1, [r0] ldr r0, =0xFEFFFC14 //PMC Periph clock disable reg ldr r1, =0x7FFFFFFC // disable all but AIC and SYSC str r1, [r0] b firstpoint secondpoint: ldr r2, =0xFEFFFD00 ldr r3, =0xA5000005 //system reset nop nop nop nop nop nop nop nop str r3, [r2] nop mov pc, lr // should never get here firstpoint: nop b secondpoint |
|
| Author: | lhrossouw [ Mon Jun 21, 2010 2:36 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Hi, Has anybody implemented the interrupt Trap the for Hardware reset and wdt reset? Lucas. |
|
| Author: | ravspratapsingh [ Wed Aug 18, 2010 8:50 am ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Even I am getting similar issues. I have already applied the reset related patch. Still when I continuously reboot the system, sometimes i get ROMBOOT > msg and then it hangs. Some where I read that the AT91 Romboot is not compatible with the nand flashes having ECC in their 00h sector. Is that the real reason for this? Is there any work around for this? |
|
| Author: | snip [ Wed Jun 22, 2011 1:58 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
IMHO, A cleaner solution would be to run from SRAM. For a Non-OS-based application I placed the C function that performs the reset in the SRAM by using the "ramfunc" attribute. Otherwise I'm running my application from SDRAM. This way, I don't need to go into assembly. Nothing against assembly programming but I think keeping these things in C helps makes it more flexible, readable and better integrated. I don't know how this can be done for Linux but it should be possible. |
|
| Author: | ManuelSahm [ Fri Sep 30, 2011 2:52 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Hi, all worked fine for me aith Kernel 2.6.30.5. Now I switched to Kernel 3.0.0. I use the sam code in both kernels for reset, but unfortunately with the new kernel the system hangs at reset: Last line on the console: "Rstarting system" It seems to be strange, because no RomBOOT Message appears...? It seems that the Reset isn´t executed by the AT91SAM9G20 ! If I insert 2 printk´s before I execute the Assembler Code the system reset works ??? I try to exchange the printk with a mdelay, but this doesn´t fix the problem.... Please have a look at my code: Regards Manuel Is there anybody who could help me ? [code] #define CP15_CR_I (1 << 12) #define SYS_VIRT_OFS (-0x01000000) #define SDRAMC_BASE (SYS_VIRT_OFS + 0xffffea00) #define SDRAMC_TR 0x0004 #define SDRAMC_LPR 0x0010 #define SDRAMC_LPCB_POWER_DOWN 2 #define RSTC_BASE (SYS_VIRT_OFS + 0xfffffd00) #define RSTC_CR 0x0000 #define RSTC_PROCRST (1 << 0) #define RSTC_PERRST (1 << 2) #define RSTC_KEY (0xa5 << 24) void soft_user_reset (void) { // ATTENTION: Without the following 2 printk´s - the reset sometimes won´t work ???? //printk("SDRAMC_BASE = %04X\n", SDRAMC_BASE); //printk("RSTC_BASE = %04X\n", RSTC_BASE); //soft_user_reset //;disable IRQs asm("MRS r0, CPSR"); asm("ORR r0, r0, #0x80"); asm("MSR CPSR_c, r0"); asm("mov r0, #0"); asm("mcr p15, 0, r0, c7, c5, 0"); //@ flush I-cache asm("mrc p15, 0, r0, c1, c0, 0"); asm("orr r0, r0, #(1 << 12)"); //asm("orr r0, r0, #CP15_CR_I"); asm("mcr p15, 0, r0, c1, c0, 0"); //@ enable I-cache // @ preload constants asm("ldr r0, =0xFEFFEA00"); //SDRAMC_BASE asm("ldr r1, =0xFEFFFD00"); //RSTC_BASE asm("mov r2, #1"); //;change refresh rate to block all data accesses asm("mov r3, #2"); //;prepare power down command asm("ldr r4, =0xA5000005"); //;prepare proc_reset and periph_reset asm(".balign 32"); //@ align to cache line //;change refresh rate to block all data accesses (in the ARM pipeline) asm("str r2, [r0, #0x0004]"); //@ disable SDRAM access //;perform power down command (in the ARM pipeline) asm("str r3, [r0, #0x0010]"); //@ power down SDRAM //;perform proc_reset and periph_reset (in the ARM pipeline) asm("str r4, [r1, #0x0000]"); //@ reset processor //Endless lopp asm("b ."); } [/code] |
|
| Author: | cole [ Sun Oct 23, 2011 8:54 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Don't poke 0x2 into 0xFFFFEA10, this places the SDRAM into very low power mode, from which it seems to get stuck during reset. Why not just disable the LPM altogether to assure a clean reset? - asm("mov r3, #2"); //;prepare power down command + asm("mov r3, #0"); //;disable low power function In linux, you can patch the reset routine with this: === --- at91sam9_alt_reset.S (revision 10727) +++ at91sam9_alt_reset.S (working copy) @@ -31,7 +31,7 @@ ldr r1, .at91_va_base_rstc_cr mov r2, #1 - mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN + mov r3, #AT91_SDRAMC_LPCB_DISABLE ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST .balign 32 @ align to cache line === Let me know how this works for you. It works for me on an AT91SAM9G20 running Linux kernel 3.0. Take care, -Chris |
|
| Author: | jparent [ Wed Feb 22, 2012 12:23 am ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Looking at the kernel source provided for my project, it seems that the code provided by colonel-panic is provided. (At the moment I'm not sure where my source tree came from, I inherited this project) That being said, the solution only covers when a system reboot occurs. I am still seeing issues when hitting the external reset line and from the 9G20 documentation it looks like you can catch the rstc_irq and hopefully perform this same action. The problem I'm running into is figuring out how to register the interrupt. I'm wanting to add the register to at91sam9260.c in at91sam9260_initialize but since its a System Peripheral I'm not quite sure how to go about that. Are all system peripherals masked together and then you need to resolve which was triggered? I don't see in the mach-at91 directory any situations where any of the other system peripherals using interrupt service routines. Any ideas? Edit: I also am assuming that since the Watchdog timer triggers the Reset Controller, figuring out my previous issue would move me closer to resolving the Errata in the situation where the Watchdog causes the reset. |
|
| Author: | trong_tran@yahoo.com [ Mon Aug 06, 2012 5:20 am ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Hi, Does any one know how to apply this patch http://lists.infradead.org/pipermail/li ... 05795.html to kernel using quilt command or any other command ? Thanks, Trong |
|
| Author: | jgilles [ Mon Sep 17, 2012 9:53 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Have other people found the at91sam9_alt_reset code to be reliable? I have been doing soft reboot testing on our G20-based boards using a 2.6.39 kernel, and I haven't found it to be reliable at all. Our boards hang with "Rebooting... Restarting system." and "RomBOOT" never even shows up. This suggests that the processor isn't resetting? We ran soft reboot cycle testing using a 2.6.35 kernel (with no reset patch) and it was still working after over 6500 reboots. With the alternate reset routine, reboot fails after less than 100 cycles and sometimes after as few as 1-5 cycles. I also tried changing AT91_SDRAMC_LPCB_POWER_DOWN to AT91_SDRAMC_LPCB_DISABLE as cole suggested and this doesn't seem to help (with 2.6.39). Thanks, Jesse |
|
| Author: | nickludlam [ Wed Mar 13, 2013 1:50 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
Jesse I'm seeing exactly the issue you describe, with lockups despite the kernel alt_reset fix being applied. Did you have any further insight into the problem? I'm thinking of reverting to 2.6.36 before the patch made it into the kernel tree. Nick |
|
| Author: | jgilles [ Tue Mar 19, 2013 11:37 pm ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
nickludlam - I never found out anything more. I ended up patching 2.6.39 for one of my projects to use the original reset method. Here is the patch in case it is useful to you: http://git.multitech.net/cgi-bin/cgit.cgi/corecdp.git/tree/multitech/recipes/linux/linux-2.6.39.4/linux-2.6.39.4-at91sam9260-reset.patch |
|
| Author: | nickludlam [ Wed Mar 20, 2013 2:24 am ] |
| Post subject: | Re: AT91SAM9G20 - ResetController Problem [Errata 44.3.5.1] |
jgilles wrote: nickludlam - I never found out anything more. I ended up patching 2.6.39 for one of my projects to use the original reset method. Thanks, that's good to know. I've tested 2.6.36 before the patch was applied and have a rock stable system now, so that alt_reset code is definitely dubious. And thank you for the patch link! |
|
| Page 2 of 2 | All times are UTC + 1 hour [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|



Forum