board: gateworks: venice: fix dt adjustment for gw73xx baseboard for imx8mp

The GW73xx baseboard needs a PCI dt adjustment for revC/D based on a
change of the PCIe switch. Make sure we are only doing this for a pci
based ethernet to avoid causing a boot hang when the ethernet1 alias
points to eqos or fec. To know this is a pcie device ensure the alias
begins with the pcie controller.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
Tim Harvey 2024-04-17 13:01:53 -07:00 committed by Fabio Estevam
parent 45d14c0120
commit 8d22015d23

View file

@ -230,6 +230,7 @@ uint mmc_get_env_part(struct mmc *mmc)
int ft_board_setup(void *fdt, struct bd_info *bd) int ft_board_setup(void *fdt, struct bd_info *bd)
{ {
const char *base_model = eeprom_get_baseboard_model(); const char *base_model = eeprom_get_baseboard_model();
const char *path;
char pcbrev; char pcbrev;
int off; int off;
@ -238,10 +239,10 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
if (!strncmp(base_model, "GW73", 4)) { if (!strncmp(base_model, "GW73", 4)) {
pcbrev = get_pcb_rev(base_model); pcbrev = get_pcb_rev(base_model);
path = fdt_get_alias(fdt, "ethernet1");
if (pcbrev > 'B' && pcbrev < 'E') { if (pcbrev > 'B' && pcbrev < 'E' && path && !strncmp(path, "/soc@0/pcie@", 12)) {
printf("adjusting dt for %s\n", base_model); printf("adjusting %s pcie\n", base_model);
/* /*
* revC/D/E has PCIe 4-port switch which changes * revC/D/E has PCIe 4-port switch which changes
* ethernet1 PCIe GbE: * ethernet1 PCIe GbE: