~ubuntu-branches/debian/sid/mstflint/sid

« back to all changes in this revision

Viewing changes to mflash/mflash_common_structs.h

  • Committer: Package Import Robot
  • Author(s): Ana Beatriz Guerrero Lopez
  • Date: 2014-07-04 15:39:23 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140704153923-khknwv3o1jeap3oo
Tags: 3.7.0-1
* New upstream release: 3.7.0-1.10.gdf7ec73
* Add build depends on libibmad-dev and autotools-dev.
* Remove build depends on automake and libtool.
* Switch to dh 9 and source format version 3.0
* Remove placeholder manpages.
* Remove flag DM-Upload-Allowed.
* Remove all current Uploaders, they're welcome back anytime.
  Add myself to Uploaders.
* Bump Standards-Version to 3.9.5 (no changes required).
* Update homepage.
* Add a watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * mflash_common_structs.h - Mellanox Technilogies LTD. Flash access lib heared file
 
3
 * 
 
4
 * Copyright (C) Jan 2013 Mellanox Technologies Ltd. All rights reserved.
 
5
 *
 
6
 * This software is available to you under a choice of one of two
 
7
 * licenses.  You may choose to be licensed under the terms of the GNU
 
8
 * General Public License (GPL) Version 2, available from the file
 
9
 * COPYING in the main directory of this source tree, or the
 
10
 * OpenIB.org BSD license below:
 
11
 *
 
12
 *     Redistribution and use in source and binary forms, with or
 
13
 *     without modification, are permitted provided that the following
 
14
 *     conditions are met:
 
15
 *
 
16
 *      - Redistributions of source code must retain the above
 
17
 *        copyright notice, this list of conditions and the following
 
18
 *        disclaimer.
 
19
 *
 
20
 *      - Redistributions in binary form must reproduce the above
 
21
 *        copyright notice, this list of conditions and the following
 
22
 *        disclaimer in the documentation and/or other materials
 
23
 *        provided with the distribution.
 
24
 * 
 
25
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
26
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
27
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
28
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
29
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
30
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
31
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
32
 * SOFTWARE.
 
33
 */
 
34
 
 
35
 
 
36
#ifndef MFLASH_COMMON_STRUCTS_H
 
37
#define MFLASH_COMMON_STRUCTS_H
 
38
 
 
39
typedef struct mflash mflash;
 
40
 
 
41
typedef enum MfOpt {
 
42
    MFO_NO_VERIFY = 0,
 
43
    MFO_AMD_UNLOCK_BYPASS,
 
44
    MFO_AMD_BYTE_MODE,
 
45
    MFO_IGNORE_SEM_LOCK,
 
46
    MFO_CLOSE_MF_ON_EXIT,
 
47
    MFO_NUM_OF_BANKS,
 
48
    MFO_IGNORE_CASHE_REP_GUARD,
 
49
    MFO_USER_BANKS_NUM,
 
50
    MFO_FW_ACCESS_TYPE_BY_MFILE,
 
51
    MFO_SX_TYPE,
 
52
    MFO_NEW_CACHE_REPLACEMENT_EN,
 
53
    MFO_LAST
 
54
} MfOpt;
 
55
 
 
56
enum MfAccessType {
 
57
    MFAT_MFILE = 0,
 
58
    MFAT_UEFI,
 
59
};
 
60
 
 
61
/////////////////////////////////////////////
 
62
//
 
63
// Flash attributes struct
 
64
//
 
65
/////////////////////////////////////////////
 
66
typedef struct flash_attr {
 
67
    const char *type_str;
 
68
    //
 
69
    // hw_dev_id    hw dev id of the HCA.
 
70
    //
 
71
    u_int32_t hw_dev_id;
 
72
    u_int32_t rev_id;
 
73
 
 
74
    //
 
75
    // size:        Total size (in bytes) of all flash devices connected to
 
76
    //              the device (forming a contigous address space)
 
77
    //
 
78
    u_int32_t size;
 
79
 
 
80
    //
 
81
    // sector_size: Flash sector size (in bytes).
 
82
    //              Assuming a single sector size for the flash.
 
83
    //
 
84
    u_int32_t sector_size;
 
85
 
 
86
    int       num_erase_blocks;         // Number of sector defs.
 
87
    struct {
 
88
        unsigned long sector_size;      // Byte size of sector
 
89
        int           num_sectors;      // Num sectors of this size
 
90
        u_int32_t     sector_mask;      // Sector mask
 
91
    } erase_block[8];
 
92
 
 
93
    //
 
94
    // bank_size:   Different bank means a different chip sellect or gpio settings is needed when crossing
 
95
    //              this alignment.
 
96
    //              This may indicate a different flash device (for SPI flash in InfiniHostIIILx / ConnectX).
 
97
    //              Or GPIO change for parallel flash (in InfiniHostIII / InfiniHost)
 
98
    //
 
99
    int bank_size;
 
100
    int log2_bank_size;
 
101
 
 
102
    //
 
103
    // Command set (taken from CFI terminology)
 
104
    //
 
105
    int command_set;
 
106
 
 
107
    u_int8_t erase_command;
 
108
 
 
109
    //
 
110
    // block_write - if block write is supported, holds the block size in bytes. 0 otherwise.
 
111
    //               The meaning of "block write" is not the same in parallel and serial flash.
 
112
    //
 
113
    int block_write;
 
114
 
 
115
    //
 
116
    // page_write -  if page write is supported, holds the page size in bytes. 0 otherwise.
 
117
    //
 
118
    int page_write;
 
119
 
 
120
    u_int8_t banks_num;
 
121
    u_int8_t quad_en_support;
 
122
    u_int8_t dummy_cycles_support;
 
123
    u_int8_t write_protect_support;
 
124
    u_int8_t protect_sub_and_sector;
 
125
    u_int8_t vendor;
 
126
    u_int8_t type;
 
127
 
 
128
 
 
129
} flash_attr;
 
130
 
 
131
#endif // MFLASH_COMMON_STRUCTS_H
 
132
 
 
133
 
 
134