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]

Re: driver init and timer enable


Hi Bart,
I totally understood the current implement of those feature.

Thank you!

Bart Veer wrote:
> >>>>> "Kashiwaya" == KASHIWAYA Haruki <kashiwaya@redhat.com> writes:
> 
>     Kashiwaya> Hi There,
>     Kashiwaya> I have some questions about driver initialization.
> 
>     Kashiwaya> Q1:
>     Kashiwaya> When I try to use cyg_thread_delay() in driver initialization,
>     Kashiwaya> the function donot work correctly because all interrupts are
>     Kashiwaya> disabled until it is enabled in sched.cxx:
> 
>     Kashiwaya> 232:    // Let the interrupts go
>     Kashiwaya> 233:    Cyg_Interrupt::enable_interrupts();
> 
> 
>     Kashiwaya> I know cyg_thread_delay() is primarily for *thread*
>     Kashiwaya> use, but I guess it is better if eCos provide the delay
>     Kashiwaya> function for driver use.
> 
> Driver initialization should normally happen with interrupts disabled,
> so cannot rely on clock interrupts.
> 
> If a device driver needs to wait for a little bit while hardware
> settles down, this would normally involve a busy loop based on a
> bogomips rating. The rating can be calculated at run-time early on in
> the startup. Alternatively it could be determined by other means and
> set by the user via a configuration option - the latter approach saves
> some code. There are issues such as whether or not various caches are
> enabled.
> 
> Unfortunately so far we have managed to do without generic bogomips
> support, so it has not been implemented yet.
> 
>     Kashiwaya> Q2:
>     Kashiwaya> All driver's init function is called from cyg_io_init()
>     Kashiwaya> in sysio.c, it seems there is no way to specify the
>     Kashiwaya> calling order of each init function. I guess the order
>     Kashiwaya> is decided by DEVTAB entry in linker. Forwhy if each
>     Kashiwaya> driver is in association and if it need an order, it
>     Kashiwaya> must to specify the order of initialization.
> 
>     Kashiwaya> Maybe I misunderstood something but any suggestion
>     Kashiwaya> would be appreciated.
> 
> Ordering the device drivers can be achieved by having appropriately
> numbered sections, and then using a SORT directive in the linker
> script. I believe that with the current sources, putting one device
> driver into section .devtab.0 and another into section .devtab.1, you
> can control the initialization order. Some work is in progress to
> generalise this, so that we can add new entities like the device table
> without having to modify all the linker scripts.
> 
> Bart Veer // eCos net maintainer
> 



--
KASHIWAYA Haruki
Red Hat K.K.

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