Re: [U-Boot] [PATCH 12/33] x86: pci: Add handlers before and after a PCI hose scan

2014-11-11 Thread Bin Meng
On Wed, Nov 12, 2014 at 8:18 AM, Simon Glass  wrote:
> Some boards will want to do some setup before and after a PCI hose
> is scanned.
>
> Signed-off-by: Simon Glass 
> ---
>
>  arch/x86/cpu/pci.c | 14 +-
>  arch/x86/include/asm/pci.h |  3 +++
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/pci.c b/arch/x86/cpu/pci.c
> index 36057c6..43a4cb9 100644
> --- a/arch/x86/cpu/pci.c
> +++ b/arch/x86/cpu/pci.c
> @@ -32,6 +32,16 @@ int pci_early_init_hose(struct pci_controller **hosep)
> return 0;
>  }
>
> +__weak int board_pci_pre_scan(struct pci_controller *hose)
> +{
> +   return 0;
> +}
> +
> +__weak int board_pci_post_scan(struct pci_controller *hose)
> +{
> +   return 0;
> +}
> +
>  void pci_init_board(void)
>  {
> struct pci_controller *hose = &x86_hose;
> @@ -42,7 +52,9 @@ void pci_init_board(void)
> board_pci_setup_hose(hose);
> pci_register_hose(hose);
>
> -   pci_hose_scan(hose);
> +   board_pci_pre_scan(hose);
> +   hose->last_busno = pci_hose_scan(hose);
> +   board_pci_post_scan(hose);
>  }
>
>  static struct pci_controller *get_hose(void)
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index 98817aa..ac1a808 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -34,6 +34,9 @@ void board_pci_setup_hose(struct pci_controller *hose);
>   */
>  int pci_early_init_hose(struct pci_controller **hosep);
>
> +int board_pci_pre_scan(struct pci_controller *hose);
> +int board_pci_post_scan(struct pci_controller *hose);
> +
>  /*
>   * Simple PCI access routines - these work from either the early PCI hose
>   * or the 'real' one, created after U-Boot has memory available
> --

Reviewed-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 12/33] x86: pci: Add handlers before and after a PCI hose scan

2014-11-11 Thread Simon Glass
Some boards will want to do some setup before and after a PCI hose
is scanned.

Signed-off-by: Simon Glass 
---

 arch/x86/cpu/pci.c | 14 +-
 arch/x86/include/asm/pci.h |  3 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/pci.c b/arch/x86/cpu/pci.c
index 36057c6..43a4cb9 100644
--- a/arch/x86/cpu/pci.c
+++ b/arch/x86/cpu/pci.c
@@ -32,6 +32,16 @@ int pci_early_init_hose(struct pci_controller **hosep)
return 0;
 }
 
+__weak int board_pci_pre_scan(struct pci_controller *hose)
+{
+   return 0;
+}
+
+__weak int board_pci_post_scan(struct pci_controller *hose)
+{
+   return 0;
+}
+
 void pci_init_board(void)
 {
struct pci_controller *hose = &x86_hose;
@@ -42,7 +52,9 @@ void pci_init_board(void)
board_pci_setup_hose(hose);
pci_register_hose(hose);
 
-   pci_hose_scan(hose);
+   board_pci_pre_scan(hose);
+   hose->last_busno = pci_hose_scan(hose);
+   board_pci_post_scan(hose);
 }
 
 static struct pci_controller *get_hose(void)
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 98817aa..ac1a808 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -34,6 +34,9 @@ void board_pci_setup_hose(struct pci_controller *hose);
  */
 int pci_early_init_hose(struct pci_controller **hosep);
 
+int board_pci_pre_scan(struct pci_controller *hose);
+int board_pci_post_scan(struct pci_controller *hose);
+
 /*
  * Simple PCI access routines - these work from either the early PCI hose
  * or the 'real' one, created after U-Boot has memory available
-- 
2.1.0.rc2.206.gedb03e5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot