FreeCalypso > hg > freecalypso-tools
diff loadtools/flash.h @ 506:0dd2c87c1b63
fc-loadtool flash support overhaul
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 28 May 2019 05:12:47 +0000 |
parents | e7502631a0f9 |
children | 9c5b0629e346 |
line wrap: on
line diff
--- a/loadtools/flash.h Mon May 27 19:58:01 2019 +0000 +++ b/loadtools/flash.h Tue May 28 05:12:47 2019 +0000 @@ -1,5 +1,11 @@ /* this header file contains definitions for fc-loadtool flash support */ +/* global configuration */ +#define FLASH_GLOBAL_CFG_NONE 0 +#define FLASH_GLOBAL_CFG_SINGLE_4M 1 +#define FLASH_GLOBAL_CFG_SINGLE_8M 2 +#define FLASH_GLOBAL_CFG_DUAL_8M 3 + /* * The following structures represent an "abstract" * description of flash devices. @@ -25,22 +31,16 @@ unsigned total_sectors; }; -struct flash_idcheck { - uint16_t offset; - uint16_t expect_val; +struct cfi_check { + int offset; + uint8_t expect_val; }; -struct flash_bank_desc { - uint32_t align_size; - struct flash_geom *geom; - struct flash_idcheck *idcheck_table; - unsigned idcheck_num; -}; - -struct flash_device_desc { +struct flash_device { char *name; - struct flash_bank_desc *bank_desc; - unsigned nbanks; + struct cfi_check *cfi_table; + int required_global_config; + struct flash_geom *bank_geom[2]; struct flash_cmdset *cmdset; }; @@ -65,9 +65,9 @@ struct flash_bank_info { uint32_t base_addr; - struct flash_bank_desc *bank_desc; + struct flash_device *device; struct flash_geom *geom; struct flash_cmdset *ops; struct sector_info *sectors; - int idcheck_done; + int detect_done; };