From fe4790ec18de6dc5553aa0150718a461e461cf00 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Mon, 10 Sep 2018 11:56:52 +0000 Subject: [PATCH] Merged in sur5r/nuttx-nuttx/lpc43_eth_pins (pull request #717) arch/arm/src/lpc43xx: Fix ethernet TX_EN pin definitions TX_EN on LPC43xx can be routed via P0.1 and PC.4 in both MII and RMII mode. Before, P0.1 was hardcoded for MII and PC.4 was hardcoded for RMII. Also, the definitions used inconsistent naming (TXEN vs. TX_EN). Approved-by: GregoryN --- arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h | 4 ++-- arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h | 4 ++-- arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h | 4 ++-- arch/arm/src/lpc43xx/lpc43_ethernet.c | 2 +- configs/bambino-200e/include/board.h | 1 + configs/lpc4330-xplorer/include/board.h | 1 + 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h index 0139dfa420..e3aba44dcd 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h @@ -298,9 +298,9 @@ #define PINCONF_ENET_TXD2_2 (PINCONF_FUNC5|PINCONF_SLEW_FAST|PINCONF_PINS9|PINCONF_PIN_4) #define PINCONF_ENET_TXD3_1 (PINCONF_FUNC3|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_3) #define PINCONF_ENET_TXD3_2 (PINCONF_FUNC5|PINCONF_SLEW_FAST|PINCONF_PINS9|PINCONF_PIN_5) -#define PINCONF_ENET_TXEN (PINCONF_FUNC6|PINCONF_SLEW_FAST|PINCONF_PINS0|PINCONF_PIN_1) #define PINCONF_ENET_TX_CLK (PINCONF_FUNC0|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_19) -#define PINCONF_ENET_TX_EN (PINCONF_FUNC3|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_ENET_TX_EN_1 (PINCONF_FUNC6|PINCONF_SLEW_FAST|PINCONF_PINS0|PINCONF_PIN_1) +#define PINCONF_ENET_TX_EN_2 (PINCONF_FUNC3|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) #define PINCONF_ENET_TX_ER_1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_5) #define PINCONF_ENET_TX_ER_2 (PINCONF_FUNC6|PINCONF_INBUFFER|PINCONF_GLITCH|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_14) diff --git a/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h index db66b779ad..9c43d1bdcb 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4337jet100_pinconfig.h @@ -299,9 +299,9 @@ #define PINCONF_ENET_TXD2_2 (PINCONF_FUNC5|PINCONF_PINS9|PINCONF_PIN_4) #define PINCONF_ENET_TXD3_1 (PINCONF_FUNC3|PINCONF_PINSC|PINCONF_PIN_3) #define PINCONF_ENET_TXD3_2 (PINCONF_FUNC5|PINCONF_PINS9|PINCONF_PIN_5) -#define PINCONF_ENET_TXEN (PINCONF_FUNC6|PINCONF_PINS0|PINCONF_PIN_1|PINCONF_FLOAT|PINCONF_GLITCH) #define PINCONF_ENET_TX_CLK (PINCONF_FUNC0|PINCONF_PINS1|PINCONF_PIN_19) -#define PINCONF_ENET_TX_EN (PINCONF_FUNC3|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_ENET_TX_EN_1 (PINCONF_FUNC6|PINCONF_PINS0|PINCONF_PIN_1|PINCONF_FLOAT|PINCONF_GLITCH) +#define PINCONF_ENET_TX_EN_2 (PINCONF_FUNC3|PINCONF_PINSC|PINCONF_PIN_4) #define PINCONF_ENET_TX_ER_1 (PINCONF_FUNC3|PINCONF_PINSC|PINCONF_PIN_5) #define PINCONF_ENET_TX_ER_2 (PINCONF_FUNC6|PINCONF_PINSC|PINCONF_PIN_14) diff --git a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h index ad3a401d20..ad33ee9587 100644 --- a/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h +++ b/arch/arm/src/lpc43xx/chip/lpc4357fet256_pinconfig.h @@ -298,9 +298,9 @@ #define PINCONF_ENET_TXD2_2 (PINCONF_FUNC5|PINCONF_SLEW_FAST|PINCONF_PINS9|PINCONF_PIN_4) #define PINCONF_ENET_TXD3_1 (PINCONF_FUNC3|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_3) #define PINCONF_ENET_TXD3_2 (PINCONF_FUNC5|PINCONF_SLEW_FAST|PINCONF_PINS9|PINCONF_PIN_5) -#define PINCONF_ENET_TXEN (PINCONF_FUNC6|PINCONF_SLEW_FAST|PINCONF_PINS0|PINCONF_PIN_1) #define PINCONF_ENET_TX_CLK (PINCONF_FUNC0|PINCONF_INBUFFER|PINCONF_SLEW_FAST|PINCONF_PINS1|PINCONF_PIN_19) -#define PINCONF_ENET_TX_EN (PINCONF_FUNC3|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) +#define PINCONF_ENET_TX_EN_1 (PINCONF_FUNC6|PINCONF_SLEW_FAST|PINCONF_PINS0|PINCONF_PIN_1) +#define PINCONF_ENET_TX_EN_2 (PINCONF_FUNC3|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_4) #define PINCONF_ENET_TX_ER_1 (PINCONF_FUNC3|PINCONF_INBUFFER|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_5) #define PINCONF_ENET_TX_ER_2 (PINCONF_FUNC6|PINCONF_INBUFFER|PINCONF_SLEW_FAST|PINCONF_PINSC|PINCONF_PIN_14) diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 69473f03bc..23205cb77c 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -3386,7 +3386,7 @@ static inline void lpc43_ethgpioconfig(FAR struct lpc43_ethmac_s *priv) lpc43_pin_config(PINCONF_ENET_RXD1); lpc43_pin_config(PINCONF_ENET_TXD0); lpc43_pin_config(PINCONF_ENET_TXD1); - lpc43_pin_config(PINCONF_ENET_TXEN); + lpc43_pin_config(PINCONF_ENET_TX_EN); #ifdef PINCONF_ENET_RESET lpc43_pin_config(PINCONF_ENET_RESET); diff --git a/configs/bambino-200e/include/board.h b/configs/bambino-200e/include/board.h index 5b6d91a88a..7c4030a149 100644 --- a/configs/bambino-200e/include/board.h +++ b/configs/bambino-200e/include/board.h @@ -387,6 +387,7 @@ #define PINCONF_ENET_RESET PINCONF_GPIO0p4 #define GPIO_ENET_RESET (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN4) #define PINCONF_ENET_MDC PINCONF_ENET_MDC_3 +#define PINCONF_ENET_TX_EN PINCONF_ENET_TX_EN_1 /* SD/MMC pinout */ diff --git a/configs/lpc4330-xplorer/include/board.h b/configs/lpc4330-xplorer/include/board.h index 48b6c4da33..513adb5ff2 100644 --- a/configs/lpc4330-xplorer/include/board.h +++ b/configs/lpc4330-xplorer/include/board.h @@ -315,5 +315,6 @@ #define PINCONF_ENET_RESET PINCONF_GPIO0p4 #define GPIO_ENET_RESET (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN4) #define PINCONF_ENET_MDC PINCONF_ENET_MDC_3 +#define PINCONF_ENET_TX_EN PINCONF_ENET_TX_EN_1 #endif /* __ARCH_BOARD_BOARD_H */