mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-07-21 18:39:43 +09:00
x86: Move ECC initialisation outside RAM initialisation
To allow for 'load anywhere' images, the %ebp return pointer 'hack' must be removed, so we cannot have two 'calls' to get_mem_size
This commit is contained in:
parent
6ae032a86a
commit
00940a229d
@ -517,22 +517,11 @@ bad_ram:
|
|||||||
jmp bad_reint
|
jmp bad_reint
|
||||||
|
|
||||||
dram_done:
|
dram_done:
|
||||||
|
jmp *%ebp
|
||||||
|
|
||||||
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
||||||
/*
|
.globl init_ecc
|
||||||
* We are in the middle of an existing 'call' - Need to store the
|
|
||||||
* existing return address before making another 'call'
|
|
||||||
*/
|
|
||||||
movl %ebp, %ebx
|
|
||||||
|
|
||||||
/* Get the memory size */
|
|
||||||
movl $init_ecc, %ebp
|
|
||||||
jmpl get_mem_size
|
|
||||||
|
|
||||||
init_ecc:
|
init_ecc:
|
||||||
/* Restore the orignal return address */
|
|
||||||
movl %ebx, %ebp
|
|
||||||
|
|
||||||
/* A nominal memory test: just a byte at each address line */
|
/* A nominal memory test: just a byte at each address line */
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
shrl $0x1, %ecx
|
shrl $0x1, %ecx
|
||||||
@ -571,10 +560,10 @@ set_ecc:
|
|||||||
movl $ECCCTL, %edi
|
movl $ECCCTL, %edi
|
||||||
movb $0x05, %al
|
movb $0x05, %al
|
||||||
movb %al,(%edi)
|
movb %al,(%edi)
|
||||||
#endif
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
jmp *%ebp
|
jmp *%ebp
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read and decode the sc520 DRCBENDADR MMCR and return the number of
|
* Read and decode the sc520 DRCBENDADR MMCR and return the number of
|
||||||
|
@ -93,6 +93,17 @@ mem_init_ret:
|
|||||||
jmp get_mem_size
|
jmp get_mem_size
|
||||||
get_mem_size_ret:
|
get_mem_size_ret:
|
||||||
|
|
||||||
|
#if CONFIG_SYS_SDRAM_ECC_ENABLE
|
||||||
|
/* Skip ECC initialization if not starting from cold-reset */
|
||||||
|
movl %ebx, %ecx
|
||||||
|
andl $GD_FLG_COLD_BOOT, %ecx
|
||||||
|
jz init_ecc_ret
|
||||||
|
mov $init_ecc_ret, %ebp
|
||||||
|
jmp init_ecc
|
||||||
|
|
||||||
|
init_ecc_ret:
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Check we have enough memory for stack */
|
/* Check we have enough memory for stack */
|
||||||
movl $CONFIG_SYS_STACK_SIZE, %ecx
|
movl $CONFIG_SYS_STACK_SIZE, %ecx
|
||||||
cmpl %ecx, %eax
|
cmpl %ecx, %eax
|
||||||
|
Loading…
Reference in New Issue
Block a user