1 #ifndef CYGONCE_DEVS_MOAB_ETH_INL
2 #define CYGONCE_DEVS_MOAB_ETH_INL
3 //==========================================================================
7 // Hardware specifics for TAMS MOAB ethernet support
9 //==========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 // Copyright (C) 2003 Gary Thomas
16 // eCos is free software; you can redistribute it and/or modify it under
17 // the terms of the GNU General Public License as published by the Free
18 // Software Foundation; either version 2 or (at your option) any later version.
20 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 // You should have received a copy of the GNU General Public License along
26 // with eCos; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 // As a special exception, if other files instantiate templates or use macros
30 // or inline functions from this file, or you compile this file and link it
31 // with other works to produce a work based on this file, this file does not
32 // by itself cause the resulting work to be covered by the GNU General Public
33 // License. However the source code for this file must still be made available
34 // in accordance with section (3) of the GNU General Public License.
36 // This exception does not invalidate any other reasons why a work based on
37 // this file might be covered by the GNU General Public License.
39 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40 // at http://sources.redhat.com/ecos/ecos-license/
41 // -------------------------------------------
42 //####ECOSGPLCOPYRIGHTEND####
43 //==========================================================================
44 //#####DESCRIPTIONBEGIN####
47 // Contributors: gthomas
52 //####DESCRIPTIONEND####
54 //==========================================================================
56 #include CYGDAT_DEVS_PPC405_ETH_CDL
58 #ifdef CYGHWR_DEVS_ETH_POWERPC_MOAB_ETH0
59 ETH_PHY_REG_LEVEL_ACCESS_FUNS(eth0_phy,
62 ppc405_eth_phy_put_reg,
63 ppc405_eth_phy_get_reg);
65 // Align buffers on a cache boundary
66 #define RxBUFSIZE CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
67 #define TxBUFSIZE CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
68 static unsigned char ppc405_eth_rxbufs[RxBUFSIZE] __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
69 static unsigned char ppc405_eth_txbufs[TxBUFSIZE] __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
70 static mal_bd_t ppc405_eth_rxbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM] __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
71 static mal_bd_t ppc405_eth_txbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM] __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
73 extern char _moab_eth0_ESA[];
74 static struct ppc405_eth_info ppc405_eth0_info = {
75 0, // Interrupt vector
78 CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM, // Number of Rx buffers
79 ppc405_eth_rxbufs, // Rx buffer space
80 ppc405_eth_rxbd, // Rx buffer headers
81 CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM, // Number of Tx buffers
82 ppc405_eth_txbufs, // Tx buffer space
83 ppc405_eth_txbd, // Tx buffer headers
84 ð0_phy, // PHY access routines
87 ETH_DRV_SC(ppc405_eth0_sc,
88 &ppc405_eth0_info, // Driver specific data
89 "eth0", // Name for this interface
98 ppc405_eth_int_vector);
100 NETDEVTAB_ENTRY(ppc405_netdev,
105 #ifdef CYGPKG_REDBOOT
106 #include <pkgconf/redboot.h>
107 #ifdef CYGSEM_REDBOOT_FLASH_CONFIG
109 #include <flash_config.h>
110 RedBoot_config_option("eth0 network hardware address [MAC]",
112 ALWAYS_ENABLED, true,
113 CONFIG_ESA, _moab_eth0_ESA
115 #endif // CYGSEM_REDBOOT_FLASH_CONFIG
116 #endif // CYGPKG_REDBOOT
118 #endif // CYGHWR_DEVS_ETH_POWERPC_MOAB_ETH0
120 #endif // CYGONCE_DEVS_MOAB_ETH_INL
121 // ------------------------------------------------------------------------