Mini pci express uart card

hi
i use EMP2-X403 (EMP2-X403 | mPCIe to four RS232 Module | Serial Card | Communication Module | Embedded Peripheral | Solutions – Innodisk) on mpcie on ixora
its driver is

/*****************************************************************************/
/*
*      xr17v35x.c  -- MaxLinear multiport serial driver.
*
*      
*****************************************************************************
*                                        Copyright (c) 2010, MaxLinear, Inc.
*****************************************************************************
*
*      Based on Linux 2.6.37 Kernel's  drivers/serial/8250.c and /8250_pci.c
*
*      This program is free software; you can redistribute it and/or modify
*      it under the terms of the GNU General Public License as published by
*      the Free Software Foundation; either version 2 of the License, or
*      (at your option) any later version.
*
*      This program is distributed in the hope that it will be useful,
*      but WITHOUT ANY WARRANTY; without even the implied warranty of
*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*      GNU General Public License for more details.
*
*      You should have received a copy of the GNU General Public License
*      along with this program; if not, write to the Free Software
*      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
*	   Multiport Serial Driver for MaxLinear's PCI Family of UARTs (XR17V258/254/252/358/354/352/8358/4358/8354)
*								  (XR17D158/154/152)
*       ChangeLog:
*	   for    	: LINUX 2.6.32 and newer (Tested on various kernel versions from 2.6.32 to 4.15)
*	   date   	: July 2019
*	   version	: 2.6 
*	 Note: XR_17v35x_UART_RHR was not defined. Fixed  
*	Check Release Notes for information on what has changed in the new version.
*
*/

when i make above driver on ubuntu 14.04 on apalis tk1
i get following error:
make:***/lib/modules/3.10.40-2.8.6+g2c7ac3af726/build: No such file or directory .stop
i dont know why?
thank you

Most likely you are just missing the Linux kernel sources. If you would like to natively compile Linux kernel modules directly on your target you may proceed as per the following article on our developer website:

Then, you would need to create a symbolic link from /home/ubuntu/linux-toradex (e.g. where you cloned the git repository according to above-mentioned article) to /lib/modules/3.10.40-2.8.6+g2c7ac3af726/build (e.g. as you initially reported in your question).

Alternatively, you may want to cross-compile as outlined in the following article on our developer website:

dear marcel
i did following steps according to your above link, to solve driver make problem
1-sudo su
1.git clone -b toradex_tk1_l4t_r21.7 git://git.toradex.com/linux-toradex.git
2.apt-get update
3.apt-get install u-boot-tools
4.cd linux-toradex
5.ake apalis-tk1_defconfig
6.make -j6
7.make -j6 zImage

but i get this error ofter step 7

drivers/video/tegra/dc/of_dc.c:260:2: error :'for' initial declarations are only allowed in c99 mode 
for(int i=0;i<5;i++){
drivers/video/tegra/dc/of_dc.c:260:2: note:use option -std=c99 or -std=gnu99 to compile your code 

i think i should change makefile but i dont know the location of adding option (-std=c99) to makefile
thank you

Hi

You are right. You just to define int i before using i in loop. I made the following and the compilation of kernel worked.

diff --git a/drivers/video/tegra/dc/of_dc.c b/drivers/video/tegra/dc/of_dc.c
index 57ebf76..8c8ac7b 100644
--- a/drivers/video/tegra/dc/of_dc.c
+++ b/drivers/video/tegra/dc/of_dc.c
@@ -250,6 +250,7 @@ static u64 parse_dt_lvds_drive_strength(struct device_node *np)
 {
        u32 temp[5];
        u64 drive_strength = 0;
+       int i;
 
        if(of_property_read_u32_array(np, "lvds-drive-strength",
                                temp, 5)) {
@@ -257,7 +258,7 @@ static u64 parse_dt_lvds_drive_strength(struct device_node *np)
                return 0;
        }
 
-       for (int i = 0; i < 5;i++) {
+       for (i = 0; i < 5;i++) {
                if (temp[i] < 0x100) {
                        drive_strength += ((u64)temp[i] << i*8);
                } else {

Best regards,
Jaski

i solved this error by unrolling for loop
in line 260 , in (of_dc.c) file

for (int i=0;i<5;i++){
  if(temp[i]<0x100){
   drive_strength+=(u64)temp[i]<<i*8);
 }else{
  OF_DC_LOG("Invalid LVDS driver strength for lane %d\n",i);
}
}

the unrolling loop result is

 if(temp[0]<0x100){
   drive_strength+=(u64)temp[0]<<0*8);
 }else{
  OF_DC_LOG("Invalid LVDS driver strength for lane %d\n",0);
}

do this for all indexes
best regards

i solved this error by unrolling for loop
in line 260 , in (of_dc.c) file

for (int i=0;i<5;i++){
  if(temp[i]<0x100){
   drive_strength+=(u64)temp[i]<<i*8);
 }else{
  OF_DC_LOG("Invalid LVDS driver strength for lane %d\n",i);
}
}

the unrolling loop result is

 if(temp[0]<0x100){
   drive_strength+=(u64)temp[0]<<0*8);
 }else{
  OF_DC_LOG("Invalid LVDS driver strength for lane %d\n",0);
}

do this for all indexes
best regards