diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 2285b51dec..819b8ee0e5 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -116,11 +116,12 @@ int board_fit_config_name_match(const char *name) static void __maybe_unused detect_enable_hyperflash(void *blob) { struct gpio_desc desc = {0}; + char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6"; - if (dm_gpio_lookup_name("6", &desc)) + if (dm_gpio_lookup_name(hypermux_sel_gpio, &desc)) return; - if (dm_gpio_request(&desc, "6")) + if (dm_gpio_request(&desc, hypermux_sel_gpio)) return; if (dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN)) @@ -139,7 +140,8 @@ static void __maybe_unused detect_enable_hyperflash(void *blob) } #endif -#if defined(CONFIG_SPL_BUILD) && (defined(CONFIG_TARGET_J7200_A72_EVM) || defined(CONFIG_TARGET_J7200_R5_EVM)) +#if defined(CONFIG_SPL_BUILD) && (defined(CONFIG_TARGET_J7200_A72_EVM) || defined(CONFIG_TARGET_J7200_R5_EVM) || \ + defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J721E_R5_EVM)) void spl_perform_fixups(struct spl_image_info *spl_image) { detect_enable_hyperflash(spl_image->fdt_addr); @@ -503,17 +505,18 @@ int board_late_init(void) static int __maybe_unused detect_SW3_1_state(void) { - if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) { + if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) { struct gpio_desc desc = {0}; int ret; + char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6"; - ret = dm_gpio_lookup_name("6", &desc); + ret = dm_gpio_lookup_name(hypermux_sel_gpio, &desc); if (ret) { printf("error getting GPIO lookup name: %d\n", ret); return ret; } - ret = dm_gpio_request(&desc, "6"); + ret = dm_gpio_request(&desc, hypermux_sel_gpio); if (ret) { printf("error requesting GPIO: %d\n", ret); goto err_free_gpio; @@ -568,8 +571,7 @@ void spl_board_init(void) printf("ESM PMIC init failed: %d\n", ret); } #endif - - if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) && + if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) && IS_ENABLED(CONFIG_HBMC_AM654)) { struct udevice *dev; int ret;