[#6500] u-boot crashes when booting from SPI EEPROM M25P128 and CONFIG_ENV_SIZE = 0x40000

Document created by Aaronwu Employee on Sep 26, 2013
Version 1Show Document
  • View in full screen mode

[#6500] u-boot crashes when booting from SPI EEPROM M25P128 and CONFIG_ENV_SIZE = 0x40000

Submitted By: Timur Aydin

Open Date

2011-02-25 05:31:17    

Priority:

Medium     Assignee:

Mike Frysinger

Category:

Commands     Fixed In Release:

N/A

Found In Release:

2010R1     Status:

Open

Board:

Custom     Processor:

BF537

Silicon Revision:

0.3     Resolution:

N/A

Is the bug repeatable?:

yes     

Summary: u-boot crashes when booting from SPI EEPROM M25P128 and CONFIG_ENV_SIZE = 0x40000

Details:

 

u-boot crashes when booting from SPI EEPROM M25P128 and CONFIG_ENV_SIZE = 0x40000. Here are the environment related settings:

 

#define CONFIG_ENV_OFFSET    0x40000

#define CONFIG_ENV_SIZE        0x40000

#define CONFIG_ENV_SECT_SIZE    0x40000

 

As can be seen, the environment is not embedded into u-boot, but resides in a

separate sector. I have debugged the problem and found out that the crash occurs during the spi dma transfer. Basically, the amount transferred is 262144 bytes and the spi_dma_xfer function in bfin_spi.c uses 2D DMA for this.

 

I have forced the unconditional use of pio mode for spi transfers and this issue did not occur. So there seems to be an issue with the spi_dma_xfer.

 

Follow-ups

 

--- Timur Aydin                                              2011-02-25 05:43:32

Just for completeness, here is the patch I applied to force pio mode:

 

@@ -387,11 +387,8 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,

const void *dout,

     if (flags & SPI_XFER_BEGIN)

         spi_cs_activate(slave);

 

-    /* TX DMA doesn't work quite right */

-    if (SPI_DMA && bytes > 6 && (!tx /*|| !rx*/))

-        ret = spi_dma_xfer(bss, tx, rx, bytes);

-    else

-        ret = spi_pio_xfer(bss, tx, rx, bytes);

+        /* TODO: don't use dma */

+        ret = spi_pio_xfer(bss, tx, rx, bytes);

 

  done:

     if (flags & SPI_XFER_END)

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes