blob: 0525f6e6f9793209b94d25c53e47fdda46233682 [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
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053068int board_init(void)
69{
70 return 0;
71}
72
Heinrich Schuchardt51a9aac2023-08-12 20:16:58 +020073phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053074{
75#ifdef CONFIG_PHYS_64BIT
76 /* Limit RAM used by U-Boot to the DDR low region */
77 if (gd->ram_top > 0x100000000)
78 return 0x100000000;
79#endif
80
81 return gd->ram_top;
82}
83
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053084#ifdef CONFIG_SPL_LOAD_FIT
85int board_fit_config_name_match(const char *name)
86{
Sinthu Raja944ff632022-02-09 15:06:52 +053087 bool eeprom_read = board_ti_was_eeprom_read();
88
89 if (!eeprom_read || board_is_j721e_som()) {
90 if (!strcmp(name, "k3-j721e-common-proc-board") ||
91 !strcmp(name, "k3-j721e-r5-common-proc-board"))
92 return 0;
93 } else if (board_is_j721e_sk()) {
94 if (!strcmp(name, "k3-j721e-sk") ||
95 !strcmp(name, "k3-j721e-r5-sk"))
96 return 0;
97 }
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053098
99 return -1;
100}
101#endif
Suman Anna8eac9e62019-06-13 10:29:50 +0530102
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530103#if CONFIG_IS_ENABLED(DM_GPIO) && CONFIG_IS_ENABLED(OF_LIBFDT)
104/* Returns 1, if onboard mux is set to hyperflash */
105static void __maybe_unused detect_enable_hyperflash(void *blob)
106{
107 struct gpio_desc desc = {0};
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530108 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530109
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530110 if (dm_gpio_lookup_name(hypermux_sel_gpio, &desc))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530111 return;
112
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530113 if (dm_gpio_request(&desc, hypermux_sel_gpio))
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530114 return;
115
116 if (dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN))
117 return;
118
119 if (dm_gpio_get_value(&desc)) {
120 int offset;
121
122 do_fixup_by_compat(blob, "ti,am654-hbmc", "status",
123 "okay", sizeof("okay"), 0);
124 offset = fdt_node_offset_by_compatible(blob, -1,
Vignesh Raghavendra57b78362020-09-17 16:48:16 +0530125 "ti,am654-ospi");
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530126 fdt_setprop(blob, offset, "status", "disabled",
127 sizeof("disabled"));
128 }
129}
130#endif
131
Simon Glass49c24a82024-09-29 19:49:47 -0600132#if defined(CONFIG_XPL_BUILD) && (defined(CONFIG_TARGET_J7200_A72_EVM) || defined(CONFIG_TARGET_J7200_R5_EVM) || \
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530133 defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J721E_R5_EVM))
Vignesh Raghavendra4c3c3d22020-08-13 14:56:16 +0530134void spl_perform_fixups(struct spl_image_info *spl_image)
135{
136 detect_enable_hyperflash(spl_image->fdt_addr);
137}
138#endif
139
Suman Anna8eac9e62019-06-13 10:29:50 +0530140#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +0900141int ft_board_setup(void *blob, struct bd_info *bd)
Suman Anna8eac9e62019-06-13 10:29:50 +0530142{
Vignesh Raghavendra685d8652020-08-07 00:26:57 +0530143 detect_enable_hyperflash(blob);
144
Andrew Davisb1c29792023-04-06 11:38:10 -0500145 return 0;
Suman Anna8eac9e62019-06-13 10:29:50 +0530146}
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530147#endif
148
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530149#ifdef CONFIG_TI_I2C_BOARD_DETECT
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530150int do_board_detect(void)
151{
152 int ret;
153
Sinthu Raja944ff632022-02-09 15:06:52 +0530154 if (board_ti_was_eeprom_read())
155 return 0;
156
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530157 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
158 CONFIG_EEPROM_CHIP_ADDRESS);
Sinthu Raja812364f2022-02-09 15:06:49 +0530159 if (ret) {
160 printf("EEPROM not available at 0x%02x, trying to read at 0x%02x\n",
161 CONFIG_EEPROM_CHIP_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS + 1);
162 ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
163 CONFIG_EEPROM_CHIP_ADDRESS + 1);
164 if (ret)
165 pr_err("Reading on-board EEPROM at 0x%02x failed %d\n",
166 CONFIG_EEPROM_CHIP_ADDRESS + 1, ret);
167 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530168
169 return ret;
170}
171
Lokesh Vutla1db6b642020-01-07 13:15:55 +0530172int checkboard(void)
173{
174 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
175
176 if (do_board_detect())
177 /* EEPROM not populated */
178 printf("Board: %s rev %s\n", "J721EX-PM1-SOM", "E2");
179 else
180 printf("Board: %s rev %s\n", ep->name, ep->version);
181
182 return 0;
183}
184
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530185/*
186 * Declaration of daughtercards to probe. Note that when adding more
187 * cards they should be grouped by the 'i2c_addr' field to allow for a
188 * more efficient probing process.
189 */
190static const struct {
191 u8 i2c_addr; /* I2C address of card EEPROM */
192 char *card_name; /* EEPROM-programmed card name */
193 char *dtbo_name; /* Device tree overlay to apply */
194 u8 eth_offset; /* ethXaddr MAC address index offset */
195} ext_cards[] = {
196 {
197 0x51,
198 "J7X-BASE-CPB",
199 "", /* No dtbo for this board */
200 0,
201 },
202 {
203 0x52,
204 "J7X-INFOTAN-EXP",
205 "", /* No dtbo for this board */
206 0,
207 },
208 {
209 0x52,
210 "J7X-GESI-EXP",
211 "", /* No dtbo for this board */
212 5, /* Start populating from eth5addr */
213 },
214 {
215 0x54,
216 "J7X-VSC8514-ETH",
217 "", /* No dtbo for this board */
218 1, /* Start populating from eth1addr */
219 },
220};
221
222static bool daughter_card_detect_flags[ARRAY_SIZE(ext_cards)];
223
224const char *board_fit_get_additionnal_images(int index, const char *type)
225{
226 int i, j;
227
228 if (strcmp(type, FIT_FDT_PROP))
229 return NULL;
230
231 j = 0;
232 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
233 if (daughter_card_detect_flags[i]) {
234 if (j == index) {
235 /*
236 * Return dtbo name only if populated,
237 * otherwise stop parsing here.
238 */
239 if (strlen(ext_cards[i].dtbo_name))
240 return ext_cards[i].dtbo_name;
241 else
242 return NULL;
243 };
244
245 j++;
246 }
247 }
248
249 return NULL;
250}
251
252static int probe_daughtercards(void)
253{
254 char mac_addr[DAUGHTER_CARD_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN];
255 bool eeprom_read_success;
256 struct ti_am6_eeprom ep;
257 u8 previous_i2c_addr;
258 u8 mac_addr_cnt;
259 int i;
260 int ret;
261
262 /* Mark previous I2C address variable as not populated */
263 previous_i2c_addr = 0xff;
264
265 /* No EEPROM data was read yet */
266 eeprom_read_success = false;
267
268 /* Iterate through list of daughtercards */
269 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
270 /* Obtain card-specific I2C address */
271 u8 i2c_addr = ext_cards[i].i2c_addr;
272
273 /* Read card EEPROM if not already read previously */
274 if (i2c_addr != previous_i2c_addr) {
275 /* Store I2C address so we can avoid reading twice */
276 previous_i2c_addr = i2c_addr;
277
278 /* Get and parse the daughter card EEPROM record */
279 ret = ti_i2c_eeprom_am6_get(CONFIG_EEPROM_BUS_ADDRESS,
280 i2c_addr,
281 &ep,
282 (char **)mac_addr,
283 DAUGHTER_CARD_NO_OF_MAC_ADDR,
284 &mac_addr_cnt);
285 if (ret) {
286 debug("%s: No daughtercard EEPROM at 0x%02x found %d\n",
287 __func__, i2c_addr, ret);
288 eeprom_read_success = false;
289 /* Skip to the next daughtercard to probe */
290 continue;
291 }
292
293 /* EEPROM read successful, okay to further process. */
294 eeprom_read_success = true;
295 }
296
297 /* Only continue processing if EEPROM data was read */
298 if (!eeprom_read_success)
299 continue;
300
301 /* Only process the parsed data if we found a match */
302 if (strncmp(ep.name, ext_cards[i].card_name, sizeof(ep.name)))
303 continue;
304
305 printf("Detected: %s rev %s\n", ep.name, ep.version);
306 daughter_card_detect_flags[i] = true;
307
Simon Glass49c24a82024-09-29 19:49:47 -0600308 if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500309 int j;
310 /*
311 * Populate any MAC addresses from daughtercard into the U-Boot
312 * environment, starting with a card-specific offset so we can
313 * have multiple ext_cards contribute to the MAC pool in a well-
314 * defined manner.
315 */
316 for (j = 0; j < mac_addr_cnt; j++) {
317 if (!is_valid_ethaddr((u8 *)mac_addr[j]))
318 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530319
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500320 eth_env_set_enetaddr_by_index("eth",
321 ext_cards[i].eth_offset + j,
322 (uchar *)mac_addr[j]);
323 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530324 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530325 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530326
Simon Glass49c24a82024-09-29 19:49:47 -0600327 if (!IS_ENABLED(CONFIG_XPL_BUILD)) {
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500328 char name_overlays[1024] = { 0 };
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530329
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500330 for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
331 if (!daughter_card_detect_flags[i])
332 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530333
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500334 /* Skip if no overlays are to be added */
335 if (!strlen(ext_cards[i].dtbo_name))
336 continue;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530337
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500338 /*
339 * Make sure we are not running out of buffer space by checking
340 * if we can fit the new overlay, a trailing space to be used
341 * as a separator, plus the terminating zero.
342 */
343 if (strlen(name_overlays) + strlen(ext_cards[i].dtbo_name) + 2 >
344 sizeof(name_overlays))
345 return -ENOMEM;
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530346
Nishanth Menon4f4c9d82023-11-04 02:21:41 -0500347 /* Append to our list of overlays */
348 strcat(name_overlays, ext_cards[i].dtbo_name);
349 strcat(name_overlays, " ");
350 }
351
352 /* Apply device tree overlay(s) to the U-Boot environment, if any */
353 if (strlen(name_overlays))
354 return env_set("name_overlays", name_overlays);
355 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530356
357 return 0;
358}
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530359#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530360
Sinthu Rajae861aa92022-02-09 15:06:48 +0530361#ifdef CONFIG_BOARD_LATE_INIT
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600362static struct ti_fdt_map ti_j721e_evm_fdt_map[] = {
Aashvij Shenai73e4cbe2025-01-20 14:20:42 +0530363 {"j721e", "ti/k3-j721e-common-proc-board.dtb"},
364 {"j721e-sk", "ti/k3-j721e-sk.dtb"},
365 {"j7200", "ti/k3-j7200-common-proc-board.dtb"},
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600366 { /* Sentinel. */ }
367};
Sinthu Rajae861aa92022-02-09 15:06:48 +0530368static void setup_board_eeprom_env(void)
369{
370 char *name = "j721e";
371
372 if (do_board_detect())
373 goto invalid_eeprom;
374
375 if (board_is_j721e_som())
376 name = "j721e";
Sinthu Raja1c24ab42022-02-09 15:06:50 +0530377 else if (board_is_j721e_sk())
378 name = "j721e-sk";
Sinthu Rajae861aa92022-02-09 15:06:48 +0530379 else if (board_is_j7200_som())
380 name = "j7200";
381 else
382 printf("Unidentified board claims %s in eeprom header\n",
383 board_ti_get_name());
384
385invalid_eeprom:
386 set_board_info_env_am6(name);
Nishanth Menon3c0f8312024-02-12 13:47:22 -0600387 ti_set_fdt_env(name, ti_j721e_evm_fdt_map);
Sinthu Rajae861aa92022-02-09 15:06:48 +0530388}
389
390static void setup_serial(void)
391{
392 struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
393 unsigned long board_serial;
394 char *endp;
395 char serial_string[17] = { 0 };
396
397 if (env_get("serial#"))
398 return;
399
400 board_serial = hextoul(ep->serial, &endp);
401 if (*endp != '\0') {
402 pr_err("Error: Can't set serial# to %s\n", ep->serial);
403 return;
404 }
405
406 snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial);
407 env_set("serial#", serial_string);
408}
409
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530410int board_late_init(void)
411{
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530412 if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
413 setup_board_eeprom_env();
414 setup_serial();
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530415
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530416 /* Check for and probe any plugged-in daughtercards */
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530417 if (board_is_j721e_som() || board_is_j7200_som())
418 probe_daughtercards();
Lokesh Vutla5a08e652020-08-05 22:44:14 +0530419 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530420
421 return 0;
422}
Sinthu Rajae861aa92022-02-09 15:06:48 +0530423#endif
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530424
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530425static int __maybe_unused detect_SW3_1_state(void)
426{
427 if (IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) {
428 struct gpio_desc desc = {0};
429 int ret;
430 char *hypermux_sel_gpio = (board_is_j721e_som()) ? "8" : "6";
431
432 ret = dm_gpio_lookup_name(hypermux_sel_gpio, &desc);
433 if (ret) {
434 printf("error getting GPIO lookup name: %d\n", ret);
435 return ret;
436 }
437
438 ret = dm_gpio_request(&desc, hypermux_sel_gpio);
439 if (ret) {
440 printf("error requesting GPIO: %d\n", ret);
441 goto err_free_gpio;
442 }
443
444 ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_IN);
445 if (ret) {
446 printf("error setting direction flag of GPIO: %d\n", ret);
447 goto err_free_gpio;
448 }
449
450 ret = dm_gpio_get_value(&desc);
451 if (ret < 0)
452 printf("error getting value of GPIO: %d\n", ret);
453
454err_free_gpio:
455 dm_gpio_free(desc.dev, &desc);
456 return ret;
457 }
458}
459
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530460void spl_board_init(void)
461{
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200462 struct udevice *dev;
463 int ret;
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200464
Lokesh Vutla046ad432020-08-05 22:44:24 +0530465 if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
466 IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&
Sinthu Raja9a4fa302022-02-09 15:06:51 +0530467 IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
468 if (!board_is_j721e_sk())
469 probe_daughtercards();
470 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200471
Nishanth Menon591443e2023-11-04 02:21:40 -0500472 if (IS_ENABLED(CONFIG_ESM_K3)) {
Udit Kumar43e842a2024-04-17 10:06:50 +0530473 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@700000", &dev);
474 if (ret)
475 printf("MISC init for esm@700000 failed: %d\n", ret);
476
477 ret = uclass_get_device_by_name(UCLASS_MISC, "esm@40800000", &dev);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200478 if (ret)
Udit Kumar43e842a2024-04-17 10:06:50 +0530479 printf("MISC init for esm@40800000 failed: %d\n", ret);
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200480 }
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200481
Nishanth Menon591443e2023-11-04 02:21:40 -0500482 if (IS_ENABLED(CONFIG_ESM_PMIC)) {
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200483 ret = uclass_get_device_by_driver(UCLASS_MISC,
Simon Glass65130cd2020-12-28 20:34:56 -0700484 DM_DRIVER_GET(pmic_esm),
Tero Kristo1a2c7ba2020-02-14 11:18:19 +0200485 &dev);
486 if (ret)
487 printf("ESM PMIC init failed: %d\n", ret);
488 }
Vaishnav Achathb8b17442022-05-09 11:50:16 +0530489 if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) &&
490 IS_ENABLED(CONFIG_HBMC_AM654)) {
491 struct udevice *dev;
492 int ret;
493
494 ret = detect_SW3_1_state();
495 if (ret == 1) {
496 ret = uclass_get_device_by_driver(UCLASS_MTD,
497 DM_DRIVER_GET(hbmc_am654),
498 &dev);
499 if (ret)
500 debug("Failed to probe hyperflash\n");
501 }
502 }
Andreas Dannenbergd036a212020-01-07 13:15:54 +0530503}