All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken
@ 2009-11-02 15:05 Ed Swarthout
  2009-11-03 11:25 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization isbroken Mahajan Vivek-B08308
  2009-11-05  0:07 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Kumar Gala
  0 siblings, 2 replies; 3+ messages in thread
From: Ed Swarthout @ 2009-11-02 15:05 UTC (permalink / raw)
  To: u-boot

commit 70ed869e broke fsl pcie end-point initialization.
Returning 0 is not correct.  The function must return the first free
bus number for the next controller.

fsl_pci_init() must still be called and a bus allocated even if the
controller is an end-point.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
---

This fixes the current breakage, but I don't think adding another
layer (fsl_pci_init_port) and parameter structure is all that helpful.

So now there is:

pci_init_board() -> fsl_pci_init_port() -> fsl_pci_init() ->
pciauto_setup_device()

with even less flexibility on setting up the inbound 
and outbound windows.

 drivers/pci/fsl_pci_init.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 8fbab68..db2cd4b 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -420,20 +420,6 @@ int fsl_pci_init_port(struct fsl_pci_info *pci_info,
 
 	pci = (ccsr_fsl_pci_t *) pci_info->regs;
 
-	if (pcie_ep) {
-		volatile pit_t *pi = &pci->pit[2];
-
-		pci_setup_indirect(hose, (u32)&pci->cfg_addr,
-					 (u32)&pci->cfg_data);
-		out_be32(&pi->pitar, 0);
-		out_be32(&pi->piwbar, 0);
-		out_be32(&pi->piwar, PIWAR_EN | PIWAR_LOCAL |
-			PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP | PIWAR_IWS_4K);
-
-		fsl_pci_config_unlock(hose);
-		return 0;
-	}
-
 	/* on non-PCIe controllers we don't have pme_msg_det so this code
 	 * should do nothing since the read will return 0
 	 */
@@ -464,6 +450,11 @@ int fsl_pci_init_port(struct fsl_pci_info *pci_info,
 
 	fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
 
+	if (pcie_ep) {
+		fsl_pci_config_unlock(hose);
+		hose->last_busno = hose->first_busno;
+	}
+
 	printf("    PCIE%x on bus %02x - %02x\n", pci_info->pci_num,
 			hose->first_busno, hose->last_busno);
 
-- 
1.5.6.5

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

* [U-Boot] [PATCH] fsl_pci_init_port end-point initialization isbroken
  2009-11-02 15:05 [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Ed Swarthout
@ 2009-11-03 11:25 ` Mahajan Vivek-B08308
  2009-11-05  0:07 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Kumar Gala
  1 sibling, 0 replies; 3+ messages in thread
From: Mahajan Vivek-B08308 @ 2009-11-03 11:25 UTC (permalink / raw)
  To: u-boot

> From: u-boot-bounces at lists.denx.de 
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Swarthout 
> Edward L-SWARTHOU
> Sent: Monday, November 02, 2009 8:36 PM
> To: u-boot at lists.denx.de
> Cc: Swarthout Edward L-SWARTHOU
> Subject: [U-Boot] [PATCH] fsl_pci_init_port end-point 
> initialization isbroken
> 
> commit 70ed869e broke fsl pcie end-point initialization.
> Returning 0 is not correct.  The function must return the 
> first free bus number for the next controller.
> 
> fsl_pci_init() must still be called and a bus allocated even 
> if the controller is an end-point.
> 
> Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>

Acked-by: Vivek Mahajan <vivek.mahajan@freescale.com>

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

* [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken
  2009-11-02 15:05 [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Ed Swarthout
  2009-11-03 11:25 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization isbroken Mahajan Vivek-B08308
@ 2009-11-05  0:07 ` Kumar Gala
  1 sibling, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2009-11-05  0:07 UTC (permalink / raw)
  To: u-boot


On Nov 2, 2009, at 9:05 AM, Ed Swarthout wrote:

> commit 70ed869e broke fsl pcie end-point initialization.
> Returning 0 is not correct.  The function must return the first free
> bus number for the next controller.
>
> fsl_pci_init() must still be called and a bus allocated even if the
> controller is an end-point.
>
> Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
> ---
>
> This fixes the current breakage, but I don't think adding another
> layer (fsl_pci_init_port) and parameter structure is all that helpful.
>
> So now there is:
>
> pci_init_board() -> fsl_pci_init_port() -> fsl_pci_init() ->
> pciauto_setup_device()
>
> with even less flexibility on setting up the inbound
> and outbound windows.
>
> drivers/pci/fsl_pci_init.c |   19 +++++--------------
> 1 files changed, 5 insertions(+), 14 deletions(-)

applied w/update (reverted 70ed869e and used a standard way to  
determine PCI host vs agent/end-point.

- k

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

end of thread, other threads:[~2009-11-05  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02 15:05 [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Ed Swarthout
2009-11-03 11:25 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization isbroken Mahajan Vivek-B08308
2009-11-05  0:07 ` [U-Boot] [PATCH] fsl_pci_init_port end-point initialization is broken Kumar Gala

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.