1

I have a Freescale iMX6 SMARC module and carrier board. It came from the manufacturer with Ubuntu Linaro 12.04 LTS (kernel 3.0.35). I need a lot of serial ports, so I got the Syba 8 port PCIe card with the Exar XR17V358 chipset to go with it. When I attempted to install the driver from the Exar website, I get an error:

make -C /lib/modules/'uname -r'/build SUBDIRS=/home/linaro/Desktop/exar modules
make: *** /lib/modules/3.0.35/build: No such file of directory. Stop
make: *** [build] Error 2

I am assuming that the kernel headers are not installed and that is why it did not work. Unfortunately, it does not appear that the linux headers are available from the the default apt repos.

sudo apt-get install linux-headers-3.0.35  

Returned:

E: Unable to locate package linux-headers-3.0.35 
E: Couldn't find any package by regex 'linux-headers-3.0.35'

Doing some searching, it appears that this is a common problem. I found a link to a tarball of the header files and instructions for a different iMX6 board running linaro.

wget http://commondatastorage.googleapis.com/boundarydevices.com/linux-headers-3.0.35-02829-gac24896_4.1.0.tar.gz
tar zxvf linux-headers-3.0.35-02829-gac24896_4.1.0.tar.gz -C /usr

Download was successful, but when I tried building the exar driver again, same output as above.

Linux-headers are not properly installed.

dpkg -l | grep linux-headers 

returns no results.

Tried installing linux-headers-generic, to no avail.

Package linux-headers-generic is not available, but is referred to by 
another package.  This may mean that the package is missing, has been
obsoleted, or is only available from another source.

Anyone else installing Exar PCIe drivers on Linaro?

Suggestions?

Axe
  • 11

2 Answers2

0

You need to install linux headers. Ubuntu 12.04 never had 3.0 kernels.

Run in terminal

sudo apt-get install linux-generic

This will install kernel image and headers 3.2.

If you can't do this, then you need to install Ubuntu headers for the kernel you have.

Pilot6
  • 92,041
0

I was able to get it to work. Here is how I did it:

First, I got the kernel source from the manufacturer and downloaded it to an Ubuntu 12.04 VM in a folder I called kernel on the desktop

Second, I downloaded the driver source from exar (https://www.exar.com/common/content/document.ashx?id=20121) and put it in the VM in a folder I called exar on the desktop.

Next, I cross compiled using gcc-arm-linux-gnueabihf in the VM

sudo apt-get install gcc-arm-linux-gnueabihf

Make configuration file for cross compiling

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx6_rev_sa01_defconfig

Build Kernel (optional step, could copy the kernel from the iMX6 image)

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage

Cross compile the driver

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/ubuntu/Desktop/kernel/ M=/home/ubuntu/Desktop/exar/ modules

Then I copied the exar directory onto the target and completed the installation

tar -xzvf exar.tgz
cd exar
cp xr17v35x.ko /lib/modules/3.0.35/kernel/drivers/misc/.
cd /lib/modules/3.0.35/kernel/drivers/misc/.
insmod xr17v35x.ko

Last, I verified that the driver was registered and that the ports were listed.

lsmod
ls -l /dev/ttyXR*

ports /dev/ttyXR0 through XR7 were available and functional.

After doing a reboot, it appears that the driver does not persist. As a patch I added a serial setup script at /etc/rc3.d/S50SerialPortSetup

#! /bin/sh
cd /lib/modules/3.0.35/kernel/drivers/misc/.
insmod xr17v35x.ko

I also do some stty commands to initialize the ports for my specific application.

Axe
  • 11