Linux on an XUP board - cant access user IP!

Hey all, I'm currently bringing up Linux on a Xilinx XUP demo board and I could use some assistance. For those who are unfamiliar, the XUP has a Virtex II Pro with 2 hard-core PPC405 processors. I have been following the EMPART tutorial to get things going

formatting link
and am ~almost~ there.

I have the basic system up and running and things look good EXCEPT: I can not seem to map into a custom IP hanging off the OPB bus. Actually, I can't manage to communicate with any peripherals at all off the OPB bus.

As per the EMPART tutorial's recommendations, here's how I attempt IP access:

fd = open("/dev/mem", O_RDWR); ptr = MAP_FAILED; // Initialize to bad value ptr = (int *) mmap(0, 256, PROT_READ|PROT_WRITE, MAP_SHARED, fd, USER_LOGIC_BASEADDR);

if(ptr==MAP_FAILED) { printf("Err: cannot access address!\n"); return -1; }

*ptr = 0xA;

The mmap call appears to work, and returns a pointer to virtual memory that supposedly references the physical address my IP is located at. However, when I try to read or write to this pointer I just get a rather ambiguous "bus error".

In attempt to diagnose the problem, I have tried simple file i/o calls to /dev/mem via the fd variable specifically lseek and read() / write(). These also fail. lseek works, but then when I try to read or write it returns 0.

It is noteworthy, however, that when I make a stand-alone project in Xilinx EDK and acces my custom IP from there everything works fine.

So, anyone have any suggestions? Could this have to do w/ the PPC405's MMU or something? Anyone have any experience here?

Thanks much for your help,

--scott

Reply to
scotto
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.