This is the mail archive of the ecos-discuss@sourceware.org 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: Redboot: No network interfaces found on olimex lpc-l2294 board


On Wed, Nov 14, 2007 at 08:48:26AM +0100, Andrew Lunn wrote:
> > Sergei's code:
> > 
> > static __inline__ void post_reset(cyg_addrword_t base)
> > {
> >     // Toggle A0 connected to the SBHE# line
> >     *(char *)0x82000000 = 1;
> >     *(char *)0x82000001 = 2;
> >     *(char *)0x82000000 = 3;
> >     *(char *)0x82000001 = 0;
> > }
> > 
> > Your code:
> > 
> > static __inline__ void post_reset(cyg_addrword_t base)
> > {
> >     // Toggle A0 connected to the SBHE# line
> >     (*(volatile char *)0x82000001) = 0x00;
> >     (*(volatile char *)0x82000000) = 0x00;
> >     (*(volatile char *)0x82000001) = 0x00;
> > }
> 
> The correct thing to do here is use the HAL MACROS
> 
> HAL_WRITE_UINT8
> HAL_WRITE_UINT16
> HAL_WRITE_UINT32
> 
> and
> 
> HAL_READ_UINT8
> HAL_READ_UINT16
> HAL_READ_UINT32
> 
> These will take care of the volatile etc.
> 
>       Andrew
> 

Andrew, you're seeing in a root of the problem as you do it as well :-)
>From my side that was just a copy such a rudimentary coding style for CL
was cut from the devs_eth_arm_cerfpda.inl driver. Your points is
appreciated, thank you.

Sergei


-- 
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]