Commit cfe82b81 authored by Alexander Potashev's avatar Alexander Potashev
Browse files

RT75957. kinetis gpio: fix crash when trying to configure pins of PORT F

parent 65d91d4f
...@@ -445,7 +445,8 @@ static void gpio_init(void) ...@@ -445,7 +445,8 @@ static void gpio_init(void)
/* /*
* Configure GPIO pins using the `twr_k70f120m_gpio[]` table * Configure GPIO pins using the `twr_k70f120m_gpio[]` table
*/ */
kinetis_gpio_config_table(twr_k70f120m_gpio, ARRAY_SIZE(twr_k70f120m_gpio)); kinetis_gpio_config_table(
twr_k70f120m_gpio, ARRAY_SIZE(twr_k70f120m_gpio));
} }
/* /*
......
...@@ -50,13 +50,13 @@ struct kinetis_port_regs { ...@@ -50,13 +50,13 @@ struct kinetis_port_regs {
KINETIS_PORT_BASE(port)) KINETIS_PORT_BASE(port))
/* /*
* Clock gates for the I/O ports: 0..4 <-> A..E * Clock gates for the I/O ports: 0..5 <-> A..F
* *
* These values can be passed into the `kinetis_periph_enable()` function. * These values can be passed into the `kinetis_periph_enable()` function.
*/ */
static const kinetis_clock_gate_t port_clock_gate[] = { static const kinetis_clock_gate_t port_clock_gate[] = {
KINETIS_CG_PORTA, KINETIS_CG_PORTB, KINETIS_CG_PORTC, KINETIS_CG_PORTA, KINETIS_CG_PORTB, KINETIS_CG_PORTC,
KINETIS_CG_PORTD, KINETIS_CG_PORTE KINETIS_CG_PORTD, KINETIS_CG_PORTE, KINETIS_CG_PORTF,
}; };
/* /*
...@@ -70,7 +70,7 @@ static inline int kinetis_validate_gpio(const struct kinetis_gpio_dsc *dsc) ...@@ -70,7 +70,7 @@ static inline int kinetis_validate_gpio(const struct kinetis_gpio_dsc *dsc)
rv = 0; rv = 0;
/* /*
* A[31:0]; B[31:0]; C[31:0]; D[31:0]; E[31:0] * A[31:0]; B[31:0]; C[31:0]; D[31:0]; E[31:0]; optionally F[31:0]
*/ */
if (!dsc || dsc->port >= KINETIS_GPIO_PORTS || if (!dsc || dsc->port >= KINETIS_GPIO_PORTS ||
dsc->pin >= KINETIS_GPIO_PORT_PINS) { dsc->pin >= KINETIS_GPIO_PORT_PINS) {
......
...@@ -86,6 +86,7 @@ typedef u32 kinetis_clock_gate_t; ...@@ -86,6 +86,7 @@ typedef u32 kinetis_clock_gate_t;
#define KINETIS_CG_PORTC KINETIS_MKCG(4, 11) /* SIM_SCGC5[11] */ #define KINETIS_CG_PORTC KINETIS_MKCG(4, 11) /* SIM_SCGC5[11] */
#define KINETIS_CG_PORTD KINETIS_MKCG(4, 12) /* SIM_SCGC5[12] */ #define KINETIS_CG_PORTD KINETIS_MKCG(4, 12) /* SIM_SCGC5[12] */
#define KINETIS_CG_PORTE KINETIS_MKCG(4, 13) /* SIM_SCGC5[13] */ #define KINETIS_CG_PORTE KINETIS_MKCG(4, 13) /* SIM_SCGC5[13] */
#define KINETIS_CG_PORTF KINETIS_MKCG(4, 14) /* SIM_SCGC5[14] */
/* ENET */ /* ENET */
#define KINETIS_CG_ENET KINETIS_MKCG(1, 0) /* SIM_SCGC2[0] */ #define KINETIS_CG_ENET KINETIS_MKCG(1, 0) /* SIM_SCGC2[0] */
/* DDR */ /* DDR */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment