Commit Graph

4 Commits

Author SHA1 Message Date
robert-hh
0a433a02e1 mimxrt/hal: Set the flexspi flash CLK frequency on boot.
The flash clock frequency may have been set to a different value by a
bootloader.  Set the frequency according to the configured value.  Use a
table of pre-calculated dividers to get the closest value for the flash
frequency, achieving for MIMXRT10xx:

  30 -> 30.85 MHz
  50 -> 49.65 MHz
  60 -> 60 MHz
  75 -> 75.13 MHz
  80 -> 80 MHz
  100 -> 99.31 Mhz
  133 -> 132.92 MHz
  166  -> 166.15 MHz

for MIMXRT1176:

  30 -> 31 MHz
  50 -> 52.8 MJz
  60 -> 58.7 MHz
  75 -> 75.4 MHz
  80 -> 75.4 MHz
  100 -> 105.6 MHz
  133 -> 132 MHz
  166 -> 176 MHz

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:32:26 +11:00
robert-hh
2a80d5c68b mimxrt/flash: Swap the order of disabling IRQ and disabling the cache.
This change stopped problems with USB IRQ happening during flash writes.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:31:28 +11:00
robert-hh
b251aec0fc mimxrt/hal: Update the LUT and re-enable PAGEPROGRAM_QUAD.
Changes:
- Change the LUT table ordering to be similar to the order of the
  UF2-Bootloader and fsl_romapi.h.
- Rewrite the LUT entry for PAGEPROGRAM_QUAD and update the LUT.  That
  enabled QUAD program again.

Signed-off-by: robert-hh <robert@hammelrath.com>
2025-02-10 11:30:44 +11:00
Philipp Ebensberger
a3f3b9045c mimxrt/flash: Separate low level driver code from flash object.
Separate low level flash access from mimxrt flash driver object.  Allows
better abstraction from hardware for testing and reuse in other areas (e.g.
bootloader).

Signed-off-by: Philipp Ebensberger <philipp.ebensberger@3bricks-software.de>
2023-05-09 15:18:36 +10:00