From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward.hsphere.cc (forward-dummy6.hsphere.cc [216.157.144.6]) by ozlabs.org (Postfix) with SMTP id B3D66DDDF4 for ; Wed, 24 Oct 2007 23:07:00 +1000 (EST) Content-Type: text/html; charset="iso-8859-1" MIME-Version: 1.0 From: Amin Farajian To: linuxppc-embedded@ozlabs.org Subject: strataflash size and partitioning problem Date: Wed, 24 Oct 2007 09:00:08 -0400 Message-Id: <20071024130700.B3D66DDDF4@ozlabs.org> Reply-To: afarajian@sinamicro.com List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: ,


Hi there,

We are working on an embedded platform which has 2= 56MB DDR and 64MB strataflash(TE28F64J3C-120) and  our da= tabus is 32 bits. 

we have used the following MAP driver for our= strata flash as the start of our work:

-----------------------------= ------------- 

#include <linux/module.h>
#include = <linux/types.h>
#include <linux/kernel.h>
#include &l= t;asm/io.h>
#include <linux/mtd/mtd.h>
#include <linu= x/mtd/map.h>
#include <linux/mtd/partitions.h>
#include = <linux/delay.h>

struct map_info sdp_map =3D
{=
    .name=3D       "= ;SDP Flash",
    .size=3D    &= nbsp;  8 * 1024 * 1024, /* Overwritten by cfi_probe */
 &nbs= p;  .bankwidth=3D   2,
    .phys=3DNO_XI= P   

    /*
  &nbs= p;     read:      sdp_read,
&n= bsp;   write:     sdp_write,
  = ;  copy_from:  sdp_copy_from,
    */ &nb= sp;   
};

static struct mtd_partition sdp_f= lash_partition[] =3D
{
    /*
  &nb= sp;  * Flash map in the
     *  &n= bsp; KERNEL AND BOOTLOADER AND ROOT : 20000000-24000000
  &n= bsp; */
    {
    name:  =       "data",
   &nb= sp;    size:         0x80= 0000,
        offset:  &n= bsp;      0x00000000
    },
};=
static struct mtd_partition *sdp_partitions;
#define NB_OF(x)&nb= sp;   (sizeof(x)/sizeof(x[0]))
static struct mtd_info &= nbsp;  *mymtds;
static int __init sdp_init_mtd (void)
{
   
    int    &nb= sp;            =     nb_parts;
    char   =             &nb= sp;    *part_type =3D "static";
  &= nbsp; int           =           i;
  =   unsigned int         &n= bsp;  flash_addresses =3D 0x20000000;
 
  &nb= sp; /* Determine flash partitioning */
    sdp_partitio= ns =3D sdp_flash_partition;
    nb_parts =3D NB_OF(sdp_= flash_partition);
    sdp_map.virt =3D ioremap (flash_a= ddresses, sdp_map.size);
    mymtds =3D do_map_probe(&q= uot;cfi_probe", &sdp_map);
     &nbs= p;  if (!mymtds){
        = ;        iounmap ((void *) sdp_map.map_p= riv_1);
          &n= bsp;     return -ENXIO;
    &n= bsp;       }

   &nb= sp;    printk (KERN_NOTICE "SDP flash device: %08xMB at= 0x%08x\n",
         = ;       (mymtds->size), flash_addresses);<= br />
        sdp_map.size =3D mymt= ds->size;
        mymtds->own= er =3D THIS_MODULE;
        printk = (KERN_NOTICE "Using %s partition definition\n", part_type);
=         add_mtd_partitions (mymtds, sdp_= partitions, nb_parts);
       return 0;
}

static void __exit sdp_cleanup_mtd(void)
{
  &n= bsp; printk("sdp_cleanup_mtd\n");
    return;=
}

module_init(sdp_init_mtd);
module_exit(sdp_cleanup_= mtd);

-----------------------------------------------
=0D

But unfortunately we were not able to map upper than 8MB of flash , = and we found that the problem was related the range of Virtual address mapp= ing in kernel.  

So,

    1- What we can do= now if we want to map all of flash?

    2- Does it re= late to bankwidth parameter in map_info structure? ( if we set that to 1 ,4= , and the system will hangup..So what is that parameter?is it related to fl= ash itself or data bandwidth or number of flashes on the board?)

&nbs= p;

Any help will be greatly appretiated. 

 


=