[U-Boot] [PATCH] 85xx/p2020ds: Use is_serdes_configured() to determine of PCIe enabled

Kumar Gala galak at kernel.crashing.org
Fri May 28 14:53:30 CEST 2010


On May 27, 2010, at 4:38 PM, Timur Tabi wrote:

> On Fri, May 21, 2010 at 4:17 AM, Kumar Gala <galak at kernel.crashing.org> wrote:
> 
>>        if (pcie_configured && !(devdisr & MPC85xx_DEVDISR_PCIE2)) {
>> +               set_next_law(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_512M,
>> +                               LAW_TRGT_IF_PCIE_2);
>> +               set_next_law(CONFIG_SYS_PCIE2_IO_PHYS, LAW_SIZE_64K,
>> +                               LAW_TRGT_IF_PCIE_2);
>>                SET_STD_PCIE_INFO(pci_info[num], 2);
> 
> How about this instead:
> 
>                SET_STD_PCIE_INFO(pci_info[num], 2);
> +               set_next_law(pci_info[num].mem_phys,
> +			     law_size_bits(pci_info[num].mem_size),
> +			     LAW_TRGT_IF_PCIE_2);
> +               set_next_law(pci_info[num].io_phys,
> +			     law_size_bits(pci_info[num].io_size),
> +                               LAW_TRGT_IF_PCIE_2);

that's fine.  We could fold the law setup into fsl_pci_init_port()

* tweak SET_STD_PCIE_INFO to track LAW_TRGT_IF_PCIE_n
* add something like the following to fsl_pci_init_port():

        struct law_entry law;

	law = find_law(pci_info->mem_phys);
        if (law.index == -1) {
                law.index = set_next_law(pci_info->mem_phys,
					law_size_bits(pci_info->mem_size),
					pci_info->law_trgt_id);
        }

	/* duplicate for IO */

- k


More information about the U-Boot mailing list