flash/nor/bl602: add bl602 flash driver

Initial release of Flash bank driver for Bouffalo chips.
The driver currently supports BL602, BL702, BL702L series of chips.
Similar SFlash core is inside of BL808, BL606P and BL616 series,
so those might be supported in future as well.

With adapter speed set to 8000, it can reach speed 140 KiB/s.

Since chips have eXecute In Place support, and they also require
boot config in Flash at offset 0x0, it's required to have properly
crafted linker script, so OpenOCD knows where to write firmware
through gdb.

There is required flash bank parameter, which specifies the chip type.
This is required because BL702 and BL702L have same TAP ID CODE, and
there are no usable indicators to use for automatic chip type
recognition in the chip.

Change-Id: Id57336d447be3c608b39ba3ed143527bfdc0af98
Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8527
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marek Kraus
2024-10-21 20:22:08 +02:00
committed by Antonio Borneo
parent 3e86eaaf7d
commit df2eb07086
9 changed files with 807 additions and 1 deletions

View File

@@ -7132,6 +7132,34 @@ flash erase_sector 0 0 last # It will perform a mass erase
Triggering a mass erase is also useful when users want to disable readout protection.
@end deffn
@deffn {Flash Driver} {bl602}
Supports RISC-V chips Bouffalo Lab BL602, BL702 and BL702L series.
Both internal and external flashes are supported. The driver automatically
recognizes the specific version's flash parameters and autoconfigures itself.
Due to how the SFlash and XIP in those chips works, it is recommended to probe
the flash before usage, and reset the chip after work with flash is finished.
This driver does not generate boot header which is required to have working
firmware. This header must be inside of ELF with proper Load Memory Address
and other parts of firmware must have proper LMA based on boot header configuration.
The @var{bl602} driver needs following parameters,
which must appear in the following order:
@itemize
@item @var{chip_type} ... required, may be
@option{bl602},
@option{bl702},
@option{bl702l}
@end itemize
Example:
@example
flash bank $_FLASHNAME bl602 0x23000000 0 0 0 $_TARGETNAME bl602
@end example
@end deffn
@deffn {Flash Driver} {cc26xx}
All versions of the SimpleLink CC13xx and CC26xx microcontrollers from Texas
Instruments include internal flash. The cc26xx flash driver supports both the