Port-arm archive

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

Overriding MAC address via device_properties?


I have a few rock64s running NetBSD-9.  I'm trying to migrate them from microSD
cards to eMMC, and apparently the rock64 u-boot isn't able to write its
environment to eMMC.

That's unfortunate, because the rock64 doesn't have a unique per-board MAC
address.  If the MAC address isn't explicitly set in the u-boot environment,
all boards will use 9e:6b:01:38:f7:da.

Attempting to override the MAC address via ifconfig's 'link <address> active'
kills the awge interface completely.

I'm planning on untangling that issue, as well as the u-boot issue, but in the
meantime I need to get these boards running with unique MAC addresses.

I see this bit in sys/dev/ic/dwc_gmac.c:

        prop_data_t ea = dict ? prop_dictionary_get(dict, "mac-address") : NULL;
        if (ea != NULL) {
                 * If the MAC address is overriden by a device property,
                 * use that.
                KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
                KASSERT(prop_data_size(ea) == ETHER_ADDR_LEN);
                memcpy(enaddr, prop_data_data_nocopy(ea), ETHER_ADDR_LEN);

... which leads me to believe that there's a way to specify the MAC address via
a property dictionary.

However, I haven't been able to find any documentation on where that is
actually configured.  Adding various permutations of mac-address to
/boot/{cmdline,config}.txt hasn't worked.

Does this need to be done via a custom .dtb, or an option in a custom kernel,
or other?

A clue-by-four would be greatly appreciated,

-- Chris
   GPG key fingerprint B566 051D D99D 37B6 41F2  7593 22EE 9E38 FBA7 7B34

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index