source: soft/giet_vm/giet_drivers/ioc_driver.h @ 289

Last change on this file since 289 was 289, checked in by cfuguet, 10 years ago

Modifications on GIET-VM IOC driver:

  • Introducing new layer on the IOC driver. Every call to ioc_read, ioc_write, ioc_get_block_size or ioc_init

functions will call the specific driver of the used IOC
controller. Supported IOC controllers are (for now) :

  1. BDV (Soclib Block Device)
  2. HBA
  3. SPI (SDCARD - SPI controller)
  • All functions of IOC controllers drivers respect the same interface.
  • To specify the used IOC controller of the platform, a subtype field has been introduced on the map.xml file. This subtype field must be declared on the IOC periph instantiation. Available subtypes (for now) : BDV, HBA or SPI.
File size: 2.8 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : ioc_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _GIET_IOC_DRIVER_H_
9#define _GIET_IOC_DRIVER_H_
10
11///////////////////////////////////////////////////////////////////////////////////
12// IOC (vci_block device) registers offsets
13///////////////////////////////////////////////////////////////////////////////////
14
15enum IOC_registers
16{
17    BLOCK_DEVICE_BUFFER,
18    BLOCK_DEVICE_LBA,
19    BLOCK_DEVICE_COUNT,
20    BLOCK_DEVICE_OP,
21    BLOCK_DEVICE_STATUS,
22    BLOCK_DEVICE_IRQ_ENABLE,
23    BLOCK_DEVICE_SIZE,
24    BLOCK_DEVICE_BLOCK_SIZE,
25    BLOCK_DEVICE_BUFFER_EXT,
26};
27enum IOC_operations
28{
29    BLOCK_DEVICE_NOOP,
30    BLOCK_DEVICE_READ,
31    BLOCK_DEVICE_WRITE,
32};
33enum IOC_status
34{
35    BLOCK_DEVICE_IDLE,
36    BLOCK_DEVICE_BUSY,
37    BLOCK_DEVICE_READ_SUCCESS,
38    BLOCK_DEVICE_WRITE_SUCCESS,
39    BLOCK_DEVICE_READ_ERROR,
40    BLOCK_DEVICE_WRITE_ERROR,
41    BLOCK_DEVICE_ERROR,
42};
43enum IOC_driver_modes
44{
45    IOC_BOOT_PA_MODE,  // No V2P translation / Polling IOC_STATUS / no access checking
46    IOC_BOOT_VA_MODE,  // V2P translation    / Polling IOC_STATUS / no access checking
47    IOC_KERNEL_MODE,   // V2P translation    / Descheduling + IRQ / no access checking
48    IOC_USER_MODE,     // V2P translation    / Descheduling + IRQ / access checking
49};
50
51///////////////////////////////////////////////////////////////////////////////////
52// IOC access functions and variables (vci_block_device)
53///////////////////////////////////////////////////////////////////////////////////
54
55extern unsigned int _ioc_lock;
56extern unsigned int _ioc_status;
57extern volatile unsigned int _ioc_gtid;
58extern volatile unsigned int _ioc_iommu_ix1;
59extern volatile unsigned int _ioc_iommu_npages; 
60
61extern unsigned int _ioc_init( unsigned int channel );
62
63extern unsigned int _ioc_write( unsigned int mode,
64                                unsigned int lba, 
65                                const void*  buffer, 
66                                unsigned int count );
67
68extern unsigned int _ioc_read(  unsigned int mode,
69                                unsigned int lba, 
70                                void*        buffer,
71                                unsigned int count );
72
73extern unsigned int _ioc_get_status( unsigned int  channel,
74                                     unsigned int* status );
75
76extern unsigned int _ioc_get_block_size();
77
78///////////////////////////////////////////////////////////////////////////////////
79
80
81#endif
82
83// Local Variables:
84// tab-width: 4
85// c-basic-offset: 4
86// c-file-offsets:((innamespace . 0)(inline-open . 0))
87// indent-tabs-mode: nil
88// End:
89// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
90
Note: See TracBrowser for help on using the repository browser.