blob: 1fa78ff7b30d1e433c9d2cdaad07730925ad078f [file] [log] [blame]
Lokesh Vutla1a9dd212019-06-13 10:29:49 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Board specific initialization for J721E EVM
4 *
Nishanth Menoneaa39c62023-11-01 15:56:03 -05005 * Copyright (C) 2018-2019 Texas Instruments Incorporated - https://www.ti.com/
Lokesh Vutla1a9dd212019-06-13 10:29:49 +05306 * Lokesh Vutla <lokeshvutla@ti.com>
7 *
8 */
9
Jonathan Humphreys1f522a92024-06-14 11:35:34 -050010#include <efi_loader.h>
Aswath Govindraju1e2b4202021-07-21 21:28:39 +053011#include <generic-phy.h>
Simon Glass2dc9c342020-05-10 11:40:01 -060012#include <image.h>
Simon Glass274e0b02020-05-10 11:39:56 -060013#include <net.h>
Andreas Dannenbergd036a212020-01-07 13:15:54 +053014#include <asm/arch/hardware.h>
15#include <asm/gpio.h>
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053016#include <spl.h>
Tero Kristo1a2c7ba2020-02-14 11:18:19 +020017#include <dm.h>
Santhosh Kumar K25d150f2025-01-06 14:37:08 +053018#include <asm/arch/k3-ddr.h>
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053019
Andreas Dannenbergd036a212020-01-07 13:15:54 +053020#include "../common/board_detect.h"
Nishanth Menon3c0f8312024-02-12 13:47:22 -060021#include "../common/fdt_ops.h"
Andreas Dannenbergd036a212020-01-07 13:15:54 +053022
23#define board_is_j721e_som() (board_ti_k3_is("J721EX-PM1-SOM") || \
24 board_ti_k3_is("J721EX-PM2-SOM"))
25
Sinthu Raja1c24ab42022-02-09 15:06:50 +053026#define board_is_j721e_sk() (board_ti_k3_is("J721EX-EAIK") || \
27 board_ti_k3_is("J721EX-SK"))
28
Aswath Govindraju1e2b4202021-07-21 21:28:39 +053029#define board_is_j7200_som() (board_ti_k3_is("J7200X-PM1-SOM") || \
30 board_ti_k3_is("J7200X-PM2-SOM"))
Lokesh Vutlae2af9662020-08-05 22:44:25 +053031
Andreas Dannenbergd036a212020-01-07 13:15:54 +053032/* Max number of MAC addresses that are parsed/processed per daughter card */
33#define DAUGHTER_CARD_NO_OF_MAC_ADDR 8
34
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053035DECLARE_GLOBAL_DATA_PTR;
36
Jonathan Humphreys1f522a92024-06-14 11:35:34 -050037struct efi_fw_image fw_images[] = {
38 {
39 .image_type_id = J721E_SK_TIBOOT3_IMAGE_GUID,
40 .fw_name = u"J721E_SK_TIBOOT3",
41 .image_index = 1,
42 },
43 {
44 .image_type_id = J721E_SK_SPL_IMAGE_GUID,
45 .fw_name = u"J721E_SK_SPL",
46 .image_index = 2,
47 },
48 {
49 .image_type_id = J721E_SK_UBOOT_IMAGE_GUID,
50 .fw_name = u"J721E_SK_UBOOT",
51 .image_index = 3,
52 },
53 {
54 .image_type_id = J721E_SK_SYSFW_IMAGE_GUID,
55 .fw_name = u"J721E_SK_SYSFW",
56 .image_index = 4,
57 }
58};
59
60struct efi_capsule_update_info update_info = {
61 .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;"
62 "tispl.bin raw 80000 200000;u-boot.img raw 280000 400000;"
63 "sysfw.itb raw 6C0000 100000",
64 .num_images = ARRAY_SIZE(fw_images),
65 .images = fw_images,
66};
67
68#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
69void set_dfu_alt_info(char *interface, char *devstr)
70{
71 if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
72 env_set("dfu_alt_info", update_info.dfu_string);
73}
74#endif
75
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053076int board_init(void)
77{
78 return 0;
79}
80
Heinrich Schuchardt51a9aac2023-08-12 20:16:58 +020081phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053082{
83#ifdef CONFIG_PHYS_64BIT
84 /* Limit RAM used by U-Boot to the DDR low region */
85 if (gd->ram_top > 0x100000000)
86 return 0x100000000;
87#endif
88
89 return gd->ram_top;
90}
91
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053092#ifdef CONFIG_SPL_LOAD_FIT
93int board_fit_config_name_match(const char *name)
94{
Sinthu Raja944ff632022-02-09 15:06:52 +053095 bool eeprom_read = board_ti_was_eeprom_read();
96
97 if (!eeprom_read || board_is_j721e_som()) {
98 if (!strcmp(name, "k3-j721e-common-proc-board") ||
99 !strcmp(name, "k3-j721e-r5-common-proc-board"))
100 return 0;
101 } else if (board_is_j721e_sk()) {
102 if (!strcmp(name, "k3-j721e-sk") ||
103 !strcmp(name, "k3-j721e-r5-sk"))
104 return 0;
105 }
Lokesh Vutla1a9dd212019-06-13 10:29:49 +0530106
107 return -1;
108}
109#endif
Suman Anna8eac9e62019-06-13 10:29:50 +0530110
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530111#if CONFIG_IS_ENABLED(DM_GPIO) && CONFIG_IS_ENABLED(OF_LIBFDT)
112/* Returns 1, if onboard mux is set to hyperflash */
113static void __maybe_unused detect_enable_hyperflash(void *blob)
114{
115 struct gpio_desc desc = {0};
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530116 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530117
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530118 if (dm_gpio_lookup_name(hypermux_sel_gpio, &desc))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530119 return;
120
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530121 if (dm_gpio_request(&desc, hypermux_sel_gpio))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530122 return;
123
124 if (dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN))
125 return;
126
127 if (dm_gpio_get_value(&desc)) {
128 int offset;
129
130 do_fixup_by_compat(blob, "ti,am654-hbmc", "status",
131 "okay", sizeof("okay"), 0);
132 offset = fdt_node_offset_by_compatible(blob, -1,
Vignesh Raghavendra57b78362020-09-17 16:48:16 +0530133 "ti,am654-ospi");
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530134 fdt_setprop(blob, offset, "status", "disabled",
135 sizeof("disabled"));
136 }
137}
138#endif
139
Simon Glass49c24a82024-09-29 19:49:47 -0600140#if defined(CONFIG_XPL_BUILD) && (defined(CONFIG_TARGET_J7200_A72_EVM) || defined(CONFIG_TARGET_J7200_R5_EVM) || \
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530141 defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J721E_R5_EVM))
Vignesh Raghavendra4c3c3d22020-08-13 14:56:16 +0530142void spl_perform_fixups(struct spl_image_info *spl_image)
143{
144 detect_enable_hyperflash(spl_image->fdt_addr);
145}
146#endif
147
Suman Anna8eac9e62019-06-13 10:29:50 +0530148#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +0900149int ft_board_setup(void *blob, struct bd_info *bd)
Suman Anna8eac9e62019-06-13 10:29:50 +0530150{
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530151 detect_enable_hyperflash(blob);
152
Andrew Davisb1c29792023-04-06 11:38:10 -0500153 return 0;
Suman Anna8eac9e62019-06-13 10:29:50 +0530154}
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530155#endif
156
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530157#ifdef CONFIG_TI_I2C_BOARD_DETECT
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530158int do_board_detect(void)
159{
160 int ret;
161
Sinthu Raja944ff632022-02-09 15:06:52 +0530162 if (board_ti_was_eeprom_read())
163 return 0;
164
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530165 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
166 CONFIG_EEPROM_CHIP_ADDRESS);
Sinthu Raja812364f2022-02-09 15:06:49 +0530167 if (ret) {
168 printf("EEPROM not available at 0x%02x, trying to read at 0x%02x\n",
169 CONFIG_EEPROM_CHIP_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS + 1);
170 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
171 CONFIG_EEPROM_CHIP_ADDRESS + 1);
172 if (ret)
173 pr_err("Reading on-board EEPROM at 0x%02x failed %d\n",
174 CONFIG_EEPROM_CHIP_ADDRESS + 1, ret);
175 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530176
177 return ret;
178}
179
Lokesh Vutla1db6b642020-01-07 13:15:55 +0530180int checkboard(void)
181{
182 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
183
184 if (do_board_detect())
185 /* EEPROM not populated */
186 printf("Board: %s rev %s\n", "J721EX-PM1-SOM", "E2");
187 else
188 printf("Board: %s rev %s\n", ep->name, ep->version);
189
190 return 0;
191}
192
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530193/*
194 * Declaration of daughtercards to probe. Note that when adding more
195 * cards they should be grouped by the 'i2c_addr' field to allow for a
196 * more efficient probing process.
197 */
198static const struct {
199 u8 i2c_addr; /* I2C address of card EEPROM */
200 char *card_name; /* EEPROM-programmed card name */
201 char *dtbo_name; /* Device tree overlay to apply */
202 u8 eth_offset; /* ethXaddr MAC address index offset */
203} ext_cards[] = {
204 {
205 0x51,
206 "J7X-BASE-CPB",
207 "", /* No dtbo for this board */
208 0,
209 },
210 {
211 0x52,
212 "J7X-INFOTAN-EXP",
213 "", /* No dtbo for this board */
214 0,
215 },
216 {
217 0x52,
218 "J7X-GESI-EXP",
219 "", /* No dtbo for this board */
220 5, /* Start populating from eth5addr */
221 },
222 {
223 0x54,
224 "J7X-VSC8514-ETH",
225 "", /* No dtbo for this board */
226 1, /* Start populating from eth1addr */
227 },
228};
229
230static bool daughter_card_detect_flags[ARRAY_SIZE(ext_cards)];
231
232const char *board_fit_get_additionnal_images(int index, const char *type)
233{
234 int i, j;
235
236 if (strcmp(type, FIT_FDT_PROP))
237 return NULL;
238
239 j = 0;
240 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
241 if (daughter_card_detect_flags[i]) {
242 if (j == index) {
243 /*
244 * Return dtbo name only if populated,
245 * otherwise stop parsing here.
246 */
247 if (strlen(ext_cards[i].dtbo_name))
248 return ext_cards[i].dtbo_name;
249 else
250 return NULL;
251 };
252
253 j++;
254 }
255 }
256
257 return NULL;
258}
259
260static int probe_daughtercards(void)
261{
262 char mac_addr[DAUGHTER_CARD_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN];
263 bool eeprom_read_success;
264 struct ti_am6_eeprom ep;
265 u8 previous_i2c_addr;
266 u8 mac_addr_cnt;
267 int i;
268 int ret;
269
270 /* Mark previous I2C address variable as not populated */
271 previous_i2c_addr = 0xff;
272
273 /* No EEPROM data was read yet */
274 eeprom_read_success = false;
275
276 /* Iterate through list of daughtercards */
277 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
278 /* Obtain card-specific I2C address */
279 u8 i2c_addr = ext_cards[i].i2c_addr;
280
281 /* Read card EEPROM if not already read previously */
282 if (i2c_addr != previous_i2c_addr) {
283 /* Store I2C address so we can avoid reading twice */
284 previous_i2c_addr = i2c_addr;
285
286 /* Get and parse the daughter card EEPROM record */
287 ret = ti_i2c_eeprom_am6_get(CONFIG_EEPROM_BUS_ADDRESS,
288 i2c_addr,
289 &ep,
290 (char **)mac_addr,
291 DAUGHTER_CARD_NO_OF_MAC_ADDR,
292 &mac_addr_cnt);
293 if (ret) {
294 debug("%s: No daughtercard EEPROM at 0x%02x found %d\n",
295 __func__, i2c_addr, ret);
296 eeprom_read_success = false;
297 /* Skip to the next daughtercard to probe */
298 continue;
299 }
300
301 /* EEPROM read successful, okay to further process. */
302 eeprom_read_success = true;
303 }
304
305 /* Only continue processing if EEPROM data was read */
306 if (!eeprom_read_success)
307 continue;
308
309 /* Only process the parsed data if we found a match */
310 if (strncmp(ep.name, ext_cards[i].card_name, sizeof(ep.name)))
311 continue;
312
313 printf("Detected: %s rev %s\n", ep.name, ep.version);
314 daughter_card_detect_flags[i] = true;
315
Simon Glass49c24a82024-09-29 19:49:47 -0600316 if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500317 int j;
318 /*
319 * Populate any MAC addresses from daughtercard into the U-Boot
320 * environment, starting with a card-specific offset so we can
321 * have multiple ext_cards contribute to the MAC pool in a well-
322 * defined manner.
323 */
324 for (j = 0; j < mac_addr_cnt; j++) {
325 if (!is_valid_ethaddr((u8 *)mac_addr[j]))
326 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530327
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500328 eth_env_set_enetaddr_by_index("eth",
329 ext_cards[i].eth_offset + j,
330 (uchar *)mac_addr[j]);
331 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530332 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530333 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530334
Simon Glass49c24a82024-09-29 19:49:47 -0600335 if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500336 char name_overlays[1024] = { 0 };
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530337
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500338 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
339 if (!daughter_card_detect_flags[i])
340 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530341
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500342 /* Skip if no overlays are to be added */
343 if (!strlen(ext_cards[i].dtbo_name))
344 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530345
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500346 /*
347 * Make sure we are not running out of buffer space by checking
348 * if we can fit the new overlay, a trailing space to be used
349 * as a separator, plus the terminating zero.
350 */
351 if (strlen(name_overlays) + strlen(ext_cards[i].dtbo_name) + 2 >
352 sizeof(name_overlays))
353 return -ENOMEM;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530354
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500355 /* Append to our list of overlays */
356 strcat(name_overlays, ext_cards[i].dtbo_name);
357 strcat(name_overlays, " ");
358 }
359
360 /* Apply device tree overlay(s) to the U-Boot environment, if any */
361 if (strlen(name_overlays))
362 return env_set("name_overlays", name_overlays);
363 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530364
365 return 0;
366}
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530367#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530368
Sinthu Rajae861aa92022-02-09 15:06:48 +0530369#ifdef CONFIG_BOARD_LATE_INIT
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600370static struct ti_fdt_map ti_j721e_evm_fdt_map[] = {
Aashvij Shenai73e4cbe2025-01-20 14:20:42 +0530371 {"j721e", "ti/k3-j721e-common-proc-board.dtb"},
372 {"j721e-sk", "ti/k3-j721e-sk.dtb"},
373 {"j7200", "ti/k3-j7200-common-proc-board.dtb"},
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600374 { /* Sentinel. */ }
375};
Sinthu Rajae861aa92022-02-09 15:06:48 +0530376static void setup_board_eeprom_env(void)
377{
378 char *name = "j721e";
379
380 if (do_board_detect())
381 goto invalid_eeprom;
382
383 if (board_is_j721e_som())
384 name = "j721e";
Sinthu Raja1c24ab42022-02-09 15:06:50 +0530385 else if (board_is_j721e_sk())
386 name = "j721e-sk";
Sinthu Rajae861aa92022-02-09 15:06:48 +0530387 else if (board_is_j7200_som())
388 name = "j7200";
389 else
390 printf("Unidentified board claims %s in eeprom header\n",
391 board_ti_get_name());
392
393invalid_eeprom:
394 set_board_info_env_am6(name);
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600395 ti_set_fdt_env(name, ti_j721e_evm_fdt_map);
Sinthu Rajae861aa92022-02-09 15:06:48 +0530396}
397
398static void setup_serial(void)
399{
400 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
401 unsigned long board_serial;
402 char *endp;
403 char serial_string[17] = { 0 };
404
405 if (env_get("serial#"))
406 return;
407
408 board_serial = hextoul(ep->serial, &endp);
409 if (*endp != '\0') {
410 pr_err("Error: Can't set serial# to %s\n", ep->serial);
411 return;
412 }
413
414 snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial);
415 env_set("serial#", serial_string);
416}
417
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530418int board_late_init(void)
419{
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530420 if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
421 setup_board_eeprom_env();
422 setup_serial();
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530423
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530424 /* Check for and probe any plugged-in daughtercards */
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530425 if (board_is_j721e_som() || board_is_j7200_som())
426 probe_daughtercards();
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530427 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530428
429 return 0;
430}
Sinthu Rajae861aa92022-02-09 15:06:48 +0530431#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530432
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530433static int __maybe_unused detect_SW3_1_state(void)
434{
435 if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) {
436 struct gpio_desc desc = {0};
437 int ret;
438 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
439
440 ret = dm_gpio_lookup_name(hypermux_sel_gpio, &desc);
441 if (ret) {
442 printf("error getting GPIO lookup name: %d\n", ret);
443 return ret;
444 }
445
446 ret = dm_gpio_request(&desc, hypermux_sel_gpio);
447 if (ret) {
448 printf("error requesting GPIO: %d\n", ret);
449 goto err_free_gpio;
450 }
451
452 ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN);
453 if (ret) {
454 printf("error setting direction flag of GPIO: %d\n", ret);
455 goto err_free_gpio;
456 }
457
458 ret = dm_gpio_get_value(&desc);
459 if (ret < 0)
460 printf("error getting value of GPIO: %d\n", ret);
461
462err_free_gpio:
463 dm_gpio_free(desc.dev, &desc);
464 return ret;
465 }
466}
467
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530468void spl_board_init(void)
469{
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200470 struct udevice *dev;
471 int ret;
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200472
Lokesh Vutla046ad432020-08-05 22:44:24 +0530473 if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
474 IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530475 IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
476 if (!board_is_j721e_sk())
477 probe_daughtercards();
478 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200479
Nishanth Menon591443e2023-11-04 02:21:40 -0500480 if (IS_ENABLED(CONFIG_ESM_K3)) {
Udit Kumar43e842a2024-04-17 10:06:50 +0530481 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@700000", &dev);
482 if (ret)
483 printf("MISC init for esm@700000 failed: %d\n", ret);
484
485 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@40800000", &dev);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200486 if (ret)
Udit Kumar43e842a2024-04-17 10:06:50 +0530487 printf("MISC init for esm@40800000 failed: %d\n", ret);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200488 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200489
Nishanth Menon591443e2023-11-04 02:21:40 -0500490 if (IS_ENABLED(CONFIG_ESM_PMIC)) {
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200491 ret = uclass_get_device_by_driver(UCLASS_MISC,
Simon Glass65130cd2020-12-28 20:34:56 -0700492 DM_DRIVER_GET(pmic_esm),
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200493 &dev);
494 if (ret)
495 printf("ESM PMIC init failed: %d\n", ret);
496 }
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530497 if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) &&
498 IS_ENABLED(CONFIG_HBMC_AM654)) {
499 struct udevice *dev;
500 int ret;
501
502 ret = detect_SW3_1_state();
503 if (ret == 1) {
504 ret = uclass_get_device_by_driver(UCLASS_MTD,
505 DM_DRIVER_GET(hbmc_am654),
506 &dev);
507 if (ret)
508 debug("Failed to probe hyperflash\n");
509 }
510 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530511}