This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Problem about writing IO device driver
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: HuangQiang <jameshq at liverpool dot ac dot uk>
- Cc: eCos <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 08 Jan 2002 15:08:26 +0000
- Subject: Re: [ECOS] Problem about writing IO device driver
- Organization: Red Hat UK Ltd.
- References: <KIEBICHBADHFCLGCKOPDEEMMCKAA.jameshq@liv.ac.uk>
HuangQiang wrote:
>
> Hi all:
> I am trying to write a device (logical) driver for memory mapped IO
> device for ARM E7T board. I have a question:
>
> I develope the logical device driver for memory mapped io device follow the
> way doing serial device driver.
>
> calling procedure is:
>
> 1. install the IO function: DEVIO_TABLE(...)
> 2. write the logical device driver function: read(), write(), set_config(),
> get_config()
> 3. in read(), write(), set_config(), get_config() call the hardware function
> to manipulate the hardware
>
> one problem is that: I need to pass the register address into the
> application (call cyg_io_read(), cyg_io_write()) as reading or writing to
> the memory mapped io device. but cyg_io_read(), cyg_io_write() can't receive
> this extra parameter. So any way doing this? Or maybe I went into the wrong
> way. Thanks for any help.
You should associate the register address with the handle of each device,
the handle in turn corresponding to the DEVTAB_ENTRY.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine