spiflash.h (1036B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * Arm Processor Subsystem flash utility 8 */ 9 10 #ifndef SPIFLASH_H 11 #define SPIFLASH_H 12 13 #if defined(BCM_PLATFORM_STRING) || defined(STAND_ALONE) 14 #include <appl/diag/aps/spiflash_toc.h> 15 #else 16 #include "spiflash_toc.h" 17 #endif 18 19 #define SPIFLASH_PAGE_SIZE 256 20 21 typedef struct flash_info_s { 22 char name[16]; 23 uint32 rdid; 24 uint32 page_size; 25 uint32 erase_page_size; /* MGMT_FLASH_ERASE_PAGE erase size */ 26 uint32 erase_sector_size; /* MGMT_FLASH_ERASE_SECTOR erase size */ 27 uint32 flash_size; 28 } flash_info_t; 29 30 int spiflash_calculate_header(flash_info_t *flash_info, flash_header_t *header, 31 uint32 dmu_config, uint32 spi_speed); 32 33 flash_info_t *spiflash_info_by_name(char *name); 34 flash_info_t *spiflash_info_by_rdid(uint32 rdid); 35 36 #endif