What's a good dev environment setup for developing drivers?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What's a good dev environment setup for developing drivers?

Jump to solution
1,768 Views
jaket
Contributor II

Hi, I need to develop 2 drivers for the T1040RDB. Both devices are on PCI express. The first device is a PLX NET2280 that is going to run in device mode. The second is a custom device on a Altera Cyclone V PCIe card. As of now I've built the kernel and rootfs using bitbake and the 1.6 SDK. It seems to me that this is not an acceptable environment in which to develop drivers or application code though. What I've done so far is to bitbake meta-toolchain and that works fine for building user mode apps out of tree, but when it comes to building a kernel module I'm not sure where to look. For example, if I run "find -name module.h" under "build_t1040rdb_release/tmp" there are many many copies of it. So I'm wondering, do I just download a clean kernel from kernel.org or freescale and use that for building my drivers? What are others doing?

1 Solution
1,494 Views
lunminliang
NXP Employee
NXP Employee

Hi,

The kernel source directory is in build_t1040rdb_release/tmp/work/t1040rdb-fsl-linux/linux-qoriq-sdk/3.12-r0/git

You can add own driver code to the kernel source then build it inside SDK.

To make menuconfig:

$ bitbake -c menuconfig virtual/kernel

Then:

$ bitbake -c compile -f virtual/kernel

$ bitbake virtual/kernel

to compile it.

If you download a clean kernel source from kernel.org, please note it may not include some latest FSL patches.

BR

View solution in original post

3 Replies
1,495 Views
lunminliang
NXP Employee
NXP Employee

Hi,

The kernel source directory is in build_t1040rdb_release/tmp/work/t1040rdb-fsl-linux/linux-qoriq-sdk/3.12-r0/git

You can add own driver code to the kernel source then build it inside SDK.

To make menuconfig:

$ bitbake -c menuconfig virtual/kernel

Then:

$ bitbake -c compile -f virtual/kernel

$ bitbake virtual/kernel

to compile it.

If you download a clean kernel source from kernel.org, please note it may not include some latest FSL patches.

BR

1,494 Views
jaket
Contributor II

Thanks, that got me going! Here's what I ended up doing:

- Made a clone of build_t1040rdb_release/tmp/work/t1040rdb-fs-linux/linux-qoriq-sdk/3.12-r0/git

- added my driver source to that tree - updated the kernel config, etc...

- from there:

  $ bitbake meta-toolchain

  $ tmp/deply/sdk/fsl-networking-eglibc-x86_64-ppce5500-toolchain-QorIQ-SDK-V1.7.sh

  $ source /opt/fsl-networking/QorIQ-SDK-V1.7/site-config-ppce5500-fsl-linux

In the kernel source tree I did this:

  $ make menuconfig

  $ make

  $ make image

To get the make image step running I had to install the u-boot tools:

  $ sudo apt-get install u-boot-tools

Thanks again! Jake

0 Kudos
1,494 Views
lunminliang
NXP Employee
NXP Employee

Hi,

Welcome and thanks for feedback.

Those copys mentioned previously are different stages while compiling the BSP, which could be some intermediate stage.

For example, checkout out here: http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#package-splitting-dev-environmen... for source in packages-split.

And http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#structure-build-tmp-work for description of work directories.

BR

0 Kudos