]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci_ep: Add the init function
authorXiaowei Bao <xiaowei.bao@nxp.com>
Thu, 9 Jul 2020 15:31:34 +0000 (23:31 +0800)
committerPriyanka Jain <priyanka.jain@nxp.com>
Mon, 27 Jul 2020 08:54:15 +0000 (14:24 +0530)
Some EP deivces need to initialize before RC scan it, e.g. NXP
layerscape platform, so add the init function in pci_ep uclass.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
common/board_r.c
drivers/pci_endpoint/pci_ep-uclass.c
include/init.h

index 67dc25c7d2820969516f8f1e3c9682b4186e3b7e..d9307f02e06cbbce9adc687484d67a48ec645817 100644 (file)
@@ -233,6 +233,15 @@ static int initr_unlock_ram_in_cache(void)
 }
 #endif
 
+#ifdef CONFIG_PCI_ENDPOINT
+static int initr_pci_ep(void)
+{
+       pci_ep_init();
+
+       return 0;
+}
+#endif
+
 #ifdef CONFIG_PCI
 static int initr_pci(void)
 {
@@ -816,6 +825,9 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_BITBANGMII
        initr_bbmii,
 #endif
+#ifdef CONFIG_PCI_ENDPOINT
+       initr_pci_ep,
+#endif
 #ifdef CONFIG_CMD_NET
        INIT_FUNC_WATCHDOG_RESET
        initr_net,
index 9f53a9a9b9796dbc0762f9600e4f65f8a616503c..38a5f0837690335f5510da0b6fc721d0cd16c3e9 100644 (file)
@@ -209,3 +209,14 @@ UCLASS_DRIVER(pci_ep) = {
        .name           = "pci_ep",
        .flags          = DM_UC_FLAG_SEQ_ALIAS,
 };
+
+void pci_ep_init(void)
+{
+       struct udevice *dev;
+
+       for (uclass_first_device_check(UCLASS_PCI_EP, &dev);
+            dev;
+            uclass_next_device_check(&dev)) {
+               ;
+       }
+}
index e727031514c1c63a8818d1b93ea871d5d0477560..de408baf892a27819cc7d7a5a3e4bea3a054823b 100644 (file)
@@ -213,6 +213,7 @@ int set_cpu_clk_info(void);
 int update_flash_size(int flash_size);
 int arch_early_init_r(void);
 void pci_init(void);
+void pci_ep_init(void);
 int misc_init_r(void);
 #if defined(CONFIG_VID)
 int init_func_vid(void);