| .. | .. |
|---|
| 22 | 22 | /** |
|---|
| 23 | 23 | * struct rockchip_pcie_ep - private data for PCIe endpoint controller driver |
|---|
| 24 | 24 | * @rockchip: Rockchip PCIe controller |
|---|
| 25 | + * @epc: PCI EPC device |
|---|
| 25 | 26 | * @max_regions: maximum number of regions supported by hardware |
|---|
| 26 | 27 | * @ob_region_map: bitmask of mapped outbound regions |
|---|
| 27 | 28 | * @ob_addr: base addresses in the AXI bus where the outbound regions start |
|---|
| .. | .. |
|---|
| 263 | 264 | struct rockchip_pcie *pcie = &ep->rockchip; |
|---|
| 264 | 265 | u32 r; |
|---|
| 265 | 266 | |
|---|
| 266 | | - r = find_first_zero_bit(&ep->ob_region_map, |
|---|
| 267 | | - sizeof(ep->ob_region_map) * BITS_PER_LONG); |
|---|
| 267 | + r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG); |
|---|
| 268 | 268 | /* |
|---|
| 269 | 269 | * Region 0 is reserved for configuration space and shouldn't |
|---|
| 270 | 270 | * be used elsewhere per TRM, so leave it out. |
|---|
| .. | .. |
|---|
| 499 | 499 | |
|---|
| 500 | 500 | rockchip_pcie_write(rockchip, cfg, PCIE_CORE_PHY_FUNC_CFG); |
|---|
| 501 | 501 | |
|---|
| 502 | | - list_for_each_entry(epf, &epc->pci_epf, list) |
|---|
| 503 | | - pci_epf_linkup(epf); |
|---|
| 504 | | - |
|---|
| 505 | 502 | return 0; |
|---|
| 503 | +} |
|---|
| 504 | + |
|---|
| 505 | +static const struct pci_epc_features rockchip_pcie_epc_features = { |
|---|
| 506 | + .linkup_notifier = false, |
|---|
| 507 | + .msi_capable = true, |
|---|
| 508 | + .msix_capable = false, |
|---|
| 509 | +}; |
|---|
| 510 | + |
|---|
| 511 | +static const struct pci_epc_features* |
|---|
| 512 | +rockchip_pcie_ep_get_features(struct pci_epc *epc, u8 func_no) |
|---|
| 513 | +{ |
|---|
| 514 | + return &rockchip_pcie_epc_features; |
|---|
| 506 | 515 | } |
|---|
| 507 | 516 | |
|---|
| 508 | 517 | static const struct pci_epc_ops rockchip_pcie_epc_ops = { |
|---|
| .. | .. |
|---|
| 515 | 524 | .get_msi = rockchip_pcie_ep_get_msi, |
|---|
| 516 | 525 | .raise_irq = rockchip_pcie_ep_raise_irq, |
|---|
| 517 | 526 | .start = rockchip_pcie_ep_start, |
|---|
| 527 | + .get_features = rockchip_pcie_ep_get_features, |
|---|
| 518 | 528 | }; |
|---|
| 519 | 529 | |
|---|
| 520 | 530 | static int rockchip_pcie_parse_ep_dt(struct rockchip_pcie *rockchip, |
|---|
| .. | .. |
|---|
| 605 | 615 | rockchip_pcie_write(rockchip, BIT(0), PCIE_CORE_PHY_FUNC_CFG); |
|---|
| 606 | 616 | |
|---|
| 607 | 617 | err = pci_epc_mem_init(epc, rockchip->mem_res->start, |
|---|
| 608 | | - resource_size(rockchip->mem_res)); |
|---|
| 618 | + resource_size(rockchip->mem_res), PAGE_SIZE); |
|---|
| 609 | 619 | if (err < 0) { |
|---|
| 610 | 620 | dev_err(dev, "failed to initialize the memory space\n"); |
|---|
| 611 | 621 | goto err_uninit_port; |
|---|