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: Creating UART driver


eibach@gdsys.de wrote:
Hello,

I want to write a driver for the EXAR XR16L788 8 channel UART, which is based on the 16C550 registers.
The UART is connected to my Atmel EB40A board.
I have found the generic 16x5x driver in packages/devs/serial/generic. I think I could modify it to fit for the XR16L788.

But how do I put the driver into the ecos tree the correct way? I didn't find anything very helpful in the docu or the maling list.
Is there something like a driver creation - sourcetree setup HOWTO?

Not that I know of - you could write one when you're done =8^)


In eCos, drivers are (whenever possible) split into a generic part, and
a platform-specific part that contains all the stuff needed to make the
generic driver work on a specific platform. Both parts are put into
their own packages.

You will need to create a platform-specific package for your target. A
good starting point would be the platform-specific 16550A driver
packages that already exist, for instance that for the common PC target.
Take a look at <...>/packages/devs/serial/i386/pc. There you will find
two files of interest:

<...>cdl/ser_i386_pc.cdl - this CDL file contains all the PC-specific
settings that can be used for the generic serial driver

<...>include/i386_pc_ser.inl - this file contains definitions for the PC target. It is included during compilation of the generic driver.

Adapt these two files for the specifics of your target. Then, you must
add your new package to the eCos package database ecos.db. Finally,
create a new 'target' section in the database for the EB40A with your
new driver package (since you cannot add hardware packages to an
existing target with configtool).

Unless the generic driver is not really generic, this should all be
fairly simple and painless.
--
--------------------------------------------------------------------
|     Eric Doenges              |     DynaPel Laboratories GmbH    |
|     Tel: +49 89 962428 23     |     Fraunhoferstrasse 9/2        |
|     Fax: +49 89 962428 90     |     D - 85737 Ismaning, Germany  |
--------------------------------------------------------------------


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


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