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

> On Fri, May 21, 2010 at 4:17 AM, Kumar Gala <ga...@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
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to