Skip to content
Open
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
1 change: 1 addition & 0 deletions board/aarch64/microchip-ev23x71a/Config.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config BR2_PACKAGE_MICROCHIP_EV23X71A
bool "Microchip EV23X71A (Laguna)"
depends on BR2_aarch64
select BR2_PACKAGE_SYMREG
help
Support for the Microchip EV23X71A evaluation board, based on
the LAN969x (Laguna) family of TSN capable switches. 24 GbE
Expand Down
12 changes: 12 additions & 0 deletions board/aarch64/microchip-ev23x71a/dts/microchip/infix.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@
};
};
};

/* Register access by name for the symreg tool, debugfs only */
&axi {
symreg@e00c0000 {
compatible = "microchip,sparx5-symreg";
reg = <0xe00c0000 0x10000>,
<0xe2000000 0x2000000>;
reg-names = "cpu", "dev";
microchip,symreg = <0xe00c0000 0x10000>,
<0xe2000000 0x2000000>;
};
};
72 changes: 72 additions & 0 deletions board/aarch64/microchip-lan969x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Microchip LAN969x (Laguna)

Files shared by the boards built on the LAN969x switch family:

| Board | Package |
|-------------------------------------------------|------------------------------------|
| [Microchip EV23X71A](../microchip-ev23x71a) | `BR2_PACKAGE_MICROCHIP_EV23X71A` |
| [Novarq Tactical 1000](../novarq-tactical-1000) | `BR2_PACKAGE_NOVARQ_TACTICAL_1000` |

`uboot/` holds the U-Boot config fragment and environment used by the
`*_boot_defconfig` of each board. Kernel device tree and configuration
fixups stay with each board, see its `dts/` directory and `.mk` file.

A new Laguna board should select `BR2_PACKAGE_SYMREG` in its `Config.in`
and carry the `microchip,sparx5-symreg` node in its `dts/microchip/infix.dtsi`,
copied from one of the boards above, so the tool below works on it too.

## Debugging

### Register access by name

Every Laguna board ships `symreg`, Microchip's tool for reading and
writing switch registers by their datasheet names. It talks to the
`symreg` debugfs driver, which maps the register space the device tree
node describes and exposes it as `/sys/kernel/debug/symreg/mem`. Root
only, since debugfs is.

```
symreg --help # options and the register syntax
symreg -m # MAC table
symreg -v # VLAN table
symreg -c 0 # VCAP instance 0
symreg -s # stream table

symreg 'DEV2G5[29]*' # all registers of port 29's device block
symreg 'ASM*[29]*' # ingress side of the same port
symreg -a 'DSM*[29]*' # same, with the physical addresses

symreg REG[idx] # read one register
symreg REG[idx].FIELD # read one field
symreg REG[idx].FIELD 1 # write one field, add -f for wildcards
```

Register and field names follow the LAN969x datasheet. Quote the
wildcards or the shell expands them. The dispatcher `symreg` picks the
SoC from `/proc/device-tree/compatible` and runs `symreg_lan969x`, which
can also be called directly.

The tool reads live hardware, so the useful pattern for an intermittent
fault is a snapshot while the port works, another once it has failed,
and a diff of the two. For the management port, which is switch port 29
on both boards:

```bash
for blk in 'DEV2G5[29]*' 'ASM*[29]*' 'DSM*[29]*' 'QSYS*[29]*'; do
symreg "$blk"
done >/tmp/port29-$(date +%s).txt
```

Check the PHY as well. The management PHY sits on the GCB MDIO bus and
shares one level triggered interrupt line with the copper PHYs, so a
stale link state can come from a missed PHY interrupt as well as from
the switch. Read it with `mdio` from mdio-tools, see the
[EV23X71A README](../microchip-ev23x71a/README.md#debug-and-analysis),
which also covers the VCAP debugfs and `ethtool` counters; both apply to
either board.

### Writing registers

Writes take effect immediately and bypass the driver, which keeps no
record of them. Expect the driver's own view to disagree afterwards,
and reboot before trusting any behaviour again.
1 change: 1 addition & 0 deletions board/aarch64/novarq-tactical-1000/Config.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config BR2_PACKAGE_NOVARQ_TACTICAL_1000
bool "Novarq Tactical 1000 (Laguna)"
depends on BR2_aarch64
select BR2_PACKAGE_SYMREG
help
Support for the Novarq Tactical 1000, based on the LAN969x
(Laguna) family of TSN capable switches. 24 GbE copper ports,
Expand Down
12 changes: 12 additions & 0 deletions board/aarch64/novarq-tactical-1000/dts/microchip/infix.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@
};
};
};

