LPC1788+Uclinux+SDcard very slow

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

LPC1788+Uclinux+SDcard very slow

1,058 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nohabviktor on Wed Dec 03 07:01:49 MST 2014
Hi!

I have a custom board with LPC1788, 32Mbyte SDRAM, 128 Mbyte Nand flash, on 108Mhz.

I configure the SSP/SPI driver with amba linux driver:

static struct amba_device lpc178x_spi1_dev = {
.dev                            = {
.coherent_dma_mask      = ~0,
.init_name              = "dev:ssp1",
.platform_data          = &lpc178x_spi1_data,
},
.res                            = {
.start                  = SPI_LPC178X_DEV1_REGS,
.end                    = SPI_LPC178X_DEV1_REGS +
SPI_LPC178X_REGS_SIZE,
.flags                  = IORESOURCE_MEM,
},
.dma_mask                       = ~0,
.irq                            = {SPI_LPC178X_DEV1_IRQ, NO_IRQ},
};

and mmc:

static struct pl022_config_chip spi1_slave = {
.com_mode = INTERRUPT_TRANSFER,
.iface = SSP_INTERFACE_MOTOROLA_SPI,
.hierarchy = SSP_MASTER,
.slave_tx_disable = 0,
.rx_lev_trig = SSP_RX_32_OR_MORE_ELEM,
.tx_lev_trig = SSP_TX_32_OR_MORE_EMPTY_LOC,
.ctrl_len = SSP_BITS_8,
.data_size = SSP_DATA_BITS_8,
.wait_state = SSP_MWIRE_WAIT_ZERO,
.duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
.cs_control = spi1_lpc178x_flash_cs__lpc178x_eval,
};

static struct mmc_spi_platform_data mmc_pdata = {
.detect_delay = 100,
.powerup_msecs = 100,
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
};



static struct spi_board_info spi_devices_info[] __initdata =
{
    {
.modalias = "mmc_spi",
.max_speed_hz = 20000000,
.bus_num = 1,
.chip_select = 0,
.controller_data = &spi1_slave,
.mode = SPI_MODE_0,
.platform_data = &mmc_pdata,
    }

uclinux kernel info:
mmc_spi spi1.0: SD/MMC host mmc0, no WP, no poweroff                           
mmc_spi spi1.0: can't change chip-select polarity   
...
mmc0: host does not support reading read-only switch. assuming write-enable.   
mmc0: new SDHC card on SPI                                                     
mmcblk0: mmc0:0000 00000 14.7 GiB                                              
mmcblk0: p1

The problem is the reading from sd card is very slow.
My qt project size is 6 Mbyte and if I copied to sd card or run from sd card is always more then 1 minute:
~ # date                                                                       
Wed Dec  3 13:57:10 UTC 2014                                                   
~ #                                                                            
~ # cp card/qt /                                                               
~ #                                                                            
~ # date                                                                       
Wed Dec  3 13:58:12 UTC 2014 

Please give me an advice on what could be the problem?

Thank you
Labels (1)
0 Kudos
Reply
3 Replies

798 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amptektech on Sun Mar 01 20:18:12 MST 2015
I am also using LPC1788.  However, the SD card interface is used by a wi-fi module.  Can I use the SPIFI in 4-bit mode on a SD card?

Thank you.
0 Kudos
Reply

798 Views
jmccabe
Contributor II

LPC1788 doesn't have the SPIFI and doesn't directly support Quad SPI modes. 

0 Kudos
Reply

798 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Dec 03 08:51:49 MST 2014
On LPC1788, you might use the SD-Card controller with 4 bit data. SPI is using only 1 bit data, and is slow.
0 Kudos
Reply