Device Driver for Reserved Memory

Device Driver for Reserved Memory

Postby chaithanya » Wed Aug 09, 2017 5:44 am

I am trying to develop a simple character device driver that access the reserved memory region as described in the site:

/* Get reserved memory region from Device-tree */

np = of_parse_phandle(dev->of_node, "memory-region", 0);

if (!np) {

dev_err(dev, "No %s specified\n", "memory-region");

goto error1;


rc = of_address_to_resource(np, 0, &r);

if (rc) {

dev_err(dev, "No memory address assigned to the region\n");

goto error1;


lp->paddr = r.start;

lp->vaddr = memremap(r.start, resource_size(&r), MEMREMAP_WB);

dev_info(dev, "Allocated reserved memory, vaddr: 0x%0llX, paddr: 0x%0llX\n", (u64)lp->vaddr, lp->paddr);

The site does not give any information regarding lp->paddr and lp->vaddr

What is the datatype of "lp" ?
Posts: 1
Joined: Wed Aug 09, 2017 5:42 am

Return to Xilinx

Who is online

Users browsing this forum: No registered users and 1 guest