URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/ecos-2.0/packages/devs/eth/h8300/aki3068net/v2_0
- from Rev 1254 to Rev 1765
- ↔ Reverse comparison
Rev 1254 → Rev 1765
/cdl/h8300_aki3068net_eth_drivers.cdl
0,0 → 1,131
# ==================================================================== |
# |
# h8300_aki3068net_eth_drivers.cdl |
# |
# Ethernet drivers - support for DP83902A(RTL8019AS) |
# ethernet controller on the Akizuki H8/3068 Network micom. |
# |
# ==================================================================== |
#####ECOSGPLCOPYRIGHTBEGIN#### |
## ------------------------------------------- |
## This file is part of eCos, the Embedded Configurable Operating System. |
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
## |
## eCos is free software; you can redistribute it and/or modify it under |
## the terms of the GNU General Public License as published by the Free |
## Software Foundation; either version 2 or (at your option) any later version. |
## |
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
## WARRANTY; without even the implied warranty of MERCHANTABILITY or |
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
## for more details. |
## |
## You should have received a copy of the GNU General Public License along |
## with eCos; if not, write to the Free Software Foundation, Inc., |
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
## |
## As a special exception, if other files instantiate templates or use macros |
## or inline functions from this file, or you compile this file and link it |
## with other works to produce a work based on this file, this file does not |
## by itself cause the resulting work to be covered by the GNU General Public |
## License. However the source code for this file must still be made available |
## in accordance with section (3) of the GNU General Public License. |
## |
## This exception does not invalidate any other reasons why a work based on |
## this file might be covered by the GNU General Public License. |
## |
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
## at http://sources.redhat.com/ecos/ecos-license/ |
## ------------------------------------------- |
#####ECOSGPLCOPYRIGHTEND#### |
# ==================================================================== |
######DESCRIPTIONBEGIN#### |
# |
# Author(s): |
# Contributors: |
# Date: |
# |
#####DESCRIPTIONEND#### |
# |
# ==================================================================== |
|
cdl_package CYGPKG_DEVS_ETH_H8300_AKI3068NET { |
display "aki3068net board ethernet driver" |
description " |
Ethernet driver for Akizuki |
H8/3068 Netwotk Micom board" |
|
parent CYGPKG_IO_ETH_DRIVERS |
active_if CYGPKG_IO_ETH_DRIVERS |
active_if CYGPKG_HAL_H8300_H8300H_AKI3068NET |
compile -library=libextras.a if_aki3068net.c |
|
include_dir cyg/io |
|
# FIXME: This really belongs in the NS DP83902A package |
cdl_interface CYGINT_DEVS_ETH_NS_DP83902A_REQUIRED { |
display "NS dp83902a ethernet driver required" |
} |
|
define_proc { |
puts $::cdl_system_header "/***** ethernet driver proc output start *****/" |
puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_NS_DP83902A_INL <cyg/io/devs_eth_h8300_aki3068net.inl>" |
puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_NS_DP83902A_CFG <pkgconf/devs_eth_h8300_aki3068net.h>" |
puts $::cdl_system_header "/***** ethernet driver proc output end *****/" |
} |
|
cdl_component CYGPKG_DEVS_ETH_H8300_AKI3068NET_ETH0 { |
display "Ethernet port 0 driver" |
flavor bool |
default_value 1 |
|
implements CYGHWR_NET_DRIVERS |
implements CYGHWR_NET_DRIVER_ETH0 |
|
implements CYGINT_DEVS_ETH_NS_DP83902A_REQUIRED |
|
cdl_option CYGDAT_DEVS_ETH_H8300_AKI3068NET_ETH0_NAME { |
display "Device name for the ETH0 ethernet port 0 driver" |
flavor data |
default_value {"\"eth0\""} |
description " |
This option sets the name of the ethernet device for the |
RTL8019AS ethernet port 0." |
} |
|
cdl_component CYGSEM_DEVS_ETH_H8300_AKI3068NET_ETH0_SET_ESA { |
display "Set the ethernet station address" |
flavor bool |
default_value 0 |
description "Enabling this option will allow the ethernet |
station address to be forced to the value set by the |
configuration. This may be required if the hardware does |
not include a serial EEPROM for the ESA." |
|
cdl_option CYGDAT_DEVS_ETH_H8300_AKI3068NET_ETH0_ESA { |
display "The ethernet station address" |
flavor data |
default_value {"{0x08, 0x00, 0x00, 0x00, 0x00, 0x01}"} |
description "The ethernet station address" |
} |
} |
} |
|
cdl_component CYGPKG_DEVS_ETH_H8300_AKI3068NET_OPTIONS { |
display "PCMCIA ethernet driver build options" |
flavor none |
no_define |
|
cdl_option CYGPKG_DEVS_ETH_CF_CFLAGS_ADD { |
display "Additional compiler flags" |
flavor data |
no_define |
default_value { "-D_KERNEL -D__ECOS" } |
description " |
This option modifies the set of compiler flags for |
building the PCMCIA ethernet driver package. |
These flags are used in addition |
to the set of global flags." |
} |
} |
} |
/include/devs_eth_h8300_aki3068net.inl
0,0 → 1,96
//========================================================================== |
// |
// devs_eth_h8300_aki3068net.inl |
// |
// DP83902(RTL8019AS) ethernet I/O definitions. |
// |
//========================================================================== |
//####ECOSGPLCOPYRIGHTBEGIN#### |
// ------------------------------------------- |
// This file is part of eCos, the Embedded Configurable Operating System. |
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
// |
// eCos is free software; you can redistribute it and/or modify it under |
// the terms of the GNU General Public License as published by the Free |
// Software Foundation; either version 2 or (at your option) any later version. |
// |
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
// for more details. |
// |
// You should have received a copy of the GNU General Public License along |
// with eCos; if not, write to the Free Software Foundation, Inc., |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
// |
// As a special exception, if other files instantiate templates or use macros |
// or inline functions from this file, or you compile this file and link it |
// with other works to produce a work based on this file, this file does not |
// by itself cause the resulting work to be covered by the GNU General Public |
// License. However the source code for this file must still be made available |
// in accordance with section (3) of the GNU General Public License. |
// |
// This exception does not invalidate any other reasons why a work based on |
// this file might be covered by the GNU General Public License. |
// |
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
// at http://sources.redhat.com/ecos/ecos-license/ |
// ------------------------------------------- |
//####ECOSGPLCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): |
// Contributors: |
// Date: |
// Purpose: aki3068net ethernet defintions |
//####DESCRIPTIONEND#### |
//========================================================================== |
|
#include <cyg/hal/hal_intr.h> // CYGNUM_HAL_INTERRUPT_ETHR |
#include <cyg/hal/hal_if.h> |
|
#define CYGHWR_NS_DP83902A_PLF_INIT ns_dp83902a_plf_init |
|
#ifdef __WANT_DEVS |
|
#ifdef CYGPKG_DEVS_ETH_H8300_AKI3068NET_ETH0 |
|
static dp83902a_priv_data_t dp83902a_eth0_priv_data = { |
base: 0x200000, |
interrupt: 16, |
tx_buf1: 0x40, |
tx_buf2: 0x48, |
rx_buf_start: 0x50, |
rx_buf_end: 0x80, |
#ifdef CYGSEM_DEVS_ETH_H8300_AKI3068NET_ETH0_SET_ESA |
hardwired_esa: true, |
mac_address: CYGDAT_DEVS_ETH_H8300_AKI3068NET_ETH0_ESA |
#else |
hardwired_esa: false, |
#endif |
}; |
|
ETH_DRV_SC(dp83902a_sc, |
&dp83902a_eth0_priv_data, // Driver specific data |
CYGDAT_DEVS_ETH_H8300_AKI3068NET_ETH0_NAME, |
dp83902a_start, |
dp83902a_stop, |
dp83902a_control, |
dp83902a_can_send, |
dp83902a_send, |
dp83902a_recv, |
dp83902a_deliver, // "pseudoDSR" called from fast net thread |
dp83902a_poll, // poll function, encapsulates ISR and DSR |
dp83902a_int_vector); |
|
NETDEVTAB_ENTRY(dp83902a_netdev, |
"dp83902a_" CYGDAT_DEVS_ETH_H8300_AKI3068NET_ETH0_NAME, |
dp83902a_init, |
&dp83902a_sc); |
|
void ns_dp83902a_plf_init(dp83902a_priv_data_t *dp); |
|
#endif // CYGPKG_DEVS_ETH_H8300_AKI3068NET_ETH0 |
#endif |
// EOF devs_eth_h8300_aki3068net.inl |
/ChangeLog
0,0 → 1,54
2002-08-14 Yoshinori Sato <qzb04471@nifty.ne.jp> |
2002-08-14 Jonathan Larmour <jifl@ecoscentric.com> |
|
* include/devs_eth_h8300_aki3068net.inl: Allow to build with |
if_dp83902a.c changes. |
|
2002-06-14 Gary Thomas <gary@chez-thomas.org> |
|
* src/if_aki3068net.c: |
Need to include <pkgconf/io_eth_drivers.h> for proper configuration |
of stand-alone (polled) vs. system (interrupt driven) mode. |
|
2002-05-28 Jonathan Larmour <jlarmour@redhat.com> |
|
* src/if_aki3068net.c: Remove unused includes. |
|
2002-04-24 Yoshinori Sato <qzb04471@nifty.ne.jp> |
|
* New package. |
|
//=========================================================================== |
//####ECOSGPLCOPYRIGHTBEGIN#### |
// ------------------------------------------- |
// This file is part of eCos, the Embedded Configurable Operating System. |
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
// |
// eCos is free software; you can redistribute it and/or modify it under |
// the terms of the GNU General Public License as published by the Free |
// Software Foundation; either version 2 or (at your option) any later version. |
// |
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
// for more details. |
// |
// You should have received a copy of the GNU General Public License along |
// with eCos; if not, write to the Free Software Foundation, Inc., |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
// |
// As a special exception, if other files instantiate templates or use macros |
// or inline functions from this file, or you compile this file and link it |
// with other works to produce a work based on this file, this file does not |
// by itself cause the resulting work to be covered by the GNU General Public |
// License. However the source code for this file must still be made available |
// in accordance with section (3) of the GNU General Public License. |
// |
// This exception does not invalidate any other reasons why a work based on |
// this file might be covered by the GNU General Public License. |
// |
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
// at http://sources.redhat.com/ecos/ecos-license/ |
// ------------------------------------------- |
//####ECOSGPLCOPYRIGHTEND#### |
//=========================================================================== |
/src/if_aki3068net.c
0,0 → 1,125
//========================================================================== |
// |
// if_aki3068net.c |
// |
// Ethernet device driver for Akizuki H8/3068 Netwotk micom |
// |
//========================================================================== |
//####ECOSGPLCOPYRIGHTBEGIN#### |
// ------------------------------------------- |
// This file is part of eCos, the Embedded Configurable Operating System. |
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
// |
// eCos is free software; you can redistribute it and/or modify it under |
// the terms of the GNU General Public License as published by the Free |
// Software Foundation; either version 2 or (at your option) any later version. |
// |
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY |
// WARRANTY; without even the implied warranty of MERCHANTABILITY or |
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
// for more details. |
// |
// You should have received a copy of the GNU General Public License along |
// with eCos; if not, write to the Free Software Foundation, Inc., |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
// |
// As a special exception, if other files instantiate templates or use macros |
// or inline functions from this file, or you compile this file and link it |
// with other works to produce a work based on this file, this file does not |
// by itself cause the resulting work to be covered by the GNU General Public |
// License. However the source code for this file must still be made available |
// in accordance with section (3) of the GNU General Public License. |
// |
// This exception does not invalidate any other reasons why a work based on |
// this file might be covered by the GNU General Public License. |
// |
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. |
// at http://sources.redhat.com/ecos/ecos-license/ |
// ------------------------------------------- |
//####ECOSGPLCOPYRIGHTEND#### |
//####BSDCOPYRIGHTBEGIN#### |
// |
// ------------------------------------------- |
// |
// Portions of this software may have been derived from OpenBSD or other sources, |
// and are covered by the appropriate copyright disclaimers included herein. |
// |
// ------------------------------------------- |
// |
//####BSDCOPYRIGHTEND#### |
//========================================================================== |
//#####DESCRIPTIONBEGIN#### |
// |
// Author(s): |
// Contributors: |
// Date: |
// Purpose: |
// Description: |
// |
// |
//####DESCRIPTIONEND#### |
// |
//========================================================================== |
|
#include <pkgconf/system.h> |
#include <pkgconf/io_eth_drivers.h> |
|
#include <cyg/infra/cyg_type.h> |
#include <cyg/hal/hal_arch.h> |
#include <cyg/infra/diag.h> |
#include <cyg/hal/drv_api.h> |
#include <cyg/io/eth/eth_drv.h> |
#include <cyg/io/eth/netdev.h> |
|
#define DP_CARD_RESET 0x1f |
|
#include <cyg/io/dp83902a.h> |
|
void ns_dp83902a_plf_init(dp83902a_priv_data_t *dp) |
{ |
static struct { |
unsigned short offset; |
unsigned short data; |
} init_data[] = { |
{DP_DCR, 0x48}, // Bytewide access |
{DP_RBCH, 0}, // Remote byte count |
{DP_RBCL, 0}, |
{DP_ISR, 0xFF}, // Clear any pending interrupts |
{DP_IMR, 0x00}, // Mask all interrupts |
{DP_RCR, 0x20}, // Monitor |
{DP_TCR, 0x02}, // loopback |
{DP_RBCH, 32}, // Remote byte count |
{DP_RBCL, 0}, |
{DP_RSAL, 0}, // Remote address |
{DP_RSAH, 0}, |
{DP_CR, DP_CR_START|DP_CR_RDMA} // Read data |
}; |
unsigned char prom[32]; |
int cnt,tmp; |
|
HAL_READ_UINT8(dp->base+DP_CARD_RESET, tmp); |
HAL_WRITE_UINT8(dp->base+DP_CARD_RESET, tmp); |
dp->data = dp->base+DP_DATAPORT; |
// Wait for card |
do { |
int cnt; |
DP_IN(dp->base, DP_ISR, tmp); |
for (cnt=0; cnt< 1024; cnt++); |
} while (0 == (tmp & DP_ISR_RESET)); |
|
if (dp->hardwired_esa) |
return ; |
|
for (cnt=0; cnt<sizeof(init_data)/sizeof(init_data[0]); cnt++) |
DP_OUT(dp->base, init_data[cnt].offset, init_data[cnt].data); |
for (cnt = 0; cnt < 32; cnt++) |
DP_IN_DATA(dp->data, prom[cnt]); |
if ((prom[0] == 0xff) && (prom[2] == 0xff) && (prom[4] == 0xff)) { |
dp->base = 0; |
return ; |
} |
DP_OUT(dp->base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1); |
for (cnt = 0; cnt < 6; cnt ++) { |
DP_OUT(dp->base, DP_P1_PAR0+cnt, prom[cnt*2]); |
} |
} |