Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions board/aarch64/acer-connect-vero-w6m/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ U-Boot from the first partition after fip.
installing. Interrupt autoboot and run `printenv` to note down:
`2gMAC`, `5gMAC`, `6gMAC`, `LANMAC`, and `WANMAC`.

## Giving the Unit a Permanent MAC Address

Infix does not read the stock U-Boot environment, so the unit boots
with random Ethernet addresses until it is given a product record.
Store one as `/mnt/aux/vpd.bin`, from the Infix shell, using the
`WANMAC` noted down above as the base address:

```
echo '{"mac-address":"<WANMAC>","serial-number":"<serial>","vendor":"Acer","product-name":"Connect Vero W6m"}' \
| onieprom -e > /mnt/aux/vpd.bin
```

After a reboot the ports get fixed offsets from the base address and
the WiFi interfaces derive theirs from it. See
[Vital Product Data](../../../doc/vpd.md#vpd-file-on-the-aux-partition)
for the record format.

## Required Files

Prepare these files on a host reachable from the Vero:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
infix {
/* Default admin user password: 'admin' */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
vpds = <&vpd>;
};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Product VPD, an ONIE TLV that the boot loader copies from the aux
* partition into reserved memory. The region is zeroed when there is
* no VPD, which leaves the layout without cells. Ports reference the
* base MAC address with an index, <&base_mac N>, and get base + N as
* their permanent address.
*/
&{/reserved-memory} {
vpd: vpd@43e00000 {
compatible = "nvmem-rmem";
reg = <0 0x43e00000 0 0x10000>;
no-map;
infix,board = "product";

nvmem-layout {
compatible = "onie,tlv-layout";

base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
};

/* Port addresses: VPD base MAC + 1 .. + 5 in port name order */
&gmac0 {
nvmem-cells = <&base_mac 1>;
nvmem-cell-names = "mac-address";
};

&swport0 {
nvmem-cells = <&base_mac 2>;
nvmem-cell-names = "mac-address";
};

&switch {
ports {
port@1 {
nvmem-cells = <&base_mac 3>;
nvmem-cell-names = "mac-address";
};

port@2 {
nvmem-cells = <&base_mac 4>;
nvmem-cell-names = "mac-address";
};

port@3 {
nvmem-cells = <&base_mac 5>;
nvmem-cell-names = "mac-address";
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/dts-v1/;
#include "mt7986a-acer-connect-vero-w6m-common.dtsi"
#include "mt7986a-acer-connect-vero-w6m-pcie-eeprom.dtsi"
#include "mt7986a-acer-connect-vero-w6m-vpd.dtsi"

/ {
model = "Acer Connect Vero W6m";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"prefix-length": 24
}
]
}
},
"ietf-ip:ipv6": {}
},
{
"name": "lan1",
Expand Down
23 changes: 12 additions & 11 deletions board/aarch64/bananapi-bpi-r3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,26 @@ default address on every board, so two boards cannot even connect to
each other over WiFi: a client refuses to authenticate to an access
point that has its own address.

The eMMC image carries an empty `factory` partition for this purpose.
Write a product record to it once, from the Infix shell, and the board
keeps that identity across reboots and upgrades:
Store a product record as `/mnt/aux/vpd.bin`, from the Infix shell,
and the board keeps that identity across reboots and upgrades:

```
echo '{"mac-address":"02:00:00:ba:01:00","serial-number":"banana1","vendor":"Bananapi","product-name":"BPI-R3"}' \
| onieprom -e | dd of=/dev/disk/by-partlabel/factory
echo '{"mac-address":"02:00:00:ba:01:00","serial-number":"banana1","vendor":"SinoVoip Co., Ltd.","product-name":"BPI-R3"}' \
| onieprom -e > /mnt/aux/vpd.bin
```

Give each board its own base address and serial number, then reboot.
The base address becomes the hostname suffix, the wired ports get base
+ 1, base + 2, and so on in name order, and the WiFi interfaces get
addresses derived from the base. With the record above the board is
named `bpi-ba-01-00`, `lan1` is `02:00:00:ba:01:02` and `wifi0` is
`06:00:00:ba:01:00`.
The base address becomes the hostname suffix, each wired port gets a
fixed offset from the base, and the WiFi interfaces get addresses
derived from it. With the record above the board is named
`bpi-ba-01-00`, `lan1` is `02:00:00:ba:01:02`, `wan` is
`02:00:00:ba:01:08` and `wifi0` is `06:00:00:ba:01:00`. A port goes
back to this address when a custom MAC address is removed from it.

A locally administered address like `02:xx:xx:xx:xx:xx` is fine for a
lab. For boards that will share a network with other equipment, use a
range you own. See [Vital Product Data](../../../doc/vpd.md#factory-partition)
range you own. Remove the file to return to random addresses. See
[Vital Product Data](../../../doc/vpd.md#vpd-file-on-the-aux-partition)
for the record format and what else it can carry.

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-emmc.dtsi"
#include "mt7986a-bananapi-bpi-r3-macaddr.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Port addresses: VPD base MAC + 1 .. + 8 */
&gmac0 {
nvmem-cells = <&base_mac 1>;
nvmem-cell-names = "mac-address";
};

&gmac1 {
nvmem-cells = <&base_mac 6>;
nvmem-cell-names = "mac-address";
};

&switch {
ports {
port@0 {
nvmem-cells = <&base_mac 8>;
nvmem-cell-names = "mac-address";
};

port@1 {
nvmem-cells = <&base_mac 2>;
nvmem-cell-names = "mac-address";
};

port@2 {
nvmem-cells = <&base_mac 3>;
nvmem-cell-names = "mac-address";
};

port@3 {
nvmem-cells = <&base_mac 4>;
nvmem-cell-names = "mac-address";
};

port@4 {
nvmem-cells = <&base_mac 5>;
nvmem-cell-names = "mac-address";
};

port@5 {
nvmem-cells = <&base_mac 7>;
nvmem-cell-names = "mac-address";
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@
compatible = "ethernet-phy-id03a2.a411";
};

/* Port addresses: VPD base MAC + 1 (lan) and + 2 (wan) */
&gmac0 {
nvmem-cells = <&base_mac 1>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
nvmem-cells = <&base_mac 2>;
nvmem-cell-names = "mac-address";
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

#include "mt7986a-bananapi-bpi-r3.dtsi"
#include "mt7986a-bananapi-bpi-r3-sd.dtsi"
#include "mt7986a-bananapi-bpi-r3-macaddr.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Product VPD, an ONIE TLV that the boot loader copies from the aux
* partition into reserved memory. The region is zeroed when there is
* no VPD, which leaves the layout without cells. Ports reference the
* base MAC address with an index, <&base_mac N>, and get base + N as
* their permanent address.
*/
&{/reserved-memory} {
vpd: vpd@43e00000 {
compatible = "nvmem-rmem";
reg = <0 0x43e00000 0 0x10000>;
no-map;
infix,board = "product";

nvmem-layout {
compatible = "onie,tlv-layout";

base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* every boot, into the node behind the ethernet0 alias. The
* kernel then reports that port, and every switch port that
* inherits from it, as having a permanent hardware address.
* Drop the aliases so the ports come up with a random address
* instead, which init.d/22-macaddr replaces with a chassis-
* derived one when a product VPD is present.
* Drop the aliases so the ports get their address from the
* product VPD instead, see mt7986a-bananapi-bpi-r3-vpd.dtsi,
* or a random one on a board without a VPD.
*/
aliases {
/delete-property/ ethernet0;
Expand All @@ -17,11 +17,14 @@
infix {
/* Default admin user password: 'admin' */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
vpds = <&vpd>;
usb-ports = <&ssusb>;
usb-port-names = "USB";
};
};
};
#include "mt7986a-bananapi-bpi-r3-vpd.dtsi"

/*
From 236317dd4e55512933dcdaec3d0b4a0824f5e5bd Mon Sep 17 00:00:00 2001
From: Shiji Yang <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Wireless Ethernet Dispatch, the WiFi hardware offload path
options mt7915e wed_enable=1
options mt7915e wed_enable=0
86 changes: 0 additions & 86 deletions board/aarch64/bananapi-bpi-r3/rootfs/usr/libexec/bpi-r3/macaddr

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"prefix-length": 24
}
]
}
},
"ietf-ip:ipv6": {}
},
{
"name": "lan1",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"prefix-length": 24
}
]
}
},
"ietf-ip:ipv6": {}
},
{
"name": "lan",
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions board/aarch64/bananapi-bpi-r3/uboot/mt7986-env.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
bootcmd = "run ixboot";
boot_targets = "mmc0";
ethprime = "eth0";
vpd_addr_r = "0x43e00000";
fdt_addr_r = "0x43f00000";
kernel_addr_r = "0x44000000";
scriptaddr = "0x48000000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"prefix-length": 24
}
]
}
},
"ietf-ip:ipv6": {}
},
{
"name": "lan0",
Expand Down
Loading
Loading