mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
pci: layerscape: Modify the EP and RC mode judge method
Modify the RC and EP mode judge method, save the mode as a variable, the variable will be used by other function. Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
@@ -438,9 +438,7 @@ static int ls_pcie_probe(struct udevice *dev)
|
|||||||
struct ls_pcie *pcie = dev_get_priv(dev);
|
struct ls_pcie *pcie = dev_get_priv(dev);
|
||||||
const void *fdt = gd->fdt_blob;
|
const void *fdt = gd->fdt_blob;
|
||||||
int node = dev_of_offset(dev);
|
int node = dev_of_offset(dev);
|
||||||
u8 header_type;
|
|
||||||
u16 link_sta;
|
u16 link_sta;
|
||||||
bool ep_mode;
|
|
||||||
uint svr;
|
uint svr;
|
||||||
int ret;
|
int ret;
|
||||||
fdt_size_t cfg_size;
|
fdt_size_t cfg_size;
|
||||||
@@ -524,15 +522,15 @@ static int ls_pcie_probe(struct udevice *dev)
|
|||||||
(unsigned long)pcie->ctrl, (unsigned long)pcie->cfg0,
|
(unsigned long)pcie->ctrl, (unsigned long)pcie->cfg0,
|
||||||
pcie->big_endian);
|
pcie->big_endian);
|
||||||
|
|
||||||
header_type = readb(pcie->dbi + PCI_HEADER_TYPE);
|
pcie->mode = readb(pcie->dbi + PCI_HEADER_TYPE) & 0x7f;
|
||||||
ep_mode = (header_type & 0x7f) == PCI_HEADER_TYPE_NORMAL;
|
|
||||||
printf("PCIe%u: %s %s", pcie->idx, dev->name,
|
|
||||||
ep_mode ? "Endpoint" : "Root Complex");
|
|
||||||
|
|
||||||
if (ep_mode)
|
if (pcie->mode == PCI_HEADER_TYPE_NORMAL) {
|
||||||
ls_pcie_setup_ep(pcie);
|
printf("PCIe%u: %s %s", pcie->idx, dev->name, "Endpoint");
|
||||||
else
|
ls_pcie_setup_ep(pcie);
|
||||||
ls_pcie_setup_ctrl(pcie);
|
} else {
|
||||||
|
printf("PCIe%u: %s %s", pcie->idx, dev->name, "Root Complex");
|
||||||
|
ls_pcie_setup_ctrl(pcie);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ls_pcie_link_up(pcie)) {
|
if (!ls_pcie_link_up(pcie)) {
|
||||||
/* Let the user know there's no PCIe link */
|
/* Let the user know there's no PCIe link */
|
||||||
|
@@ -144,6 +144,7 @@ struct ls_pcie {
|
|||||||
bool big_endian;
|
bool big_endian;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
int next_lut_index;
|
int next_lut_index;
|
||||||
|
int mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct list_head ls_pcie_list;
|
extern struct list_head ls_pcie_list;
|
||||||
|
Reference in New Issue
Block a user