Re: [RFC PATCH 4.19.y-cip 41/50] PCI: rcar: Add endpoint mode support
Pavel Machek
Hi!
believe usleep can guarantee microsecond accuracy.
(And you probably don't need it, right?)
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
commit 2a6d0d63d99956a66f6605832f11755d74a41951 upstream.
Add support for R-Car PCIe controller to work in endpoint mode.
+ ep->ob_window[i].phys_base = res->start;Comment not according to CodingStyle.
+ ep->ob_window[i].size = resource_size(res);
+ /* controller doesn't support multiple allocation
+ * from same window, so set page_size to window size
+ */
+ memset(&win, 0x0, sizeof(win));Plain 0 would be enough
+ memset(&res, 0x0, sizeof(res));
+ val |= ASTINTX;This is crazy. Either you need exact timing or you don't, but I don't
+ rcar_pci_write_reg(pcie, val, PCIEINTXR);
+ usleep_range(1000, 1001);
+ val = rcar_pci_read_reg(pcie, PCIEINTXR);
believe usleep can guarantee microsecond accuracy.
(And you probably don't need it, right?)
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany