Changeset 286


Ignore:
Timestamp:
Jan 14, 2013, 4:39:14 PM (11 years ago)
Author:
cfuguet
Message:

Fixing bug in boot_tty.c:

Use address of tty status when reading with the ioread32 function.

Makefile and ioc.c:
Introducing SYSCLK_FREQ environment variable to choose a clock frequency when
using FPGA platform. 50000000 Hz by default.

Location:
trunk/softs/tsar_boot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/Makefile

    r281 r286  
    5555$(info Making for $(PLATFORM_DIR), SocLib variant)
    5656else
     57ifdef SYSCLK_FREQ
     58DEFS+= -DSYSCLK_FREQ
     59endif
    5760DTS=platform_fpga.dts
    5861$(info Making for $(PLATFORM_DIR), FPGA variant)
  • trunk/softs/tsar_boot/boot_loader_entry.c

    r276 r286  
    8383    /* Initialize the block device */
    8484    if (_ioc_init() != 0) {
    85         boot_puts(start_boot_str_err);
    86         while (1);
     85        boot_puts(start_boot_str_err);
     86        while (1);
    8787    }
    8888
     
    9393    nb_available       = 0;
    9494    nb_rest            = sizeof(Elf32_Ehdr);
    95     offset                  = 0;
     95    offset             = 0;
    9696
    9797    elf_header         = (Elf32_Ehdr *) elf_header_base;
     
    108108            if ( _ioc_read(nb_block , boot_loader_buffer, 1) )
    109109            {
    110                 boot_puts(start_boot_str_err);
    111                 while (1);
     110                boot_puts(start_boot_str_err);
     111                while (1);
    112112            }
    113113           
  • trunk/softs/tsar_boot/boot_tty.c

    r280 r286  
    77in_reset int boot_getc(int *c)
    88{
    9         unsigned int* tty_address = (unsigned int*) TTY_BASE;
    10         if (ioread32(tty_address[TTY_STATUS]) == 0)
     9        unsigned int* tty_address = (unsigned int*) TTY_BASE;
     10        if (ioread32(&tty_address[TTY_STATUS]) == 0)
    1111                return 0;
    12         *c = ioread32(&tty_address[TTY_READ]);
     12
     13        *c = ioread32(&tty_address[TTY_READ]);
    1314        return 1;
    1415}
  • trunk/softs/tsar_boot/io_drivers/ioc.c

    r279 r286  
    5555//    // iterate on lines to invalidate each one of them
    5656//    for ( i=0; i<size; i+=dcache_line_size )
    57 //        asm volatile(" cache %0, %1"
    58 //                :
    59 //                :"i" (0x11), "R" (*((char*)buffer+i)));
     57//        asm volatile
     58//            (" mtc2 %0,     $7\n"
     59//             :
     60//             : "r" (*((char*)buffer+i))
     61//             );
    6062//}
    6163
     
    105107    boot_puts(init_begin);
    106108
     109#ifndef SYSCLK_FREQ
     110#warning "Using default value for SYSCLK_FREQ = 50000000"
     111#define SYSCLK_FREQ 50000000U
     112#endif
     113
    107114    /**
    108115     * Initializing the SPI controller
     
    111118      _spi_device   ,
    112119      200000        , /**< SPI_clk: 200 Khz */
    113       50000000      , /**< Sys_clk: 50  Mhz */
     120      SYSCLK_FREQ   , /**< Sys_clk          */
    114121      8             , /**< Charlen: 8       */
    115122      SPI_TX_NEGEDGE,
     
    132139        _spi_device ,
    133140        10000000    , /**< SPI_clkL 10 Mhz */
    134         50000000    , /**< Sys_clk: 50 Mhz */
     141        SYSCLK_FREQ , /**< Sys_clk        */
    135142        -1          , /**< Charlen: 8      */
    136143        -1          ,
     
    327334
    328335    //_ioc_lock = 0;
    329     //
    330     //_dcache_buf_invalidate(buffer, count);
    331336
    332337    return 0;
Note: See TracChangeset for help on using the changeset viewer.