X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fmt29f_sam3.h;h=3a8a9abe68cd7dbedebe164af8cca92b54f0333d;hb=7a825da467bf9ce79329686b37d373c709c9937d;hp=2d2d7353361d8acb3deb40508f3c7b653a508370;hpb=b13dbf31d82c002be6169e7cba5923c9970f5267;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/mt29f_sam3.h b/bertos/cpu/cortex-m3/drv/mt29f_sam3.h index 2d2d7353..3a8a9abe 100644 --- a/bertos/cpu/cortex-m3/drv/mt29f_sam3.h +++ b/bertos/cpu/cortex-m3/drv/mt29f_sam3.h @@ -42,10 +42,22 @@ // MT29F2G08AAD, FIXME: configurable -#define MT29F_PAGE_SIZE 0x800 // 2048 B -#define MT29F_BLOCK_SIZE 0x20000 // 128 kB -#define MT29F_SIZE 0x10000000 // 256 MB -#define MT29F_CSID NFC_CMD_CSID_0 // Chip select +#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_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.