aihuazou,
I read your question as how do I write a driver for my flash chip. I'm afraid there is no real shortcut, you need to start with an existing driver and modify it to work with your flash part, as monkeyboy has already explained with this post.
<div class='quotetop'>QUOTE </div>
--- Quote Start ---
Unfortunately you cannot use the Altera CFI flash driver with eCos since eCos is based on the eCos HAL, rather than the Altera HAL - so you will need to provide an eCos specific driver for your flash part.
My guess would be that flash_tc58xxx.inl is a good starting point, although I haven't personally used these flash parts/your board - so I can't be certain.
As far as I'm aware, there's no documentation on how to write flash drivers for eCos. The best way at this is to follow the existing examples, and read the comments in the apropriate source code. In your case moab_nand_flash.c may serve as a useful example.
An explanation of the macros you will need to define (such as CYGNUM_FLASH_INTERLEAVE) can be found in flash_tx58xxx_parts.inl.
In addition, the flash driver provided for the flash on the Nios II development board may help explain how to access Nios II specific information (such as the base address of the flash part).
Good luck![/b]
--- Quote End ---