board: ti: am335x: Choose CPSW or PRUSS configuration based on jumper setting
authorAmjad Ouled-Ameur <aouledameur@baylibre.com>
Fri, 29 Oct 2021 14:08:17 +0000 (16:08 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 16 Jan 2022 13:31:03 +0000 (08:31 -0500)
commit609983e981a0a7f053ee6f9f6cd2772226a33000
tree747941ffda575cae26db20d7fa043c118a45d5bd
parentf44bcb9f0d73c13738b8f3e437bda75fda642ad7
board: ti: am335x: Choose CPSW or PRUSS configuration based on jumper setting

The am335x-ice-v2 board's Ethernet ports can be configured
in 'MII' or 'RMII' mode to be connected to 'PRUSS' or 'CPSW'
Ethernet subsystems.

This patch sets the environment variable 'ice_mii' to
'mii' or 'rmii' accordingly. Based on that we choose the
appropriate board devicetree i.e. 'am335x-ice-v2.dtb' or
'am335x-ice-v2-prueth.dtb'.

Since there are 2 Ethernet ports with 2 modes, there can be 4
configurations but for now we consider both ports in different modes
to be an invalid configuration and prevent boot in that case.

Signed-off-by: Roger Quadros <rogerq@ti.com>
[Amjad: use overlay instead of using new am335x-ice-v2-prueth.dtb]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Make prueth_is_mii be marked __maybe_unused]
Signed-off-by: Tom Rini <trini@konsulko.com>
board/ti/am335x/board.c
include/configs/am335x_evm.h
include/configs/ti_armv7_common.h