This is the mail archive of the ecos-maintainers@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: [flashv2 merge] io/flash


Bart Veer wrote:
>>>>>> "Jifl" == Jonathan Larmour <jifl@eCosCentric.com> writes:
> 
>     <snip>
>     
>     >> Now, I suspect that no solution is going to work for every bit of
>     >> hardware that people can conceive off. As and when we run into
>     >> problems we may have to add configury for setting certain init
>     >> priorities, together with requires constraints in the platform HAL, to
>     >> ensure that everything initializes in the correct order for a specific
>     >> platform. However the following order should work for most systems:
>     >> 
>     >> #define CYG_INIT_BUS_PRIMARY
>     >> #define CYG_INIT_BUS_PCI		(alias for PRIMARY)
>     >> #define CYG_INIT_BUS_SECONDARY
>     >> #define CYG_INIT_BUS_USBHOST		(alias for secondary)
>     >> #define CYG_INIT_BUS_TERTIARY
>     >> #define CYG_INIT_BUS_SPI		(alias for tertiary)
>     >> #define CYG_INIT_BUS_I2C		(ditto)
>     >> #define CYG_INIT_BUS_CAN		(?)
>     >> #define CYG_INIT_DEV_WATCHDOG
>     >> #define CYG_INIT_DEV_WALLCLOCK
>     >> #define CYG_INIT_DEV_BLOCK_PRIMARY
>     >> #define CYG_INIT_DEV_FLASH		(alias for BLOCK_PRIMARY)
>     >> #define CYG_INIT_CONFIG
>     >> #define CYG_INIT_DEV_BLOCK_SECONDARY
>     >> #define CYG_INIT_DEV_CHAR		(all other devices)
>     >> #define CYG_INIT_IO_FS
>     Jifl> [big snip]
> 
>     Jifl> I think this is all absolutely fine.
> 
> Actually, it is wrong in at least one place. I remember one board
> where the CAN interface was hanging off an SPI bus instead of being
> on-chip. That implies CAN should be treated as a network device, not a
> bus, and should init at CYG_INIT_DEV_CHAR.
> 
> Everybody, please think carefully about any funny boards you have come
> across over the years, and whether or not the above order makes sense.

Of course the purpose of having these numbers abstracted is that if we do
need to, it can be tweaked.

>     >> Finally the file I/O subsystem. Possibly this should happen
>     >> earlier, between DEV_BLOCK_PRIMARY and CONFIG, so that an
>     >> implementation of the config data module can be layered on top
>     >> of file I/O. Or possibly CYG_INIT_IO_FS should happen
>     >> immediately after CYG_INIT_MEMALLOC, with the proviso that file
>     >> I/O operations for devices may fail until later in the init
>     >> sequence.
> 
>     Jifl> It's certainly plausible to want to read config data from an
>     Jifl> FS, IMHO. But CYG_INIT_MEMALLOC seems unnecessarily early
>     Jifl> and would probably cause more problems than it solves.
> 
> I am not sure I agree with that. MEMALLOC should only involve main
> memory, with no need to worry about whether or not any of the I/O
> subsystem is available yet. Initializing MEMALLOC early means that
> device drivers could perform run-time detection and dynamically
> allocate any buffers required, instead of statically allocating for
> the worst case.

I thought you were saying the order would be CYG_INIT_MEMALLOC,
CYG_INIT_IO_FS and then the rest of the CYG_INIT_IO*. I don't have any
issue with MEMALLOC being first, but wouldn't have thought that
CYG_INIT_IO_FS being before CYG_INIT_IO* would work well.

Were you saying something differnt perhaps?

> On the other hand, some drivers for e.g. framebuffer devices may need
> to mess about with the memory map and lower memtop. Although really
> that kind of thing should be handled at the platform linker script
> level, not at run-time.
> 
> I suspect that in the long term we'll be happier initializing memalloc
> early on.

I agree, and didn't disagree :-).

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine


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