source: rtems/c/src/lib/libbsp/arm/lpc24xx/include/lpc-ethernet-config.h @ d74ed4a

4.115
Last change on this file since d74ed4a was d74ed4a, checked in by Sebastian Huber <sebastian.huber@…>, on May 19, 2011 at 12:30:00 PM

2011-05-19 Sebastian Huber <sebastian.huber@…>

  • i2c/i2c-config.c: New file.
  • include/lcd.h: Removed EMC definitions.
  • misc/dma.c: Fixed initialization.
  • include/i2c.h, include/io.h, include/lpc-ethernet-config.h, include/lpc24xx.h, console/console-config.c, i2c/i2c.c, misc/io.c, misc/lcd.c, startup/bspstart.c, startup/bspstarthooks.c: New pin configuration API.
  • Makefile.am, preinstall.am: Update.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc24xx
5 *
6 * @brief Ethernet driver configuration.
7 */
8
9/*
10 * Copyright (c) 2009-2011 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Obere Lagerstr. 30
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.com/license/LICENSE.
21 */
22
23#ifndef LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
24#define LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
25
26#include <bsp.h>
27#include <bsp/io.h>
28#include <bsp/lpc24xx.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
34#define LPC_ETH_CONFIG_INTERRUPT LPC24XX_IRQ_ETHERNET
35
36#define LPC_ETH_CONFIG_REG_BASE MAC_BASE_ADDR
37
38#define LPC_ETH_CONFIG_RX_UNIT_COUNT_DEFAULT 16
39#define LPC_ETH_CONFIG_RX_UNIT_COUNT_MAX 54
40
41#define LPC_ETH_CONFIG_TX_UNIT_COUNT_DEFAULT 10
42#define LPC_ETH_CONFIG_TX_UNIT_COUNT_MAX 10
43
44#define LPC_ETH_CONFIG_UNIT_MULTIPLE 1U
45
46#ifdef LPC24XX_ETHERNET_RMII
47  #define LPC_ETH_CONFIG_RMII
48
49  static void lpc_eth_config_module_enable(void)
50  {
51    static const lpc24xx_pin_range pins [] = {
52      LPC24XX_PIN_ETHERNET_RMII_0,
53      LPC24XX_PIN_ETHERNET_RMII_1,
54      LPC24XX_PIN_ETHERNET_RMII_2,
55      LPC24XX_PIN_ETHERNET_RMII_3,
56      LPC24XX_PIN_TERMINAL
57    };
58
59    lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
60    lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION);
61  }
62#else
63  static void lpc_eth_config_module_enable(void)
64  {
65    static const lpc24xx_pin_range pins [] = {
66      LPC24XX_PIN_ETHERNET_MII,
67      LPC24XX_PIN_TERMINAL
68    };
69
70    lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
71    lpc24xx_pin_config(&pins [0], LPC24XX_PIN_SET_FUNCTION);
72  }
73#endif
74
75#define LPC24XX_ETH_RAM_BEGIN 0x7fe00000U
76#define LPC24XX_ETH_RAM_SIZE (16U * 1024U)
77
78static char *lpc_eth_config_alloc_table_area(size_t size)
79{
80  if (size < LPC24XX_ETH_RAM_SIZE) {
81    return (char *) LPC24XX_ETH_RAM_BEGIN;
82  } else {
83    return NULL;
84  }
85}
86
87static void lpc_eth_config_free_table_area(char *table_area)
88{
89  /* Do nothing */
90}
91
92#ifdef __cplusplus
93}
94#endif /* __cplusplus */
95
96#endif /* LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H */
Note: See TracBrowser for help on using the repository browser.