[PATCH u-boot-marvell 6/9] arm: mvebu: a38x: serdes: Don't overwrite PCI device ID

Stefan Roese sr at denx.de
Fri Oct 8 08:28:55 CEST 2021


On 24.09.21 22:59, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> PCI device ID is part of the PCIe controller SoC / revision. For Root
> Complex mode (which is the default and the only mode supported currently
> by U-Boot and Linux kernel), it is PCI device ID of PCIe Root Port device.
> 
> If there is some issue with this device ID, it should be set / updated by
> PCIe controller driver (pci_mvebu.c), as this register resides in address
> space of the controller. It shouldn't be done in SerDes initialization
> code.
> 
> In the worst case (a specific board for example) it could be done via
> U-Boot's weak function board_pex_config().
> 
> But it should not be overwritten globally for all A38x devices.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c | 27 ----------------------
>   1 file changed, 27 deletions(-)
> 
> diff --git a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
> index 7c18df8113..a7e45a5550 100644
> --- a/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
> +++ b/arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.c
> @@ -186,33 +186,6 @@ int hws_pex_config(const struct serdes_map *serdes_map, u8 count)
>   			(": Link upgraded to Gen2 based on client capabilities\n");
>   	}
>   
> -	/* Update pex DEVICE ID */
> -	ctrl_mode = sys_env_model_get();
> -
> -	for (idx = 0; idx < count; idx++) {
> -		serdes_type = serdes_map[idx].serdes_type;
> -		/* configuration for PEX only */
> -		if ((serdes_type != PEX0) && (serdes_type != PEX1) &&
> -		    (serdes_type != PEX2) && (serdes_type != PEX3))
> -			continue;
> -
> -		if ((serdes_type != PEX0) &&
> -		    ((serdes_map[idx].serdes_mode == PEX_ROOT_COMPLEX_X4) ||
> -		     (serdes_map[idx].serdes_mode == PEX_END_POINT_X4))) {
> -			/* for PEX by4 - relevant for the first port only */
> -			continue;
> -		}
> -
> -		pex_idx = serdes_type - PEX0;
> -		dev_id = reg_read(PEX_CFG_DIRECT_ACCESS
> -				  (pex_idx, PEX_DEVICE_AND_VENDOR_ID));
> -		dev_id &= 0xffff;
> -		dev_id |= ((ctrl_mode << 16) & 0xffff0000);
> -		reg_write(PEX_CFG_DIRECT_ACCESS
> -			  (pex_idx, PEX_DEVICE_AND_VENDOR_ID), dev_id);
> -	}
> -	DEBUG_INIT_FULL_C("Update PEX Device ID ", ctrl_mode, 4);
> -
>   	return MV_OK;
>   }
>   
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list