Go to the documentation of this file.
104 #define FLASH2X_TOTAL_SIZE (64*1024*1024)
105 #define DEFAULT_SECTOR_SIZE (64*1024)
243 #define EEPROM_BEGIN_CIS (0)
244 #define EEPROM_BEGIN_NON_CIS (0x200)
245 #define EEPROM_END (0x2000)
247 #define INIT_PARAMS_SIGNATURE (0x95a7a597)
249 #define MAX_INIT_PARAMS_LENGTH (2048)
252 #define MAC_ADDRESS_OFFSET 0x200
255 #define INIT_PARAMS_1_SIGNATURE_ADDRESS EEPROM_BEGIN_NON_CIS
256 #define INIT_PARAMS_1_DATA_ADDRESS (INIT_PARAMS_1_SIGNATURE_ADDRESS+16)
257 #define INIT_PARAMS_1_MACADDRESS_ADDRESS (MAC_ADDRESS_OFFSET)
258 #define INIT_PARAMS_1_LENGTH_ADDRESS (INIT_PARAMS_1_SIGNATURE_ADDRESS+4)
260 #define INIT_PARAMS_2_SIGNATURE_ADDRESS (EEPROM_BEGIN_NON_CIS+2048+16)
261 #define INIT_PARAMS_2_DATA_ADDRESS (INIT_PARAMS_2_SIGNATURE_ADDRESS+16)
262 #define INIT_PARAMS_2_MACADDRESS_ADDRESS (INIT_PARAMS_2_SIGNATURE_ADDRESS+8)
263 #define INIT_PARAMS_2_LENGTH_ADDRESS (INIT_PARAMS_2_SIGNATURE_ADDRESS+4)
265 #define EEPROM_SPI_DEV_CONFIG_REG 0x0F003000
266 #define EEPROM_SPI_Q_STATUS1_REG 0x0F003004
267 #define EEPROM_SPI_Q_STATUS1_MASK_REG 0x0F00300C
269 #define EEPROM_SPI_Q_STATUS_REG 0x0F003008
270 #define EEPROM_CMDQ_SPI_REG 0x0F003018
271 #define EEPROM_WRITE_DATAQ_REG 0x0F00301C
272 #define EEPROM_READ_DATAQ_REG 0x0F003020
273 #define SPI_FLUSH_REG 0x0F00304C
275 #define EEPROM_WRITE_ENABLE 0x06000000
276 #define EEPROM_READ_STATUS_REGISTER 0x05000000
277 #define EEPROM_16_BYTE_PAGE_WRITE 0xFA000000
278 #define EEPROM_WRITE_QUEUE_EMPTY 0x00001000
279 #define EEPROM_WRITE_QUEUE_AVAIL 0x00002000
280 #define EEPROM_WRITE_QUEUE_FULL 0x00004000
281 #define EEPROM_16_BYTE_PAGE_READ 0xFB000000
282 #define EEPROM_4_BYTE_PAGE_READ 0x3B000000
284 #define EEPROM_CMD_QUEUE_FLUSH 0x00000001
285 #define EEPROM_WRITE_QUEUE_FLUSH 0x00000002
286 #define EEPROM_READ_QUEUE_FLUSH 0x00000004
287 #define EEPROM_ETH_QUEUE_FLUSH 0x00000008
288 #define EEPROM_ALL_QUEUE_FLUSH 0x0000000f
289 #define EEPROM_READ_ENABLE 0x06000000
290 #define EEPROM_16_BYTE_PAGE_WRITE 0xFA000000
291 #define EEPROM_READ_DATA_FULL 0x00000010
292 #define EEPROM_READ_DATA_AVAIL 0x00000020
293 #define EEPROM_READ_QUEUE_EMPTY 0x00000002
294 #define EEPROM_CMD_QUEUE_EMPTY 0x00000100
295 #define EEPROM_CMD_QUEUE_AVAIL 0x00000200
296 #define EEPROM_CMD_QUEUE_FULL 0x00000400
301 #define EEPROM_STATUS_REG_WRITE_BUSY 0x00000001
305 #define MAX_EEPROM_RETRIES 80
306 #define RETRIES_PER_DELAY 64
309 #define MAX_RW_SIZE 0x10
310 #define MAX_READ_SIZE 0x10
311 #define MAX_SECTOR_SIZE (512*1024)
312 #define MIN_SECTOR_SIZE (1024)
313 #define FLASH_SECTOR_SIZE_OFFSET 0xEFFFC
314 #define FLASH_SECTOR_SIZE_SIG_OFFSET 0xEFFF8
315 #define FLASH_SECTOR_SIZE_SIG 0xCAFEBABE
316 #define FLASH_CS_INFO_START_ADDR 0xFF0000
317 #define FLASH_CONTROL_STRUCT_SIGNATURE 0xBECEF1A5
318 #define SCSI_FIRMWARE_MAJOR_VERSION 0x1
319 #define SCSI_FIRMWARE_MINOR_VERSION 0x5
320 #define BYTE_WRITE_SUPPORT 0x1
322 #define FLASH_AUTO_INIT_BASE_ADDR 0xF00000
327 #define FLASH_CONTIGIOUS_START_ADDR_AFTER_INIT 0x1C000000
328 #define FLASH_CONTIGIOUS_START_ADDR_BEFORE_INIT 0x1F000000
330 #define FLASH_CONTIGIOUS_START_ADDR_BCS350 0x08000000
331 #define FLASH_CONTIGIOUS_END_ADDR_BCS350 0x08FFFFFF
335 #define FLASH_SIZE_ADDR 0xFFFFEC
337 #define FLASH_SPI_CMDQ_REG 0xAF003040
338 #define FLASH_SPI_WRITEQ_REG 0xAF003044
339 #define FLASH_SPI_READQ_REG 0xAF003048
340 #define FLASH_CONFIG_REG 0xAF003050
341 #define FLASH_GPIO_CONFIG_REG 0xAF000030
343 #define FLASH_CMD_WRITE_ENABLE 0x06
344 #define FLASH_CMD_READ_ENABLE 0x03
345 #define FLASH_CMD_RESET_WRITE_ENABLE 0x04
346 #define FLASH_CMD_STATUS_REG_READ 0x05
347 #define FLASH_CMD_STATUS_REG_WRITE 0x01
348 #define FLASH_CMD_READ_ID 0x9F
350 #define PAD_SELECT_REGISTER 0xAF000410
352 #define FLASH_PART_SST25VF080B 0xBF258E
354 #define EEPROM_CAL_DATA_INTERNAL_LOC 0xbFB00008
356 #define EEPROM_CALPARAM_START 0x200
357 #define EEPROM_SIZE_OFFSET 524
362 #define MAX_FLASH_RETRIES 4
363 #define FLASH_PER_RETRIES_DELAY 16
366 #define EEPROM_MAX_CAL_AREA_SIZE 0xF0000
370 #define BECM ntohl(0x4245434d)
372 #define FLASH_2X_MAJOR_NUMBER 0x2
373 #define DSD_IMAGE_MAGIC_NUMBER 0xBECE0D5D
374 #define ISO_IMAGE_MAGIC_NUMBER 0xBECE0150
375 #define NON_CDLESS_DEVICE_BOOT_SIG 0xBECEB007
376 #define MINOR_VERSION(x) ((x >>16) & 0xFFFF)
377 #define MAJOR_VERSION(x) (x & 0xFFFF)
378 #define CORRUPTED_PATTERN 0x0
379 #define UNINIT_PTR_IN_CS 0xBBBBDDDD
381 #define VENDOR_PTR_IN_CS 0xAAAACCCC
384 #define FLASH2X_SECTION_PRESENT 1<<0
385 #define FLASH2X_SECTION_VALID 1<<1
386 #define FLASH2X_SECTION_RO 1<<2
387 #define FLASH2X_SECTION_ACT 1<<3
388 #define SECTOR_IS_NOT_WRITABLE STATUS_FAILURE
389 #define INVALID_OFFSET STATUS_FAILURE
390 #define INVALID_SECTION STATUS_FAILURE
391 #define SECTOR_1K 1024
392 #define SECTOR_64K (64 *SECTOR_1K)
393 #define SECTOR_128K (2 * SECTOR_64K)
394 #define SECTOR_256k (2 * SECTOR_128K)
395 #define SECTOR_512K (2 * SECTOR_256k)
396 #define FLASH_PART_SIZE (16 * 1024 * 1024)
397 #define RESET_CHIP_SELECT -1
398 #define CHIP_SELECT_BIT12 12
400 #define SECTOR_READWRITE_PERMISSION 0
401 #define SECTOR_READONLY 1
402 #define SIGNATURE_SIZE 4
403 #define DEFAULT_BUFF_SIZE 0x10000
406 #define FIELD_OFFSET_IN_HEADER(HeaderPointer,Field) ((PUCHAR)&((HeaderPointer)(NULL))->Field - (PUCHAR)(NULL))