The @var{fm4} driver uses a @var{family} parameter to select the
correct bank config, it can currently be one of the following:
@code{MB9BFx64}, @code{MB9BFx65}, @code{MB9BFx66}, @code{MB9BFx67}, @code{MB9BFx68},
-@code{S6E2Cx8}, @code{S6E2Cx9} or @code{S6E2CxA},
+@code{S6E2Cx8}, @code{S6E2Cx9}, @code{S6E2CxA} or @code{S6E2Dx},
with @code{x} treated as wildcard and otherwise case (and any trailing
characters) ignored.
*
* Copyright (c) 2015 Andreas Färber
*
+ * Based on S6E2DH_MN709-00013 for S6E2DH/DF/D5/D3 series
* Based on S6E2CC_MN709-00007 for S6E2CC/C5/C4/C3/C2/C1 series
* Based on MB9B560R_MN709-00005 for MB9BFx66/x67/x68 series
* Based on MB9B560L_MN709-00006 for MB9BFx64/x65/x66 series
s6e2cx8,
s6e2cx9,
s6e2cxa,
+
+ s6e2dx,
};
struct fm4_flash_bank {
return ERROR_OK;
}
+static int s6e2dh_probe(struct flash_bank *bank)
+{
+ uint32_t flash_addr = bank->base;
+ int i;
+
+ bank->num_sectors = 10;
+ bank->sectors = calloc(bank->num_sectors,
+ sizeof(struct flash_sector));
+ for (i = 0; i < bank->num_sectors; i++) {
+ if (i < 4)
+ bank->sectors[i].size = 8 * 1024;
+ else if (i == 4)
+ bank->sectors[i].size = 32 * 1024;
+ else
+ bank->sectors[i].size = 64 * 1024;
+ bank->sectors[i].offset = flash_addr - bank->base;
+ bank->sectors[i].is_erased = -1;
+ bank->sectors[i].is_protected = -1;
+
+ bank->size += bank->sectors[i].size;
+ flash_addr += bank->sectors[i].size;
+ }
+
+ return ERROR_OK;
+}
+
static int fm4_probe(struct flash_bank *bank)
{
struct fm4_flash_bank *fm4_bank = bank->driver_priv;
case s6e2cxa:
retval = s6e2cc_probe(bank);
break;
+ case s6e2dx:
+ retval = s6e2dh_probe(bank);
+ break;
default:
return ERROR_FLASH_OPER_UNSUPPORTED;
}
case s6e2cxa:
name = "S6E2CxA";
break;
+ case s6e2dx:
+ name = "S6E2Dx";
+ break;
default:
name = "unknown";
break;
ret = mb9bf_bank_setup(bank, variant);
else if (fm4_name_match(variant, "S6E2Cx"))
ret = s6e2cc_bank_setup(bank, variant);
- else {
+ else if (fm4_name_match(variant, "S6E2Dx")) {
+ fm4_bank->variant = s6e2dx;
+ ret = ERROR_OK;
+ } else {
LOG_WARNING("Family %s not recognized.", variant);
ret = ERROR_FLASH_OPER_UNSUPPORTED;
}