Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSZ8895 Compilation and use #4

Open
samjenkins00 opened this issue Apr 19, 2018 · 4 comments
Open

KSZ8895 Compilation and use #4

samjenkins00 opened this issue Apr 19, 2018 · 4 comments

Comments

@samjenkins00
Copy link

samjenkins00 commented Apr 19, 2018

Hi,

I'm running Linux Yocto 4.1.15 using an NXP i.mx6s ARM processor with the KSZ8895.
I've managed to get spi-ksz8895 to compile to a .ko, and i can manually modprobe to mount it.

I've read the README but i'm not clear what i need to do to use the switch driver. Do i have to compile and run the sw_setup to setup the switch, and then ksz_sw_sysfs_8895 to create a /spi0.0/sw interface?

@embeddman
Copy link

Hey,
did someone get how to compile and use this driver with Linux Yocto?

@skidaddytn
Copy link

FWIW, I compiled it into our petalinux 2018.3 distribution (Yocto w/linux 4.14). However, while I can see all interfaces with "/sys/bus/spi/devices/spi1.1", I've yet to get it all working. As for the utilities (regs_bin, kszsw, etc), I had to make them apps and add them to my user layer. They seem to work, but as I said, I can't get traffic through the switch yet.

Follow these steps to get where I am:

  1. You will need to make your own yocto kernel layer patch by first modifying the kernel source tree with the files here. Mod the tree with the cadence and micrel areas, and then run their 2 patches for the ptp and netbridge. The cadence area is confusing... it would appear that the 4.14 files are not the same-- not sure what to do here, make your own judgement call. I'm currently experimenting with leaving this area alone, and replacing it with the seemingly older version that Microchip provides.
    After you do this, then make your own patch with "git commit" and then "git format-patch -1". Stick this patch into your layer (meta-user/recipes-kernel) and reference it in linux-xlnx_%.bbappend.
  2. At this point you can rebuild and should see all the interfaces live in your OS. To get the utilities, I had to add them as individual user applications (i.e. meta-user/recipes-apps)

If you get this to work, please let me know as I'm doing the same thing... lol

@embeddman
Copy link

What chip(microprocessor) do you use?

@skidaddytn
Copy link

What chip(microprocessor) do you use?

Zynq XC7Z020 and we are using the KSZ9567R. Linux does detect it and work by default without the driver, but to get to the additional features we need the driver working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants