Jetson tx2 driver bind/unbind

Hello

I am trying to develop a mobile manipulator robot for research based on the Jetson Tx2.

Q1. I want to know the bind status of the ethernet driver
Q2. how to bind/unbind ethernet driver?

root@jetsonTx2:/home# ethtool -i eth0
driver: eqos
version:
firmware-version:
expansion-rom-version:
bus-info: 2490000.ether_qos
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

It looks like it uses the EQOS driver (kernel feature “CONFIG_EQOS=y” can be found in “/proc/config.gz”). So far as bind/unbind goes, I’m not sure what you are looking for. If you simply mean to load or unload the driver dynamically, then the integrated driver ("=y") would need to be replaced with a module format driver ("=m").

Something you might find of interest even though it isn’t exactly what you are asking about are the following:

  • If you run “ifconfig eth0”, then you will see it uses hardware IRQ 41 (or at least on my TX2 it does). You can cross-reference this with the file “/proc/interrupts”, find hardware IRQ 41, and see something similar to this:
    41: 103 0 0 0 0 0 GICv2 226 Level ether_qos.common_irq
    …which indicates driver ether_qos.
  • If you look at "find -L /proc/device-tree/ -iname '*ether_qos*' you will find an entry such as “ether_qos@2490000”. You could find more than one entry, but I see just the one at address 0x2490000. This must be the physical address of the ether_qos driver.
  • If you look at the device tree (since the ethernet chip is not plug-n-play) you will find this node:
    ether_qos@2490000->compatible
    …which lists drivers which can work with this hardware, and you will note that one of them is the “eqos” driver. If you were to remove “eqos” from “compatible”, then this driver would no longer load for this hardware. Normally this is not useful, but since the driver is integrated into the kernel ("=y") and is not in the form of a module ("=m"), then not using the device tree to mark that driver compatible would cause the driver to not load (I don’t know if the “nvidia” part would matter or not in this case, never tried).
  • If you rebuild the kernel with a new CONFIG_LOCALVERSION (e.g., something like “-test”), and with the ether_qos set as a module ("=m", assuming this is available…not all drivers can have a module format, and not all drivers can have an integrated format, but likely this can be either), and install the new “Image-test”, you could in theory unload or load the driver at will (though something might cause it to be busy and not unload). You would of course have to install both the Image-test and the modules in “/lib/modules/$(uname -r)/kernel” location (where “uname -r” would change to suffix “-test”).

When you speak of bind and unbind, is this what you are looking for? I suppose there is another way to tell an integrated driver to disassociate from the hardware, but the above methods are what I know of.

Thanks for your kind explanation

What I mean is to load/unload the ethernet driver
→ should I rebuild the kernel with the integrated driver(“CONFIG_BLK_DEV_INTEGRITY =y”)??

What I want is the eth0 driver, I want to use it as igb, not eqos!

root@jetsonTx2:~$ uname -r
4.9.253-rt168-rt

I’m not sure what you want to do will work if you are not also changing the ethernet chipset. However, it might be possible, and it is basically just a case of trying it and finding out.

Keep in mind as I describe this that when you configure a kernel feature it should be through a config tool which understands dependencies. Some people use “make menuconfig”, but I like “make nconfig” (which has a symbol search function). For either of these your compile platform will need the “libncurses5-dev” package ("sudo apt-get install libncurses5-dev"). You will start with an existing configuration, which means either “make tegra_defconfig”, or else copying “/proc/config.gz” in the right place, using gunzip on it, and renaming it to “.config”. If your Jetson is stock, then this is the same result. If your current kernel is modified, then you should only use the “config.gz” method. *For either method you still need to set CONFIG_LOCALVERSION to something new and other than “-tegra” if you change the “=y” to “=m”, and then fully install both the Image ("make Image") and modules. An example alternate CONFIG_LOCALVERSION might be “=-test”. Do not delete your old “/boot/Image” file, simply create a new entry which points at an alternate file name, e.g., “Image-test”. Tip: There are several ways to set CONFIG_LOCALVERSION.

If you know which drivers are involved, then once you have a matching configuration you should start the config editor (I’ll assume “make nconfig” since it allows you to search for things like “localversion” and “blk_dev_integrity”). If the editor allows you to switch it from “=y” to “=m”, then in theory it will work. If you have two possible drivers, then the “compatible” entry in the device tree could list both drivers as compatible, and then you could load or unload after boot based on which driver you pick. Don’t know if it will actually work, but as long as your original Image file is in place and you use serial console to pick an alternate entry to Image-test, it is safe to try.

1 Like

Thanks!

I tried what your advise to me, but It was not my goal

Actually, I want to unbind “ethernet drive” and bind “rt-ethernet drive” for ethercat

I have another question!

I find eqos driver has unbind command

Step 1. change user to root

Step 2. echo “2490000.ether_qos” > /sys/bus/platform/driver/eqos/unbind

It was work, but after Step 2. system was down, no terminal command response, file can’t open

what’s the problem??

how can I unbind ethernet driver?

I cannot tell what you want to do by your comment here. It seems the goal you want to achieve has nothing to with bind/unbind a driver… why not you elaborate your goal first?

You mentioned “igb” and also “rt-ethernet” driver. These two sound not related to each other either.

I’am sorry

I think that if i can bind/unbind “igb” driver, maybe bind/unbind “rt-ethernet” can do.

What is “rt-ethernet” and why do you want to unbind the eqos driver?

the “rt-ethernet” mean real-time ethernet driver

example:

I want to to unbind the eqos driver and bind real-time ethernet driver for ethercat

I am just wondering… do you have any hardware side change on your board for this EtherCAT?

No.

I use Jetson Tx2 Developer kit

Hi,

The ethernet PHY connection over the Jetson TX2 module is directly on the EQOS controller… Thus, replacing to another driver may not work.

1 Like

Thank you so much!

i’ll find another driver.

No… this is not the problem of “another driver”… The hardware is fixed. The only one that can control the ethernet PHY on TX2 is the eqos driver.

Each driver needs to correspond to a particular chipset. A driver for a different chipset won’t work on the original hardware. It sounds like you need to add a second ethernet card/chipset.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.