[PATCH 2/9] pci_ep: Add the init function

Z.q. Hou zhiqiang.hou at nxp.com
Tue Apr 28 14:23:59 CEST 2020



> -----Original Message-----
> From: Xiaowei Bao <xiaowei.bao at nxp.com>
> Sent: 2020年3月22日 19:13
> To: M.h. Lian <minghuan.lian at nxp.com>; Z.q. Hou
> <zhiqiang.hou at nxp.com>; Mingkai Hu <mingkai.hu at nxp.com>;
> bmeng.cn at gmail.com; yamada.masahiro at socionext.com;
> u-boot at lists.denx.de
> Cc: Xiaowei Bao <xiaowei.bao at nxp.com>
> Subject: [PATCH 2/9] pci_ep: Add the init function
> 
> 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 at nxp.com>
> ---
>  common/board_r.c                     | 12 ++++++++++++
>  drivers/pci_endpoint/pci_ep-uclass.c | 11 +++++++++++
>  include/init.h                       |  1 +
>  3 files changed, 24 insertions(+)
> 
> diff --git a/common/board_r.c b/common/board_r.c index
> 0bbeaa7..856b47f 100644
> --- a/common/board_r.c
> +++ b/common/board_r.c
> @@ -229,6 +229,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)
>  {
> @@ -839,6 +848,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,
> diff --git a/drivers/pci_endpoint/pci_ep-uclass.c
> b/drivers/pci_endpoint/pci_ep-uclass.c
> index 9f53a9a..38a5f08 100644
> --- a/drivers/pci_endpoint/pci_ep-uclass.c
> +++ b/drivers/pci_endpoint/pci_ep-uclass.c
> @@ -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)) {
> +		;
> +	}
> +}
> diff --git a/include/init.h b/include/init.h index 2a33a3f..fbc26a8 100644
> --- a/include/init.h
> +++ b/include/init.h
> @@ -202,6 +202,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);
> --
> 2.9.5
Reviewed-by: Hou Zhiqiang <Zhiqiang.Hou at nxp.com>


More information about the U-Boot mailing list