8 devices habanero switch config issues on 22.03 firmware

I am trying to configure the switch on 8 devices habanero and I suspect that there is an issue in its configuration.

Firmware: OpenWrt 22.03.4 r20123-38ccc47687 / LuCI openwrt-22.03 branch git-23.093.57104-ce20b4a

First the switch is not configured on /etc/config/network so I added the following config:

config switch 'switch0'
        option 'reset' '1'
        option 'enable_vlan' '1'

Afret adding this config I have the swithch tab on Luci, and this is what I see in the UI:

Whie this is how everything is conected:

Which is confusing and also misleading, since CPU (eth0) on the ui is actually the right most port which is interface eth1 in the network config, and I guess Port 1 in the UI is actually eth0 in the network config, while Port 4 is actually physically port 3 if we count the sockets from left to right.

Also this is the board.json :

# cat /var/board.json
{
	"model": {
		"id": "8dev,habanero-dvk",
		"name": "8devices Habanero DVK"
	},
	"network": {
		"lan": {
			"device": "eth0",
			"protocol": "static"
		},
		"wan": {
			"device": "eth1",
			"protocol": "dhcp"
		}
	},
	"system": {
		"label_macaddr": "??????" # changed
	}
}

by default he device comes with the following firmware there it seems like the switch is configured correctly.
firmware: OpenWrt-8devices v3.1 r9932-13962b7 / LuCI openwrt-19.07 branch (f138fc93)

And for the same physical conections this is what I see in the UI:

and it seems like CPU (eth0) and LAN 3 are mapped correctly, but I don't have indication for the last port.

Also this is the board.json :

# cat  /var/board.json 
{
	"model": {
		"id": "8dev,habanero-dvk-c2",
		"name": "8devices Habanero DVK-C2"
	},
	"network": {
		"lan": {
			"ifname": "eth0",
			"protocol": "static"
		},
		"wan": {
			"ifname": "eth1",
			"protocol": "dhcp"
		}
	},
	"switch": {
		"switch0": {
			"enable": true,
			"reset": true,
			"ports": [
				{
					"num": 0,
					"device": "eth0",
					"need_tag": false,
					"want_untag": true
				},
				{
					"num": 1,
					"role": "lan"
				},
				{
					"num": 2,
					"role": "lan"
				},
				{
					"num": 3,
					"role": "lan"
				},
				{
					"num": 4,
					"role": "lan"
				}
			],
			"roles": [
				{
					"role": "lan",
					"ports": "1 2 3 4 0",
					"device": "eth0"
				}
			]
		}
	}
}

How can I fix the config of the latest firmware so that the switch is configured correctly and ports are mapped correctly in the UI?

After better understandig of switch configuration I think I was able to configure the habanero switch as expected.

This is the default firmware network config:

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd8b:175f:d177::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.1'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'

Which doesn't contain any switch configuration.

Adding the following config:

config switch 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0t 1 2 3 4'

config switch_vlan
        option device 'switch0'
        option ports '0t 5'
        option vlan '2'

aligned the uci with the info running the command swconfig dev switch0 show
and I think that the device should have been flashed with this config by default.

Another important consideration is that vlans 1 and 2 are reserved for eth0 and eth1 respectivly, on ipq40xx so they shouldn't be deleted from /etc/config/network this will cause mismatch between uci and swconfig.
See discussion for more detail.

Knowing all that we can now configure different vlans on vlan ids which are not 1 or 2.

The only issue is that the UI is a bit misleading

Since port1 in the UI is the one which is not physically visible and the port called CPU(et0) is actually the fifth port from left to right on the physical device.

Update:
Moving the port marked "CPU (eth0)" in the UI to a diffrent VLAN doesn't work.
I guess I just have to accept that it's alone in vlan2 and thats it