Ah I see. That might be a problem. I thought that function will automatically build a mapping so I can use any vaddr,

Thanks Alex!

On Thu, Oct 13, 2016 at 8:38 PM, <Alexander.Kroh@data61.csiro.au> wrote:
Hi Oak,

Your code looks fine, but where do these numbers come from?

void* vaddr = (void*) 0x1980000;
uintptr_t paddr = (uintptr_t) 0x119a7000;


vaddr should be the virtual address of a buffer to which the block
should be read, and paddr should be the physical address of this buffer.


 - Alex




On Thu, 2016-10-13 at 17:33 -0700, Norrathep Rattanavipanon wrote:
> Is there any example on how to use sdhc driver in
> (https://github.com/SEL4PROJ/projects_libs/tree/master/libsdhcdrivers)?
>
>
> Currently, I'm struggling to read a block of data from micro-sd in
> seL4.
> I use the following code (assertions are omitted here for readability)
> to instantiate the driver :
>
>
>
>
> ps_io_mapper_t io_mapper = {0};
> error = sel4platsupport_new_io_mapper(simple, vspace, vka,
> &io_mapper);
>
> ps_dma_man_t dma_man = {0};
> error = sel4utils_new_page_dma_alloc(&vka, &vspace, &dma_man);
>
> ps_io_ops_t io_ops = {
>         .io_mapper = io_mapper,
>          .dma_manager = dma_man
> };
>
> sdio_host_dev_t* dev = (sdio_host_dev_t*) malloc(sizeof(*dev));
> assert(dev != NULL);
> memset(dev,0, sizeof(*dev));
>
>
> enum sdio_id id = sdio_default_id();
> error = sdio_init(id, &io_ops, dev);
>
> mmc_card_t* mmc_card = (mmc_card_t*) malloc(sizeof(*mmc_card));
> error = mmc_init(dev, &io_ops, mmc_card);
>
>
> void* vaddr = (void*) 0x1980000;
>
> uintptr_t paddr = (uintptr_t) 0x119a7000;
>
> long read_len = mmc_block_read(*mmc_card, 0, 5, vaddr, paddr, NULL,
> NULL);
>
>
>
> And the code's stuck in mmc_block_read function where interrupt status
> (BRR and BWR) are never on.
>
>
> Thanks in advance,
> Oak
>
>
>
>
> --
> Norrathep (Oak) Rattanavipanon
> M.S. in Computer Science
> University of California - Irvine
> _______________________________________________
> Devel mailing list
> Devel@sel4.systems
> https://sel4.systems/lists/listinfo/devel




--
Norrathep (Oak) Rattanavipanon
M.S. in Computer Science
University of California - Irvine