36#ifndef LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
37#define LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
49#define LPC_ETH_CONFIG_INTERRUPT LPC24XX_IRQ_ETHERNET
51#define LPC_ETH_CONFIG_REG_BASE MAC_BASE_ADDR
53#ifdef ARM_MULTILIB_ARCH_V4
54 #define LPC_ETH_CONFIG_RX_UNIT_COUNT_DEFAULT 16
55 #define LPC_ETH_CONFIG_RX_UNIT_COUNT_MAX 54
57 #define LPC_ETH_CONFIG_TX_UNIT_COUNT_DEFAULT 10
58 #define LPC_ETH_CONFIG_TX_UNIT_COUNT_MAX 10
60 #define LPC_ETH_CONFIG_UNIT_MULTIPLE 1U
62 #define LPC24XX_ETH_RAM_BEGIN 0x7fe00000U
63 #define LPC24XX_ETH_RAM_SIZE (16U * 1024U)
65 #define LPC_ETH_CONFIG_RX_UNIT_COUNT_DEFAULT 16
66 #define LPC_ETH_CONFIG_RX_UNIT_COUNT_MAX INT_MAX
68 #define LPC_ETH_CONFIG_TX_UNIT_COUNT_DEFAULT 32
69 #define LPC_ETH_CONFIG_TX_UNIT_COUNT_MAX INT_MAX
71 #define LPC_ETH_CONFIG_UNIT_MULTIPLE 8U
73 #define LPC_ETH_CONFIG_USE_TRANSMIT_DMA
75 #define LPC24XX_ETH_RAM_BEGIN 0x20000000U
76 #define LPC24XX_ETH_RAM_SIZE (32U * 1024U)
79#ifdef LPC24XX_ETHERNET_RMII
80 #define LPC_ETH_CONFIG_RMII
82 static void lpc_eth_config_module_enable(
void)
85 #ifdef LPC24XX_PIN_ETHERNET_POWER_DOWN
86 LPC24XX_PIN_ETHERNET_POWER_DOWN,
88 LPC24XX_PIN_ETHERNET_RMII_0,
89 LPC24XX_PIN_ETHERNET_RMII_1,
90 LPC24XX_PIN_ETHERNET_RMII_2,
91 LPC24XX_PIN_ETHERNET_RMII_3,
95 lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
98 #ifdef LPC24XX_PIN_ETHERNET_POWER_DOWN
100 unsigned pin = lpc24xx_pin_get_first_index(&pins[0]);
102 lpc24xx_gpio_config(pin, LPC24XX_GPIO_OUTPUT);
103 lpc24xx_gpio_set(pin);
108 static void lpc_eth_config_module_enable(
void)
111 LPC24XX_PIN_ETHERNET_MII,
115 lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
120static void lpc_eth_config_module_disable(
void)
122 lpc24xx_module_disable(LPC24XX_MODULE_ETHERNET);
125static char *lpc_eth_config_alloc_table_area(
size_t size)
127 if (size < LPC24XX_ETH_RAM_SIZE) {
128 return (
char *) LPC24XX_ETH_RAM_BEGIN;
134static void lpc_eth_config_free_table_area(
char *table_area)
rtems_status_code lpc24xx_pin_config(const lpc24xx_pin_range *pins, lpc24xx_pin_action action)
Performs the action with the pins.
Definition: io.c:530
@ LPC24XX_PIN_SET_FUNCTION
Sets the pin function.
Definition: io.h:219