cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joseer
Voyager
Voyager
671 Views
Registered: ‎07-06-2016

Update petalinux kernel driver using a patch

Jump to solution

Hello,

I'm working on a project where petalinux 2018.3 is used, and I wonder if I could 'update' a particular driver to a newer tag where some modifications/improvements have been done.

In particular I'm interested to update the CAN driver , I'm having issues with the bitrate setup so after reviewing the change log I realised that a few changes have been made in this sense for the 2019.1 version , so would it possible to update the 2018.3 CAN driver to the 2019.1 version using a patch (diff generated replacing the 2018.3 CAN driver checkout by the 2019.1 CAN ones)?   

0 Kudos
1 Solution

Accepted Solutions
aravindb
Moderator
Moderator
618 Views
Registered: ‎02-07-2018

HI @joseer 

I suggest you to follow below steps to create & apply a patch, it will work if there is not much kernel dependent changes 

1. Download same kernel tag from repository

2. modify your changes and create patch using git

3. follow the steps mentioned in this link :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

4. petalinux-build

Or
You can also find the kernel source code in your petalinux project  directory 
1. cd build/tmp/work-shared/zcu102-zynqmp/kernel-source/ 
2. modify changes

3. git add filename ; git commit -m "commit msg"; git format-patch commit-id ; -- Use this commands to create a patch

4. Follow the steps mentioned in this link to apply the patch :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

5. petalinux-build

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
-------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
3 Replies
hokim
Scholar
Scholar
632 Views
Registered: ‎10-21-2015

Hi

Simple patch by diff might not work because the driver code for old kernel might framework(subsystem)  functions  outdated in new kernel

 

0 Kudos
aravindb
Moderator
Moderator
619 Views
Registered: ‎02-07-2018

HI @joseer 

I suggest you to follow below steps to create & apply a patch, it will work if there is not much kernel dependent changes 

1. Download same kernel tag from repository

2. modify your changes and create patch using git

3. follow the steps mentioned in this link :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

4. petalinux-build

Or
You can also find the kernel source code in your petalinux project  directory 
1. cd build/tmp/work-shared/zcu102-zynqmp/kernel-source/ 
2. modify changes

3. git add filename ; git commit -m "commit msg"; git format-patch commit-id ; -- Use this commands to create a patch

4. Follow the steps mentioned in this link to apply the patch :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

5. petalinux-build

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
-------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
joseer
Voyager
Voyager
569 Views
Registered: ‎07-06-2016

Hi @hokim  and @aravindb , thanks for your answers, I'll try to apply the patch as suggested and see if that works.

0 Kudos