Showing results for 
Search instead for 
Did you mean: 
Registered: ‎03-25-2015

Driver Fsl for Petalinux

I am working with Petalinux loaded on a Spartan 6.
I have successfully connected the device FSL to the microbalze by XPS. Then I wrote a simple program in the SDK to access reading into memory, using putfsl and getfsl functions defined in fsl.h. The test was a success.


Now I'm writing a simple driver where I call assembler functions getfsl and putfslas follows:
static void getfsl(int val, int id) { asm volatile ("get\t%0,rfsl0":"=d"(val));}
static void putfsl(int val,int id) { asm volatile ("put\t%0,rfsl0"::"d"(val));}


and inside the function write I statements to initialize the driver for playback and via getfsl (var0 .0) I return the access that value should be 0 in this case.
But with the printk ("var0 value:%i\n\r," var0); I print 9 instead of 0, it is as if getfsl do not return anything.
Any idea why? Maybe the definition of assembler functions is incorrect?
/******* FUNCTION WRITE ************/
unsigend int var0;
printk("MEM-Sniffer Initialization\n\r");
printk("Monitor address range selected\n\r");
putfsl(0xC0F,0); // sending INF_LIMIT frame
putfsl(0xE00,0); // sending SUP_LIMIT frame
putfsl(4,0); // sending RUN_OPERATIONS frame
printk("MEM-Sniffer Stop\n\r");
putfsl(0,0); //sending STOP_OPERATIONS
getfsl(var0, 0);
putfsl(16, 0);
printk("var0 value: %i\n\r", var0);  //print 9 ERROR!!!
0 Kudos
1 Reply
Registered: ‎03-25-2015

Re: Driver Fsl for Petalinux

I solved the problem with the value returned by getfsl. I included in the header file "fsl.h" and now the 9 instead print me getfls I return a different value.
The problem now is that the return value is not what I want, for example, if I make one read access memory instead of print me one I print other values (such as 76, 32, 48, etc) each time a different order logical sense.
Any thoughts about that?

0 Kudos