X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fmt29f_sam3.h;h=969496a97805991ef6d15fec9fefdd13893ff353;hb=a003d4c2a077f7c60ab84a6894bcb9c423ec09a7;hp=a6108b06a489c66e21b36b5e3374ab619679745e;hpb=734abc0f8ed652abddddedee6acf515954a5b13c;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/mt29f_sam3.h b/bertos/cpu/cortex-m3/drv/mt29f_sam3.h index a6108b06..969496a9 100644 --- a/bertos/cpu/cortex-m3/drv/mt29f_sam3.h +++ b/bertos/cpu/cortex-m3/drv/mt29f_sam3.h @@ -38,9 +38,27 @@ #ifndef MT29F_SAM3_H #define MT29F_SAM3_H +#include + + // MT29F2G08AAD, FIXME: configurable -#define MT29F_PAGE_SIZE 2048 -#define MT29F_SIZE 0x10000000 // 256 MB +#define MT29F_DATA_SIZE 0x800 // 2048 B +#define MT29F_SPARE_SIZE 0x40 // 64 B +#define MT29F_PAGE_SIZE (MT29F_DATA_SIZE + MT29F_SPARE_SIZE) +#define MT29F_PAGES_PER_BLOCK 64 +#define MT29F_BLOCK_SIZE (MT29F_DATA_SIZE * MT29F_PAGES_PER_BLOCK) +#define MT29F_NUM_BLOCKS 2048 +#define MT29F_ECC_NWORDS (MT29F_DATA_SIZE / 256) +#define MT29F_REMAP_TAG_OFFSET 0x38 +#define MT29F_REMAP_TAG 0x3e10c8ed +// Used to setup a dummy remup +#define MT29F_NULL_REMAP 0xfffe + +// Number of reserved block for remapping +#define MT29F_NUM_REMAP_BLOCKS 128 +// Number of usable blocks, and index of first remapping block +#define MT29F_NUM_USER_BLOCKS (MT29F_NUM_BLOCKS - MT29F_NUM_REMAP_BLOCKS) + /* * PIO definitions. @@ -56,10 +74,11 @@ #define MT29F_PINS_PORTC (MT29F_PIN_OE | MT29F_PIN_WE | MT29F_PIN_IO) #define MT29F_PERIPH_PORTC PIO_PERIPH_A -#define MT29F_PIN_CLE BV(22) -#define MT29F_PIN_ALE BV(21) +#define MT29F_PIN_CLE BV(9) +#define MT29F_PIN_ALE BV(8) #define MT29F_PINS_PORTD (MT29F_PIN_CLE | MT29F_PIN_ALE) #define MT29F_PERIPH_PORTD PIO_PERIPH_A + #endif /* MT29F_SAM3_H */