blob: f3452ff0a8fb11d00774d92d3cd337f037c333ed [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>
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053018
Andreas Dannenbergd036a212020-01-07 13:15:54 +053019#include "../common/board_detect.h"
Nishanth Menon3c0f8312024-02-12 13:47:22 -060020#include "../common/fdt_ops.h"
Andreas Dannenbergd036a212020-01-07 13:15:54 +053021
22#define board_is_j721e_som() (board_ti_k3_is("J721EX-PM1-SOM") || \
23 board_ti_k3_is("J721EX-PM2-SOM"))
24
Sinthu Raja1c24ab42022-02-09 15:06:50 +053025#define board_is_j721e_sk() (board_ti_k3_is("J721EX-EAIK") || \
26 board_ti_k3_is("J721EX-SK"))
27
Aswath Govindraju1e2b4202021-07-21 21:28:39 +053028#define board_is_j7200_som() (board_ti_k3_is("J7200X-PM1-SOM") || \
29 board_ti_k3_is("J7200X-PM2-SOM"))
Lokesh Vutlae2af9662020-08-05 22:44:25 +053030
Andreas Dannenbergd036a212020-01-07 13:15:54 +053031/* Max number of MAC addresses that are parsed/processed per daughter card */
32#define DAUGHTER_CARD_NO_OF_MAC_ADDR 8
33
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053034DECLARE_GLOBAL_DATA_PTR;
35
Jonathan Humphreys1f522a92024-06-14 11:35:34 -050036struct efi_fw_image fw_images[] = {
37 {
38 .image_type_id = J721E_SK_TIBOOT3_IMAGE_GUID,
39 .fw_name = u"J721E_SK_TIBOOT3",
40 .image_index = 1,
41 },
42 {
43 .image_type_id = J721E_SK_SPL_IMAGE_GUID,
44 .fw_name = u"J721E_SK_SPL",
45 .image_index = 2,
46 },
47 {
48 .image_type_id = J721E_SK_UBOOT_IMAGE_GUID,
49 .fw_name = u"J721E_SK_UBOOT",
50 .image_index = 3,
51 },
52 {
53 .image_type_id = J721E_SK_SYSFW_IMAGE_GUID,
54 .fw_name = u"J721E_SK_SYSFW",
55 .image_index = 4,
56 }
57};
58
59struct efi_capsule_update_info update_info = {
60 .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;"
61 "tispl.bin raw 80000 200000;u-boot.img raw 280000 400000;"
62 "sysfw.itb raw 6C0000 100000",
63 .num_images = ARRAY_SIZE(fw_images),
64 .images = fw_images,
65};
66
67#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
68void set_dfu_alt_info(char *interface, char *devstr)
69{
70 if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
71 env_set("dfu_alt_info", update_info.dfu_string);
72}
73#endif
74
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053075int board_init(void)
76{
77 return 0;
78}
79
80int dram_init(void)
81{
82#ifdef CONFIG_PHYS_64BIT
83 gd->ram_size = 0x100000000;
84#else
85 gd->ram_size = 0x80000000;
86#endif
87
88 return 0;
89}
90
Heinrich Schuchardt51a9aac2023-08-12 20:16:58 +020091phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053092{
93#ifdef CONFIG_PHYS_64BIT
94 /* Limit RAM used by U-Boot to the DDR low region */
95 if (gd->ram_top > 0x100000000)
96 return 0x100000000;
97#endif
98
99 return gd->ram_top;
100}
101
102int dram_init_banksize(void)
103{
104 /* Bank 0 declares the memory available in the DDR low region */
Andrew Davisff64dc22023-11-30 08:49:11 -0600105 gd->bd->bi_dram[0].start = 0x80000000;
Lokesh Vutla1a9dd212019-06-13 10:29:49 +0530106 gd->bd->bi_dram[0].size = 0x80000000;
107 gd->ram_size = 0x80000000;
108
109#ifdef CONFIG_PHYS_64BIT
110 /* Bank 1 declares the memory available in the DDR high region */
Andrew Davisff64dc22023-11-30 08:49:11 -0600111 gd->bd->bi_dram[1].start = 0x880000000;
Lokesh Vutla1a9dd212019-06-13 10:29:49 +0530112 gd->bd->bi_dram[1].size = 0x80000000;
113 gd->ram_size = 0x100000000;
114#endif
115
116 return 0;
117}
118
119#ifdef CONFIG_SPL_LOAD_FIT
120int board_fit_config_name_match(const char *name)
121{
Sinthu Raja944ff632022-02-09 15:06:52 +0530122 bool eeprom_read = board_ti_was_eeprom_read();
123
124 if (!eeprom_read || board_is_j721e_som()) {
125 if (!strcmp(name, "k3-j721e-common-proc-board") ||
126 !strcmp(name, "k3-j721e-r5-common-proc-board"))
127 return 0;
128 } else if (board_is_j721e_sk()) {
129 if (!strcmp(name, "k3-j721e-sk") ||
130 !strcmp(name, "k3-j721e-r5-sk"))
131 return 0;
132 }
Lokesh Vutla1a9dd212019-06-13 10:29:49 +0530133
134 return -1;
135}
136#endif
Suman Anna8eac9e62019-06-13 10:29:50 +0530137
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530138#if CONFIG_IS_ENABLED(DM_GPIO) && CONFIG_IS_ENABLED(OF_LIBFDT)
139/* Returns 1, if onboard mux is set to hyperflash */
140static void __maybe_unused detect_enable_hyperflash(void *blob)
141{
142 struct gpio_desc desc = {0};
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530143 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530144
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530145 if (dm_gpio_lookup_name(hypermux_sel_gpio, &desc))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530146 return;
147
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530148 if (dm_gpio_request(&desc, hypermux_sel_gpio))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530149 return;
150
151 if (dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN))
152 return;
153
154 if (dm_gpio_get_value(&desc)) {
155 int offset;
156
157 do_fixup_by_compat(blob, "ti,am654-hbmc", "status",
158 "okay", sizeof("okay"), 0);
159 offset = fdt_node_offset_by_compatible(blob, -1,
Vignesh Raghavendra57b78362020-09-17 16:48:16 +0530160 "ti,am654-ospi");
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530161 fdt_setprop(blob, offset, "status", "disabled",
162 sizeof("disabled"));
163 }
164}
165#endif
166
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530167#if defined(CONFIG_SPL_BUILD) && (defined(CONFIG_TARGET_J7200_A72_EVM) || defined(CONFIG_TARGET_J7200_R5_EVM) || \
168 defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J721E_R5_EVM))
Vignesh Raghavendra4c3c3d22020-08-13 14:56:16 +0530169void spl_perform_fixups(struct spl_image_info *spl_image)
170{
171 detect_enable_hyperflash(spl_image->fdt_addr);
172}
173#endif
174
Suman Anna8eac9e62019-06-13 10:29:50 +0530175#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +0900176int ft_board_setup(void *blob, struct bd_info *bd)
Suman Anna8eac9e62019-06-13 10:29:50 +0530177{
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530178 detect_enable_hyperflash(blob);
179
Andrew Davisb1c29792023-04-06 11:38:10 -0500180 return 0;
Suman Anna8eac9e62019-06-13 10:29:50 +0530181}
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530182#endif
183
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530184#ifdef CONFIG_TI_I2C_BOARD_DETECT
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530185int do_board_detect(void)
186{
187 int ret;
188
Sinthu Raja944ff632022-02-09 15:06:52 +0530189 if (board_ti_was_eeprom_read())
190 return 0;
191
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530192 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
193 CONFIG_EEPROM_CHIP_ADDRESS);
Sinthu Raja812364f2022-02-09 15:06:49 +0530194 if (ret) {
195 printf("EEPROM not available at 0x%02x, trying to read at 0x%02x\n",
196 CONFIG_EEPROM_CHIP_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS + 1);
197 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
198 CONFIG_EEPROM_CHIP_ADDRESS + 1);
199 if (ret)
200 pr_err("Reading on-board EEPROM at 0x%02x failed %d\n",
201 CONFIG_EEPROM_CHIP_ADDRESS + 1, ret);
202 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530203
204 return ret;
205}
206
Lokesh Vutla1db6b642020-01-07 13:15:55 +0530207int checkboard(void)
208{
209 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
210
211 if (do_board_detect())
212 /* EEPROM not populated */
213 printf("Board: %s rev %s\n", "J721EX-PM1-SOM", "E2");
214 else
215 printf("Board: %s rev %s\n", ep->name, ep->version);
216
217 return 0;
218}
219
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530220/*
221 * Declaration of daughtercards to probe. Note that when adding more
222 * cards they should be grouped by the 'i2c_addr' field to allow for a
223 * more efficient probing process.
224 */
225static const struct {
226 u8 i2c_addr; /* I2C address of card EEPROM */
227 char *card_name; /* EEPROM-programmed card name */
228 char *dtbo_name; /* Device tree overlay to apply */
229 u8 eth_offset; /* ethXaddr MAC address index offset */
230} ext_cards[] = {
231 {
232 0x51,
233 "J7X-BASE-CPB",
234 "", /* No dtbo for this board */
235 0,
236 },
237 {
238 0x52,
239 "J7X-INFOTAN-EXP",
240 "", /* No dtbo for this board */
241 0,
242 },
243 {
244 0x52,
245 "J7X-GESI-EXP",
246 "", /* No dtbo for this board */
247 5, /* Start populating from eth5addr */
248 },
249 {
250 0x54,
251 "J7X-VSC8514-ETH",
252 "", /* No dtbo for this board */
253 1, /* Start populating from eth1addr */
254 },
255};
256
257static bool daughter_card_detect_flags[ARRAY_SIZE(ext_cards)];
258
259const char *board_fit_get_additionnal_images(int index, const char *type)
260{
261 int i, j;
262
263 if (strcmp(type, FIT_FDT_PROP))
264 return NULL;
265
266 j = 0;
267 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
268 if (daughter_card_detect_flags[i]) {
269 if (j == index) {
270 /*
271 * Return dtbo name only if populated,
272 * otherwise stop parsing here.
273 */
274 if (strlen(ext_cards[i].dtbo_name))
275 return ext_cards[i].dtbo_name;
276 else
277 return NULL;
278 };
279
280 j++;
281 }
282 }
283
284 return NULL;
285}
286
287static int probe_daughtercards(void)
288{
289 char mac_addr[DAUGHTER_CARD_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN];
290 bool eeprom_read_success;
291 struct ti_am6_eeprom ep;
292 u8 previous_i2c_addr;
293 u8 mac_addr_cnt;
294 int i;
295 int ret;
296
297 /* Mark previous I2C address variable as not populated */
298 previous_i2c_addr = 0xff;
299
300 /* No EEPROM data was read yet */
301 eeprom_read_success = false;
302
303 /* Iterate through list of daughtercards */
304 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
305 /* Obtain card-specific I2C address */
306 u8 i2c_addr = ext_cards[i].i2c_addr;
307
308 /* Read card EEPROM if not already read previously */
309 if (i2c_addr != previous_i2c_addr) {
310 /* Store I2C address so we can avoid reading twice */
311 previous_i2c_addr = i2c_addr;
312
313 /* Get and parse the daughter card EEPROM record */
314 ret = ti_i2c_eeprom_am6_get(CONFIG_EEPROM_BUS_ADDRESS,
315 i2c_addr,
316 &ep,
317 (char **)mac_addr,
318 DAUGHTER_CARD_NO_OF_MAC_ADDR,
319 &mac_addr_cnt);
320 if (ret) {
321 debug("%s: No daughtercard EEPROM at 0x%02x found %d\n",
322 __func__, i2c_addr, ret);
323 eeprom_read_success = false;
324 /* Skip to the next daughtercard to probe */
325 continue;
326 }
327
328 /* EEPROM read successful, okay to further process. */
329 eeprom_read_success = true;
330 }
331
332 /* Only continue processing if EEPROM data was read */
333 if (!eeprom_read_success)
334 continue;
335
336 /* Only process the parsed data if we found a match */
337 if (strncmp(ep.name, ext_cards[i].card_name, sizeof(ep.name)))
338 continue;
339
340 printf("Detected: %s rev %s\n", ep.name, ep.version);
341 daughter_card_detect_flags[i] = true;
342
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500343 if (!IS_ENABLED(CONFIG_SPL_BUILD)) {
344 int j;
345 /*
346 * Populate any MAC addresses from daughtercard into the U-Boot
347 * environment, starting with a card-specific offset so we can
348 * have multiple ext_cards contribute to the MAC pool in a well-
349 * defined manner.
350 */
351 for (j = 0; j < mac_addr_cnt; j++) {
352 if (!is_valid_ethaddr((u8 *)mac_addr[j]))
353 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530354
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500355 eth_env_set_enetaddr_by_index("eth",
356 ext_cards[i].eth_offset + j,
357 (uchar *)mac_addr[j]);
358 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530359 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530360 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530361
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500362 if (!IS_ENABLED(CONFIG_SPL_BUILD)) {
363 char name_overlays[1024] = { 0 };
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530364
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500365 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
366 if (!daughter_card_detect_flags[i])
367 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530368
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500369 /* Skip if no overlays are to be added */
370 if (!strlen(ext_cards[i].dtbo_name))
371 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530372
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500373 /*
374 * Make sure we are not running out of buffer space by checking
375 * if we can fit the new overlay, a trailing space to be used
376 * as a separator, plus the terminating zero.
377 */
378 if (strlen(name_overlays) + strlen(ext_cards[i].dtbo_name) + 2 >
379 sizeof(name_overlays))
380 return -ENOMEM;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530381
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500382 /* Append to our list of overlays */
383 strcat(name_overlays, ext_cards[i].dtbo_name);
384 strcat(name_overlays, " ");
385 }
386
387 /* Apply device tree overlay(s) to the U-Boot environment, if any */
388 if (strlen(name_overlays))
389 return env_set("name_overlays", name_overlays);
390 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530391
392 return 0;
393}
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530394#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530395
Sinthu Rajae861aa92022-02-09 15:06:48 +0530396#ifdef CONFIG_BOARD_LATE_INIT
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600397static struct ti_fdt_map ti_j721e_evm_fdt_map[] = {
398 {"j721e", "k3-j721e-common-proc-board.dtb"},
399 {"j721e-sk", "k3-j721e-sk.dtb"},
400 {"j7200", "k3-j7200-common-proc-board.dtb"},
401 { /* Sentinel. */ }
402};
Sinthu Rajae861aa92022-02-09 15:06:48 +0530403static void setup_board_eeprom_env(void)
404{
405 char *name = "j721e";
406
407 if (do_board_detect())
408 goto invalid_eeprom;
409
410 if (board_is_j721e_som())
411 name = "j721e";
Sinthu Raja1c24ab42022-02-09 15:06:50 +0530412 else if (board_is_j721e_sk())
413 name = "j721e-sk";
Sinthu Rajae861aa92022-02-09 15:06:48 +0530414 else if (board_is_j7200_som())
415 name = "j7200";
416 else
417 printf("Unidentified board claims %s in eeprom header\n",
418 board_ti_get_name());
419
420invalid_eeprom:
421 set_board_info_env_am6(name);
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600422 ti_set_fdt_env(name, ti_j721e_evm_fdt_map);
Sinthu Rajae861aa92022-02-09 15:06:48 +0530423}
424
425static void setup_serial(void)
426{
427 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
428 unsigned long board_serial;
429 char *endp;
430 char serial_string[17] = { 0 };
431
432 if (env_get("serial#"))
433 return;
434
435 board_serial = hextoul(ep->serial, &endp);
436 if (*endp != '\0') {
437 pr_err("Error: Can't set serial# to %s\n", ep->serial);
438 return;
439 }
440
441 snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial);
442 env_set("serial#", serial_string);
443}
444
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530445int board_late_init(void)
446{
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530447 if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
448 setup_board_eeprom_env();
449 setup_serial();
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530450
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530451 /* Check for and probe any plugged-in daughtercards */
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530452 if (board_is_j721e_som() || board_is_j7200_som())
453 probe_daughtercards();
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530454 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530455
456 return 0;
457}
Sinthu Rajae861aa92022-02-09 15:06:48 +0530458#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530459
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530460static int __maybe_unused detect_SW3_1_state(void)
461{
462 if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) {
463 struct gpio_desc desc = {0};
464 int ret;
465 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
466
467 ret = dm_gpio_lookup_name(hypermux_sel_gpio, &desc);
468 if (ret) {
469 printf("error getting GPIO lookup name: %d\n", ret);
470 return ret;
471 }
472
473 ret = dm_gpio_request(&desc, hypermux_sel_gpio);
474 if (ret) {
475 printf("error requesting GPIO: %d\n", ret);
476 goto err_free_gpio;
477 }
478
479 ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN);
480 if (ret) {
481 printf("error setting direction flag of GPIO: %d\n", ret);
482 goto err_free_gpio;
483 }
484
485 ret = dm_gpio_get_value(&desc);
486 if (ret < 0)
487 printf("error getting value of GPIO: %d\n", ret);
488
489err_free_gpio:
490 dm_gpio_free(desc.dev, &desc);
491 return ret;
492 }
493}
494
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530495void spl_board_init(void)
496{
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200497 struct udevice *dev;
498 int ret;
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200499
Lokesh Vutla046ad432020-08-05 22:44:24 +0530500 if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
501 IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530502 IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
503 if (!board_is_j721e_sk())
504 probe_daughtercards();
505 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200506
Nishanth Menon591443e2023-11-04 02:21:40 -0500507 if (IS_ENABLED(CONFIG_ESM_K3)) {
Udit Kumar43e842a2024-04-17 10:06:50 +0530508 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@700000", &dev);
509 if (ret)
510 printf("MISC init for esm@700000 failed: %d\n", ret);
511
512 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@40800000", &dev);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200513 if (ret)
Udit Kumar43e842a2024-04-17 10:06:50 +0530514 printf("MISC init for esm@40800000 failed: %d\n", ret);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200515 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200516
Nishanth Menon591443e2023-11-04 02:21:40 -0500517 if (IS_ENABLED(CONFIG_ESM_PMIC)) {
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200518 ret = uclass_get_device_by_driver(UCLASS_MISC,
Simon Glass65130cd2020-12-28 20:34:56 -0700519 DM_DRIVER_GET(pmic_esm),
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200520 &dev);
521 if (ret)
522 printf("ESM PMIC init failed: %d\n", ret);
523 }
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530524 if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) &&
525 IS_ENABLED(CONFIG_HBMC_AM654)) {
526 struct udevice *dev;
527 int ret;
528
529 ret = detect_SW3_1_state();
530 if (ret == 1) {
531 ret = uclass_get_device_by_driver(UCLASS_MTD,
532 DM_DRIVER_GET(hbmc_am654),
533 &dev);
534 if (ret)
535 debug("Failed to probe hyperflash\n");
536 }
537 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530538}