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

Last change on this file since 263 was 258, checked in by alain, 11 years ago

This is a major release, including a deep restructuration of code.
The main evolutions are

  • use of the Tsar preloader to load the GIET boot-loader from disk
  • introduction of a FAT32 file system library,
  • use of this fat32 library by the boot-loader to load the map.bin data structure, and the various .elf files
  • reorganisation of drivers (one file per peripheral).
  • introduction of drivers for new peripherals: vci_chbuf_dma and vci_multi_ahci.
  • introduction of a new physical memory allocator in the boot code.

This release has been tested on the tsar_generic_iob architecture,
for the two following mappings: 4c_1p_iob_four.xml and 4c_1p_iob_sort.xml

File size: 2.7 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_DRIVERS_H_
9#define _GIET_IOC_DRIVERS_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 volatile 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();
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();
74
75extern unsigned int _ioc_get_block_size();
76
77///////////////////////////////////////////////////////////////////////////////////
78
79
80#endif
81
82// Local Variables:
83// tab-width: 4
84// c-basic-offset: 4
85// c-file-offsets:((innamespace . 0)(inline-open . 0))
86// indent-tabs-mode: nil
87// End:
88// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
89
Note: See TracBrowser for help on using the repository browser.