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>
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>
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>