Re: Getting a stable MAC address for a RPI CM3+ with ue0 interface
Date: Thu, 21 Sep 2023 07:19:53 UTC
On Sep 20, 2023, at 22:35, Patrick M. Hausen <pmh@hausen.com> wrote: > HI all, > >> Am 21.09.2023 um 06:09 schrieb Mark Millard <marklmi@yahoo.com>: >> sysctl -b hw.fdt.dtb | dtc -I dtb -s > current_sorted.dts > > Without the explicit "force_mac_address" line I find this in the output: > > ----------------- > aliases { > > i2c_arm = "/soc/i2c@7e804000"; > i2c = "/soc/i2c@7e804000"; > i2c_vc = "/soc/i2c0mux/i2c@0"; > serial0 = "/soc/serial@7e201000"; > serial1 = "/soc/serial@7e215040"; > aux = "/soc/aux@7e215000"; > sound = "/soc/sound"; > soc = "/soc"; > dma = "/soc/dma@7e007000"; > intc = "/soc/interrupt-controller@7e00b200"; > watchdog = "/soc/watchdog@7e100000"; > random = "/soc/rng@7e104000"; > mailbox = "/soc/mailbox@7e00b880"; > gpio = "/soc/gpio@7e200000"; > uart0 = "/soc/serial@7e201000"; > uart1 = "/soc/serial@7e215040"; > sdhost = "/soc/mmc@7e202000"; > mmc = "/soc/mmc@7e300000"; > mmc1 = "/soc/mmc@7e300000"; > mmc0 = "/soc/mmc@7e202000"; > i2s = "/soc/i2s@7e203000"; > i2c0 = "/soc/i2c0mux/i2c@0"; > i2c1 = "/soc/i2c@7e804000"; > i2c10 = "/soc/i2c0mux/i2c@1"; > spi0 = "/soc/spi@7e204000"; > spi1 = "/soc/spi@7e215080"; > spi2 = "/soc/spi@7e2150c0"; > usb = "/soc/usb@7e980000"; > leds = "/leds"; > fb = "/soc/fb"; > thermal = "/soc/thermal@7e212000"; > axiperf = "/soc/axiperf"; > i2c2 = "/soc/i2c@7e805000"; > }; No evidence above of any ethernet device. Does the current_sorted.dts have anything in it mentioning "ethernet"? "local-mac-address"? I've no direct knowledge of the CM3+ . What are the details of how ethernet has been provided for your context? Using an RPi3B as an example: it has its "built in" ethernet via usb. So it has an alias like: ethernet0 = "/soc/usb@7e980000/usb1@1/usbether@1"; and (more ?? based redaction used): soc { . . . usb@7e980000 { compatible = "brcm,bcm2708-usb"; reg = <0x7e980000 0x00010000 0x7e006000 0x00001000>; interrupts = <0x00000001 0x00000009 0x00000002 0x00000000>; #address-cells = <0x00000001>; #size-cells = <0x00000000>; clocks = <0x00000014>; clock-names = "otg"; phys = <0x00000015>; phy-names = "usb2-phy"; interrupt-names = "usb", "soft"; power-domains = <0x00000011 0x00000006>; phandle = <0x0000006a>; usb1@1 { compatible = "usb424,9514"; reg = <0x00000001>; #address-cells = <0x00000001>; #size-cells = <0x00000000>; usbether@1 { local-mac-address = [?? ?? ?? ?? ?? ??]; compatible = "usb424,ec00"; reg = <0x00000001>; phandle = <0x0000006b>; }; }; }; . . . So, if force_mac_address were to be made to work, it would probably involve creating an alternate *.dtb (or an overlay) that included the alias and something analogous to having that usb device description. In other words, making the ethernet device appear to be built-in. (Not that I've ever done such a thing.) > chosen { > > fixup-applied; > u-boot,version = "2023.07.02"; > user-warnings = [64 74 65 72 72 6f 72 3a 20 63 61 6e 27 74 20 66 69 6e 64 20 73 79 6d 62 6f 6c 20 27 75 61 72 74 30 5f 70 69 6e 73 27 0a 46 61 69 6c 65 64 20 74 6f 20 72 65 73 6f 6c 76 65 20 6f 76 65 72 6c 61 79 20 27 64 69 73 61 62 6c 65 2d 62 74 27 0a]; > rng-seed = <0x17f7438c 0x2ab979c8 0xc4352759 0x305da3e8 0x4304ea0a 0x6ce10bfb 0xa633ae6 0xcada5dfc 0x854eeecb 0x925b > 1f20 0x12bdb423 0x1ebbf917 0x4b434ef3 0x21939e04 0x4ee3dcc7 0xe3f5af57>; > kaslr-seed = <0x64f204d4 0x19ed2123>; > os_prefix; > overlay_prefix = [6f 76 65 72 6c 61 79 73 2f]; > rpi-boardrev-ext = <0x0>; > log = <0x3ff80000 0x7ffe0>; > bootargs = "coherent_pool=1M snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:09:CB:7D vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 force_mac_address=b8:27:eb:09:cb:7d"; Making the addr's easy to compare: smsc95xx.macaddr =B8:27:EB:09:CB:7D force_mac_address=b8:27:eb:09:cb:7d So, as things were set up, they match, up to case. But nothing identifies a specific ethernet to use that address with. So, as is, insufficient context to be automatic? (Again suggesting making the ethernet device appear to be built in if force_mac_address is to be used?) > phandle = <0x2f>; > bootloader { > > boot-mode = <0x1>; > tryboot = <0x0>; > rsts = <0x1000>; > partition = <0x0>; > }; > }; > ----------------- > > The MAC address shown in the "bootargs" line is matching the serial number of the CM. So it may be that this route is too complicated if there are other alternatives, given a lack of any already-built-in ethernet. === Mark Millard marklmi at yahoo.com