arm: Freescale K64/FRDM-K64F Pinmux support

K64 pinmux support is created as a normal driver.

As opposed to the Galileo board, the pin configuration options are
defined by the MCU and are not board-specific.  Separate
platform/board-specific configuration code uses the pinmux driver for
the default pin settings. For FRDM-K64F, only the Arduino pins (22 of a
possible 160) are set up.

Some of the I/O pins routed to the Arduino header are also configured as
JTAG/SWD signals by default and are used by the OpenSDAv2 debug
interface.  Therefore, a PRESERVE_JTAG_IO_PINS config option was created
for the FRDM-K64 platform to prevent the default pin settings from
re-configuring these pins.

The K64 MCU separates pin configuration and control, implemented in the
pinmux driver, from GPIO.  This results in some cross referencing
between the K64 GPIO driver and the K64 pinmux driver due to the
dependencies of one on the other.

This pinmux driver also uses the expanded pinmux function/mode parameter
size to describe pin configuration options with bit fields for the K64,
including up to 8 pin functions, plus interrupt, pullup/down, drive
strength, open-drain and slew rate.

The following GCC warnings in the K64 pinmux driver are prevented when not
compiling with 'no-optimization' (-O0):

warning: 'gpio_dev' may be used uninitialized in this function
[-Wmaybe-uninitialized]

Change-Id: Ie5031d18750143bf895883058b3cd55fd9989fd3
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
This commit is contained in:
Jeff Blais 2016-02-01 17:30:48 -05:00 committed by Gerrit Code Review
commit 52b499fd1f
10 changed files with 973 additions and 43 deletions

View file

@ -154,6 +154,9 @@ endif
config GPIO
def_bool y
config PINMUX
def_bool y
if GPIO
config GPIO_K64
@ -176,34 +179,66 @@ config GPIO_K64_E
endif
if GPIO_K64
config PORT_K64_BASE_ADDR
default 0x40049000
endif
if GPIO_K64_A
config GPIO_K64_A_BASE_ADDR
default 0x400FF000
endif
default 0x400FF000
config PORT_K64_A_BASE_ADDR
default 0x40049000
if GPIO_K64_B
config GPIO_K64_B_BASE_ADDR
default 0x400FF040
endif
default 0x400FF040
config PORT_K64_B_BASE_ADDR
default 0x4004A000
if GPIO_K64_C
config GPIO_K64_C_BASE_ADDR
default 0x400FF080
endif
default 0x400FF080
config PORT_K64_C_BASE_ADDR
default 0x4004B000
if GPIO_K64_D
config GPIO_K64_D_BASE_ADDR
default 0x400FF0C0
endif
default 0x400FF0C0
config PORT_K64_D_BASE_ADDR
default 0x4004C000
if GPIO_K64_E
config GPIO_K64_E_BASE_ADDR
default 0x400FF100
endif
default 0x400FF100
config PORT_K64_E_BASE_ADDR
default 0x4004D000
if PINMUX
config PINMUX_K64
def_bool y
config PINMUX_BASE
default 0x00000000
config PINMUX_NUM_PINS
default 160
config PINMUX_K64_GPIO_A_NAME
default GPIO_K64_A_DEV_NAME
config PINMUX_K64_GPIO_B_NAME
default GPIO_K64_B_DEV_NAME
config PINMUX_K64_GPIO_C_NAME
default GPIO_K64_C_DEV_NAME
config PINMUX_K64_GPIO_D_NAME
default GPIO_K64_D_DEV_NAME
config PINMUX_K64_GPIO_E_NAME
default GPIO_K64_E_DEV_NAME
config PRESERVE_JTAG_IO_PINS
bool "Freescale FRDM-K64F JTAG pin usage"
depends on PINMUX
default y
help
The FRDM-K64F board routes the PTA0/1/2 pins as JTAG/SWD signals that
are used for the OpenSDAv2 debug interface. These pins are also routed to
the Arduino header as D8, D3 and D5, respectively.
Enable this option to preserve these pins for the debug interface.
endif #PINMUX
endif