[RFC 5/7] Unite all PCI-e on 85xx and 86xx under one codebase

Olof Johansson olof at lixom.net
Mon Feb 19 01:29:26 EST 2007


On Thu, Feb 15, 2007 at 08:46:03PM -0600, Andy Fleming wrote:
>  	if (devfn != 0x0 && bus->number == 0xff)
>  		return PCIBIOS_DEVICE_NOT_FOUND;
>  
> +	PCI_CFG_OUT(hose->cfg_addr, 0x80000000 | 0x4 << 24
> +		| (0 << 16) | (0x4 & 0xfc));
> +	link_training_stat = in_le32(hose->cfg_data);
> +	if ((link_training_stat & 0x5f) < 0x16)  /* Training failure */
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +

Huh? (0x4 & 0xfc) doesn't make much sense, neither does 0 << 16. Can't
you just hardcode the full hex value there, if you're not going to
use symbolic constants, there's not much use in or:ing stuff together
anyway. I.e. 0x84000004


[...]
> @@ -97,8 +105,14 @@ indirect_write_config_pcie(struct pci_bu
>  	if (devfn != 0x0 && bus->number == 0xff)
>  		return PCIBIOS_DEVICE_NOT_FOUND;
>  
> +	PCI_CFG_OUT(hose->cfg_addr, 0x80000000 | 0x4 << 24
> +		| (0 << 16) | (0x4 & 0xfc));
> +	link_training_stat = in_le32(hose->cfg_data);
> +	if ((link_training_stat & 0x5f) < 0x16)  /* Training failure */
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +

Same here.


-Olof



More information about the Linuxppc-dev mailing list