English
Language : 

TMPR3927 Datasheet, PDF (465/512 Pages) Toshiba Semiconductor – 32-Bit TX System RISC TX39 Family
Appendix A TX3927 Programming Samples
A.2.2
Start Routine
This section shows a simple start routine for the TX3904, a member of the TX39 family, that
initializes the processor following power-on reset and then transfers control to the user’s main routine.
The start routine is placed at the Reset exception vector address when your application is ROMed.
The start routine performs the following tasks:
• Determines whether the exception was caused by NMI or RESET*.
• Initializes the memory controller (boot_initreg).
• Clears the Bss section (using boot_memset).
• Copies the initial program data in the data section from ROM to RAM (using boot_memcpy).
* Memory writes are followed by a routine which ensures that the external memory is
synchronized with the internal caches (boot_synccache).
• Enables the caches.
• Initializes the gp, sp and pid_base registers.
• Jumps to the main routine.
The exception vectors other than the reset vector are implemented as dummy (dummy software loop).
The TX39 does not require any settings for the processor core to become operational. (The
COLDRESET input disables the caches and TLB.) The above tasks are most commonly used in
applications comprised of ELF object files; the coding style largely depends on the compiler used.
In TX3927, memory controller settings and cache operations have been changed from the TX3904.
Refer to the appropriate chapters in this manual.
Note: The following start routine example was generated using a GHS compiler; so the resulting
code uses symbols and tables that have been automatically generated by the GHS linker.
Specifically, the following symbols starting with __ghs are used:
__ghsbinfo_clear, __ghseinfo_clear:
__ghsbinfo_copy, __ghseinfo_copy:
__ghsbegin_sdabase:
__ghsend_stack:
Start and end addresses of initialization section table
Start and end addresses of initial data section table
Lowest address of the SDA section
Highest address of the stack space
You cannot use these symbols with other compilers, and other versions of the GHS compilers
may use symbols differently. It is recommended to refer to the crt0 source program that comes
with the GHS compiler.
Cygnus' GNUPro does not generate the above symbols automatically. The user can, however,
write a linker script file to define arbitrary symbols and use them in the same way.
• File name: Boot.mip
# $Id$
#
# ROM Boot Routine for TX3904
# Copyright(c) 1998 TOSHIBA Corp.
#
# Depend on GHS Cross MIPS Compiler ver.1.8.8
A-15