Hi
I am developing a video capture cape board for BeagleBone Black, that uses GPMC as the interface to send image buffers to applications.
The GPMC, in principle, is properly initialized by a device tree dtbo and the internal eMMC of BBB is disabled. I am using linux version 4.1.18-ti-r52 ( debian 4.9.2-10 ). Dmesg shows that my cape board was properly initialized:
[ 3.406819] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00C0,2414BBBK1726'
[ 3.406847] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.441224] bone_capemgr bone_capemgr: slot #0: 'DVE-1501,00A0,WARPTEC,DVE1501'
[ 3.497098] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.557099] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.617087] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.623052] bone_capemgr bone_capemgr: initialized OK.
[ 3.625926] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[ 3.625949] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[ 3.626246] gpmc_read_settings_dt: page/burst-length set but not used!
[ 3.627175] bone_capemgr bone_capemgr: slot #0: dtbo 'DVE1501-00A0.dtbo' loaded; overlay id #0
For testing purposes, I am using a user space application for basic tests.
But, when I try this initialization procedure to acess physical address from user space, I can't open /dev/mem:
do
{
fd = open("/dev/mem", O_RDWR | O_SYNC);
} while (fd == -1 && errno == EINTR);
if (fd == -1)
{
perror("Do not open /dev/mem");
return errno;
}
The error message says: Do not open /dev/mem: Permission denied.
I wonder that "/dev/mem" it is not related with GPMC hardware specifically, mainly if GPMC is not properly initialized. Or not?
What I am doing wrong?
Sergio