Lines Matching defs:pcie
5 * Layerscape PCIe driver
25 static int ls_pcie_next_lut_index(struct ls_pcie *pcie)
27 if (pcie->next_lut_index < PCIE_LUT_ENTRY_COUNT)
28 return pcie->next_lut_index++;
33 /* returns the next available streamid for pcie, -errno if failed */
44 static void lut_writel(struct ls_pcie *pcie, unsigned int value,
47 if (pcie->big_endian)
48 out_be32(pcie->lut + offset, value);
50 out_le32(pcie->lut + offset, value);
56 static void ls_pcie_lut_set_mapping(struct ls_pcie *pcie, int index, u32 devid,
60 lut_writel(pcie, devid << 16, PCIE_LUT_UDR(index));
61 lut_writel(pcie, streamid | PCIE_LUT_ENABLE, PCIE_LUT_LDR(index));
72 static void fdt_pcie_set_msi_map_entry(void *blob, struct ls_pcie *pcie,
82 nodeoffset = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie",
83 pcie->dbi_res.start);
90 compat = "fsl,ls2088a-pcie";
95 compat, pcie->dbi_res.start);
104 debug("\n%s: ERROR: missing msi-parent: PCIe%d\n",
105 __func__, pcie->idx);
125 static void fdt_pcie_set_iommu_map_entry(void *blob, struct ls_pcie *pcie,
136 nodeoffset = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie",
137 pcie->dbi_res.start);
144 compat = "fsl,ls2088a-pcie";
150 compat, pcie->dbi_res.start);
159 debug("\n%s: ERROR: missing iommu-map: PCIe%d\n",
160 __func__, pcie->idx);
181 struct ls_pcie *pcie;
192 pcie = dev_get_priv(bus);
200 index = ls_pcie_next_lut_index(pcie);
209 ls_pcie_lut_set_mapping(pcie, index, bdf >> 8,
212 fdt_pcie_set_msi_map_entry(blob, pcie, bdf >> 8,
215 fdt_pcie_set_iommu_map_entry(blob, pcie, bdf >> 8,
221 static void ft_pcie_ls_setup(void *blob, struct ls_pcie *pcie)
227 off = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie",
228 pcie->dbi_res.start);
235 compat = "fsl,ls2088a-pcie";
240 compat, pcie->dbi_res.start);
246 if (pcie->enabled)
252 /* Fixup Kernel DT for PCIe */
255 struct ls_pcie *pcie;
257 list_for_each_entry(pcie, &ls_pcie_list, list)
258 ft_pcie_ls_setup(blob, pcie);