diff --git a/urjtag/src/flash/amd.c b/urjtag/src/flash/amd.c index 53e3b6f9..e3605c3b 100644 --- a/urjtag/src/flash/amd.c +++ b/urjtag/src/flash/amd.c @@ -38,13 +38,14 @@ #include #include #include -#include -#include +#include #include #include #include +#include "cfi.h" + static int dbg = 0; static int amd_flash_erase_block (urj_flash_cfi_array_t *cfi_array, diff --git a/urjtag/src/flash/amd_flash.c b/urjtag/src/flash/amd_flash.c index d36a89d7..a0e360df 100644 --- a/urjtag/src/flash/amd_flash.c +++ b/urjtag/src/flash/amd_flash.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include #include #include @@ -41,6 +39,8 @@ #include #include "jedec.h" +#include "cfi.h" +#include "intel.h" //write specific #define AMD_SECTOR_PROTECTED diff --git a/urjtag/src/flash/cfi.c b/urjtag/src/flash/cfi.c index a50b955e..35def9cb 100644 --- a/urjtag/src/flash/cfi.c +++ b/urjtag/src/flash/cfi.c @@ -32,12 +32,13 @@ #include #include -#include #include #include #include +#include "cfi.h" + void urj_flash_cfi_array_free (urj_flash_cfi_array_t *cfi_array) { diff --git a/urjtag/src/flash/cfi.h b/urjtag/src/flash/cfi.h index 2b2d46f7..4bf63d53 100644 --- a/urjtag/src/flash/cfi.h +++ b/urjtag/src/flash/cfi.h @@ -162,6 +162,12 @@ typedef struct cfi_query_structure urj_flash_cfi_query_system_interface_information_t system_interface_info; urj_flash_cfi_device_geometry_t device_geometry; } urj_flash_cfi_query_structure_t; + +struct urj_flash_cfi_chip +{ + int width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */ + urj_flash_cfi_query_structure_t cfi; +}; #endif /* __ASSEMBLY__ */ /* AMD primary vendor-specific extended query structure - see [3] and [4] */ diff --git a/urjtag/src/flash/detectflash.c b/urjtag/src/flash/detectflash.c index 8dd7d1c9..8fb12875 100644 --- a/urjtag/src/flash/detectflash.c +++ b/urjtag/src/flash/detectflash.c @@ -32,14 +32,14 @@ #include #include -#include -#include -#include #include #include #include "jedec.h" +#include "cfi.h" +#include "intel.h" +#include "mic.h" urj_flash_cfi_array_t *urj_flash_cfi_array = NULL; diff --git a/urjtag/src/flash/flash.c b/urjtag/src/flash/flash.c index 09296969..e9694ec3 100644 --- a/urjtag/src/flash/flash.c +++ b/urjtag/src/flash/flash.c @@ -39,8 +39,8 @@ #include #include -#include -#include +#include +#include #include "bus.h" #include "flash.h" diff --git a/urjtag/src/flash/intel.c b/urjtag/src/flash/intel.c index dfc0d6f7..2dd7e663 100644 --- a/urjtag/src/flash/intel.c +++ b/urjtag/src/flash/intel.c @@ -40,14 +40,15 @@ #include #include #include -#include -#include -#include #include #include #include +#include "cfi.h" +#include "intel.h" +#include "mic.h" + static int intel_flash_erase_block (urj_flash_cfi_array_t *cfi_array, uint32_t adr); static int intel_flash_unlock_block (urj_flash_cfi_array_t *cfi_array, diff --git a/urjtag/src/flash/jedec.c b/urjtag/src/flash/jedec.c index ac4f3daf..4e71250b 100644 --- a/urjtag/src/flash/jedec.c +++ b/urjtag/src/flash/jedec.c @@ -26,14 +26,14 @@ #include #include #include -#include -#include #include #include #include #include +#include "cfi.h" +#include "intel.h" #include "jedec.h" /* Manufacturers */ diff --git a/urjtag/src/flash/jedec_exp.c b/urjtag/src/flash/jedec_exp.c index b4ca0120..c0438b9d 100644 --- a/urjtag/src/flash/jedec_exp.c +++ b/urjtag/src/flash/jedec_exp.c @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include #include @@ -35,6 +33,10 @@ #include #include +#include "jedec.h" +#include "cfi.h" +#include "intel.h" + void urj_flash_jedec_exp_read_id (urj_bus_t *bus, uint32_t adr, uint32_t dmask, uint32_t pata, uint32_t patb, uint32_t dcmd,