# How to build encx24j600 drivers into WP7702 and Test?

**URL:** <https://mangoh.discourse.group/t/how-to-build-encx24j600-drivers-into-wp7702-and-test/3847>\
**Category:** Uncategorized\
**Created:** [February 24, 2020, 1:11pm UTC](https://mangoh.discourse.group/t/how-to-build-encx24j600-drivers-into-wp7702-and-test/3847 "2020-02-24T13:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokulnath](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Gokulnath](https://mangoh.discourse.group/u/Gokulnath)\
**Post date:** [February 24, 2020, 1:11pm UTC](https://mangoh.discourse.group/t/how-to-build-encx24j600-drivers-into-wp7702-and-test/3847/1 "2020-02-24T13:11:42Z")

</div>

We are using Ethernet: ENC424J600-I/PT, SPI interface hardware component.

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [February 28, 2020, 5:55pm UTC](https://mangoh.discourse.group/t/how-to-build-encx24j600-drivers-into-wp7702-and-test/3847/2 "2020-02-28T17:55:59Z")

</div>

In an up-to-date Linux kernel source tree, I ran: `git log -- drivers/net/ethernet/microchip/encx24j600.c` and found that the file was introduced in commit `04fbfce7a222327b97ca165294ef19f0faa45960`. I then ran `git describe 04fbfce7a222327b97ca165294ef19f0faa45960` and it returned `v4.3-rc3-829-g04fbfce7a222` which indicates that the driver first appeared in the kernel in 4.3. The kernel we use on WP77 is based on the 3.18.y series. So this means that our kernel does _not_ include this driver. This means that you will have to backport this driver if you want to use it with the WP77.

I suggest copying these files out of a current kernel source tree and creating a Legato mdef file and trying to build the driver as part of your Legato system:

```auto
drivers/net/ethernet/microchip/encx24j600.c
drivers/net/ethernet/microchip/encx24j600-regmap.c
drivers/net/ethernet/microchip/encx24j600_hw.h

```

It’s likely that the compilation will fail due to changes in various parts of the kernel between 3.18 and the current kernel. Eventually you should be able to work through all of the items and have a working driver. Even once you get to that point, you still need to inform the kernel that the chip exists on your board by calling `spi_new_device(...)`.

---

<div class="post-metadata">

**Author:** ![Gokulnath](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Gokulnath](https://mangoh.discourse.group/u/Gokulnath)\
**Post date:** [March 2, 2020, 4:20am UTC](https://mangoh.discourse.group/t/how-to-build-encx24j600-drivers-into-wp7702-and-test/3847/3 "2020-03-02T04:20:25Z")

</div>

Thank you dfrey for your information. We tried using the source file and built the kernel using Legato Mdef . But the call spi\_register\_device() fails everytime and not identifying the device attached. We are using 3.18.44 version of kernel. Kindly suggest
