[PATCH 6/7] arm: mach-k3: j721e_init: initialize ESM support

Lokesh Vutla lokeshvutla at ti.com
Thu Feb 13 11:47:03 CET 2020



On 13/02/20 3:04 PM, Tero Kristo wrote:
> Initialize both ESM and ESM_PMIC support if available for the board.
> If support is not available for either, a warning is printed out.
> 
> ESM signals are only properly routed on PM2 version of the J721E SOM,
> so only probe the drivers on this device.
> 
> Signed-off-by: Tero Kristo <t-kristo at ti.com>
> ---
>  arch/arm/mach-k3/j721e_init.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
> index f7f7398081..2de9583937 100644
> --- a/arch/arm/mach-k3/j721e_init.c
> +++ b/arch/arm/mach-k3/j721e_init.c
> @@ -18,6 +18,7 @@
>  #include <dm.h>
>  #include <dm/uclass-internal.h>
>  #include <dm/pinctrl.h>
> +#include "../../../board/ti/common/board_detect.h"
>  
>  #ifdef CONFIG_SPL_BUILD
>  #ifdef CONFIG_K3_LOAD_SYSFW
> @@ -114,7 +115,8 @@ static void store_boot_index_from_rom(void)
>  
>  void board_init_f(ulong dummy)
>  {
> -#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW)
> +#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW) || \
> +	defined(CONFIG__ESM_K3) || defined(CONFIG_ESM_PMIC)
>  	struct udevice *dev;
>  	int ret;
>  #endif
> @@ -181,6 +183,25 @@ void board_init_f(ulong dummy)
>  		printf("AVS init failed: %d\n", ret);
>  #endif
>  
> +#ifdef CONFIG_ESM_K3
> +	if (board_ti_k3_is("J721EX-PM2-SOM")) {
> +		ret = uclass_get_device_by_driver(UCLASS_MISC,
> +						  DM_GET_DRIVER(k3_esm), &dev);
> +		if (ret)
> +			printf("MISC init failed: %d\n", ret);
> +	}
> +#endif
> +
> +#ifdef CONFIG_ESM_PMIC
> +	if (board_ti_k3_is("J721EX-PM2-SOM")) {
> +		ret = uclass_get_device_by_driver(UCLASS_MISC,
> +						  DM_GET_DRIVER(pmic_esm),
> +						  &dev);
> +		if (ret)
> +			printf("ESM PMIC init failed: %d\n", ret);
> +	}
> +#endif

Since this is board specific, can you call this under spl_board_init() and add
it in board/ti/j721e ?

Thanks and regards,
Lokesh


More information about the U-Boot mailing list