From: Andreas Färber Date: Sun, 6 Dec 2015 16:51:49 +0000 (+0100) Subject: fm4: Add support for MB9BFx64/x65 X-Git-Tag: v0.10.0-rc1~233 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=f2b3a8b0e88adccea9b2c4ad8eba322973051d03 fm4: Add support for MB9BFx64/x65 These appear to be just additional flash size configurations. Entirely based on manual, untested. Change-Id: I4460dc1a588335df8fc0a385d24513a4e35b6951 Signed-off-by: Andreas Färber Reviewed-on: http://openocd.zylin.com/3157 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/doc/openocd.texi b/doc/openocd.texi index e131f1ed60..a5f0a83cdf 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -5245,7 +5245,7 @@ All members of the FM4 microcontroller family from Spansion (formerly Fujitsu) include internal flash and use ARM Cortex-M4 cores. The @var{fm4} driver uses a @var{family} parameter to select the correct bank config, it can currently be one of the following: -@code{MB9BFx66}, @code{MB9BFx67}, @code{MB9BFx68}, +@code{MB9BFx64}, @code{MB9BFx65}, @code{MB9BFx66}, @code{MB9BFx67}, @code{MB9BFx68}, @code{S6E2Cx8}, @code{S6E2Cx9} or @code{S6E2CxA}, with @code{x} treated as wildcard and otherwise case (and any trailing characters) ignored. diff --git a/src/flash/nor/fm4.c b/src/flash/nor/fm4.c index 917ff0186b..0f8de8caeb 100644 --- a/src/flash/nor/fm4.c +++ b/src/flash/nor/fm4.c @@ -5,6 +5,7 @@ * * 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 */ #ifdef HAVE_CONFIG_H @@ -26,6 +27,8 @@ #define WDG_LCK (WDG_BASE + 0xC00) enum fm4_variant { + mb9bfx64, + mb9bfx65, mb9bfx66, mb9bfx67, mb9bfx68, @@ -342,6 +345,12 @@ static int mb9bf_probe(struct flash_bank *bank) int i; switch (fm4_bank->variant) { + case mb9bfx64: + bank->num_sectors = 8; + break; + case mb9bfx65: + bank->num_sectors = 10; + break; case mb9bfx66: bank->num_sectors = 12; break; @@ -463,6 +472,8 @@ static int fm4_probe(struct flash_bank *bank) } switch (fm4_bank->variant) { + case mb9bfx64: + case mb9bfx65: case mb9bfx66: case mb9bfx67: case mb9bfx68: @@ -510,6 +521,12 @@ static int fm4_get_info_command(struct flash_bank *bank, char *buf, int buf_size } switch (fm4_bank->variant) { + case mb9bfx64: + name = "MB9BFx64"; + break; + case mb9bfx65: + name = "MB9BFx65"; + break; case mb9bfx66: name = "MB9BFx66"; break; @@ -568,7 +585,11 @@ static int mb9bf_bank_setup(struct flash_bank *bank, const char *variant) { struct fm4_flash_bank *fm4_bank = bank->driver_priv; - if (fm4_name_match(variant, "MB9BFx66")) { + if (fm4_name_match(variant, "MB9BFx64")) { + fm4_bank->variant = mb9bfx64; + } else if (fm4_name_match(variant, "MB9BFx65")) { + fm4_bank->variant = mb9bfx65; + } else if (fm4_name_match(variant, "MB9BFx66")) { fm4_bank->variant = mb9bfx66; } else if (fm4_name_match(variant, "MB9BFx67")) { fm4_bank->variant = mb9bfx67;