Forum Topic - SATA driver on the P1013. xpt_alloc / xpt_free.: (4 Items)
   
SATA driver on the P1013. xpt_alloc / xpt_free.  
I'm bringing up a custom P1013 board and testing out the SATA interface.  P1013/P1022 BSPs don't have a SATA driver, but
 the P1010 does.  So I grab that, and build it under my bsp. Everything builds fine and it runs, sort of.

P1010 bsp has libcam but not cam-disk.
My qnx650 toolchain has libcam and cam-disk.so, but not the xpt_alloc function that the driver uses.

It looks like xpt_alloc allocates DMAable, non-cacheable contiguous memory, and substituting something like mmap this 
doesn't work - the driver hangs and throws errors. 
mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_NOCACHE, MAP_PRIVATE | MAP_ANON | MAP_PHYS, NOFD, 0);

After 10 minutes or so, it eventually succeeds.

If I use the libcam that came with the P1010 driver, it identifies the drive quickly.  But then I get a version mismatch
 against my cam-disk.so and it never creates /dev/hd0.

Can someone point me to the source code for xpt_alloc() / xpt_free()?  I can't seem to find it.  Is libcam and cam-disk 
source available?

Header is at bsp-freescale-p1010-rdb.6.5.0-1.2.2/src/hardware/devb/include/xpt.h 

QNX 6.5.0
P1022 bsp 
Re: SATA driver on the P1013. xpt_alloc / xpt_free.  
Try the libcam and cam-disk from your tool chain that should work.
Re: SATA driver on the P1013. xpt_alloc / xpt_free.  
I tried that and it didn't work, because the libcam or cam-disk from my toolchain doesn't implement the function 
xpt_alloc() and xpt_free() that the driver uses.

However, I must have missed it earlier, the P1010 bsp does have cam-disk.  Using that one works.
Well, works is a relative term.  At least it gets me to the next obstacle..
Re: SATA driver on the P1013. xpt_alloc / xpt_free.  
Got it working. I had to modify the startup code to add the SATA IRQs, so the driver can attach properly to the correct 
interrupt.  

26 MB/sec to an SSD.  Not exactly speedy, but it works.