/* Register access by name for the symreg tool, debugfs only */
&axi {
symreg@e00c0000 {
compatible = "microchip,sparx5-symreg";
reg = <0xe00c0000 0x10000>,
<0xe2000000 0x2000000>;
reg-names = "cpu", "dev";
microchip,symreg = <0xe00c0000 0x10000>,
<0xe2000000 0x2000000>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,17 @@ if ask "Create aux, primary ${imgsize}, secondary ${imgsize}, cfg ${cfgsize}, an
mkfs.ext4 -qF -L aux -m 0 -i 4096 -O ^metadata_csum,^metadata_csum_seed,uninit_bg "${disk}p4"
mkfs.ext4 -qF -L cfg -m 0 -i 4096 -O uninit_bg "${disk}p7"
mkfs.ext4 -qF -L var -m 0 -i 4096 -O uninit_bg "${disk}p8"
#
# RAUC tracks slot boot state in uboot.env, seed it as prod/provision does.
mnt=$(mktemp -d)
mount -t ext4 "${disk}p4" "$mnt"
echo 1 >"$mnt"/resized
mkenvimage -s 0x4000 -o "$mnt"/uboot.env - <<EOF
BOOT_ORDER=primary secondary net
BOOT_primary_LEFT=1
BOOT_secondary_LEFT=1
BOOT_net_LEFT=1
EOF
umount "$mnt"
rmdir "$mnt"
fi
Expand Down
16 changes: 1 addition & 15 deletions board/common/rootfs/etc/bash.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,7 @@ bind "set show-all-if-ambiguous on"

export LANG=C.UTF-8

log()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
less +G -r "$fn"
}

follow ()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"

tail -F -n +1 "$fn"
}

# log and follow are defined in /etc/profile.d/log.sh
_logfile_completions()
{
local cur=${COMP_WORDS[COMP_CWORD]}
Expand Down
15 changes: 15 additions & 0 deletions board/common/rootfs/etc/profile.d/log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Page or follow a log file, default syslog. Plain sh, so BusyBox ash
# and bash both get it; the bash completions live in /etc/bash.bashrc.
log()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
less +G -r "$fn"
}

follow()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
tail -F -n +1 "$fn"
}
3 changes: 3 additions & 0 deletions configs/aarch64_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ BR2_PACKAGE_HOST_GENEXT2FS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FDT_ADD_PUBKEY=y
BR2_PACKAGE_ACER_CONNECT_VERO_W6M=y
BR2_PACKAGE_ALDER_ALDER=y
BR2_PACKAGE_BANANAPI_BPI_R3=y
BR2_PACKAGE_BANANAPI_BPI_R4=y
BR2_PACKAGE_BANANAPI_BPI_R64=y
BR2_PACKAGE_FRIENDLYARM_NANOPI_R2S=y
BR2_PACKAGE_MARVELL_CN9130_CRB=y
BR2_PACKAGE_MARVELL_ESPRESSOBIN=y
BR2_PACKAGE_MICROCHIP_EV23X71A=y
BR2_PACKAGE_NOVARQ_TACTICAL_1000=y
BR2_PACKAGE_RASPBERRYPI_RPI64=y
BR2_PACKAGE_STYX_DCP_SC_28P=y
IX_VENDOR_HOME="https://www.kernelkit.org"
Expand Down
33 changes: 33 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ All notable changes to the project are documented in this file.
- WiFi channel survey is on request: `show hardware <radio> survey`, the
Scan channels button on the WebUI WiFi page, or the `channel-survey`
action. The always-on `survey` container under the radio is gone
- LAN969x boards ship `symreg`, which reads and writes switch registers by
name and dumps the MAC, VLAN and VCAP tables, for debugging the switch
core, see `board/aarch64/microchip-lan969x/README.md`

### Fixes

