[RFC][Help] Finishing MikroTik OmniTIK UPA-5HnD support

Dear devs,

I've been working recently on adding support to the MikroTik OmniTIK UPA-5HnD outdoor router. It is almost done, but there is a minor issue with the wifi MAC address stopping me from submitting the code.

Right now, I have the following:

  • Almost there:

    • Wireless working (but with the same MAC address as eth0)
  • Unsupported:

    • PoE passthrough controlled via ATtiny461a chip (keeps settings from stock firmware: auto on/force on/force off)
    • LEDs (same as PoE?)
    • Reset button (unable to find it)
  • Working:

    • Board/system detection
    • Serial console
    • NAND Storage
    • 1x Ethernet WAN (eth1, port 1) + 4x Ethernet LAN (eth0.1, ports 2-5)
    • USB
    • Sysupgrade

The following commit adds support to the device, based on the code already there for the similar RB750-ish devices: https://github.com/rogerpueyo/lede-source/commit/4036386aafe877e5bfe19dcd27f245f10d397d67.

With the current code, the Ethernet interfaces get the MAC addresses from the flash but the ath9k wireless doesn't:

  • eth0: base MAC address +0 :heavy_check_mark: (same as stock firmware)
  • eth1: base MAC address +1 :heavy_check_mark:
  • wlan0: base MAC address +0 ✘ (in stock firmware is base MAC address + 5)

Could anybody help me getting the right MAC address for the wireless interface? I've tried several things like adding offsets or copying initialization functions from other boards, but only ended up reading the next bytes from the flash, or getting a kernel compilation error.

Regarding the ATtiny461a chip that controls the PoE passthrough (circuit pads can be traced from chip to the Ethernet ports and to the LEDs), I have no clue on how to support it but, if it keeps the settings from the stock firmware, it seems fair enough as to not care too much about it. In particular, the "auto on" setting is able to detect whether a regular Ethernet card/switch port or a device demanding passive PoE is connected, and enable it accordingly.

Thanks for your help. Looking forward for your comments! :slight_smile:

Since it uses the same MCU for POE as RB750PBr2 aka Powerbox I can tell you that once you install LEDE POE wont work at all.
Even returning to stock does not bring POE back

Hi @robimarko,

Thanks for your reply. I have double-checked and the PoE settings are kept when booting a LEDE initramfs image via TFTP and also when flashing a sysupgrade image to NAND. Furthermore, going to stock firmware allows configuring them at will again.

Anyway, do you have any suggestion for the wlan0 MAC address issue?

Best,
Roger

Than despite using same MCU for POE behaviour is different.
Easiest way to see where WLAN MAC is to search you flash dump for it and then apply correct offset in code
I will take a look at your code