public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthias Fuchs <matthias.fuchs@esd.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] pci: move pcidelay code to new location just before PCI bus scan
Date: Wed, 12 Oct 2011 08:58:09 +0200	[thread overview]
Message-ID: <4E953A81.4050106@esd.eu> (raw)
In-Reply-To: <1318346295-15601-1-git-send-email-agust@denx.de>

Hi Anatolij,

in general this is a good idea. It also fixes an issue on dual role
boards that can act as pci host and target like the PMC440 and PMC405DE.
When these boards are configured as target, the pcidelay variable
must be ignored or _target_ initialization must be done before the delay.

That's why I put my own pcidelay implementation in our board code.

But I see a problem on boards with more than one PCI bus/PCIe
rootcomplex like some 440 parts. In this case the delay is executed
multiple times.

So it might be a good idea to restrict pci_hose_scan to wait for only
during its initial call and to ignore pcidelay for any further call.

BTW, 4xx_pcie.c also implements an additional delay controlled by the
pciscandelay variable before calling pci_hose_scan() :-) I think this is
obsolete.

Matthias

On 11.10.2011 17:18, Anatolij Gustschin wrote:
> PCI cards might need some time after reset to respond. On some
> boards (mpc5200 or mpc8260 based) the PCI bus reset is deasserted
> at pci_init_board() time, so we currently can not use available
> "pcidelay" option for waiting before PCI bus scan since this
> waiting takes place before calling pci_init_board(). By moving
> the pcidelay code to the new location using of the "pcidelay"
> option is possible on mpc5200 or mpc8260 based boards, too.
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/pci/pci.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 1a0b14c..b65cdd1 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -695,6 +695,19 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
>  
>  int pci_hose_scan(struct pci_controller *hose)
>  {
> +#if defined(CONFIG_PCI_BOOTDELAY)
> +	char *s;
> +	int i;
> +
> +	/* wait "pcidelay" ms (if defined)... */
> +	s = getenv("pcidelay");
> +	if (s) {
> +		int val = simple_strtoul(s, NULL, 10);
> +		for (i = 0; i < val; i++)
> +			udelay(1000);
> +	}
> +#endif /* CONFIG_PCI_BOOTDELAY */
> +
>  	/* Start scan at current_busno.
>  	 * PCIe will start scan at first_busno+1.
>  	 */
> @@ -709,19 +722,6 @@ int pci_hose_scan(struct pci_controller *hose)
>  
>  void pci_init(void)
>  {
> -#if defined(CONFIG_PCI_BOOTDELAY)
> -	char *s;
> -	int i;
> -
> -	/* wait "pcidelay" ms (if defined)... */
> -	s = getenv ("pcidelay");
> -	if (s) {
> -		int val = simple_strtoul (s, NULL, 10);
> -		for (i=0; i<val; i++)
> -			udelay (1000);
> -	}
> -#endif /* CONFIG_PCI_BOOTDELAY */
> -
>  	hose_head = NULL;
>  
>  	/* now call board specific pci_init()... */


-- 
------------------------------------------------------------------------
Dipl.-Ing. Matthias Fuchs
Head of System Design

esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Phone: +49-511-37298-0 - Fax: +49-511-37298-68
Please visit our homepage http://www.esd.eu
Quality Products - Made in Germany

Besuchen Sie uns auf der Hannover Messe 2011
in Halle 9, Stand D13 vom 04.-08. April 2011 in Hannover!
-------------------------------------------------------------------------
Gesch?ftsf?hrer: Klaus Detering
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-------------------------------------------------------------------------

  reply	other threads:[~2011-10-12  6:58 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 14:08 [U-Boot] [PATCH 0/5] mpc5200: digsy_mtc: update for next Anatolij Gustschin
2011-05-27 14:08 ` [U-Boot] [PATCH 1/5] video: mb862xx: support Coral-PA controller Anatolij Gustschin
2011-07-04 22:32   ` Anatolij Gustschin
2011-05-27 14:08 ` [U-Boot] [PATCH 2/5] pci: option for configurable delay between pci reset and pci bus scan Anatolij Gustschin
2011-05-27 15:26   ` Detlev Zundel
2011-05-27 16:43     ` Anatolij Gustschin
2011-05-30  7:45       ` Detlev Zundel
2011-05-30 14:10         ` Stefan Roese
2011-10-11 15:16           ` Anatolij Gustschin
2011-10-11 15:18           ` [U-Boot] [PATCH 1/1] pci: move pcidelay code to new location just before PCI " Anatolij Gustschin
2011-10-12  6:58             ` Matthias Fuchs [this message]
2011-10-12  8:44             ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-10-12  9:42               ` Stefan Roese
2011-10-13 12:50               ` Matthias Fuchs
2011-10-13 13:03                 ` Stefan Roese
2011-10-13 13:08                   ` Matthias Fuchs
2011-10-15 20:16               ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 3/5] mpc5200: digsy_mtc: enable pci_scan_delay option Anatolij Gustschin
2011-05-27 15:28   ` Detlev Zundel
2011-10-13 15:19   ` [U-Boot] [PATCH] mpc5200: digsy_mtc: fix detection of Coral-PA Anatolij Gustschin
2011-10-14  8:19     ` Detlev Zundel
2011-10-15 20:19     ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 4/5] mpc5200: digsy_mtc: add support for graphic extension board Anatolij Gustschin
2011-05-27 15:33   ` Detlev Zundel
2011-05-27 17:56     ` Anatolij Gustschin
2011-05-30  7:16   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-06-06  9:49     ` Detlev Zundel
2011-07-27 21:26     ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 5/5] mpc5200: digsy_mtc: add support for writing 'appreg' value Anatolij Gustschin
2011-05-27 15:36   ` Detlev Zundel
2011-05-27 18:00     ` Anatolij Gustschin
2011-05-30  7:18   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-07-16 20:26     ` [U-Boot] [PATCH] digsy_mtc: move board into vendor dir and add vendor logo Anatolij Gustschin
2011-07-27 21:27       ` Wolfgang Denk
2011-07-27 21:26     ` [U-Boot] [PATCH v2 5/5] mpc5200: digsy_mtc: add support for writing 'appreg' value Wolfgang Denk

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=4E953A81.4050106@esd.eu \
    --to=matthias.fuchs@esd.eu \
    --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