public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* SPI Flash
@ 2007-12-18 15:02 Duke
  2007-12-18 15:39 ` Nicolas Ferre
  0 siblings, 1 reply; 5+ messages in thread
From: Duke @ 2007-12-18 15:02 UTC (permalink / raw)
  To: linux-mtd

Hi all,
Has anyone use ST's SPI flash and Atmels SPI DataFlash suscessfully?

How does the interface look from userspace? Is it still an mtdblockX
device or is it a spi device node?
Are these two manufacturers SPI flash compatable?
How about access speed?

Thanks,
D.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SPI Flash
  2007-12-18 15:02 Duke
@ 2007-12-18 15:39 ` Nicolas Ferre
  2007-12-18 15:45   ` Duke
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Ferre @ 2007-12-18 15:39 UTC (permalink / raw)
  To: Duke; +Cc: linux-mtd

Duke :
> Hi all,
> Has anyone use ST's SPI flash and Atmels SPI DataFlash suscessfully?

Atmel DataFlash are working on Linux with this configuration in your 
.config :
CONFIG_MTD_DATAFLASH=y

> How does the interface look from userspace? Is it still an mtdblockX
> device or is it a spi device node?

It is seen as a mtd device :
# cat /proc/mtd
dev:    size   erasesize  name
[..]
mtd2: 00840000 00000420 "spi0.0-AT45DB642x"

So you can mount is using mtdblockx interface.

Regards,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SPI Flash
  2007-12-18 15:39 ` Nicolas Ferre
@ 2007-12-18 15:45   ` Duke
  2007-12-18 15:46     ` Duke
  0 siblings, 1 reply; 5+ messages in thread
From: Duke @ 2007-12-18 15:45 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: linux-mtd

On 12/18/07, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> Duke :
> > Hi all,
> > Has anyone use ST's SPI flash and Atmels SPI DataFlash suscessfully?
>
> Atmel DataFlash are working on Linux with this configuration in your
> .config :
> CONFIG_MTD_DATAFLASH=y
>
> > How does the interface look from userspace? Is it still an mtdblockX
> > device or is it a spi device node?
>
> It is seen as a mtd device :
> # cat /proc/mtd
> dev:    size   erasesize  name
> [..]
> mtd2: 00840000 00000420 "spi0.0-AT45DB642x"
>
> So you can mount is using mtdblockx interface.

Thanks,
Various DataFlash cards have different size alterable, is this
supported my the mtd driver? Let say I want to have a section that I
never want altered, do I need to do partition the dataflash
accordingly so this section wouldn't be erased, or I don't need to do
that? Taken into consideration the filesystem limit on block sizes.

Do you know if this is the same for all spi flash chips that may not
be from atmel?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SPI Flash
  2007-12-18 15:45   ` Duke
@ 2007-12-18 15:46     ` Duke
  0 siblings, 0 replies; 5+ messages in thread
From: Duke @ 2007-12-18 15:46 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: linux-mtd

On 12/18/07, Duke <ezbonites@gmail.com> wrote:
> On 12/18/07, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> > Duke :
> > > Hi all,
> > > Has anyone use ST's SPI flash and Atmels SPI DataFlash suscessfully?
> >
> > Atmel DataFlash are working on Linux with this configuration in your
> > .config :
> > CONFIG_MTD_DATAFLASH=y
> >
> > > How does the interface look from userspace? Is it still an mtdblockX
> > > device or is it a spi device node?
> >
> > It is seen as a mtd device :
> > # cat /proc/mtd
> > dev:    size   erasesize  name
> > [..]
> > mtd2: 00840000 00000420 "spi0.0-AT45DB642x"
> >
> > So you can mount is using mtdblockx interface.
>
> Thanks,
> Various DataFlash cards have different size alterable, is this
> supported my the mtd driver? Let say I want to have a section that I
> never want altered, do I need to do partition the dataflash
> accordingly so this section wouldn't be erased, or I don't need to do
> that? Taken into consideration the filesystem limit on block sizes.
>
> Do you know if this is the same for all spi flash chips that may not
> be from atmel?
>

Sorry, I ment Chips, not Cards (I don't indent to use DataFlash Cards).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SPI Flash
       [not found] <mailman.54.1197992805.2861.linux-mtd@lists.infradead.org>
@ 2007-12-19 15:17 ` Ian McDonnell
  0 siblings, 0 replies; 5+ messages in thread
From: Ian McDonnell @ 2007-12-19 15:17 UTC (permalink / raw)
  To: Duke; +Cc: Nicolas Ferre, linux-mtd

On Tuesday 18 December 2007 10:46, ezbonites@gmail.com wrote:
> Hi all,
> Has anyone use ST's SPI flash and Atmels SPI DataFlash
> suscessfully?
>
> How does the interface look from userspace? Is it still an
> mtdblockX device or is it a spi device node?
> Are these two manufacturers SPI flash compatable?
> How about access speed?
>
> Thanks,
> D.

I found I needed to tweak MTD's cache allocation to make it work
with the atmel DMA'ed SPI. Substitute kmalloc for vmalloc so
the cache buffer is mappable as per the Atmel SPI driver's
requirements.

-imcd


diff -u -I'$Id' -I'$Revision' -r1.1 -r1.2
--- mtdblock.c  13 Aug 2007 04:25:24 -0000      1.1
+++ mtdblock.c  14 Nov 2007 17:36:35 -0000      1.2
@@ -253,7 +253,11 @@
 {
        struct mtdblk_dev *mtdblk = mtdblks[dev->devnum];
        if (unlikely(!mtdblk->cache_data && mtdblk->cache_size)) {
+#ifdef CONFIG_BSE_TWEAKS // BSE fix for dataflash/spi DMA mapping
+               mtdblk->cache_data = kmalloc(mtdblk->mtd->erasesize, GFP_KERNEL);
+#else
                mtdblk->cache_data = vmalloc(mtdblk->mtd->erasesize);
+#endif
                if (!mtdblk->cache_data)
                        return -EINTR;
                /* -EINTR is not really correct, but it is the best match
@@ -315,7 +319,11 @@
                mtdblks[dev] = NULL;
                if (mtdblk->mtd->sync)
                        mtdblk->mtd->sync(mtdblk->mtd);
+#ifdef CONFIG_BSE_TWEAKS // BSE fix for dataflash/spi DMA mapping
+               kfree(mtdblk->cache_data);
+#else
                vfree(mtdblk->cache_data);
+#endif
                kfree(mtdblk);
        }
        DEBUG(MTD_DEBUG_LEVEL1, "ok\n");

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-19 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.54.1197992805.2861.linux-mtd@lists.infradead.org>
2007-12-19 15:17 ` SPI Flash Ian McDonnell
2007-12-18 15:02 Duke
2007-12-18 15:39 ` Nicolas Ferre
2007-12-18 15:45   ` Duke
2007-12-18 15:46     ` Duke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox