This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Drivers for SMSC LAN91C110
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] Drivers for SMSC LAN91C110
- From: Hugo Tyson <hmt at redhat dot com>
- Date: 31 May 2001 16:03:10 +0100
- References: <000d01c0e9df$e38a14b0$fe78a8c0@raypc2>
"Raymund Hofmann" <rhofmann@raygmbh.de> writes:
> I try to get familiar with eCos for using it on a Triscend A7 (ARM).
> I want to attach a 100Mbit Ehternet via a SMSC LAN91C110SMSC.
>
> On "Supported Hardware" this part is listed as supported.
>
> I loaded the actual cvs version and the '-P net'.
> I don't know if the hardware driver will be specific to any processor /
> board / hardware.
> I searched for any file mentioning the smsc chip in the ecos directory, but
> couldn't find anything.
> Where would i have to look ?
There should be a generic driver in packages/devs/eth/smsc/lan91cxx, the
package name is
cdl_package CYGPKG_DEVS_ETH_SMSC_LAN91CXX {
display "SMSC LAN91CXX compatible ethernet driver"
description "Ethernet driver for SMSC LAN91CXX compatible controllers."
It might not work straight off with the LAN91C110; we wrote for and tested
with the 91C96 part specifically.
It needs a platform-specific package to instantiate it, much like other
generic drivers. That means telling the generic code where the thing is
mapped in memory, what interrupt number it's wired to, and stuff like that.
Unfortunately we don't have a public example of such a package, but I'll
attach something to help you create yours; it consists of a CDL file and an
include file (*.inl), that's all - you must add the package clause to
ecos.db, add that package to your platform build and so on yourself.
The files follow, with the names changed... look for "YOUR_PLATFORM" ;-)
There's not a great deal to it, as you'll see.
Note that I'm putting these files in this message under the same terms as
the usual license applied to eCos sources you got from cvs.
HTH,
- Huge
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# ====================================================================
#
# YOUR_PLATFORM_smsc_eth_drivers.cdl
#
# Ethernet drivers - support for LAN91C96/110 ethernet controller
# on the YOUR PLATFORM board.
#
# ====================================================================
#####COPYRIGHTBEGIN####
#
# -------------------------------------------
# The contents of this file are subject to the Red Hat eCos Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.redhat.com/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations under
# the License.
#
# The Original Code is eCos - Embedded Configurable Operating System,
# released September 30, 1998.
#
# The Initial Developer of the Original Code is Red Hat.
# Portions created by Red Hat are
# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
# All Rights Reserved.
# -------------------------------------------
#
#####COPYRIGHTEND####
# ====================================================================
######DESCRIPTIONBEGIN####
#
# Author(s): YOU
# Contributors: YOU
# Date: TODAY
#
#####DESCRIPTIONEND####
#
# ====================================================================
cdl_package CYGPKG_DEVS_ETH_YOUR_PLATFORM_SMSC {
display "YOUR_PLATFORM board ethernet driver"
description "Ethernet driver for..."
parent CYGPKG_IO_ETH_DRIVERS
active_if CYGPKG_IO_ETH_DRIVERS
active_if CYGPKG_HAL_YOUR_PLATFORM
include_dir cyg/io
# Arguably this should do in the SMSC_LAN91CXX package
# but then there is a logic loop so you can never enable it.
cdl_interface CYGINT_DEVS_ETH_SMSC_LAN91CXX_REQUIRED {
display "SMSC LAN91CXX ethernet driver required"
}
define_proc {
puts $::cdl_system_header "/***** ethernet driver proc output start *****/"
puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_SMSC_LAN91CXX_INL <cyg/io/devs_eth_YOUR_PLATFORM_smsc.inl>"
puts $::cdl_system_header "#define CYGDAT_DEVS_ETH_SMSC_LAN91CXX_CFG <pkgconf/devs_eth_YOUR_PLATFORM_smsc.h>"
puts $::cdl_system_header "/***** ethernet driver proc output end *****/"
}
cdl_component CYGPKG_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0 {
display "YOUR_PLATFORM ethernet port 0 driver"
flavor bool
default_value 1
description "
This option includes the ethernet device driver for the
YOUR_PLATFORM port 0."
implements CYGINT_DEVS_ETH_SMSC_LAN91CXX_REQUIRED
implements CYGHWR_NET_DRIVERS
implements CYGHWR_NET_DRIVER_ETH0
cdl_option CYGDAT_DEVS_ETH_YOUR_PLATFORM_SMSC_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
YOUR_PLATFORM ethernet port 0."
}
cdl_component CYGSEM_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_STATIC_ESA {
display "Configure the ethernet station address"
flavor bool
default_value 0
requires !CYGSEM_DEVS_ETH_SMSC_LAN91CXX_WRITE_EEPROM
implements CYGINT_DEVS_ETH_SMSC_LAN91CXX_STATIC_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."
cdl_option CYGDAT_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_ESA {
display "The ethernet station address"
flavor data
default_value {"{0x08, 0x80, 0x12, 0x34, 0x56, 0x78}"}
description "The ethernet station address"
}
}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//==========================================================================
//
// devs/eth/YOUR_PLATFORM/include/devs_eth_YOUR_PLATFORM_smsc.inl
//
// YOUR_PLATFORM ethernet I/O definitions.
//
//==========================================================================
//####COPYRIGHTBEGIN####
//
// -------------------------------------------
// The contents of this file are subject to the Red Hat eCos Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.redhat.com/
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations under
// the License.
//
// The Original Code is eCos - Embedded Configurable Operating System,
// released September 30, 1998.
//
// The Initial Developer of the Original Code is Red Hat.
// Portions created by Red Hat are
// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
// All Rights Reserved.
// -------------------------------------------
//
//####COPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): YOU
// Contributors:YOU
// Date: TODAY
// Purpose: YOUR_PLATFORM ethernet defintions
//####DESCRIPTIONEND####
//==========================================================================
#include <cyg/hal/hal_intr.h> // CYGNUM_HAL_INTERRUPT_ETHR
#include <cyg/hal/YOUR_PLATFORM.h>
#ifdef CYGPKG_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0
static lan91cxx_priv_data lan91cxx_eth0_priv_data = {
// The "0x300" offset from the base is ignored in PCMCIA mode
base : (unsigned short*) 0x20000000,
interrupt : CYGNUM_HAL_INTR_SMSC_ETHER,
#ifdef CYGSEM_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_STATIC_ESA
enaddr : CYGDAT_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_ESA,
#endif
config_enaddr : NULL };
ETH_DRV_SC(smsc_lan91cxx_sc,
&lan91cxx_eth0_priv_data, // Driver specific data
CYGDAT_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_NAME,
lan91cxx_start,
lan91cxx_stop,
lan91cxx_control,
lan91cxx_can_send,
lan91cxx_send,
lan91cxx_recv,
lan91cxx_deliver, // "pseudoDSR" called from fast net thread
lan91cxx_poll, // poll function, encapsulates ISR and DSR
lan91cxx_int_vector);
NETDEVTAB_ENTRY(smsc_netdev,
"smsc_" CYGDAT_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0_NAME,
smsc_lan91cxx_init,
&smsc_lan91cxx_sc);
#endif // CYGPKG_DEVS_ETH_YOUR_PLATFORM_SMSC_ETH0
// EOF devs_eth_YOUR_PLATFORM_smsc.inl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%