public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] Creating UART driver
  2003-09-11 13:37 [ECOS] Creating UART driver eibach
@ 2003-09-11 13:37 ` Gary Thomas
  2003-09-11 13:37 ` Eric Doenges
  1 sibling, 0 replies; 5+ messages in thread
From: Gary Thomas @ 2003-09-11 13:37 UTC (permalink / raw)
  To: eibach; +Cc: eCos Discussion

On Thu, 2003-09-11 at 06:18, 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?

You don't need to modify that driver.  It's designed to work with your
platform specific code.  Look at how it's done for any of the platforms
that are already using it, e.g. the x86 PC, the ARM PID, etc.

What you'll end up doing is create a platform specific package which
is an instantiation of the generic 16x5x package.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ECOS] Creating UART driver
@ 2003-09-11 13:37 eibach
  2003-09-11 13:37 ` Gary Thomas
  2003-09-11 13:37 ` Eric Doenges
  0 siblings, 2 replies; 5+ messages in thread
From: eibach @ 2003-09-11 13:37 UTC (permalink / raw)
  To: ecos-discuss

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?

Regards,
Dirk Eibach


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Creating UART driver
  2003-09-11 13:37 [ECOS] Creating UART driver eibach
  2003-09-11 13:37 ` Gary Thomas
@ 2003-09-11 13:37 ` Eric Doenges
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Doenges @ 2003-09-11 13:37 UTC (permalink / raw)
  To: eibach; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Creating UART driver
  2004-04-14  7:28 ` [ECOS] Creating UART driver Sam Pham
@ 2004-04-14 13:49   ` Nick Garnett
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Garnett @ 2004-04-14 13:49 UTC (permalink / raw)
  To: Sam Pham; +Cc: ecos-discuss

Sam Pham <anhmn@yahoo.com> writes:

> Hello,
> 
> I have a simlar task as mentioned in the the email
> below.  One thing I don't understand about its
> explaination is the last step: 
> 
> "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)"
> 
> Why do we have to create a new 'target' section? 
> Can't we just adding new driver package into the
> exising 'target' section?

In the example the original serial drivers are being replaced with new
ones. Hence it is necessary to make a new target. If you just add the
new drivers to the existing target, then you will have both sets of
drivers present at the same time. If this is what you want you can do
it. Just make sure that the device names are distinct.

> 
> Also, after adding new driver package into the
> existing 'target' section, my .ecc file does not have
> -hardware or -template for this new package.  For
> example, CYGPKG_IO_SERIAL_GENERIC_16X5X stands alone
> by itself:


This I cannot help you with. Maybe there are some obscure rules about
when a package gets marked with -hardware here. Note that you need a
platform customization package to go with the 16X5X driver. The lack
of this may have something to do with it.

> 
>     hardware    pc ;
>     template    default ;
>     package -hardware CYGPKG_HAL_POWERPC current ;
>     package -hardware CYGPKG_HAL_POWERPC_MPC8xx
> current ;
>     package -hardware CYGPKG_HAL_POWERPC_ADDER current
> ;
>     package -hardware CYGPKG_HAL_QUICC current ;
>     package -template CYGPKG_HAL current ;
>     package -template CYGPKG_IO current ;
>     package -template CYGPKG_IO_SERIAL current ;
>     package CYGPKG_IO_SERIAL_GENERIC_16X5X current ;
> 
> Thanks.
> 

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Creating UART driver
  2004-04-13 22:12 [ECOS] What to use instead of pipe? Konstantin Azarov
@ 2004-04-14  7:28 ` Sam Pham
  2004-04-14 13:49   ` Nick Garnett
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Pham @ 2004-04-14  7:28 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I have a simlar task as mentioned in the the email
below.  One thing I don't understand about its
explaination is the last step: 

"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)"

Why do we have to create a new 'target' section? 
Can't we just adding new driver package into the
exising 'target' section?

Also, after adding new driver package into the
existing 'target' section, my .ecc file does not have
-hardware or -template for this new package.  For
example, CYGPKG_IO_SERIAL_GENERIC_16X5X stands alone
by itself:

    hardware    pc ;
    template    default ;
    package -hardware CYGPKG_HAL_POWERPC current ;
    package -hardware CYGPKG_HAL_POWERPC_MPC8xx
current ;
    package -hardware CYGPKG_HAL_POWERPC_ADDER current
;
    package -hardware CYGPKG_HAL_QUICC current ;
    package -template CYGPKG_HAL current ;
    package -template CYGPKG_IO current ;
    package -template CYGPKG_IO_SERIAL current ;
    package CYGPKG_IO_SERIAL_GENERIC_16X5X current ;

Thanks.




    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.


	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-04-14  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-11 13:37 [ECOS] Creating UART driver eibach
2003-09-11 13:37 ` Gary Thomas
2003-09-11 13:37 ` Eric Doenges
2004-04-13 22:12 [ECOS] What to use instead of pipe? Konstantin Azarov
2004-04-14  7:28 ` [ECOS] Creating UART driver Sam Pham
2004-04-14 13:49   ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).