From patchwork Fri Feb 14 09:18:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 236355 List-Id: U-Boot discussion From: t-kristo at ti.com (Tero Kristo) Date: Fri, 14 Feb 2020 11:18:19 +0200 Subject: [PATCHv2 6/7] board: ti: j721e: initialize ESM support In-Reply-To: <20200214091820.28877-1-t-kristo@ti.com> References: <20200214091820.28877-1-t-kristo@ti.com> Message-ID: <20200214091820.28877-7-t-kristo@ti.com> 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 --- board/ti/j721e/evm.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index aa2240b852..c068bb86b5 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "../common/board_detect.h" @@ -343,5 +345,29 @@ int board_late_init(void) void spl_board_init(void) { +#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC) + struct udevice *dev; + int ret; +#endif + probe_daughtercards(); + +#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("ESM 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 }