Google
  Web www.spinics.net

Re: at91 dataflash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Friday 28 March 2008 06:17, Victor Librado wrote:
>  So ...
>
> what is the point in the failure with dma error while trying
> to write to the mtd partition of the dataflash, command:
>
> dd if=bootloAder.bin of=/dev/mtdblock2.
>
> Bug, under the driver, in AT91 dataflash card support CONFIG
> option in kernel sources?
>
> Any configuratio nmissing in kernel config or error in dd
> statement?
>

See my earlier posting from December for a simple work-around...

Date: Wed, 19 Dec 2007 10:17:51 -0500
Subject: SPI Flash
In-Reply-To: <mailman.54.1197992805.2861.linux-mtd@xxxxxxxxxxxxxxxxxxx>
References: <mailman.54.1197992805.2861.linux-mtd@xxxxxxxxxxxxxxxxxxx>
Message-ID: <200712191017.51669.ian@xxxxxxxxxxxxxxxxx>

On Tuesday 18 December 2007 10:46, ezbonites at 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");



-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Site Home]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux ARM Kernel]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Monitors]

Powered by Linux

Google PageRank Checking tool