public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] PCIe:change the method to get the address of a requested capability in configuration space.
Date: Thu, 10 Oct 2013 15:42:46 -0700	[thread overview]
Message-ID: <52572D66.50401@freescale.com> (raw)
In-Reply-To: <1379323662-31938-1-git-send-email-B45475@freescale.com>

Qiang,

On 09/16/2013 02:27 AM, Zhao Qiang wrote:
> Previously, the address of a requested capability is define like that
> 	"#define PCI_DCR	0x78"
> But, the addresses of capabilities is different with regard to PCIe revs.
> So this method is not flexible.
> 
> Now a function to get the address of a requested capability is added and used.
> It can get the address dynamically by capability ID.
> The step of this function:
> 	1. Read Status register in PCIe configuration space to confirm that
> 	   Capabilities List is valid.
> 	2. Find the address of Capabilities Pointer Register.
> 	3. Find the address of requested capability from the first capability.
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	-Put an variable into "#ifdef" and "#endif"
> Changes for v3:
> 	-Modify the patch description
> 
> 
>  arch/powerpc/include/asm/fsl_pci.h | 13 +-------
>  drivers/pci/fsl_pci_init.c         | 44 +++++++++++++++++++-------
>  drivers/pci/pci.c                  | 65 ++++++++++++++++++++++++++++++++++++++
>  include/pci.h                      | 10 ++++++
>  4 files changed, 108 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/fsl_pci.h b/arch/powerpc/include/asm/fsl_pci.h
> index 90b0a2f..6b12afa 100644
> --- a/arch/powerpc/include/asm/fsl_pci.h
> +++ b/arch/powerpc/include/asm/fsl_pci.h
> @@ -32,22 +32,11 @@
>  /* Freescale-specific PCI config registers */
>  #define FSL_PCI_PBFR		0x44
>  
> -#ifdef CONFIG_SYS_FSL_PCI_VER_3_X
> +#ifndef CONFIG_SYS_FSL_PCI_VER_3_X
>  /* Currently only the PCIe capability is used, so hardcode the offset.
>   * if more capabilities need to be justified, the capability link method
>   * should be applied here
>   */

Does these comment still apply after you remove almost everything?

> -#define FSL_PCIE_CAP_ID		0x70
> -#define PCI_DCR		0x78    /* PCIe Device Control Register */
> -#define PCI_DSR		0x7a    /* PCIe Device Status Register */
> -#define PCI_LSR		0x82    /* PCIe Link Status Register */
> -#define PCI_LCR		0x80    /* PCIe Link Control Register */
> -#else
> -#define FSL_PCIE_CAP_ID		0x4c
> -#define PCI_DCR		0x54    /* PCIe Device Control Register */
> -#define PCI_DSR		0x56    /* PCIe Device Status Register */
> -#define PCI_LSR		0x5e    /* PCIe Link Status Register */
> -#define PCI_LCR		0x5c    /* PCIe Link Control Register */
>  #define FSL_PCIE_CFG_RDY	0x4b0
>  #endif
>  #define FSL_PCI_CFG_READY	1 /* Endpoint: allow inbound configuration */

What is the base of your patch? I don't see this line in either master
branch, or any of my branches. Can you rebase to master branch, or
mpc85xx/next branch?

York

      parent reply	other threads:[~2013-10-10 22:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  9:27 [U-Boot] [PATCH v3] PCIe:change the method to get the address of a requested capability in configuration space Zhao Qiang
2013-09-30  3:09 ` Zhao Qiang-B45475
2013-10-10 22:42 ` York Sun [this message]

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=52572D66.50401@freescale.com \
    --to=yorksun@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