stm32: flash: pull up prefetch to _all

Turns out, there's lots of common code for flash.  Pull up prefetch
on/off to start with, as there's only a single bit name different.

Pull up the definitions of common API functions too, starting with
flash_set_ws.  Even if the implementations are different, things that
meant to be the same, should be defined centrally.
This commit is contained in:
Karl Palsson
2018-07-10 22:21:18 +00:00
parent 9dd901ba27
commit b23dccc7ae
30 changed files with 117 additions and 185 deletions

View File

@@ -29,34 +29,6 @@
#include <libopencm3/stm32/flash.h>
/*---------------------------------------------------------------------------*/
/** @brief Enable the FLASH Prefetch Buffer
This buffer is used for instruction fetches and is enabled by default after
reset.
Note carefully the restrictions under which the prefetch buffer may be
enabled or disabled. Prefetch is only available when 64-bit
access is enabled.
*/
void flash_prefetch_enable(void)
{
FLASH_ACR |= FLASH_ACR_PRFTEN;
}
/*---------------------------------------------------------------------------*/
/** @brief Disable the FLASH Prefetch Buffer
Note carefully the restrictions under which the prefetch buffer may be
set to disabled. See the reference and programming manuals for details.
*/
void flash_prefetch_disable(void)
{
FLASH_ACR &= ~FLASH_ACR_PRFTEN;
}
/*---------------------------------------------------------------------------*/
/** @brief Set the Number of Wait States