ethernet: Rename ksdk to mcux
Renames the ksdk ethernet shim driver to mcux. Change-Id: Ief03eabe4ce39be0d0896543c1cb660ff380b439 Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
8765fbaa5a
commit
40f5de5a56
|
@ -65,7 +65,7 @@ endif # SPI
|
|||
|
||||
if NET_L2_ETHERNET
|
||||
|
||||
config ETH_KSDK
|
||||
config ETH_MCUX
|
||||
def_bool y
|
||||
|
||||
endif # NET_L2_ETHERNET
|
||||
|
|
|
@ -142,7 +142,7 @@ static ALWAYS_INLINE void clkInit(void)
|
|||
|
||||
CLOCK_SetSimConfig(&simConfig);
|
||||
|
||||
#if CONFIG_ETH_KSDK
|
||||
#if CONFIG_ETH_MCUX
|
||||
CLOCK_SetEnetTime0Clock(TIMESRC_OSCERCLK);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ endif # SPI
|
|||
|
||||
if NET_L2_ETHERNET
|
||||
|
||||
config ETH_KSDK_0
|
||||
config ETH_MCUX_0
|
||||
def_bool y
|
||||
|
||||
endif # NET_L2_ETHERNET
|
||||
|
|
|
@ -75,7 +75,7 @@ static int frdm_k64f_pinmux_init(struct device *dev)
|
|||
| PORT_PCR_ODE_MASK);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ETH_KSDK_0
|
||||
#if CONFIG_ETH_MCUX_0
|
||||
pinmux_pin_set(porta, 5, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
pinmux_pin_set(porta, 12, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
pinmux_pin_set(porta, 13, PORT_PCR_MUX(kPORT_MuxAlt4));
|
||||
|
|
|
@ -208,7 +208,7 @@ endif # SPI
|
|||
|
||||
if ETHERNET
|
||||
|
||||
config ETH_KSDK_0
|
||||
config ETH_MCUX_0
|
||||
def_bool y
|
||||
|
||||
endif # ETHERNET
|
||||
|
|
|
@ -44,7 +44,7 @@ config ETH_INIT_PRIORITY
|
|||
so that it can start before the networking sub-system.
|
||||
|
||||
source "drivers/ethernet/Kconfig.enc28j60"
|
||||
source "drivers/ethernet/Kconfig.ksdk"
|
||||
source "drivers/ethernet/Kconfig.mcux"
|
||||
source "drivers/ethernet/Kconfig.dw"
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Kconfig - ETH_KSDK Ethernet driver configuration options
|
||||
# Kconfig - ETH_MCUX Ethernet driver configuration options
|
||||
|
||||
# Copyright (c) 2016 ARM Ltd
|
||||
#
|
||||
|
@ -14,75 +14,75 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
menuconfig ETH_KSDK
|
||||
menuconfig ETH_MCUX
|
||||
bool
|
||||
prompt "KSDK Ethernet driver"
|
||||
depends on NET_L2_ETHERNET && HAS_KSDK
|
||||
prompt "MCUX Ethernet driver"
|
||||
depends on NET_L2_ETHERNET && HAS_MCUX
|
||||
default n
|
||||
help
|
||||
Enable KSDK Ethernet driver. Note, this driver performs one shot PHY
|
||||
Enable MCUX Ethernet driver. Note, this driver performs one shot PHY
|
||||
setup. There is no support for PHY disconnect, reconnect or
|
||||
configuration change.
|
||||
|
||||
if ETH_KSDK
|
||||
config ETH_KSDK_RX_BUFFERS
|
||||
int "Number of KSDK RX buffers"
|
||||
depends on ETH_KSDK
|
||||
if ETH_MCUX
|
||||
config ETH_MCUX_RX_BUFFERS
|
||||
int "Number of MCUX RX buffers"
|
||||
depends on ETH_MCUX
|
||||
default 2
|
||||
range 1 16
|
||||
help
|
||||
Set the number of RX buffers provided to the KSDK driver.
|
||||
Set the number of RX buffers provided to the MCUX driver.
|
||||
|
||||
config ETH_KSDK_TX_BUFFERS
|
||||
int "Number of KSDK TX buffers"
|
||||
depends on ETH_KSDK
|
||||
config ETH_MCUX_TX_BUFFERS
|
||||
int "Number of MCUX TX buffers"
|
||||
depends on ETH_MCUX
|
||||
default 2
|
||||
range 1 16
|
||||
help
|
||||
Set the number of TX buffers provided to the KSDK driver.
|
||||
Set the number of TX buffers provided to the MCUX driver.
|
||||
|
||||
config ETH_KSDK_0
|
||||
bool "KSDK Ethernet port 0"
|
||||
config ETH_MCUX_0
|
||||
bool "MCUX Ethernet port 0"
|
||||
default n
|
||||
help
|
||||
Include port 0 driver
|
||||
|
||||
config ETH_KSDK_0_NAME
|
||||
config ETH_MCUX_0_NAME
|
||||
string "Driver name"
|
||||
depends on ETH_KSDK_0
|
||||
depends on ETH_MCUX_0
|
||||
default "ETH_0"
|
||||
|
||||
config ETH_KSDK_0_IRQ_PRI
|
||||
config ETH_MCUX_0_IRQ_PRI
|
||||
int "Controller interrupt priority"
|
||||
depends on ETH_KSDK_0
|
||||
depends on ETH_MCUX_0
|
||||
default 0
|
||||
help
|
||||
IRQ priority
|
||||
|
||||
config ETH_KSDK_0_RANDOM_MAC
|
||||
config ETH_MCUX_0_RANDOM_MAC
|
||||
bool "Random MAC address"
|
||||
depends on ETH_KSDK_0 && RANDOM_GENERATOR
|
||||
depends on ETH_MCUX_0 && RANDOM_GENERATOR
|
||||
default y
|
||||
help
|
||||
Generate a random MAC address dynamically.
|
||||
|
||||
if ETH_KSDK_0 && ! ETH_KSDK_0_RANDOM_MAC
|
||||
if ETH_MCUX_0 && ! ETH_MCUX_0_RANDOM_MAC
|
||||
|
||||
config ETH_KSDK_0_MAC3
|
||||
config ETH_MCUX_0_MAC3
|
||||
hex "MAC Address Byte 3"
|
||||
default 0
|
||||
range 0 ff
|
||||
help
|
||||
This is the byte 3 of the MAC address.
|
||||
|
||||
config ETH_KSDK_0_MAC4
|
||||
config ETH_MCUX_0_MAC4
|
||||
hex "MAC Address Byte 4"
|
||||
default 0
|
||||
range 0 ff
|
||||
help
|
||||
This is the byte 4 of the MAC address.
|
||||
|
||||
config ETH_KSDK_0_MAC5
|
||||
config ETH_MCUX_0_MAC5
|
||||
hex "MAC Address Byte 5"
|
||||
default 0
|
||||
range 0 ff
|
|
@ -1,5 +1,5 @@
|
|||
ccflags-y += -I${srctree}
|
||||
|
||||
obj-$(CONFIG_ETH_DW) += eth_dw.o
|
||||
obj-$(CONFIG_ETH_KSDK) += eth_ksdk.o
|
||||
obj-$(CONFIG_ETH_ENC28J60) += eth_enc28j60.o
|
||||
obj-$(CONFIG_ETH_MCUX) += eth_mcux.o
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* KSDK Ethernet Driver
|
||||
/* MCUX Ethernet Driver
|
||||
*
|
||||
* Copyright (c) 2016 ARM Ltd
|
||||
* Copyright (c) 2016 Linaro Ltd
|
||||
|
@ -18,14 +18,14 @@
|
|||
|
||||
/* The driver performs one shot PHY setup. There is no support for
|
||||
* PHY disconnect, reconnect or configuration change. The PHY setup,
|
||||
* implemented via KSDK contains polled code that can block the
|
||||
* implemented via MCUX contains polled code that can block the
|
||||
* initialization thread for a few seconds.
|
||||
*
|
||||
* There is no statistics collection for either normal operation or
|
||||
* error behaviour.
|
||||
*/
|
||||
|
||||
#define SYS_LOG_DOMAIN "dev/eth_ksdk"
|
||||
#define SYS_LOG_DOMAIN "dev/eth_mcux"
|
||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_DEBUG
|
||||
#include <logging/sys_log.h>
|
||||
|
||||
|
@ -46,14 +46,14 @@ struct eth_context {
|
|||
struct k_sem tx_buf_sem;
|
||||
uint8_t mac_addr[6];
|
||||
/* TODO: FIXME. This Ethernet frame sized buffer is used for
|
||||
* interfacing with KSDK. How it works is that hardware uses
|
||||
* interfacing with MCUX. How it works is that hardware uses
|
||||
* DMA scatter buffers to receive a frame, and then public
|
||||
* KSDK call gathers them into this buffer (there's no other
|
||||
* MCUX call gathers them into this buffer (there's no other
|
||||
* public interface). All this happens only for this driver
|
||||
* to scatter this buffer again into Zephyr fragment buffers.
|
||||
* This is not efficient, but proper resolution of this issue
|
||||
* depends on introduction of zero-copy networking support
|
||||
* in Zephyr, and adding needed interface to KSDK (or
|
||||
* in Zephyr, and adding needed interface to MCUX (or
|
||||
* bypassing it and writing a more complex driver working
|
||||
* directly with hardware).
|
||||
*/
|
||||
|
@ -63,22 +63,22 @@ struct eth_context {
|
|||
static void eth_0_config_func(void);
|
||||
|
||||
static enet_rx_bd_struct_t __aligned(ENET_BUFF_ALIGNMENT)
|
||||
rx_buffer_desc[CONFIG_ETH_KSDK_TX_BUFFERS];
|
||||
rx_buffer_desc[CONFIG_ETH_MCUX_TX_BUFFERS];
|
||||
|
||||
static enet_tx_bd_struct_t __aligned(ENET_BUFF_ALIGNMENT)
|
||||
tx_buffer_desc[CONFIG_ETH_KSDK_TX_BUFFERS];
|
||||
tx_buffer_desc[CONFIG_ETH_MCUX_TX_BUFFERS];
|
||||
|
||||
/* Use ENET_FRAME_MAX_VALNFRAMELEN for VLAN frame size
|
||||
* Use ENET_FRAME_MAX_FRAMELEN for ethernet frame size
|
||||
*/
|
||||
#define ETH_KSDK_BUFFER_SIZE \
|
||||
#define ETH_MCUX_BUFFER_SIZE \
|
||||
ROUND_UP(ENET_FRAME_MAX_VALNFRAMELEN, ENET_BUFF_ALIGNMENT)
|
||||
|
||||
static uint8_t __aligned(ENET_BUFF_ALIGNMENT)
|
||||
rx_buffer[CONFIG_ETH_KSDK_RX_BUFFERS][ETH_KSDK_BUFFER_SIZE];
|
||||
rx_buffer[CONFIG_ETH_MCUX_RX_BUFFERS][ETH_MCUX_BUFFER_SIZE];
|
||||
|
||||
static uint8_t __aligned(ENET_BUFF_ALIGNMENT)
|
||||
tx_buffer[CONFIG_ETH_KSDK_TX_BUFFERS][ETH_KSDK_BUFFER_SIZE];
|
||||
tx_buffer[CONFIG_ETH_MCUX_TX_BUFFERS][ETH_MCUX_BUFFER_SIZE];
|
||||
|
||||
static int eth_tx(struct net_if *iface, struct net_buf *buf)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ static int eth_tx(struct net_if *iface, struct net_buf *buf)
|
|||
imask = irq_lock();
|
||||
|
||||
/* Gather fragment buffers into flat Ethernet frame buffer
|
||||
* which can be fed to KSDK Ethernet functions. First
|
||||
* which can be fed to MCUX Ethernet functions. First
|
||||
* fragment is special - it contains link layer (Ethernet
|
||||
* in our case) headers and must be treated specially.
|
||||
*/
|
||||
|
@ -256,7 +256,7 @@ static void eth_callback(ENET_Type *base, enet_handle_t *handle,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ETH_KSDK_0_RANDOM_MAC)
|
||||
#if defined(CONFIG_ETH_MCUX_0_RANDOM_MAC)
|
||||
static void generate_mac(uint8_t *mac_addr)
|
||||
{
|
||||
uint32_t entropy;
|
||||
|
@ -279,10 +279,10 @@ static int eth_0_init(struct device *dev)
|
|||
bool link;
|
||||
status_t status;
|
||||
enet_buffer_config_t buffer_config = {
|
||||
.rxBdNumber = CONFIG_ETH_KSDK_RX_BUFFERS,
|
||||
.txBdNumber = CONFIG_ETH_KSDK_TX_BUFFERS,
|
||||
.rxBuffSizeAlign = ETH_KSDK_BUFFER_SIZE,
|
||||
.txBuffSizeAlign = ETH_KSDK_BUFFER_SIZE,
|
||||
.rxBdNumber = CONFIG_ETH_MCUX_RX_BUFFERS,
|
||||
.txBdNumber = CONFIG_ETH_MCUX_TX_BUFFERS,
|
||||
.rxBuffSizeAlign = ETH_MCUX_BUFFER_SIZE,
|
||||
.txBuffSizeAlign = ETH_MCUX_BUFFER_SIZE,
|
||||
.rxBdStartAddrAlign = rx_buffer_desc,
|
||||
.txBdStartAddrAlign = tx_buffer_desc,
|
||||
.rxBufferAlign = rx_buffer[0],
|
||||
|
@ -290,7 +290,7 @@ static int eth_0_init(struct device *dev)
|
|||
};
|
||||
|
||||
k_sem_init(&context->tx_buf_sem,
|
||||
CONFIG_ETH_KSDK_TX_BUFFERS, CONFIG_ETH_KSDK_TX_BUFFERS);
|
||||
CONFIG_ETH_MCUX_TX_BUFFERS, CONFIG_ETH_MCUX_TX_BUFFERS);
|
||||
|
||||
sys_clock = CLOCK_GetFreq(kCLOCK_CoreSysClk);
|
||||
|
||||
|
@ -320,7 +320,7 @@ static int eth_0_init(struct device *dev)
|
|||
SYS_LOG_INF("Link down.");
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ETH_KSDK_0_RANDOM_MAC)
|
||||
#if defined(CONFIG_ETH_MCUX_0_RANDOM_MAC)
|
||||
generate_mac(context->mac_addr);
|
||||
#endif
|
||||
|
||||
|
@ -357,7 +357,7 @@ static struct net_if_api api_funcs_0 = {
|
|||
.send = eth_tx,
|
||||
};
|
||||
|
||||
static void eth_ksdk_rx_isr(void *p)
|
||||
static void eth_mcux_rx_isr(void *p)
|
||||
{
|
||||
struct device *dev = p;
|
||||
struct eth_context *context = dev->driver_data;
|
||||
|
@ -365,7 +365,7 @@ static void eth_ksdk_rx_isr(void *p)
|
|||
ENET_ReceiveIRQHandler(ENET, &context->enet_handle);
|
||||
}
|
||||
|
||||
static void eth_ksdk_tx_isr(void *p)
|
||||
static void eth_mcux_tx_isr(void *p)
|
||||
{
|
||||
struct device *dev = p;
|
||||
struct eth_context *context = dev->driver_data;
|
||||
|
@ -373,7 +373,7 @@ static void eth_ksdk_tx_isr(void *p)
|
|||
ENET_TransmitIRQHandler(ENET, &context->enet_handle);
|
||||
}
|
||||
|
||||
static void eth_ksdk_error_isr(void *p)
|
||||
static void eth_mcux_error_isr(void *p)
|
||||
{
|
||||
struct device *dev = p;
|
||||
struct eth_context *context = dev->driver_data;
|
||||
|
@ -387,30 +387,30 @@ static struct eth_context eth_0_context = {
|
|||
0x00,
|
||||
0x04,
|
||||
0x9f,
|
||||
#if !defined(CONFIG_ETH_KSDK_0_RANDOM_MAC)
|
||||
CONFIG_ETH_KSDK_0_MAC3,
|
||||
CONFIG_ETH_KSDK_0_MAC4,
|
||||
CONFIG_ETH_KSDK_0_MAC5
|
||||
#if !defined(CONFIG_ETH_MCUX_0_RANDOM_MAC)
|
||||
CONFIG_ETH_MCUX_0_MAC3,
|
||||
CONFIG_ETH_MCUX_0_MAC4,
|
||||
CONFIG_ETH_MCUX_0_MAC5
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
NET_DEVICE_INIT(eth_ksdk_0, CONFIG_ETH_KSDK_0_NAME,
|
||||
NET_DEVICE_INIT(eth_mcux_0, CONFIG_ETH_MCUX_0_NAME,
|
||||
eth_0_init, ð_0_context,
|
||||
NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs_0,
|
||||
ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), 1500);
|
||||
|
||||
static void eth_0_config_func(void)
|
||||
{
|
||||
IRQ_CONNECT(IRQ_ETH_RX, CONFIG_ETH_KSDK_0_IRQ_PRI,
|
||||
eth_ksdk_rx_isr, DEVICE_GET(eth_ksdk_0), 0);
|
||||
IRQ_CONNECT(IRQ_ETH_RX, CONFIG_ETH_MCUX_0_IRQ_PRI,
|
||||
eth_mcux_rx_isr, DEVICE_GET(eth_mcux_0), 0);
|
||||
irq_enable(IRQ_ETH_RX);
|
||||
|
||||
IRQ_CONNECT(IRQ_ETH_TX, CONFIG_ETH_KSDK_0_IRQ_PRI,
|
||||
eth_ksdk_tx_isr, DEVICE_GET(eth_ksdk_0), 0);
|
||||
IRQ_CONNECT(IRQ_ETH_TX, CONFIG_ETH_MCUX_0_IRQ_PRI,
|
||||
eth_mcux_tx_isr, DEVICE_GET(eth_mcux_0), 0);
|
||||
irq_enable(IRQ_ETH_TX);
|
||||
|
||||
IRQ_CONNECT(IRQ_ETH_ERR_MISC, CONFIG_ETH_KSDK_0_IRQ_PRI,
|
||||
eth_ksdk_error_isr, DEVICE_GET(eth_ksdk_0), 0);
|
||||
IRQ_CONNECT(IRQ_ETH_ERR_MISC, CONFIG_ETH_MCUX_0_IRQ_PRI,
|
||||
eth_mcux_error_isr, DEVICE_GET(eth_mcux_0), 0);
|
||||
irq_enable(IRQ_ETH_ERR_MISC);
|
||||
}
|
|
@ -90,7 +90,7 @@ static const struct pin_config mux_config[] = {
|
|||
{ K64_PIN_PTC11, K64_PINMUX_FUNC_ANALOG }, /* ADC1_SE7b/Analog In 4 */
|
||||
{ K64_PIN_PTC10, K64_PINMUX_FUNC_ANALOG }, /* ADC1_SE6b/Analog In 5 */
|
||||
|
||||
#if CONFIG_ETH_KSDK_0
|
||||
#if CONFIG_ETH_MCUX_0
|
||||
{ K64_PIN_PTA5, K64_PINMUX_FUNC_ETHERNET},
|
||||
{ K64_PIN_PTA12, K64_PINMUX_FUNC_ETHERNET},
|
||||
{ K64_PIN_PTA13, K64_PINMUX_FUNC_ETHERNET},
|
||||
|
|
|
@ -21,7 +21,7 @@ MCUX_DEVICE = $(shell echo $(CONFIG_SOC) | tr '[:lower:]' '[:upper:]')
|
|||
MCUX_CPU = CPU_$(subst $(DQUOTE),,$(CONFIG_SOC_PART_NUMBER))
|
||||
|
||||
ifdef CONFIG_HAS_MCUX
|
||||
ifdef CONFIG_ETH_KSDK
|
||||
ifdef CONFIG_ETH_MCUX
|
||||
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/nxp/mcux/components/phyksz8081
|
||||
endif
|
||||
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/nxp/mcux/devices/$(MCUX_DEVICE)
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_ETH_KSDK) += phyksz8081/fsl_phy.o
|
||||
obj-$(CONFIG_ETH_MCUX) += phyksz8081/fsl_phy.o
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
obj-$(CONFIG_ETH_KSDK) += fsl_enet.o
|
||||
obj-$(CONFIG_ETH_MCUX) += fsl_enet.o
|
||||
obj-$(CONFIG_I2C_KSDK) += fsl_i2c.o
|
||||
obj-$(CONFIG_RANDOM_KSDK) += fsl_rnga.o
|
||||
obj-$(CONFIG_SOC_FLASH_KSDK) += fsl_flash.o
|
||||
|
|
Loading…
Reference in a new issue