Ignore:
Timestamp:
Jul 24, 2014, 3:19:18 PM (10 years ago)
Author:
cfuguet
Message:

tsar_boot: improving configuration infrastructure

  • Using hard_config.h which respects the same sintax that the hard_config.h file of all TSAR platforms. This file can be then generated by the GIET-VM genmap tool or written manually.
  • All peripheral drivers have been moved to a drivers directory and they are compiled as a static library. This allows GCC to only include in the final .ELF the object files of used peripherals and not all of them.
  • Example hard_config.h and ldscripts have been introduced in the conf directory.
  • Improving comments in all files
Location:
trunk/softs/tsar_boot/drivers
Files:
9 added
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/drivers/reset_tty.c

    r757 r758  
    22 * \file    reset_tty.c
    33 * \date    5 mars 2014
    4  * \author  Cesar Fuguet 
     4 * \author  Cesar Fuguet
    55 *
    6  * Minimal driver for TTY controler 
     6 * Minimal driver for TTY controler
    77 *******************************************************************/
    88
     
    1111#include <defs.h>
    1212
     13#ifndef SEG_TTY_BASE
     14#   error "SEG_TTY_BASE constant must be defined in the hard_config.h file"
     15#endif
     16
     17static int* const tty_address = (int* const)SEG_TTY_BASE;
     18
     19enum tty_registers {
     20    TTY_WRITE   = 0,
     21    TTY_STATUS  = 1,
     22    TTY_READ    = 2,
     23    TTY_CONFIG  = 3,
     24
     25    TTY_SPAN    = 4,
     26};
     27
    1328///////////////////////
    1429int reset_getc(char *c)
    1530{
    16     unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE;
    17 
    1831    if (ioread32( &tty_address[TTY_STATUS] ) == 0) return 0;
    1932    *c = ioread32( &tty_address[TTY_READ] );
     
    2437void reset_putc(const char c)
    2538{
    26     unsigned int* tty_address = (unsigned int*) TTY_PADDR_BASE;
    27 
    2839    iowrite32( &tty_address[TTY_WRITE], (unsigned int)c );
    2940    if (c == '\n') reset_putc( '\r' );
     
    3142
    3243///////////////////////////////////
    33 void reset_puts(const char *buffer) 
     44void reset_puts(const char *buffer)
    3445{
    3546    unsigned int n;
     
    4051        reset_putc(buffer[n]);
    4152    }
    42 } 
     53}
    4354
    4455/////////////////////////////////
     
    5465
    5566    for ( c = 0 ; c < 8 ; c++ )
    56     { 
     67    {
    5768        buf[9-c] = HexaTab[val&0xF];
    5869        val = val >> 4;
  • trunk/softs/tsar_boot/drivers/reset_tty.h

    r757 r758  
    11#ifndef RESET_TTY_H
    22#define RESET_TTY_H
    3 
    4 # include <tty.h>
    53
    64void reset_exit();
Note: See TracChangeset for help on using the changeset viewer.