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: [ Spam Mail ] Re: How can I initial the flashs of sst29vfxxx and intel_strata at do_flash_init() ? (This message is to be blocked by code: bkfkact590)


On Tue, Aug 30, 2005 at 09:57:08AM +0800, Steven_cheng wrote:
> Hi Andrew,
> 
>     There are two flashs in my platform at the same time, one intel
> strata, the other is sst 39vfxxx. But it only one strata flash or vf39xxx
> flash can be initiated and work currently.
> 
> Q1 : Is only one driver initiated at the same time with multi-driver ??

No, it will initialize all drivers in the table.

> The flash spec is as following:
> 
> chip : sst vf39xxx (Boot ROM)
> start : 0xfff00000
> end  : 0xfff80000
> size  : 512K
> 
> chip : intel strata
> start : 0x70000000
> end  : 0x71000000
> size  : 16MB
> 
> The target is announced in ecos.db as following:
> 
> target px {
>  alias  { "Alpha pX PowerPC 8245" px8245 }
>  packages        { CYGPKG_HAL_POWERPC
>                           CYGPKG_HAL_POWERPC_PPC60x
>                           CYGPKG_HAL_POWERPC_PX
>                           CYGPKG_IO_PCI
>                           CYGPKG_IO_FLASH
>                           CYGPKG_DEVS_FLASH_SST_39VFXXX
>                           CYGPKG_DEVS_FLASH_SST_POWERPC_PX
>                           CYGPKG_DEVS_FLASH_STRATA
>                           CYGPKG_DEVS_FLASH_STRATA_POWERPC_PX

This looks OK. Two generic drivers and two specific drivers.

>                           CYGPKG_IO_ETH_DRIVERS
>                           CYGPKG_DEVS_ETH_ICPLUS_IP1000
>                           CYGPKG_DEVS_ETH_ICXIP1000_POWERPC_PX
>         }
>         description "
>             The pX target provides the packages needed to run
>             eCos on the Alpha pX (8245) board."
> }
> 
> Q2 : And Do I need modify the following code in the
> /io/flash/current/src/flash.c ??
> 
> cyg_flash_get_info(cyg_uint32 Nth, cyg_flash_info_t * info)
> {
>   struct cyg_flash_dev * dev;
> 
>   if (!init) return CYG_FLASH_ERR_NOT_INIT;
> 
> #if (1 == CYGHWR_IO_FLASH_DEVICE)
>   if ((0 == Nth) && cyg_flashdevtab[0].init) {
>       dev = &(cyg_flashdevtab[0]);
>   } else {
>       return CYG_FLASH_ERR_INVALID;
>   }
> #else
>   // Only initialized devices are on the list.
>   for (dev = flash_head; dev && Nth; dev=dev->next, Nth--)
>     ;       <----------------------------------------- Do I need modify  it
> ????

No this is correct. The whole point of putting the ; on a new line is
to indicate it is deliberate. If i was to see:

for (dev = flash_head; dev && Nth; dev=dev->next, Nth--);

then i would be suspicious.

What this code is doing is counting along the linked list of devices
to find the N'th device.

Please describe your problem in more detail. What do you see and what
don't you see. Why do you think only one is being initialized?

        Andrew

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