1 #ifndef CYGONCE_DEVS_ETH_PHYCORE229X_INL
2 #define CYGONCE_DEVS_ETH_PHYCORE229X_INL
3 //==========================================================================
5 // devs_eth_phycore_229x.inl
7 // phyCORE-LPC229x ethernet I/O definitions.
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) 2008 eCosCentric Limited
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 // -------------------------------------------
40 //####ECOSGPLCOPYRIGHTEND####
41 //==========================================================================
42 //#####DESCRIPTIONBEGIN####
44 // Author(s): Uwe Kindler
48 //####DESCRIPTIONEND####
49 //==========================================================================
52 //==========================================================================
54 //==========================================================================
55 #include <pkgconf/system.h>
56 #include <pkgconf/devs_eth_arm_phycore229x.h>
57 #include <cyg/hal/hal_intr.h>
60 #include <pkgconf/redboot.h>
61 #ifdef CYGSEM_REDBOOT_FLASH_CONFIG
63 #include <flash_config.h>
64 #endif // CYGSEM_REDBOOT_FLASH_CONFIG
65 #endif // CYGPKG_REDBOOT
69 //--------------------------------------------------------------------------
70 // Configure LAN91CXX driver
72 #define LAN91CXX_IS_LAN91C111 1
73 #define LAN91CXX_FORCE_10MHZ 1 // due a PCB tracking problem only
75 #define LAN91CXX_32BIT_RX 1 // 32 bit access
78 //--------------------------------------------------------------------------
79 // RedBoot ESA Flash configuration options
80 // When this option is enabled, RedBoot will keep configuration
81 // data in a separate block of FLASH memory.
83 #if defined(CYGPKG_REDBOOT) && defined(CYGSEM_REDBOOT_FLASH_CONFIG)
84 RedBoot_config_option("Set " CYGDAT_DEVS_ETH_ARM_PHYCORE229X_NAME " network hardware address [MAC]",
89 RedBoot_config_option(CYGDAT_DEVS_ETH_ARM_PHYCORE229X_NAME " network hardware address [MAC]",
94 #endif // CYGPKG_REDBOOT && CYGSEM_REDBOOT_FLASH_CONFIG
97 //--------------------------------------------------------------------------
98 // Application ESA Flash configuration options
99 // Note that this section *is* active in an application, outside
100 // RedBoot, where the above section is not included.
102 #ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
103 #include <cyg/hal/hal_if.h>
106 #define CONFIG_ESA (6)
109 #define CONFIG_BOOL (1)
113 //--------------------------------------------------------------------------
114 // Provide ESA function
115 // Returns true if ESA is configured by flash, else false
117 cyg_bool phycore229x_provide_esa(struct lan91cxx_priv_data *cpd)
124 // first we check, if the ESA should be set according to flash
127 ok = CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET,
132 // if esa should be set by flash configuration, then we store the
133 // esa from flash in driver configuration data and return true
137 ok = CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET,
142 return ok && set_esa;
144 #endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
147 //---------------------------------------------------------------------------
148 // Stores configuration data for generic smsc91xxx driver
150 static lan91cxx_priv_data lan91cxx_eth0_priv_data = {
151 base : (unsigned short *)(CYGHWR_HAL_ARM_PHYCORE229X_ETH_MEM_AREA
153 interrupt : ( CYGHWR_HAL_ARM_PHYCORE229X_ETH_EINT +
154 CYGNUM_HAL_INTERRUPT_EINT0) ,
156 // if user selects a hardwired ESA in configuration then
157 // we fill the ESA here
159 #ifdef CYGSEM_DEVS_ETH_PHYCORE229X_SET_ESA
160 enaddr : CYGDAT_DEVS_ETH_PHYCORE229X_ESA,
161 hardwired_esa : true,
163 hardwired_esa : false,
165 #ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
166 provide_esa : &phycore229x_provide_esa,
168 provide_esa : NULL, // read MAC from associated EEPROM
169 #endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
170 }; // lan91cxx_priv_data
173 //---------------------------------------------------------------------------
174 // Driver configuration
178 &lan91cxx_eth0_priv_data, // driver specific data
179 CYGDAT_DEVS_ETH_ARM_PHYCORE229X_NAME, // device name
192 //---------------------------------------------------------------------------
193 // Entry into net device table
197 "lan91cxx_" CYGDAT_DEVS_ETH_ARM_PHYCORE229X_NAME,
202 //---------------------------------------------------------------------------
203 #endif // CYGONCE_DEVS_ETH_PHYCORE229X_INL