2
* mflash_common_structs.h - Mellanox Technilogies LTD. Flash access lib heared file
4
* Copyright (C) Jan 2013 Mellanox Technologies Ltd. All rights reserved.
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:
12
* Redistribution and use in source and binary forms, with or
13
* without modification, are permitted provided that the following
16
* - Redistributions of source code must retain the above
17
* copyright notice, this list of conditions and the following
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.
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
36
#ifndef MFLASH_COMMON_STRUCTS_H
37
#define MFLASH_COMMON_STRUCTS_H
39
typedef struct mflash mflash;
43
MFO_AMD_UNLOCK_BYPASS,
48
MFO_IGNORE_CASHE_REP_GUARD,
50
MFO_FW_ACCESS_TYPE_BY_MFILE,
52
MFO_NEW_CACHE_REPLACEMENT_EN,
61
/////////////////////////////////////////////
63
// Flash attributes struct
65
/////////////////////////////////////////////
66
typedef struct flash_attr {
69
// hw_dev_id hw dev id of the HCA.
75
// size: Total size (in bytes) of all flash devices connected to
76
// the device (forming a contigous address space)
81
// sector_size: Flash sector size (in bytes).
82
// Assuming a single sector size for the flash.
84
u_int32_t sector_size;
86
int num_erase_blocks; // Number of sector defs.
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
94
// bank_size: Different bank means a different chip sellect or gpio settings is needed when crossing
96
// This may indicate a different flash device (for SPI flash in InfiniHostIIILx / ConnectX).
97
// Or GPIO change for parallel flash (in InfiniHostIII / InfiniHost)
103
// Command set (taken from CFI terminology)
107
u_int8_t erase_command;
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.
116
// page_write - if page write is supported, holds the page size in bytes. 0 otherwise.
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;
131
#endif // MFLASH_COMMON_STRUCTS_H