source: trunk/softs/tsar_boot/src/reset_ioc.c @ 982

Last change on this file since 982 was 962, checked in by alain, 10 years ago

Introducing a new IOC driver supporting the VciMultiAhci? disk controller (in polling mode only).
Extending the MMC driver to support the SYNC command requested by the AHCI protocol on the tsar_generic_iob platform.

File size: 1.8 KB
RevLine 
[758]1/**
2 * \file   reset_ioc.c
3 * \date   December 2013
4 * \author Cesar Fuguet
5 *
6 * \brief  API for accessing the disk controller
7 *
8 * \note   These functions call the specific disk controller driver depending
[962]9 *         on the USE_IOC_BDV, USE_IOC_SDC or USE_IOC_RDK constants
[758]10 */
11
[586]12#include <reset_ioc.h>
[758]13#include <defs.h>
[292]14
[962]15#if (USE_IOC_BDV + USE_IOC_SDC + USE_IOC_RDK + USE_IOC_HBA) != 1
16#   error "in reset_ioc.c : undefined disk controller in hard_config.h"
[586]17#endif
[302]18
[962]19#if USE_IOC_SDC
[758]20#include <reset_sdc.h>
21#endif
[388]22
[758]23#if USE_IOC_BDV
24#include <reset_bdv.h>
25#endif
[292]26
[796]27#if USE_IOC_RDK
[758]28#include <reset_rdk.h>
[347]29#endif
[568]30
[962]31#if USE_IOC_HBA
32#include <reset_hba.h>
33#endif
34
35
[758]36/**
37 * \brief Initialize the disk controller
38 */
39int reset_ioc_init()
[347]40{
[758]41#if USE_IOC_BDV
42    return reset_bdv_init();
[962]43#elif USE_IOC_SDC
[758]44    return reset_sdc_init();
[796]45#elif USE_IOC_RDK
[758]46    return reset_rdk_init();
[962]47#elif USE_IOC_HBA
48    return reset_hba_init();
[758]49#else
[962]50#   error "in reset_ioc_init.c : undefined disk controller in hard_config.h"
[347]51#endif
52}
53
[758]54/**
55 * \param lba   : first block index on the disk
56 * \param buffer: base address of the memory buffer
57 * \param count : number of blocks to be transfered
58 *
59 * \brief Transfer data from disk to a memory buffer
60 *
61 * \note  This is a blocking function. The function returns once the transfer
62 *        is completed.
63 */
64int reset_ioc_read( unsigned int lba, void* buffer, unsigned int count )
[568]65{
[758]66#if USE_IOC_BDV
[654]67    return reset_bdv_read(lba, buffer, count);
[962]68#elif USE_IOC_SDC
[758]69    return reset_sdc_read(lba, buffer, count);
[796]70#elif USE_IOC_RDK
[654]71    return reset_rdk_read(lba, buffer, count);
[962]72#elif USE_IOC_HBA
73    return reset_hba_read(lba, buffer, count);
[654]74#else
[962]75#   error "in reset_ioc_read.c : undefined disk controller in hard_config.h"
[653]76#endif
[568]77}
78
[292]79/*
[758]80 * vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
[292]81 */
Note: See TracBrowser for help on using the repository browser.