[ECOS] Re: How can I use the flashs of sst29vfxxx and intel_strata at the same timeat redboot ???

Steven_cheng 05071@alphanetworks.com
Wed Sep 14 05:07:00 GMT 2005


Hi Andrew,

    It does not works in some commands.

As following:
RedBoot> fis list
... Read from 0x70fe0000-0x70fffbff to 0x0efe0000:
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0x70000000  0x70000000  0x00040000  0x00000000
FIS directory     0x70FE0000  0x70FE0000  0x0001FC00  0x00000000
RedBoot config    0x70FFFC00  0x70FFFC00  0x00000400  0x00000000

RedBoot> load -m xmodem -b 0x100000
CCCCAddress offset = 0x000c0000
Entry point: 0x00100100, address range: 0x00100000-0x00135cc8
xyzModem - CRC mode, 2553(SOH)/0(STX)/0(CAN) packets, 4 retries

RedBoot> fis create pX[RAM] -f 0xfff00000
... Read from 0x70fe0000-0x70fffbff to 0x0efe0000:
... Read from 0x70fe0000-0x70fffbff to 0x0efe0000:
... Read from 0x70fe0000-0x70fffbff to 0x0efe0000:
Invalid FLASH address - not free!

I find it is taken mistake in find_free() (codebase is flashv2 branch of
ecos);
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////
static int
find_free(struct free_chunk *chunks)
{
    cyg_flashaddr_t err_addr;
    cyg_flash_info_t info;
    struct fis_image_desc *img;
    int i=0, idx;
    int num_chunks = 0;
    int ret;

    do {
      ret = cyg_flash_get_info(i, &info);
      if (ret == CYG_FLASH_ERR_OK) {
        if (i == 0 ) {
          // Do not search the area reserved for pre-RedBoot systems:
          chunks[num_chunks].start = (info.start +
                                        CYGNUM_REDBOOT_FLASH_RESERVED_BASE +
                                        CYGBLD_REDBOOT_MIN_IMAGE_SIZE);
          chunks[num_chunks].end = info.end;
          num_chunks++;
        } else {   // Contiguous flash? If so collapse the chunks together.
          if (chunks[num_chunks-1].end == (info.start -1)) {
            chunks[num_chunks-1].end = info.end;
          } else {
            chunks[num_chunks].start = info.start;
            chunks[num_chunks].end = info.end;
            num_chunks++;
          }
        }
      }
      i++;
    } while (ret != CYG_FLASH_ERR_INVALID);

/////////// chunks[] value  [correct !!]//////////////////////////////////
chunks[0].start  = 0x70040000
chunks[0].end = 0x70ffffff
chunks[1].start  = 0xfff00000
chunks[1].end = 0xfff7fffff
///////////////////////////////////////////////////////////////////

    cyg_flash_read(fis_addr, fis_work_block, fisdir_size, &err_addr);
    img = (struct fis_image_desc *) fis_work_block;
    for (i = 0;  i < fisdir_size/sizeof(*img);  i++, img++) {
        if (img->name[0] != (unsigned char)0xFF) {
            // Figure out which chunk this is in and split it
            for (idx = 0;  idx < num_chunks;  idx++) {
                if ((img->flash_base >= chunks[idx].start) &&
                    (img->flash_base <= chunks[idx].end)) {
                    if (img->flash_base == chunks[idx].start) {
                        chunks[idx].start += img->size;
                        if (chunks[idx].start >= chunks[idx].end) {
                            // This free chunk has collapsed
                            while (idx < (num_chunks-1)) {
                                chunks[idx] = chunks[idx+1];
                                idx++;
                            }
                            num_chunks--;
                        }
                    } else if ((img->flash_base+img->size) ==
chunks[idx].end) {
                        chunks[idx].end = img->flash_base;
                    } else {
                        // Split chunk into two parts
                        chunks[idx+1].start = img->flash_base + img->size;
                        chunks[idx+1].end = chunks[idx].end;
                        if (++num_chunks ==
CYGDAT_REDBOOT_FIS_MAX_FREE_CHUNKS) {
                          diag_printf("Warning: too many free chunks\n");
                          return num_chunks;
                        }
                        chunks[idx].end = img->flash_base;
                    }
                    break;
                }
            }
        }
    }
    return num_chunks;
}
#endif // CYGDAT_REDBOOT_FIS_MAX_FREE_CHUNKS

/////////// chunks[] value [Error value]//////////////////////////////////
chunks[0].start  = 0x70040000
chunks[0].end = 0x70fe0000
chunks[1].start  = 0x71000000
chunks[1].end = 0x70ffffff
///////////////////////////////////////////////////////////////////

Question :
1. I think this function is taken mistake. Is it correct ??
2. How can I get the lastest code for falsh multi-driver ??
Use " cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -r
flashv2 -P ecos " ??

Thank you~~

Steven Cheng



> >
> > The flash info :
> > Flash type                    BaseAddress                       Size
>
> --------------------------------------------------------------------------
--
> > Intel Strata                   0x70000000
0x1000000
> > (16MB)
> > SST 39VFXXX           0xfff00000                          0x80000
(512KB)

> > The redboot displays in power on :
> > ///////////////////////////////////
> > Platform: pX (PowerPC 8245)
> > Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
> >
> > RAM: 0x00000000-0x10000000, [0x0007ec40-0x0efdd000] available
> > FLASH: 0x70000000 - 0x70ffffff 128 x 0x20000 blocks
> > FLASH: 0xfff00000 - 0xfff7ffff 128 x 0x1000 blocks
>
> Redboot is finding the two flashes, so the basic setup is probably
correct.
>
> > RedBoot> fis list
> > ... Read from 0x70fe0000-0x70ffefff to 0x0efe0000:
> > Name              FLASH addr  Mem addr    Length      Entry point
> > RedBoot           0x70000000  0x70000000  0x00020000  0x00000000
> > RedBoot[RAM]      0x70020000  0x70020000  0x00040000  0x00100100
> > FIS directory     0x70FE0000  0x70FE0000  0x0001F000  0x00000000
> > RedBoot config    0x70FFF000  0x70FFF000  0x00001000  0x00000000
> >


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list