newlib-cygwin/libgloss/or1k/boards
Mike Frysinger 8c5bb84b6b libgloss: merge or1k into top-level Makefile
Avoid a recursive make to speed things up a bit.
A or1k-elf build shows installed objects & libs produce same code.
2024-01-19 22:23:47 -05:00
..
README libgloss: merge or1k into top-level Makefile 2024-01-19 22:23:47 -05:00
atlys.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
de0_nano.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
ml501.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
ml509.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
optimsoc.S or1k: Typo fixes 2015-08-07 15:02:03 -04:00
or1ksim-uart.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
or1ksim.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
ordb1a3pe1500.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
ordb2a.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
orpsocrefdesign.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
tmpl.S 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00
tmpl.c 2014-12-15 Stefan Wallentowitz <stefan.wallentowitz@tum.de> 2014-12-15 20:22:28 +00:00

README

# Add a new board

Before adding a new board, you may consider if your board can use another
board definition and simply overwrite the weak symbols.

If you think it is worth adding a new board, you need to perform the following
steps:

 * Decide for a meaningful board name (refered to as <board> below). It should
   be specific enough (not openrisc..), but be rather generic if it may cover
   similar boards as well.
 
 * Create a file <board>.S (assembler) or <board>.c (C). Of course, C is easier
   to write and you can implement everything in C, but there are restrictions:
   
    * There is an early initialization function. It is called before the C
      library and even the stack are initialized. A default implementation skips
      this step, so everything will compile, but if you really need
      initialization that early you are bound to assembly language.
      
    * You essentially should not use the C library functions as this may lead to
      link issues and circular dependencies.
      
   You can copy board_tmpl.S or board_tmpl.c as starting point for your board.
   
 * The following symbols must be defined in your board file:
 
    * _or1k_board_mem_base: Memory base address
    
    * _or1k_board_mem_size: Memory size
    
    * _or1k_board_clk_freq: Clock frequency
    
    * _or1k_board_uart_base: UART base address. Set to 0 if no UART present.
    
    * _or1k_board_uart_baud: UART baud rate. Only used if UART base is > 0
    
    * _or1k_board_uart_IRQ: UART interrupt line. Only used if UART base is > 0
    
   You can define a weak attribute for all of the symbols so that they can
   be overwritten by the user (more flexibility).
   
 * The following functions need to be implemented:
 
   * _or1k_board_init: Is called after C library initialization and UART
       initialization.
       
   * _or1k_board_exit: Is called after the program has exited and the C library
       finished all deconstructions etc.
       
   Similar to the symbols you can define those functions weak.
 
 * The following functions can be implemented: 
 
   * _or1k_board_init_early: Only in assembly (see above). Is called before
       anything is initialized, not even the stack! You can use all registers
       in this function. The default implementation in crt0.S skips this step,
       which is fine in most cases. If you decide to implement it, you need to
       define it with the global attribute to overwrite the default
       implementation. It is recommended to do so in assembler board files to
       keep the ability to overwrite the default implementation by the user.

When you are done with your board, add it to libgloss/or1k/Makefile.inc like the
other libboard-*.a definitions and compile.