This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem writing a serial hardware interface driver


On Mon, 2005-06-06 at 16:33 +0200, jpath@free.fr wrote:
> Hello,
> 
> I'm porting a BSP from PSOS to the HAL from ECOS (my target is a PPC860) for my
> application, and I have a problem writing my serial hardware interface driver.

What's wrong with the framework that's already in place for PPC8xx?
You can simply adapt one of the existing targets (there are a number
to choose from) for your specific hardware.

Have you looked at the drivers that already exist for this processor?

> I already have all my I/O function "handlers" to attach to the
> DEVTAB_ENTRY/handlers,  but
> I don't understand what is exactly done in the DEVTAB_ENTRY/"module_init"
> function.
> Here are my questions:
> 1) Is there a setup of the serial device driver already done in the ECOS's HAL
> (before the DEVTAB_ENTRY/init), or do I have to add MY driver setup in the
> hal_variant_init() or in the hal_platform_init()?

Normally hal_XXX_init sets up the basic hardware (on the PPC8xx, it 
might set up I/O pins, etc).  It's up to the driver to configure the
device as required.

> 2) the DEVTAB_ENTRY/"init" function is said to be "called when eCos is
> initialized. This function can query the device, setup hardware, etc."
> When is it exactly called in the HAL? in which file?

It's not called from the HAL - it's called from the I/O framework.  This
happens as part of the "CTOR" initializations (called to initialize 
static classes)

> 3) What am I supposed to initialize exactly in the DEVTAB_ENTRY/init function?

100% up to you.  You need to set up enough stuff so that when the lookup
(part of 'opening' a device) happens, you're ready to take off.  
Typically this includes things like setting up interrupt handlers, 
creating auxiliary threads, etc.

> 4) Is there a "Print()" function furnished with ECOS to print messages on the
> console when my serial device driver will be installed?

diag_printf()?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]