Ignore:
Timestamp:
Mar 26, 2014, 6:44:44 PM (11 years ago)
Author:
alain
Message:

Introducing a major release, to suppoort the tsar_generic_leti platform
and the various (external or internal) peripherals configurations.
The map.xml format has been modified, in order to support the new
vci_iopic componentand a new policy for peripherals initialisation.
The IRQs are nom described in the XICU and IOPIC components
(and not anymore in the processors).
To enforce this major change, the map.xml file signature changed:
The signature value must be: 0xDACE2014

This new release has been tested on the tsar_generic_leti platform
for the following mappings:

  • 4c_4p_sort_leti
  • 4c_4p_sort_leti_ext
  • 4c_4p_transpose_leti
  • 4c_4p_transpose_leti_ext
  • 4c_1p_four_leti_ext
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/sdc_driver.c

    r289 r295  
    55// Copyright (c) UPMC-LIP6
    66///////////////////////////////////////////////////////////////////////////////////
     7
    78#include <sdc_driver.h>
     9#include <tty_driver.h>
    810#include <utils.h>
    911
     
    179181        if ( sdcard_rsp != 0x01 )
    180182        {
    181 
    182                 _puts("card CMD0 failed ");
     183                _printf("[SDC ERROR] card CMD0 failed\n");
    183184                return sdcard_rsp;
    184185        }
     
    196197        if (!SDCARD_CHECK_R1_VALID(sdcard_rsp))
    197198    {
    198                 _puts("card CMD8 failed ");
     199                _printf("[SDC ERROR] card CMD8 failed\n");
    199200                return sdcard_rsp;
    200201        }
     
    206207                ersp = (ersp << 8) | _sdc_receive_char();
    207208                ersp = (ersp << 8) | _sdc_receive_char();
    208                 if ((ersp & 0xffff) != 0x0101) {
     209                if ((ersp & 0xffff) != 0x0101)
     210        {
    209211                        // voltage mismatch
    210                         _puts("card CMD8 mismatch: ");
    211                         _putx(ersp);
     212                        _printf("[SDC ERROR] card CMD8 mismatch : ersp = %x\n");
    212213                        return sdcard_rsp;
    213214                }
    214                 _puts("v2 or later ");
     215                _printf("[SDC WARNING] v2 or later ");
    215216                sdcard.sdhc = 1;
    216217        }
     
    218219    {
    219220                // other error
    220                 _puts("card CMD8 error ");
     221                _printf("[SDC ERROR] card CMD8 error\n");
    221222                return sdcard_rsp;
    222223        }
     
    249250        if (sdcard_rsp)
    250251    {
    251                 _puts("SD ACMD41 failed ");
     252                _printf("[SDC ERROR] ACMD41 failed\n");
    252253                return sdcard_rsp;
    253254        }
     
    263264                if (sdcard_rsp)
    264265        {
    265                         _puts("SD CMD58 failed ");
     266                        _printf("[SDC ERROR] CMD58 failed\n");
    266267                        return sdcard_rsp;
    267268                }
     
    272273                if (ersp & 0x40000000)
    273274        {
    274                         _puts("SDHC ");
    275                 } else
     275                        _printf(" SDHC ");
     276                }
     277        else
    276278        {
    277279                        sdcard.sdhc = 0;
     
    279281                _sdc_disable();
    280282        }
    281         _puts("card detected ");
     283        _printf("card detected\n");
    282284        return 0;
    283285}
     
    334336// Returns 0 if success, other value if failure
    335337///////////////////////////////////////////////////////////////////////////////
    336 unsigned int _sdc_init( unsigned int channel )
     338unsigned int _sdc_init()
    337339{
    338340    spi = (struct spi_dev*) &seg_ioc_base;
     
    355357    while(1)
    356358    {
    357         _puts("Trying to initialize SD card... ");
    358 
    359         sdcard_rsp = _sdc_open( channel );
     359        _printf("[SDC WARNING] Trying to initialize SD card...\n");
     360
     361        sdcard_rsp = _sdc_open( 0 );  // only channel 0
    360362        if (sdcard_rsp == 0)
    361363        {
    362             _puts("OK\n");
     364            _printf("OK\n");
    363365            break;
    364366        }
    365367
    366         _puts("KO\n");
     368        _printf("KO\n");
    367369
    368370        for (i = 0; i < 1000; i++);
     
    370372        if (++iter >= SDCARD_RESET_ITER_MAX)
    371373        {
    372             _puts("\nERROR: During SD card reset to IDLE state\n"
    373                  "/ card response = ");
    374             _putx(sdcard_rsp);
    375             _puts("\n");
     374            _printf("\n[SDC ERROR] During SD card reset to IDLE state "
     375                    "/ card response = %x\n", sdcard_rsp );
    376376            _exit();
    377377        }
     
    382382    if (sdcard_rsp)
    383383    {
    384         _puts("ERROR: During SD card blocklen initialization\n");
     384        _printf("[SDC ERROR] During SD card blocklen initialization\n");
    385385        _exit();
    386386    }
     
    396396    );
    397397
    398     _puts("Finish block device initialization\n\r");
     398    _printf("[SDC WARNING] Finish SD card initialization\n\r");
    399399
    400400    return 0;
     
    478478
    479479///////////////////////////////////////////////////////////////////////////////
    480 //     _sdc_get_status()
    481480// Transfer data from memory buffer to SD card device.
    482481// - channel: channel index
     
    484483// Returns 0 if success, > 0 if error.
    485484///////////////////////////////////////////////////////////////////////////////
    486 unsigned int _sdc_get_status( unsigned int channel ,
    487                               unsigned int* status )
    488 {
    489     *status = BLOCK_DEVICE_IDLE;
    490 
    491     return 0;
    492 }
    493 
    494 ///////////////////////////////////////////////////////////////////////////////
    495 //     _sdc_get_block_size()
     485unsigned int _sdc_get_status()
     486{
     487    _printf("[SDC ERROR] function _sdc_get_status() should not be called\n");
     488    _exit();
     489
     490    return 0;  // to avoid a warning
     491}
     492
     493///////////////////////////////////////////////////////////////////////////////
    496494// Returns the block size in bytes of the SD card
    497495///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.