Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Overriding MAC address via device_properties?



abs%absd.org@localhost (David Brownlee) writes:

>OpenFirmware and UEFI allow properties to be set in the firmware to be
>read into a booting system, and NetBSD already reads FDT data from
>boot media.

>It feels like there should be some way to inject additional
>information. Does the rock64 support device tree overlay? If not then
>is there some other similar mechanism already defined that could be
>implemented?


That's usually done in the attachment code. For dwc-gmac we have:

sys/arch/arm/altera/cycv_gmac.c
sys/arch/arm/amlogic/meson_dwmac.c
sys/arch/arm/rockchip/rk_gmac.c
sys/arch/arm/sunxi/sunxi_gmac.c

which already fetch some parameters from FDT.

A common property for ethernet controllers would be

  local-mac-address:
    description:
      Specifies the MAC address that was assigned to the network device.
    $ref: /schemas/types.yaml#/definitions/uint8-array
    minItems: 6
    maxItems: 6

and

  mac-address:
    description:
      Specifies the MAC address that was last used by the boot
      program; should be used in cases where the MAC address assigned
      to the device by the boot program is different from the
      local-mac-address property.
    $ref: /schemas/types.yaml#/definitions/uint8-array
    minItems: 6
    maxItems: 6

There could be some layer in sys/dev/fdt/ handling such common
properties.




Home | Main Index | Thread Index | Old Index