Re: Getting a stable MAC address for a RPI CM3+ with ue0 interface

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On Sep 20, 2023, at 14:12, Patrick M. Hausen <[email protected]> wrote:

>> Am 20.09.2023 um 23:06 schrieb Mark Millard <[email protected]>:
>> It might be worth figuring out if the ethernet0 alias exists and what
>> it points to (if it exists).
> 
> What is an ethernet0 alias and how can I check it? Currently I have access
> to the modules when they are running FreeBSD. No console or pre-boot.

It is not in the notation that can be used with dtc or the like
but you likely can look usefully at:

# ofwdump -p -r / | more

output to get some information. For example, from a RPi4B:

# ofwdump -p -r / | more
Node 0x48: 
  memreserve:
    3b 30 00 00 04 c0 00 00 
  serial-number:
  . . .
  Node 0x15c: psci
    compatible:
      61 72 6d 2c 70 73 63 69 2d 30 2e 32 00 
      'arm,psci-0.2'
    method:
      73 6d 63 00 
      'smc'
. . .
  Node 0x200: aliases
. . .
    emmc2bus:
      2f 65 6d 6d 63 32 62 75 73 00 
      '/emmc2bus'
    ethernet0:
      2f 73 63 62 2f 65 74 68 65 72 6e 65 74 40 37 64 35 38 30 30 
      30 30 00 
      '/scb/ethernet@7d580000'
    pcie0:
      2f 73 63 62 2f 70 63 69 65 40 37 64 35 30 30 30 30 30 00 
      '/scb/pcie@7d500000'
. . .

So: the ethernet0 alias points to /scb/ethernet@7d580000

/scb/ethernet@7d580000 starts with (partially redacted):

  Node 0x87f0: scb
    compatible:
      73 69 6d 70 6c 65 2d 62 75 73 00 
      'simple-bus'
. . .
    Node 0x8b90: ethernet@7d580000
      local-mac-address:
        ?? ?? ?? ?? ?? ?? 
. . .

That is what force_mac_address would be providing,
given the ethernet0 definition above.

I'll note that, as I remembmer, the psci material
was added to the live dtb by the armstub*.bin
provided by via FreeBSD specific materials.

An example addition by U-Boot is:

  Node 0x828: chosen
    fixup-applied:
    u-boot,version:
      32 30 32 33 2e 30 31 00 
      '2023.01'

The RPi* firmware does various dynamic adjustments
of what is in the *.dtb file used. The *.dtb's do
not span the variations.

I'm not aware of ofwdump being able to show any
earlier-stage live dtb's, even if you know the
address(es).

> I will have to check how I can get any pre-boot access if necessary.
> 



===
Mark Millard
marklmi at yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.