This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Ethernet on top of SPI
- From: Ilija Stanislevik <ilijas at siva dot com dot mk>
- To: Bart Veer <bartv at ecoscentric dot com>, ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 14 Oct 2009 18:57:16 +0200
- Subject: Re: [ECOS] Ethernet on top of SPI
- References: <4AD57670.9020705@siva.com.mk> <pniqeithth.fsf@delenn.bartv.net>
Bart Veer wrote
> The code which instantiates the cyg_spi_device object, typically the
> platform HAL, should not care about how other code uses the device.
> That other code may be your driver, some other driver, or application
> code directly. It should simply make sure that the cyg_spi_device
> object contains all the information needed by the SPI bus driver to
> allow interaction with the physical device, i.e. polarity and phase
> info, chip select wiring details, etc.
> The details of this will depend
> on the SPI bus driver. There should be no need to change any of these
> settings by configury or at run-time.
>
> So, the way things are expected to work is that the platform HAL will
> instantiate a cyg_spi_device object with a well-known name, e.g.
> cyg_spi_enc424j600_0. All the hardware-specific details are encoded
> inside that object. The ethernet driver will expect that something
> else provides an object cyg_spi_enc424j600_0 If that expectation is
> not met then you'll get a bunch of errors at compile-time. If you
> prefer you can get the errors at configure-time by having a CDL
> interface and constraints on that interface. The ethernet driver does
> not need to worry about any of the hardware-specific details.
>
My idea is to produce an Ethernet-on-top-of-SPI driver which can be used
on ANY particular SPI driver or, in other words, I wish if the low-level
Ethernet driver does not care which SPI driver is below. This way I (or
anyone) will be able to use the same low-level Ethernet driver with any
SPI driver, without going into depths of specific SPI implementation.
> If you take a look at devs/disk/generic/mmc, that code already works
> along similar lines. The driver looks for a cyg_spi_device
> cyg_spi_mmc_dev0. It is up to the platform HAL (usually) to
> instantiate that object with the right settings.
>
> Bart
>
>
Thank you for the comprehensive explanation and for directions. I find
it very useful.
Going to dig some code and manuals,
Ilija Stanislevik
SIvA doo
Macedonia
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss