|
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]
|