public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS reference board
Date: Wed, 26 May 2010 16:59:16 -0500	[thread overview]
Message-ID: <4BFD99B4.6050106@freescale.com> (raw)
In-Reply-To: <4BFD7A94.7070703@freescale.com>

Scott Wood wrote:
> A few of those things don't belong there -- I think first_free_busno 
> should be a static variable inside the pci setup function, for example 
> (does Linux still even need separate bus number spaces on different 
> hoses?).  pcie_ep should just be a local variable.  The hose could maybe 
> just be an uninitialized member of the struct instead of a pointer to an 
> arbitrary other symbol.

I'm not sure what you mean about the 'hose'.  How about this:

static void configure_pcie(enum srds_prtcl pci,
			   u32 devdisr_mask,
			   const char *target,
			   enum law_trgt_if law,
			   phys_addr_t mem_addr,
			   enum law_size mem_size,
			   phys_addr_t io_addr,
			   enum law_size io_size,
			   struct pci_controller *hose)
{
	volatile ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
	struct fsl_pci_info pci_info;
	u32 devdisr;
	static int first_free_busno = 0;
	int is_endpoint;
	int num;

	devdisr = in_be32(&gur->devdisr);

	if (is_serdes_configured(pci) && !(devdisr & devdisr_mask)) {
		set_next_law(mem_addr, mem_size, law);
		set_next_law(io_addr, io_size, law);

		switch (pci) {
#ifdef CONFIG_PCIE1
		case PCIE1:
			num = 1;
			SET_STD_PCIE_INFO(pci_info, 1);
			break;
#endif
#ifdef CONFIG_PCIE2
		case PCIE2:
			num = 2;
			SET_STD_PCIE_INFO(pci_info, 2);
			break;
#endif
#ifdef CONFIG_PCIE3
		case PCIE3:
			num = 3;
			SET_STD_PCIE_INFO(pci_info, 3);
			break;
#endif
#ifdef CONFIG_PCIE4
		case PCIE4:
			num = 4;
			SET_STD_PCIE_INFO(pci_info, 4);
			break;
#endif
		default:
			break;
		}

		is_endpoint = fsl_setup_hose(hose, pci_info.regs);
		printf("    PCIE%u: connected to %s as %s (base addr %lx)\n",
		       num, target, is_endpoint ? "Endpoint" : "Root Complex",
		       pci_info.regs);

		first_free_busno = fsl_pci_init_port(&pci_info, hose, first_free_busno);
	} else {
		printf("    PCIE%u: disabled\n", num);
	}
}


-- 
Timur Tabi
Linux kernel developer at Freescale

  reply	other threads:[~2010-05-26 21:59 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 22:01 [U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS reference board Timur Tabi
2010-05-20 22:33 ` Wolfgang Denk
2010-05-20 23:13   ` Kumar Gala
2010-05-21  6:50     ` Wolfgang Denk
2010-05-20 23:23   ` Timur Tabi
2010-05-21  7:07     ` Wolfgang Denk
2010-05-21 13:45       ` Timur Tabi
2010-05-21 14:22         ` Wolfgang Denk
2010-05-21 14:33           ` Timur Tabi
2010-05-21 16:07           ` Timur Tabi
2010-05-26 18:12       ` Timur Tabi
2010-05-26 18:17         ` Scott Wood
2010-05-26 18:19           ` Timur Tabi
2010-05-26 19:04             ` Scott Wood
2010-05-26 19:34               ` Timur Tabi
2010-05-26 19:46                 ` Scott Wood
2010-05-26 21:59                   ` Timur Tabi [this message]
2010-05-25 18:30   ` Timur Tabi
2010-05-26 20:10     ` Wolfgang Denk
2010-05-26 20:18       ` Timur Tabi
2010-05-26 20:24       ` Timur Tabi
2010-05-27  7:02         ` Wolfgang Denk
2010-05-27 14:31           ` Timur Tabi
2010-05-27 18:11             ` Wolfgang Denk
2010-05-27 18:25               ` Timur Tabi
2010-05-27 19:03                 ` Scott Wood
2010-05-27 19:07                   ` Timur Tabi
2010-05-27 19:10                     ` Scott Wood
2010-05-27 19:54                       ` Wolfgang Denk
2010-05-27 19:53                     ` Wolfgang Denk
2010-05-27 20:11                       ` Timur Tabi
2010-05-27 21:10                         ` Wolfgang Denk
2010-05-27 19:53                   ` Wolfgang Denk
2010-05-27 20:03                     ` Timur Tabi
2010-05-27 20:59                       ` Wolfgang Denk
2010-05-27 20:05                     ` Scott Wood
2010-05-27 21:03                       ` Wolfgang Denk
2010-05-27 19:45                 ` Wolfgang Denk
2010-05-27 19:54                   ` Timur Tabi
2010-05-27 20:00                     ` Wolfgang Denk
2010-05-27 20:10                       ` Scott Wood
2010-05-21  0:26 ` [U-Boot] [PATCH] powerpc: add support for the FreescaleP1022DS " Liu Dave-R63238
2010-05-21 15:25   ` Timur Tabi
2010-05-21  9:46 ` [U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS " Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BFD99B4.6050106@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox