We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Omega2S+. How to disable Ethernet LED on the GPIO43?



  • Hello all!

    I have a little question.

    How to use Omega2S+'s GPIO43 as an usual GPIO? By default it is used as the Ethernet activity indicator, and I haven't found any way to disable it.

    I've tried to remove the kmod-ledtrig-netdev package, and it didn't solved the problem.

    In system/config/leds there is no another LED , but just omega2p:amber:system LED, which is apparently not the one that I'm trying to find.

    Thanks in advance!



  • @Artem-Reznikov said in Omega2S+. How to disable Ethernet LED on the GPIO43?:

    I've tried to remove the kmod-ledtrig-netdev package, and it didn't solved the problem.

    kmod-ledtrig-netdev is to make a generic GPIO show network activity. However, the ethernet activity LED signal on GPIO43 is a MT7688 hardware feature, no kernel code involved.

    In system/config/leds there is no another LED , but just omega2p:amber:system LED, which is apparently not the one that I'm trying to find.

    As it is a MT7688 hardware feature, you need to configure it at that level. The omega2-ctrl utility has a option to change this - I never used it myself but I guess it should do the trick:

    omega2-ctrl gpiomux set ephy gpio
    

    To understand the underlying mechanisms, have a look at the MT7688 datasheet, page 62, GPIO2_MODE register. This is where you can switch the mode for the LED pins.

    The …AN_MODE bits are relevant, because the Chip in the Omega2S is the MT7688AN (the datasheet, obviously largely copyied&pasted, talks about MT7628, the near identical predecessor of the MT7688).

    In case omega2-ctrl should not work, you could also use devmem to change these bits directly from the command line (provided that utility is included in the current OnionOS build, I'm not sure about that):

    devmem 0x10000064 32 0x05550555
    

    This will make all the LED pins work as GPIOs.

    There's one caveat: using these pins as GPIOs is the reset state of the MT7688 (see datasheet). Which means that some code in the bootloader and/or Linux actually explicitly changes the mode to make GPIO43 show ethernet activity.
    Now, as we don't know what code is responsible and when it is called, it could be that these bits are not only changed during startup, but repeatedly during operation, for example when initializing network (/etc/init.d/network restart etc…).

    So I personally would not use GPIO43 for a hardware function that could cause real-world problems in case it suddenly receives ethernet activity flicker...



  • @luz Thank you for a great and useful reply!

    As it is a MT7688 hardware feature, you need to configure it at that level. The omega2-ctrl utility has a option to change this - I never used it myself but I guess it should do the trick:
    omega2-ctrl gpiomux set ephy gpio

    That command will completely disable Ethernet PHY, isn't it? It is the way, but I already use EPHY in my design, so no.

    So I personally would not use GPIO43 for a hardware function that could cause real-world problems in case it suddenly receives ethernet activity flicker...

    When I was designing a PCB for Omega 2S, I haven't had all the docs, and as a result I've used some of I2S pins, almost all SPI pins, etc. (literally, all the pins that could cause boot and other problems when they are pulled up/down) as a GPIO. Now I have a bunch of the produced PCB's, and yeah, I've gone the hardware way - "cut the route and solder a wire instead". Yep, I know, that this is the shittiest way to do the thing, but I don't want to burn something out in case of some SUDDEN ethernet activity.

    Also, thanks for the MT7688AN datasheet, it has a lot of useful info!

    And particular thanks for the devmem example, and comments, that's just amazing!



  • @Artem-Reznikov said in Omega2S+. How to disable Ethernet LED on the GPIO43?:

    That command will completely disable Ethernet PHY, isn't it? It is the way, but I already use EPHY in my design, so no.

    No, the ephy label in omega2-ctrl is misleading, it does not control ethernet phys, just the LED.

    See AGPIO_CFG register for enabling/disabling ephys 1..4 (all together either ephy or GPIO, unfortunatly it is not possible to selectively enable only one of them -. ephy0 however can be used separately, with ephy1..4 in GPIO mode).

    When I was designing a PCB for Omega 2S, I haven't had all the docs, and as a result I've used some of I2S pins, almost all SPI pins, etc. (literally, all the pins that could cause boot and other problems when they are pulled up/down) as a GPIO.

    I was in the same situation a while ago when trying to find a usable wiring of my first Omega2 and Omega2S circuits, with all those various constraints...

    To see all options for all pins of Omega2 and Omega2S at a glance, I augmented the official pinouts a bit in a PDF, including boldface labels matching the pin names in the datasheet and red labels on the pins that must not be pulled up or down at boot. That started in a forum thread about this back in the first Omega2 days...

    Still, this is my most often used PDF when designing new Omega2(S) PCBs, maybe it's of use for you, too.



Looks like your connection to Community was lost, please wait while we try to reconnect.