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

4.104.115
Last change on this file since 33785342 was 1d11028, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Mar 12, 2010 at 8:25:53 AM

Fixed IO configurations

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc24xx
5 *
6 * @brief Ethernet driver configuration.
7 */
8
9/*
10 * Copyright (c) 2009
11 * embedded brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * <rtems@embedded-brains.de>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.com/license/LICENSE.
20 */
21
22#ifndef LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
23#define LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H
24
25#include <bsp.h>
26#include <bsp/io.h>
27#include <bsp/lpc24xx.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
33#define LPC_ETH_CONFIG_INTERRUPT LPC24XX_IRQ_ETHERNET
34
35#define LPC_ETH_CONFIG_REG_BASE MAC_BASE_ADDR
36
37#define LPC_ETH_CONFIG_RX_UNIT_COUNT_DEFAULT 16
38#define LPC_ETH_CONFIG_RX_UNIT_COUNT_MAX 54
39
40#define LPC_ETH_CONFIG_TX_UNIT_COUNT_DEFAULT 10
41#define LPC_ETH_CONFIG_TX_UNIT_COUNT_MAX 10
42
43#define LPC_ETH_CONFIG_UNIT_MULTIPLE 1U
44
45#ifdef LPC24XX_ETHERNET_RMII
46  #define LPC_ETH_CONFIG_RMII
47
48  static void lpc_eth_config_module_enable(void)
49  {
50    lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
51    lpc24xx_io_config(LPC24XX_MODULE_ETHERNET, 1);
52  }
53#else
54  static void lpc_eth_config_module_enable(void)
55  {
56    lpc24xx_module_enable(LPC24XX_MODULE_ETHERNET, LPC24XX_MODULE_PCLK_DEFAULT);
57    lpc24xx_io_config(LPC24XX_MODULE_ETHERNET, 0);
58  }
59#endif
60
61#define LPC24XX_ETH_RAM_BEGIN 0x7fe00000U
62#define LPC24XX_ETH_RAM_SIZE (16U * 1024U)
63
64static char *lpc_eth_config_alloc_table_area(size_t size)
65{
66  if (size < LPC24XX_ETH_RAM_SIZE) {
67    return (char *) LPC24XX_ETH_RAM_BEGIN;
68  } else {
69    return NULL;
70  }
71}
72
73static void lpc_eth_config_free_table_area(char *table_area)
74{
75  /* Do nothing */
76}
77
78#ifdef __cplusplus
79}
80#endif /* __cplusplus */
81
82#endif /* LIBBSP_ARM_LPC24XX_LPC_ETHERNET_CONFIG_H */
Note: See TracBrowser for help on using the repository browser.