arm: K64 SPI module driver

Support for Freescale/NXP K64 SPI modules, limited to:

- Master mode
- A single active set of clock and transfer attributes (CTAR0), which
includes non-adjustable delay parameters
- Tx FIFO fill and Rx FIFO drain interrupt handling
- Standard, continuous select and continuous SCK SPI transfer formats

Also, divide-by-zero code generation in this driver is prevented.
The 'volatile' attribute is added to some of the variables in the baud
rate and delay calculation functions of the K64 SPI driver in order to
prevent bad code generation by gcc toolchains for ARM seen when an
optimization setting above -O0 is used.
Specifically, a register is loaded with the constant 0 and is used as
the divisor in a following divide instruction, resulting in a
divide-by-zero exception.
This issue has been seen with gcc versions 4.8.1 (the VxWorks toolchain)
and 5.2.0 (the Zephyr SDK toolchain).

Change-Id: Ib5b2b748aad8fdfd5e8d40544e6e1abef3713abe
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
This commit is contained in:
Jeff Blais 2016-02-18 14:38:32 -05:00 committed by Benjamin Walsh
commit 995a9ba72a
7 changed files with 1556 additions and 4 deletions

View file

@ -274,13 +274,34 @@ config PRESERVE_JTAG_IO_PINS
the Arduino header as D8, D3 and D5, respectively.
Enable this option to preserve these pins for the debug interface.
endif #PINMUX
endif # PINMUX
if PWM
config PWM_K64_FTM
def_bool y
config PWM_K64_FTM_0
def_bool y
endif
endif
config SPI
def_bool n
if SPI
config SPI_K64
def_bool y
config SPI_K64_0
def_bool y
config SPI_K64_1
def_bool n
config SPI_K64_2
def_bool n
endif
endif # SOC_FSL_FRDM_K64F