Skip to content
Snippets Groups Projects
  • Thomas Chou's avatar
    7a6a7d10
    nios2: fix out of reach case for do_reset · 7a6a7d10
    Thomas Chou authored
    
    There is a limitation (or bug?) of nios2 toolchain. The nios2 gcc
    didn't generate correct code when the reset vector is passed as a
    constant. It just generated a direct "call", which was wrong when
    the reset vector was not located in the same 256MB span as u-boot.
    
    The "Nios II Processor Reference Handbook" said,
    "call can transfer execution anywhere within the 256 MByte range
    determined by PC31..28. The Nios II GNU linker does not automatically
    handle cases in which the address is out of this range."
    
    So we have to use registered "callr" instruction to do the job.
    
    Signed-off-by: default avatarThomas Chou <thomas@wytron.com.tw>
    Signed-off-by: default avatarScott McNutt <smcnutt@psyent.com>
    7a6a7d10
    History
    nios2: fix out of reach case for do_reset
    Thomas Chou authored
    
    There is a limitation (or bug?) of nios2 toolchain. The nios2 gcc
    didn't generate correct code when the reset vector is passed as a
    constant. It just generated a direct "call", which was wrong when
    the reset vector was not located in the same 256MB span as u-boot.
    
    The "Nios II Processor Reference Handbook" said,
    "call can transfer execution anywhere within the 256 MByte range
    determined by PC31..28. The Nios II GNU linker does not automatically
    handle cases in which the address is out of this range."
    
    So we have to use registered "callr" instruction to do the job.
    
    Signed-off-by: default avatarThomas Chou <thomas@wytron.com.tw>
    Signed-off-by: default avatarScott McNutt <smcnutt@psyent.com>