[PATCH net-next v3 3/3] net: ti: icssg-prueth: Add support for ICSSG switch firmware

Andrew Lunn andrew at lunn.ch
Wed Apr 10 05:42:00 PDT 2024


> I have been working on this and have found a way to change firmwares
> without bringing the interfaces up / down.
> 
> By default the interfaces are in MAC mode and the ICSSG EMAC firmwares
> are running on pru cores. To enable switch mode we will need to stop the
> cores and reload them with the ICSSG Switch firmwares. We can do this
> without bringing the interfaces up / down.
> 
> When first interface is added to bridge it will still run emac
> firmwares. The moment second interface gets added to bridge, we will
> disable the ports and stop the pru cores. Load the switch firmwares on
> to the cores, start the cores and enable the ports. All of this is done
> from the driver.
> 
> The user need not to bring the interfaces up / down. Loading / Reloading
> of firmwares will be handled inside the driver only. But we do need to
> stop the cores for changing firmwares. For stopping the cores we will
> change the port state to disable by sending r30 command to firmware.
> 
> As we are not restarting the interfaces, the DRAM, SMEM and MSMC RAM
> doesn't get cleared. As a result with this approach all configurations
> will be saved.
> 
> Please let me know if this approach looks ok to you.
> 
> Below will be the commands to enable switch mode now,
> 
>      ip link add name br0 type bridge
>      ip link set dev eth1 master br0
>      ip link set dev eth2 master br0 (At this point we will stop the
> cores, reload switch firmware, start the cores)
>      ip link set dev br0 up
>      bridge vlan add dev br0 vid 1 pvid untagged

This sounds a lot better.

Note that the bridge interface br0 might already be up when the
interfaces are added. So that is a different order to what you showed
here.

There will be some packet losses when you swap firmware, but it
probably is not that bad. When interfaces are added to a bridge
packets are dropped anywhere while spanning tree determines the
network topology. It will just appear your device is slow at doing
that.

	Andrew



More information about the linux-arm-kernel mailing list