OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [devs/] [eth/] [arm/] [aaed2000/] [current/] [include/] [devs_eth_arm_aaed2000.inl] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      devs_eth_arm_aaed2000.inl
4
//
5
//      AAED2000 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-06
45
// Purpose:     AAED2000 ethernet defintions
46
//
47
//####DESCRIPTIONEND####
48
//==========================================================================
49
 
50
#include            // CYGNUM_HAL_INTERRUPT_ETHR
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_DEVS
62
 
63
#ifdef CYGPKG_DEVS_ETH_ARM_AAED2000_ETH0
64
 
65
#if defined(CYGPKG_REDBOOT) && defined(CYGSEM_REDBOOT_FLASH_CONFIG)
66
RedBoot_config_option("Set " CYGDAT_DEVS_ETH_ARM_AAED2000_ETH0_NAME " network hardware address [MAC]",
67
                      eth0_esa,
68
                      ALWAYS_ENABLED, true,
69
                      CONFIG_BOOL, false
70
    );
71
RedBoot_config_option(CYGDAT_DEVS_ETH_ARM_AAED2000_ETH0_NAME " network hardware address [MAC]",
72
                      eth0_esa_data,
73
                      "eth0_esa", true,
74
                      CONFIG_ESA, 0
75
    );
76
#endif // CYGPKG_REDBOOT && CYGSEM_REDBOOT_FLASH_CONFIG
77
 
78
#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
79
// Note that this section *is* active in an application, outside RedBoot,
80
// where the above section is not included.
81
 
82
# include 
83
 
84
# ifndef CONFIG_ESA
85
#  define CONFIG_ESA (6)
86
# endif
87
# ifndef CONFIG_BOOL
88
#  define CONFIG_BOOL (1)
89
# endif
90
 
91
cyg_bool
92
_aaed2000_provide_eth0_esa(struct cs8900a_priv_data* cpd)
93
{
94
    cyg_bool set_esa;
95
    int ok;
96
    ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET,
97
                                      "eth0_esa", &set_esa, CONFIG_BOOL);
98
    if (ok && set_esa) {
99
        ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET,
100
                                          "eth0_esa_data", cpd->esa, CONFIG_ESA);
101
    }
102
 
103
    return ok && set_esa;
104
}
105
 
106
#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
107
 
108
static cs8900a_priv_data_t cs8900a_eth0_priv_data = {
109
    base : (cyg_addrword_t) 0x10000300,
110
    interrupt: CYGNUM_HAL_INTERRUPT_ETH,
111
#ifdef CYGSEM_DEVS_ETH_ARM_AAED2000_ETH0_SET_ESA
112
    esa : CYGDAT_DEVS_ETH_ARM_AAED2000_ETH0_ESA,
113
    hardwired_esa : true,
114
#else
115
    hardwired_esa : false,
116
#endif
117
#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
118
    provide_esa : &_aaed2000_provide_eth0_esa,
119
#else
120
    provide_esa : NULL,
121
#endif
122
};
123
 
124
ETH_DRV_SC(cs8900a_sc,
125
           &cs8900a_eth0_priv_data, // Driver specific data
126
           CYGDAT_DEVS_ETH_ARM_AAED2000_ETH0_NAME,
127
           cs8900a_start,
128
           cs8900a_stop,
129
           cs8900a_control,
130
           cs8900a_can_send,
131
           cs8900a_send,
132
           cs8900a_recv,
133
           cs8900a_deliver,     // "pseudoDSR" called from fast net thread
134
           cs8900a_poll,        // poll function, encapsulates ISR and DSR
135
           cs8900a_int_vector);
136
 
137
NETDEVTAB_ENTRY(cs8900a_netdev,
138
                "cs8900a_" CYGDAT_DEVS_ETH_ARM_AAED2000_ETH0_NAME,
139
                cs8900a_init,
140
                &cs8900a_sc);
141
 
142
#endif // CYGPKG_DEVS_ETH_ARM_AAED2000_ETH0
143
 
144
#endif // __WANT_DEVS
145
 
146
// EOF devs_eth_arm_aaed2000.inl

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.