Commit graph

2 commits

Author SHA1 Message Date
Kumar Gala a529c4511d drivers: flash: Update drivers to use devicetree Kconfig symbol
Update flash drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-30 08:27:13 -05:00
Piotr Dymacz 360d70a91e drivers: flash: introduce on-chip flash driver for TI CC13xx/CC26xx
This includes a basic driver for built-in flash on the Texas Intruments
SimpleLink CC13xx/CC26xx SoC series.

The driver makes use of driverlib HAL from TI's SDK and was tested on
two LaunchXL development boards with CC1352R and CC2652R SoCs:

- CC1352R1 LaunchXL
- CC26x2R1 LaunchXL

Tests were done using:

- flash shell sample (samples/drivers/flash_shell)
- littlefs filesystem sample (samples/subsys/fs/littlefs)*
- MCUboot (bootloader/mcuboot/boot/zephyr)*

  * additional changes in DTS for the boards were required (partitions
    table) and are not part of this changeset (will be introduced later)

Some additional information about the implementation:

1. TI's Technical Reference Manual for CC13x2 and CC26x2 points out that
   "An individual 64-bit word can be programmed to change bits 1 to 0"
   but it seems this 'alignment' requirement is handled internally by
   the ROM function and thus 'write-block-size' is set to 1.

2. Interrupts, VIMS and line buffers are disabled during flash content
   update (write or erase) and restored afterwards as recommended by TI.

3. Only RAM to flash write is supported (source of data to be written to
   flash can't point to flash).

4. The driver doesn't take care of flash sector protection disable as
   that functionality is handled by CCFG. Write or erase requests which
   refer to a protected area will fail.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-06-06 14:01:27 -07:00