​hi there . 
i'm work on mmc storage with sel4. 
i wrote a simple app that use mmc an here is that : 


//////////////////////////////////////////////////////////////////////
static int count = 0;
ps_io_ops_t io_ops = {0};
struct netif* net_if;
mmc_card_t mmc_card = 0;
sdio_host_dev_t sdio_host_dev;
int mmc_found = 0; 
void mmc_irq_handle(ps_irq_t* irq) {
    printf("mmc irq handle .... \n");

    if(!mmc_found){
        mmc_irq_acknowledge(irq);
        // printf("mmc not found yet :)\n");
        sdio_host_dev.handle_irq(&sdio_host_dev,irq->irq.number);
        return ;
    } 

    mmc_irq_acknowledge(irq);
    mmc_handle_irq(mmc_card,irq->irq.number);
}

int run(void) {
    notification = timer_notification();
    int err = camkes_io_ops(&io_ops);
    if (err != 0) {
        ZF_LOGF("Can not init ops : %d\n", err);
    };
    printf("initialize sdhc1 ...\n");
    
    err = sdio_init(SDHC1, &io_ops, &sdio_host_dev);
    // while card not present check 
    while(sdio_host_dev.reset(&sdio_host_dev) == -1){
        delay(1000);
    }
    printf("before mmc_init\n");
    mmc_init(&sdio_host_dev, &io_ops, &mmc_card);
    mmc_found = 1;
    printf("after mmc_init\n");
    if (!err) {
        printf("SDHC1 inited successfully.\n");
    } else {
        printf("SDHC1 initizatino failed!: %d", err);
    }

    while (true) {
        printf(".\n");
        delay(1000);
    }
    return 0;
////////////////////////////////////////////////

its work but in mmc_init after going to mmc_reset , first command sent but in 
second command (ie MMC_SEND_EXT_CSD ) wait for ever... 
can any body help me?


best regards




-- 
This email was Anti Virus checked by  Security Gateway.
_______________________________________________
Devel mailing list -- devel@sel4.systems
To unsubscribe send an email to devel-leave@sel4.systems

Reply via email to