<p><br />Hi there,</p><p>We are working on an embedded platform which has 256MB DDR and 64MB strataflash(<span>TE28F64J3C-120</span>) and&nbsp; our databus is 32 bits.&nbsp;</p><p>we have used the following MAP driver for our strata flash as the start of our work:</p><p>------------------------------------------&nbsp;</p><p><p>#include &lt;linux/module.h&gt;<br />#include &lt;linux/types.h&gt;<br />#include &lt;linux/kernel.h&gt;<br />#include &lt;asm/io.h&gt;<br />#include &lt;linux/mtd/mtd.h&gt;<br />#include &lt;linux/mtd/map.h&gt;<br />#include &lt;linux/mtd/partitions.h&gt;<br />#include &lt;linux/delay.h&gt;<br /></p></p><p><p>struct map_info sdp_map =<br />{<br />&nbsp;&nbsp;&nbsp; .name=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;SDP Flash&quot;,<br />&nbsp;&nbsp;&nbsp; .size=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 * 1024 * 1024, /* Overwritten by cfi_probe */<br />&nbsp;&nbsp;&nbsp; .bankwidth=&nbsp;&nbsp; 2,<br />&nbsp;&nbsp;&nbsp; .phys=NO_XIP&nbsp;&nbsp;&nbsp; <br /><br />&nbsp;&nbsp;&nbsp; /*<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; read:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sdp_read,<br />&nbsp;&nbsp;&nbsp; write:&nbsp;&nbsp;&nbsp;&nbsp; sdp_write,<br />&nbsp;&nbsp;&nbsp; copy_from:&nbsp; sdp_copy_from,<br />&nbsp;&nbsp;&nbsp; */&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />};<br /><br />static struct mtd_partition sdp_flash_partition[] =<br />{<br />&nbsp;&nbsp;&nbsp; /*<br />&nbsp;&nbsp;&nbsp; &nbsp;* Flash map in the <br />&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;&nbsp;&nbsp; KERNEL AND BOOTLOADER AND ROOT : 20000000-24000000<br />&nbsp;&nbsp;&nbsp; */<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;data&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 0x800000,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; offset:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 0x00000000<br />&nbsp;&nbsp;&nbsp; },<br />};<br />static struct mtd_partition *sdp_partitions;<br />#define NB_OF(x)&nbsp;&nbsp;&nbsp; (sizeof(x)/sizeof(x[0]))<br />static struct mtd_info&nbsp;&nbsp;&nbsp; *mymtds;<br />static int __init sdp_init_mtd (void)<br />{<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nb_parts;<br />&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *part_type = &quot;static&quot;;<br />&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i;<br />&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flash_addresses = 0x20000000;<br />&nbsp;<br />&nbsp;&nbsp;&nbsp; /* Determine flash partitioning */<br />&nbsp;&nbsp;&nbsp; sdp_partitions = sdp_flash_partition;<br />&nbsp;&nbsp;&nbsp; nb_parts = NB_OF(sdp_flash_partition);<br />&nbsp;&nbsp;&nbsp; sdp_map.virt = ioremap (flash_addresses, sdp_map.size);<br />&nbsp;&nbsp;&nbsp; mymtds = do_map_probe(&quot;cfi_probe&quot;, &amp;sdp_map);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!mymtds){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iounmap ((void *) sdp_map.map_priv_1);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -ENXIO;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk (KERN_NOTICE &quot;SDP flash device: %08xMB at 0x%08x\n&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (mymtds-&gt;size), flash_addresses);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sdp_map.size = mymtds-&gt;size;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mymtds-&gt;owner = THIS_MODULE;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printk (KERN_NOTICE &quot;Using %s partition definition\n&quot;, part_type);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add_mtd_partitions (mymtds, sdp_partitions, nb_parts);<br />&nbsp; &nbsp;&nbsp; &nbsp; return 0;<br />}<br /><br />static void __exit sdp_cleanup_mtd(void)<br />{<br />&nbsp;&nbsp;&nbsp; printk(&quot;sdp_cleanup_mtd\n&quot;);<br />&nbsp;&nbsp;&nbsp; return;<br />}<br /><br />module_init(sdp_init_mtd);<br />module_exit(sdp_cleanup_mtd); <br /></p></p><p>-----------------------------------------------<br /> 
</p><p>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 mapping in kernel. &nbsp;</p><p>So, </p><p>&nbsp;&nbsp;&nbsp; 1- What we can do now if we want to map all of flash?</p><p>&nbsp;&nbsp;&nbsp; 2- Does it relate 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 flash itself or data bandwidth or number of flashes on the board?)</p><p>&nbsp;</p><p>Any help will be greatly appretiated.&nbsp;</p><p>&nbsp;</p><BR>