1. IMPORTANT - 11/13/2015: In light of a possible breach we have scrubbed all passwords. You will need to request a password reset through the site. Click here for more information.

using/debugging uio driver on beaglebone black

Discussion in 'Linux Hardware' started by ags, Apr 30, 2014.

  1. ags

    ags New Member

    Apr 30, 2014
    Likes Received:
    I'm using a BeagleBone Black and using the onboard real-time microcontroller (PRUSS) that is exposed through uio. Reading the uio-howto documentation on kernel org says this:

    What does this mean? If .../maps/mapN/addr provides the address used to access the io device, then why is there a need for an additional offset (in increments of the page size) for each individual map (io device's accessible memory region)? In the Angstrom distro provided withe the BBB, the PRUSS uio kernel driver seems to provide the physical memory offset to the PRUSS as the value of maps/map0/addr, and the physical memory offset to DRAM reserved by the uio_pruss driver as the value of maps/map1/addr. However, examples provided on how to use the uio_pruss driver found at github in /beagleboard/am335x_pru_package/blob/master/pru_sw/app_loader/interface/prussdrv.c maps physical memory with this statement:

    prussdrv.extram_base =
    mmap(0, prussdrv.extram_map_size, PROT_READ | PROT_WRITE,

    which uses a hardcoded values set in this file: __prussdrv.h to these values, which don't use the maps/map<0/1>/addr values at all:

    #define PAGE_SIZE 4096

    and then calculate the value of the DRAM address by adding one page to the address returned by maps/map0/addr. This doesn't seem correct, although I can see where it came from in the documentation quoted above.

    So how are the maps/mapN/addr values supposed to be used correctly?
    Last edited: Apr 30, 2014

Share This Page