Expand Down Expand Up @@ -99,6 +102,36 @@ All notable changes to the project are documented in this file.
WPA3 clients
- Changing the MAC address of a WiFi access point could leave the access
points on that radio down until the WiFi service was restarted
- LAN969x: a port outside any bridge stopped receiving multicast, including
IPv6 neighbour discovery and mDNS, when another port outside a bridge went
down or joined a bridge. The port looked dead on the LAN until it was
taken down and up again, which is how the Tactical 1000 management port
kept dropping out of the test rig
- LAN969x: kernel BUG "scheduling while atomic" when a multicast address was
added to or removed from a port outside any bridge
- LAN969x: the IP address of a bridge was unreachable from its ports, while
forwarding between the ports worked. Broadcast from a bridge port never
reached the CPU, so ARP went unanswered, and the bridge's own MAC address
was missing from the switch MAC table, so unicast to the bridge was
flooded to the ports instead of delivered
- LAN969x: disabling the first port of a bridge, whose MAC address the
bridge uses, cut the bridge IP address off until the port was enabled
again
- LAN969x: taking down one port of a link aggregate stopped unicast to the
aggregate on the remaining ports, and removing the aggregate cut off the
port whose address it had used until that port was disabled and enabled
again
- PTP ports with PHY timestamping, e.g. the copper ports on LAN969x boards,
kept dropping to the faulty state because the transmit timestamp arrived
later than the 10 ms the PTP daemon waited for it, or never at all
- PTP: IEEE 802.1AS ports stayed in the listening state on switches that
time stamp in the switch core, since the measured link delay includes the
PHY latency and exceeded the 800 ns threshold. The threshold now defaults
to 10 us with hardware time stamping and can be set per port with
`mean-link-delay-thresh`
- PTP now time stamps with the clock of the switch core when the kernel
would have picked a PHY's, so all ports of a switch share one clock, which
boundary and transparent clocks and TSN schedules depend on

[pppoe]: https://www.kernelkit.org/infix/latest/pppoe/
[wds]: https://www.kernelkit.org/infix/latest/wifi/#wds-backhaul-and-repeaters
Expand Down
1 change: 1 addition & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/python-spy/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/python-libyang/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/python-yangdoc/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/skeleton-init-finit/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/symreg/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/tetris/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/libyang-cpp/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/sysrepo-cpp/Config.in"
Expand Down
10 changes: 10 additions & 0 deletions package/symreg/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
config BR2_PACKAGE_SYMREG
bool "symreg - Microchip switch registers by name"
depends on BR2_aarch64
help
Read and write Microchip LAN969x switch registers by symbolic
name, and dump the MAC, VLAN, VCAP and stream tables, through
the symreg debugfs driver. Debug aid, root only. Selected by
the Laguna boards, see board/aarch64/microchip-lan969x/README.md

https://github.com/microchip-ung/symreg-tool
3 changes: 3 additions & 0 deletions package/symreg/symreg.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Locally calculated
sha256 0d7eee2dbdd8e79bb91103d06ee057cb477764a046c5d6d8045e978166a70490 symreg-cb96993eeb34558926a8f5851a945ad4cd674690.tar.gz
sha256 d620d728cc1c0efebe173f8840dd957a56d9ff40867c062d0571b4110ea15f1e LICENSE
11 changes: 11 additions & 0 deletions package/symreg/symreg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SYMREG_VERSION = cb96993eeb34558926a8f5851a945ad4cd674690
SYMREG_SITE = $(call github,microchip-ung,symreg-tool,$(SYMREG_VERSION))
SYMREG_LICENSE = MIT
SYMREG_LICENSE_FILES = LICENSE
SYMREG_CONF_OPTS = -DBUILD_LAN969X=ON

define SYMREG_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_SPARX5_SYMREG)
endef

$(eval $(cmake-package))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ca34ebe2b40b53b52a5ea6fb00b7bb36eeeabb5f Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 19 Sep 2023 18:38:10 +0200
Subject: [PATCH 01/86] net: phy: marvell10g: Support firmware loading on
Subject: [PATCH 01/91] net: phy: marvell10g: Support firmware loading on
88X3310

When probing, if a device is waiting for firmware to be loaded into
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 59532ff26cccf476b4e6f8eeaf2e733c93106a78 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 21 Nov 2023 20:15:24 +0100
Subject: [PATCH 02/86] net: phy: marvell10g: Fix power-up when strapped to
Subject: [PATCH 02/91] net: phy: marvell10g: Fix power-up when strapped to
start powered down

