Mercurial > nand-ecoscentric
changeset 3191:08eb5070a44f
New package --Ethernet driver for Actel Smartfusion Evaluation Board [Bugzilla 1001291]
| author | vae |
|---|---|
| date | Mon, 12 Mar 2012 20:41:07 +0000 |
| parents | a8eba6c9e005 |
| children | 1b48b0437ac3 |
| files | packages/devs/eth/cortexm/a2f200_eval/current/ChangeLog packages/devs/eth/cortexm/a2f200_eval/current/cdl/a2f200_eval.cdl packages/devs/eth/cortexm/a2f200_eval/current/include/a2f200_eval_eth.inl |
| diffstat | 3 files changed, 281 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/packages/devs/eth/cortexm/a2f200_eval/current/ChangeLog @@ -0,0 +1,31 @@ + +2011-05-07 Christophe Coutand <ecos@hotmail.co.uk> + + * include/a2fxxx_eval_eth.inl: + * cdl/a2fxxx_eval.cdl + New package --Ethernet driver for Actel Smartfusion Evaluation Board + [Bugzilla 1001291] + +//=========================================================================== +// ####GPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This program 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. +// +// This program 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 this program; if not, write to the +// Free Software Foundation, Inc., 51 Franklin Street, +// Fifth Floor, Boston, MA 02110-1301, USA. +// ------------------------------------------- +// ####GPLCOPYRIGHTEND#### +//===========================================================================
new file mode 100644 --- /dev/null +++ b/packages/devs/eth/cortexm/a2f200_eval/current/cdl/a2f200_eval.cdl @@ -0,0 +1,121 @@ +# ========================================================================== +# +# a2f200_eval.cdl +# +# Ethernet driver specifics for Actel Smartfusion (A2F200) board +# +##========================================================================== +## ####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 2011 Free Software Foundation, 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., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2. +## +## This exception does not invalidate any other reasons why a work based +## on this file might be covered by the GNU General Public License. +## ------------------------------------------- +## ####ECOSGPLCOPYRIGHTEND#### +##========================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): ccoutand +# Contributors: +# Date: 2011-05-04 +# Purpose: +# Description: Ethernet driver specifics for Actel Smartfusion (A2F200) +# board +# +#####DESCRIPTIONEND#### +# +# ========================================================================== + + +cdl_package CYGPKG_DEVS_ETH_CORTEXM_A2F200_EVAL { + display "Actel Smartfusion (A2F200) kit Ethernet support" + description " + Ethernet driver specifics for Actel Smartfusion (A2F200) board" + + parent CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_HAL_CORTEXM + active_if CYGPKG_HAL_CORTEXM_A2FXXX + + requires CYGPKG_DEVS_ETH_CORTEXM_A2FXXX + + include_dir cyg/io + + define_proc { + puts $::cdl_system_header "#define CYGDAT_DEVS_CORTEXM_A2FXXX_ETH_CDL <pkgconf/devs_eth_cortexm_a2f200_eval.h>" + puts $::cdl_system_header "#define CYGDAT_DEVS_CORTEXM_A2FXXX_ETH_INL <cyg/io/a2f200_eval_eth.inl>" + } + + cdl_component CYGPKG_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0 { + display "Actel Smartfusion (A2F200) Ethernet port 0 driver" + flavor bool + default_value 1 + description " + This option includes the Ethernet device driver on the + Actel Smartfusion (A2F200) motherboard." + + implements CYGHWR_NET_DRIVERS + implements CYGHWR_NET_DRIVER_ETH0 + + cdl_option CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_NAME { + display "Device name for the Ethernet port 0 driver" + flavor data + default_value {"\"eth0\""} + description " + This option sets the name of the Ethernet device for the + Ethernet port 0." + } + + cdl_option CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_PHY_ADDRESS { + display "Ethernet PHY address of the Ethernet port 0 driver" + flavor data + default_value 0 + description " + This option sets the Ethernet PHY address of the Ethernet device for the + Ethernet port 0." + } + + cdl_component CYGSEM_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_SET_ESA { + display "Set the Ethernet station address" + flavor bool + default_value !CYGPKG_DEVS_ETH_TSEC_ETH_REDBOOT_HOLDS_ESA + 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, and if RedBoot's + flash configuration support is not available." + + cdl_option CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_ESA { + display "The Ethernet station address" + flavor data + default_value {"{0x00, 0x20, 0x0E, 0x10, 0x39, 0x89}"} + description "The Ethernet station address" + } + } + } + +}
new file mode 100644 --- /dev/null +++ b/packages/devs/eth/cortexm/a2f200_eval/current/include/a2f200_eval_eth.inl @@ -0,0 +1,129 @@ +//========================================================================== +// +// a2f200_eval.inl +// +// Ethernet driver specifics for Actel Smartfusion (A2F200) board +// +//========================================================================== +// ####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2011 Free Software Foundation, 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., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 v2. +// +// This exception does not invalidate any other reasons why a work based +// on this file might be covered by the GNU General Public License. +// ------------------------------------------- +// ####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): ccoutand +// Contributors: +// Date: 2011-05-04 +// Purpose: +// Description: Ethernet driver specifics for Actel Smartfusion (A2F200) board +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + + +#ifndef CYGONCE_DEVS_A2F200_EVAL_ETH_INL +#define CYGONCE_DEVS_A2F200_EVAL_ETH_INL + +#include <cyg/hal/hal_intr.h> +#include <cyg/hal/var_io.h> + +// Make sure packet size is multiple of words +#define CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_ALIGN_BUFSIZE_RX \ + ((CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_BUFSIZE_RX + 0x00000003) & (0xfffffffc)) + +#define CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_ALIGN_BUFSIZE_TX \ + ((CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_BUFSIZE_TX + 0x00000003) & (0xfffffffc)) + +#define RxBUFSIZE ( CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_RxNUM*CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_ALIGN_BUFSIZE_RX ) +#define TxBUFSIZE ( CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_TxNUM*CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_ALIGN_BUFSIZE_TX ) + +#ifdef CYGPKG_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0 + +#ifdef CYGPKG_DEVS_ETH_PHY +ETH_PHY_REG_LEVEL_ACCESS_FUNS(eth0_phy, + a2fxxx_phy_init, + NULL, + a2fxxx_mdio_write, + a2fxxx_mdio_read); +#endif + +// Declare TX / RX buffers +static cyg_uint32 a2fxxx_eth0_rxbufs[ RxBUFSIZE / 4 ]; +static cyg_uint32 a2fxxx_eth0_txbufs[ TxBUFSIZE / 4 ]; + +// Declare BDs +static struct a2fxxx_bd + a2fxxx_eth0_rxring[CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_RxNUM]; +static struct a2fxxx_bd + a2fxxx_eth0_txring[CYGNUM_DEVS_ETH_CORTEXM_A2FXXX_TxNUM]; + +static struct a2fxxx_eth_info a2fxxx_eth0_info = { +#ifdef CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_ESA + .mac_address = CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_ESA, +#endif + .base = CYGHWR_HAL_A2FXXX_MAC, + .base_bb = CYGHWR_HAL_A2FXXX_MAC_BB, + .if_num = 0, + .init_rxbufs = (cyg_uint8 *) &a2fxxx_eth0_rxbufs[0], + .init_txbufs = (cyg_uint8 *) &a2fxxx_eth0_txbufs[0], + .init_rxring = &a2fxxx_eth0_rxring[0], + .init_txring = &a2fxxx_eth0_txring[0], +#ifdef CYGINT_IO_ETH_INT_SUPPORT_REQUIRED + .vector = CYGNUM_HAL_INTERRUPT_MAC0, +#endif +#ifdef CYGPKG_DEVS_ETH_PHY + .phy = ð0_phy, +#endif +}; + +ETH_DRV_SC(a2fxxx_eth0_sc, + &a2fxxx_eth0_info, + CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_NAME, + a2fxxx_eth_start, + a2fxxx_eth_stop, + a2fxxx_eth_control, + a2fxxx_eth_can_send, + a2fxxx_eth_send, + a2fxxx_eth_recv, + a2fxxx_eth_deliver, + a2fxxx_eth_poll, + a2fxxx_eth_int_vector); + +NETDEVTAB_ENTRY(a2fxxx_netdev0, + "a2fxxx_" CYGDAT_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0_NAME, + a2fxxx_eth_init, + &a2fxxx_eth0_sc); + +#endif// CYGPKG_DEVS_ETH_CORTEXM_A2F200_EVAL_ETH0 + +#endif
