Search code examples
driverethernetimx6

how to write driver for MX 6 and TJA1100 PHY?


I am working on new costume board based on (i. MX 6Solo6DualLite).and I use (TJA1100 100BASE-T1 PHY) for Automotive Ethernet..

please correct me if my questions don't make sense, or I am in the wrong way.

I want to write driver for this device.. and make sure that it works correctly.

1- I can make sure that the driver works properly in the U-boot step, Right? I mean no need to load Linux kernel, so I have just to add source code C driver in U-boot source code and compile it. I want to do this in U-boot step, so I can limit the numbers of files that initialise all peripheriques, and make it simple as possible since that U-boot can behave like (mini-Os)

2-I don't know how to write this driver (exactly..), so I am looking for the driver (source code) that initialise the Ethernet Controller in any other processor , and initialise another typeof ethernet phy, in order to get an idea and write a similar driver source code for I.MX6 and TJA1100,? after this i think that i could maybe add some very basic file c For simple Protocol like ARP, for test purpose..

3- is this good idea writing driver code by inspiring from another driver code source?

4 - maybe, if you already have a driver for (i. MX 6Solo6DualLite and TJA1100 100BASE-T1 PHY) can you provide to me please... ?

for my second question i tried to extract from U-boot source code the C file that initialise Ethernet Controller in AM335x, and initialise LAN8710A phy,(in beaglebone black) in order to get an idea and write a similar driver source code but i couldn't found it .. i found network C file for protocol .... but that's disturp me i couldn't seperate them from the real C file that initialise ethernet controller and ethernent Phy .

http://www.denx.de/wiki/U-Boot/SourceCode


Solution

  • There is a driver published on the NXP forum:

    https://community.nxp.com/thread/460767

    It includes both some bare metal code that should be usable with U-Boot and a Linux driver.