From dea9c19e5e407f8091da5d6d3c6be71aac2b48d8 Mon Sep 17 00:00:00 2001 From: "luohui2320@gmail.com" Date: Tue, 28 Feb 2012 16:40:40 +0000 Subject: update SDIO protocol git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1979 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/at91sam9260/at91_mci.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'bsp') diff --git a/bsp/at91sam9260/at91_mci.c b/bsp/at91sam9260/at91_mci.c index 213f8856dc..6fed512386 100644 --- a/bsp/at91sam9260/at91_mci.c +++ b/bsp/at91sam9260/at91_mci.c @@ -681,10 +681,10 @@ static void at91_mci_irq(int irq) } /*if (int_status & AT91_MCI_SDIOIRQA) - rt_mmcsd_signal_sdio_irq(host->mmc); + rt_mmcsd_signal_sdio_irq(host->mmc);*/ if (int_status & AT91_MCI_SDIOIRQB) - rt_mmcsd_signal_sdio_irq(host->mmc);*/ + sdio_irq_wakeup(at_mci->host); if (int_status & AT91_MCI_TXRDY) mci_dbg("Ready to transmit\n"); @@ -778,10 +778,17 @@ static void at91_mci_set_iocfg(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cf } +static void at91_mci_enable_sdio_irq(struct rt_mmcsd_host *host, rt_int32_t enable) +{ + at91_mci_write(enable ? AT91_MCI_IER : AT91_MCI_IDR, AT91_MCI_SDIOIRQB); +} + + static const struct rt_mmcsd_host_ops ops = { at91_mci_request, at91_mci_set_iocfg, RT_NULL, + at91_mci_enable_sdio_irq, }; void at91_mci_detect(int irq) @@ -834,6 +841,10 @@ rt_int32_t at91_mci_init(void) host->freq_max = 25000000; host->valid_ocr = VDD_32_33 | VDD_33_34; host->flags = MMCSD_BUSWIDTH_4 | MMCSD_MUTBLKWRITE; + host->max_seg_size = 65535; + host->max_dma_segs = 2; + host->max_blk_size = 512; + host->max_blk_count = 4096; at_mci->host = host; -- cgit v1.3.1