All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] FSL PCI: Configure PCIe reference ratio
@ 2017-09-12 17:56 Joakim Tjernlund
  2017-09-14 21:15 ` York Sun
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Joakim Tjernlund @ 2017-09-12 17:56 UTC (permalink / raw)
  To: u-boot

Most FSL PCIe controllers expects 333 MHz PCI reference clock.
This clock is derived from the CCB but in many cases the ref.
clock is not 333 MHz and a divisor needs to be configured.

This adds PEX_CCB_DIV #define which can be defined for each
type of CPU/platform.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
 drivers/pci/fsl_pci_init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 52792dcd59..4d00b3f26c 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -322,6 +322,12 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
 
 	pci_setup_indirect(hose, cfg_addr, cfg_data);
 
+#ifdef PEX_CCB_DIV
+	/* Configure the PCIE controller core clock ratio */
+	pci_hose_write_config_dword(hose, dev, 0x440,
+				    ((gd->bus_clk / 1000000) *
+				     (16 / PEX_CCB_DIV)) / 333);
+#endif
 	block_rev = in_be32(&pci->block_rev1);
 	if (PEX_IP_BLK_REV_2_2 <= block_rev) {
 		pi = &pci->pit[2];	/* 0xDC0 */
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-08-13 16:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-12 17:56 [U-Boot] [PATCH] FSL PCI: Configure PCIe reference ratio Joakim Tjernlund
2017-09-14 21:15 ` York Sun
2017-09-15  6:14   ` Mingkai Hu
2017-11-21 17:18 ` Joakim Tjernlund
2017-11-21 17:23   ` York Sun
2017-11-21 17:29     ` Joakim Tjernlund
2017-11-21 17:32       ` York Sun
2017-11-21 17:41         ` Joakim Tjernlund
2017-11-21 17:45           ` York Sun
2017-11-21 17:51             ` Joakim Tjernlund
2017-11-21 18:04               ` York Sun
2017-11-21 18:20                 ` Joakim Tjernlund
2017-11-21 18:35                   ` York Sun
2017-11-21 18:39                     ` Joakim Tjernlund
2017-11-21 18:41                       ` York Sun
2018-02-27 19:30                   ` York Sun
2018-02-27 19:52                     ` Joakim Tjernlund
2018-02-27 19:54                       ` York Sun
2018-08-02 22:38                         ` Joakim Tjernlund
2018-08-02 22:43                           ` York Sun
2018-08-13 16:29 ` York Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.