1 |
786 |
skrzyp |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// devs_eth_arm_edb7xxx.inl
|
4 |
|
|
//
|
5 |
|
|
// EDB7XXX ethernet I/O definitions.
|
6 |
|
|
//
|
7 |
|
|
//==========================================================================
|
8 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
// -------------------------------------------
|
10 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
12 |
|
|
//
|
13 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
// the terms of the GNU General Public License as published by the Free
|
15 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
// version.
|
17 |
|
|
//
|
18 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
// for more details.
|
22 |
|
|
//
|
23 |
|
|
// You should have received a copy of the GNU General Public License
|
24 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
//
|
27 |
|
|
// As a special exception, if other files instantiate templates or use
|
28 |
|
|
// macros or inline functions from this file, or you compile this file
|
29 |
|
|
// and link it with other works to produce a work based on this file,
|
30 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
// the GNU General Public License. However the source code for this file
|
32 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
// General Public License v2.
|
34 |
|
|
//
|
35 |
|
|
// This exception does not invalidate any other reasons why a work based
|
36 |
|
|
// on this file might be covered by the GNU General Public License.
|
37 |
|
|
// -------------------------------------------
|
38 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
//==========================================================================
|
40 |
|
|
//#####DESCRIPTIONBEGIN####
|
41 |
|
|
//
|
42 |
|
|
// Author(s): jskov
|
43 |
|
|
// Contributors:jskov
|
44 |
|
|
// Date: 2001-11-14
|
45 |
|
|
// Purpose: EDB7XXX ethernet defintions
|
46 |
|
|
//
|
47 |
|
|
//####DESCRIPTIONEND####
|
48 |
|
|
//==========================================================================
|
49 |
|
|
|
50 |
|
|
#include // CYGNUM_HAL_INTERRUPT_EINT3
|
51 |
|
|
#include
|
52 |
|
|
|
53 |
|
|
#ifdef CYGPKG_REDBOOT
|
54 |
|
|
# include
|
55 |
|
|
# ifdef CYGSEM_REDBOOT_FLASH_CONFIG
|
56 |
|
|
# include
|
57 |
|
|
# include
|
58 |
|
|
# endif
|
59 |
|
|
#endif
|
60 |
|
|
|
61 |
|
|
#ifdef __WANT_CONFIG
|
62 |
|
|
|
63 |
|
|
#ifndef __EDB7312
|
64 |
|
|
# define CS8900A_step 4
|
65 |
|
|
#endif
|
66 |
|
|
|
67 |
|
|
#endif
|
68 |
|
|
|
69 |
|
|
#ifdef __WANT_DEVS
|
70 |
|
|
|
71 |
|
|
#ifdef CYGPKG_DEVS_ETH_ARM_EDB7XXX_ETH0
|
72 |
|
|
|
73 |
|
|
#ifndef CYGSEM_DEVS_ETH_ARM_EDB7XXX_ETH0_SET_ESA
|
74 |
|
|
# if defined(CYGPKG_REDBOOT) && defined(CYGSEM_REDBOOT_FLASH_CONFIG)
|
75 |
|
|
RedBoot_config_option("Set " CYGDAT_DEVS_ETH_ARM_EDB7XXX_ETH0_NAME " network hardware address [MAC]",
|
76 |
|
|
eth0_esa,
|
77 |
|
|
ALWAYS_ENABLED, true,
|
78 |
|
|
CONFIG_BOOL, false
|
79 |
|
|
);
|
80 |
|
|
RedBoot_config_option(CYGDAT_DEVS_ETH_ARM_EDB7XXX_ETH0_NAME " network hardware address [MAC]",
|
81 |
|
|
eth0_esa_data,
|
82 |
|
|
"eth0_esa", true,
|
83 |
|
|
CONFIG_ESA, 0
|
84 |
|
|
);
|
85 |
|
|
# endif // CYGPKG_REDBOOT && CYGSEM_REDBOOT_FLASH_CONFIG
|
86 |
|
|
|
87 |
|
|
# ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
|
88 |
|
|
// Note that this section *is* active in an application, outside RedBoot,
|
89 |
|
|
// where the above section is not included.
|
90 |
|
|
|
91 |
|
|
# include
|
92 |
|
|
|
93 |
|
|
# ifndef CONFIG_ESA
|
94 |
|
|
# define CONFIG_ESA (6)
|
95 |
|
|
# endif
|
96 |
|
|
# ifndef CONFIG_BOOL
|
97 |
|
|
# define CONFIG_BOOL (1)
|
98 |
|
|
# endif
|
99 |
|
|
|
100 |
|
|
cyg_bool
|
101 |
|
|
_edb7xxx_provide_eth0_esa(struct cs8900a_priv_data* cpd)
|
102 |
|
|
{
|
103 |
|
|
cyg_bool set_esa;
|
104 |
|
|
int ok;
|
105 |
|
|
ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET,
|
106 |
|
|
"eth0_esa", &set_esa, CONFIG_BOOL);
|
107 |
|
|
if (ok && set_esa) {
|
108 |
|
|
ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET,
|
109 |
|
|
"eth0_esa_data", cpd->esa, CONFIG_ESA);
|
110 |
|
|
}
|
111 |
|
|
return ok && set_esa;
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
# endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
|
115 |
|
|
#endif // ! CYGSEM_DEVS_ETH_ARM_EDB7XXX_ETH0_SET_ESA
|
116 |
|
|
|
117 |
|
|
static cs8900a_priv_data_t cs8900a_eth0_priv_data = {
|
118 |
|
|
base : (cyg_addrword_t) 0x20000000,
|
119 |
|
|
interrupt: CYGNUM_HAL_INTERRUPT_EINT3,
|
120 |
|
|
#ifdef CYGSEM_DEVS_ETH_ARM_EDB7XXX_ETH0_SET_ESA
|
121 |
|
|
esa : CYGDAT_DEVS_ETH_ARM_EDB7XXX_ETH0_ESA,
|
122 |
|
|
hardwired_esa : true,
|
123 |
|
|
#else
|
124 |
|
|
hardwired_esa : false,
|
125 |
|
|
# ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
|
126 |
|
|
provide_esa : &_edb7xxx_provide_eth0_esa,
|
127 |
|
|
# else
|
128 |
|
|
provide_esa : NULL,
|
129 |
|
|
# endif
|
130 |
|
|
#endif
|
131 |
|
|
};
|
132 |
|
|
|
133 |
|
|
ETH_DRV_SC(cs8900a_sc,
|
134 |
|
|
&cs8900a_eth0_priv_data, // Driver specific data
|
135 |
|
|
CYGDAT_DEVS_ETH_ARM_EDB7XXX_ETH0_NAME,
|
136 |
|
|
cs8900a_start,
|
137 |
|
|
cs8900a_stop,
|
138 |
|
|
cs8900a_control,
|
139 |
|
|
cs8900a_can_send,
|
140 |
|
|
cs8900a_send,
|
141 |
|
|
cs8900a_recv,
|
142 |
|
|
cs8900a_deliver, // "pseudoDSR" called from fast net thread
|
143 |
|
|
cs8900a_poll, // poll function, encapsulates ISR and DSR
|
144 |
|
|
cs8900a_int_vector);
|
145 |
|
|
|
146 |
|
|
NETDEVTAB_ENTRY(cs8900a_netdev,
|
147 |
|
|
"cs8900a_" CYGDAT_DEVS_ETH_ARM_EDB7XXX_ETH0_NAME,
|
148 |
|
|
cs8900a_init,
|
149 |
|
|
&cs8900a_sc);
|
150 |
|
|
|
151 |
|
|
#endif // CYGPKG_DEVS_ETH_ARM_EDB7XXX_ETH0
|
152 |
|
|
|
153 |
|
|
#endif // __WANT_DEVS
|
154 |
|
|
|
155 |
|
|
// EOF devs_eth_arm_edb7xxx.inl
|