On devices which are hardware strapped to start powered down (PDSTATE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 2881f5a7008a4b7a214f63960f1d199f55a7a78a Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 15 Nov 2023 20:58:42 +0100
Subject: [PATCH 03/86] net: phy: marvell10g: Add LED support for 88X3310
Subject: [PATCH 03/91] net: phy: marvell10g: Add LED support for 88X3310

Pickup the LEDs from the state in which the hardware reset or
bootloader left them, but also support further configuration via
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 67a62752bdb5e1e45982289b2eda1f5df4ca6f47 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 12 Dec 2023 09:51:05 +0100
Subject: [PATCH 04/86] net: phy: marvell10g: Support LEDs tied to a single
Subject: [PATCH 04/91] net: phy: marvell10g: Support LEDs tied to a single
media side

In a combo-port setup, i.e. where both the copper and fiber interface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a60255d4ba8ea888ecb86e92a2c65334a26f6384 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 27 Mar 2024 10:10:19 +0100
Subject: [PATCH 05/86] net: phy: Do not resume PHY when attaching
Subject: [PATCH 05/91] net: phy: Do not resume PHY when attaching

The PHY should not start negotiating with its link-partner until
explicitly instructed to do so.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3fc8e2a80589a5a5ae02fac7b3f97f195cb90930 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 4 Mar 2024 16:47:28 +0100
Subject: [PATCH 06/86] net: bridge: avoid classifying unknown multicast as
Subject: [PATCH 06/91] net: bridge: avoid classifying unknown multicast as
mrouters_only

Unknown multicast, MAC/IPv4/IPv6, should always be flooded according to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8f5cf3a448d6e7a1d00043debd0bf1fcaf706680 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 5 Mar 2024 06:44:41 +0100
Subject: [PATCH 07/86] net: bridge: Ignore router ports when forwarding L2
Subject: [PATCH 07/91] net: bridge: Ignore router ports when forwarding L2
multicast

Multicast router ports are either statically configured or learned from
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a42722822b7ff8ea8ac5e65a8449bb72b1ef8c05 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 4 Apr 2024 16:36:30 +0200
Subject: [PATCH 08/86] net: bridge: drop delay for applying strict multicast
Subject: [PATCH 08/91] net: bridge: drop delay for applying strict multicast
filtering

This *local* patch drops the initial delay before applying strict multicast
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 2722df35856114c70f9896452d155b660f804ed8 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 May 2024 14:51:54 +0200
Subject: [PATCH 09/86] net: bridge: Differentiate MDB additions from
Subject: [PATCH 09/91] net: bridge: Differentiate MDB additions from
modifications

Before this change, the reception of an IGMPv3 report (and analogously
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 17f03931f23a3ed1dbe6f77a7e48bfdc11f17140 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 24 Nov 2023 23:29:55 +0100
Subject: [PATCH 10/86] nvmem: layouts: onie-tlv: Let device probe even when
Subject: [PATCH 10/91] nvmem: layouts: onie-tlv: Let device probe even when
TLV is invalid

Before this change, probing an NVMEM device, expected to contain a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cbc993b90307a45db570d20bce5e651100bafaa7 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 11 Aug 2024 11:27:35 +0200
Subject: [PATCH 11/86] net: usb: r8152: add r8153b support for link/activity
Subject: [PATCH 11/91] net: usb: r8152: add r8153b support for link/activity
LEDs

This patch adds support for the link/activity LEDs on the NanoPi R2S
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0c1a54359f6989eedad98678e030fc1d8fb44da0 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 10 Aug 2025 18:52:54 +0200
Subject: [PATCH 12/86] arm64: dts: mediatek: mt7986a: rename BPi R3 ports to
Subject: [PATCH 12/91] arm64: dts: mediatek: mt7986a: rename BPi R3 ports to
match case

For ref. see: https://wiki.banana-pi.org/File:Bpi-r3_Metal_case.jpg
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 2cbb47d51538a83315595715405a328552b9a753 Mon Sep 17 00:00:00 2001
From: Mattias Walström <lazzer@gmail.com>
Date: Wed, 20 Aug 2025 21:38:24 +0200
Subject: [PATCH 13/86] drm/panel-simple: Add a timing for the Raspberry Pi 7"
Subject: [PATCH 13/91] drm/panel-simple: Add a timing for the Raspberry Pi 7"
panel

The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI
Expand Down
Loading
Loading