]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Split out fsp_init_phase_pci() code into a new function
authorSimon Glass <sjg@chromium.org>
Mon, 10 Aug 2015 13:05:07 +0000 (07:05 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 08:23:20 +0000 (10:23 +0200)
This code may be useful for boards that use driver model for PCI.

Note: It would be better to have driver model automatically call this
function somehow. However for now it is probably safer to have it under
board control.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/include/asm/fsp/fsp_support.h
arch/x86/lib/fsp/fsp_common.c

index c6c7dc0f83b5f4a86b363c8c0fef86c2036cad6f..7317dda9024ef667ca7ce54d494b7eb5dae51ce6 100644 (file)
@@ -207,4 +207,11 @@ void *fsp_get_bootloader_tmp_mem(const void *hob_list, u32 *len);
  */
 void update_fsp_upd(struct upd_region *fsp_upd);
 
+/**
+ * fsp_init_phase_pci() - Tell the FSP that we have completed PCI init
+ *
+ * @return 0 if OK, -EPERM if the FSP gave an error.
+ */
+int fsp_init_phase_pci(void);
+
 #endif
index c585710824cce08cb9a0fcba2fb957f0591ce425..6f72c6dc7bb1f5d3a91433d43d11f8d3fe19a6b5 100644 (file)
@@ -19,19 +19,24 @@ int print_cpuinfo(void)
        return default_print_cpuinfo();
 }
 
-int board_pci_post_scan(struct pci_controller *hose)
+int fsp_init_phase_pci(void)
 {
        u32 status;
 
        /* call into FspNotify */
        debug("Calling into FSP (notify phase INIT_PHASE_PCI): ");
        status = fsp_notify(NULL, INIT_PHASE_PCI);
-       if (status != FSP_SUCCESS)
+       if (status)
                debug("fail, error code %x\n", status);
        else
                debug("OK\n");
 
-       return 0;
+       return status ? -EPERM : 0;
+}
+
+int board_pci_post_scan(struct pci_controller *hose)
+{
+       return fsp_init_phase_pci();
 }
 
 void board_final_cleanup(void)