Moving boot to SPI flash. Having issues with DMA in mx233

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Moving boot to SPI flash. Having issues with DMA in mx233

Jump to solution
6,301 Views
jlumme
Contributor III

We have a project with imx233, based on Olinuxino's maxi board (iMX233-OLinuXino-MAXI).

Normally it's booting from microsd, but we would like to move to nand flash. We have ordered ( SST25VF064C) chips from Microchip, which are 64mbit SPI flash chips.

The plan is to hook this up to SPI2.

What other things we should think about, besides changing the jumpers to boot from microsd to "SPI2 flash master", and to flash a suitable linux kernel and rootfs to that nand? Do we need to do some configuration/recompiling to bootlets ? Are there some good recommendations on the flashing procedure ?

Thanks for any advice, or tips - this is a first time project for us, so any advice is welcome, thanks!

Labels (2)
1 Solution
3,537 Views
MarekVasut
Senior Contributor I

I have this idea, try the following patch please:

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c

index eecefbc..ec80c46 100644

--- a/drivers/spi/spi-mxs.c

+++ b/drivers/spi/spi-mxs.c

@@ -243,6 +243,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, int cs,

        INIT_COMPLETION(spi->c);

        ctrl0 = readl(ssp->base + HW_SSP_CTRL0);

+       ctrl0 &= ~BM_SSP_CTRL0_XFER_COUNT;

        ctrl0 |= BM_SSP_CTRL0_DATA_XFER | mxs_spi_cs_to_reg(cs);

        if (*first)

View solution in original post

0 Kudos
Reply
24 Replies
458 Views
MarekVasut
Senior Contributor I

Also, try limiting SG_MAXLEN to 0x4000 ... that might work, see if it fixes your issue. Try with 0x8000 afterwards too, if it will work.

458 Views
MarekVasut
Senior Contributor I

I did find something peculiar, though.

That only confirms something is very wrong with the DMA on MX23. Either that or the device at the other end might be weird -- what type of flash do you use at the other end of the bus? Can you try DMA-only operation? (basically just change that if (t->len < 32) to if (0) as before, just make it call dma always.

btw. someone on freenode #olimex started poking into MX23 u-boot. Now if I'll be able to get a decent bootloader on my (only) mx23 board, I might have more of a chance to take a stab at this issue myself.

btw2. yes, I'm running out of ideas here.

0 Kudos
Reply
458 Views
jlumme
Contributor III

I'm using SST25VF064b from Microchip.

I will let you know what I see with DMA only usage..

0 Kudos
Reply
458 Views
jlumme
Contributor III

I located the code, thanks.

Once I get back home from work tonight, I will give it a shot and report the results.

I will try both ways, DD and the C test code I was using before. And with different speeds as well.

0 Kudos
Reply