I am working on a embedded board with MIPS architecture and i have a requirement to initialize the 128MB RAM by writing zero's onto the memory. I have coded the following thing
// RAM initialization part
li t2, 0x80000000 //RAM starting address
li t3, 0x02000000 //(RAM size/0x04) ( 0x08000000(128MB)/0x04 )
li t4, 0x00000000 //Value we need to initialize
ram_init:
sw t4, 0(t2)
addi t2, t2, 0x00000004
addi t3, t3, -0x00000004
bgtz t3, ram_init
nop
But with this code i am getting a performance issue where the above code takes about 70 to 80 seconds to write zero's onto the memory location. Is there any better way to do the same operation so that the time taken can be reduced to less than 5 seconds.
-BalaC-