1 // SPDX-License-Identifier: GPL-2.0+
7 #include <asm/arch/clock.h>
8 #include <asm/arch/imx-regs.h>
9 #include <asm/arch/sys_proto.h>
10 #include <asm/armv8/mmu.h>
11 #include <asm/mach-imx/boot_mode.h>
12 #include <asm/global_data.h>
13 #include <efi_loader.h>
16 #include <asm/arch/rdc.h>
17 #include <asm/mach-imx/s400_api.h>
18 #include <asm/mach-imx/mu_hal.h>
20 #include <asm/setup.h>
22 #include <dm/device-internal.h>
24 #include <dm/uclass.h>
25 #include <dm/device.h>
26 #include <dm/uclass-internal.h>
29 #include <linux/iopoll.h>
31 #include <env_internal.h>
33 DECLARE_GLOBAL_DATA_PTR;
35 struct rom_api *g_rom_api = (struct rom_api *)0x1980;
37 bool is_usb_boot(void)
39 return get_boot_device() == USB_BOOT;
42 #ifdef CONFIG_ENV_IS_IN_MMC
43 __weak int board_mmc_get_env_dev(int devno)
48 int mmc_get_env_dev(void)
55 ret = rom_api_query_boot_infor(QUERY_BT_DEV, &boot);
57 if (ret != ROM_API_OKAY) {
58 puts("ROMAPI: failure at query_boot_info\n");
59 return CONFIG_SYS_MMC_ENV_DEV;
62 boot_type = boot >> 16;
63 boot_instance = (boot >> 8) & 0xff;
65 /* If not boot from sd/mmc, use default value */
66 if (boot_type != BOOT_TYPE_SD && boot_type != BOOT_TYPE_MMC)
67 return env_get_ulong("mmcdev", 10, CONFIG_SYS_MMC_ENV_DEV);
69 return board_mmc_get_env_dev(boot_instance);
73 static void set_cpu_info(struct sentinel_get_info_data *info)
75 gd->arch.soc_rev = info->soc;
76 gd->arch.lifecycle = info->lc;
77 memcpy((void *)&gd->arch.uid, &info->uid, 4 * sizeof(u32));
82 u32 rev = (gd->arch.soc_rev >> 24) - 0xa0;
84 return (MXC_CPU_IMX8ULP << 12) | (CHIP_REV_1_0 + rev);
87 enum bt_mode get_boot_mode(void)
91 bt0_cfg = readl(SIM_SEC_BASE_ADDR + 0x24);
92 bt0_cfg &= (BT0CFG_LPBOOT_MASK | BT0CFG_DUALBOOT_MASK);
94 if (!(bt0_cfg & BT0CFG_LPBOOT_MASK)) {
95 /* No low power boot */
96 if (bt0_cfg & BT0CFG_DUALBOOT_MASK)
102 return LOW_POWER_BOOT;
105 bool m33_image_booted(void)
107 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
111 gp6 = readl(SIM_SEC_BASE_ADDR + 0x28);
117 u32 gpr0 = readl(SIM1_BASE_ADDR);
125 bool rdc_enabled_in_boot(void)
127 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
130 bool rdc_en = true; /* Default assume DBD_EN is set */
132 /* Read DBD_EN fuse */
133 ret = fuse_read(8, 1, &val);
135 rdc_en = !!(val & 0x200); /* only A1 part uses DBD_EN, so check DBD_EN new place*/
139 u32 gpr0 = readl(SIM1_BASE_ADDR);
147 static void spl_pass_boot_info(void)
149 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
150 bool m33_booted = m33_image_booted();
151 bool rdc_en = rdc_enabled_in_boot();
160 writel(val, SIM1_BASE_ADDR);
164 bool is_m33_handshake_necessary(void)
166 /* Only need handshake in u-boot */
167 if (!IS_ENABLED(CONFIG_SPL_BUILD))
168 return (m33_image_booted() || rdc_enabled_in_boot());
173 int m33_image_handshake(ulong timeout_ms)
177 ulong timeout_us = timeout_ms * 1000;
179 /* Notify m33 that it's ready to do init srtm(enable mu receive interrupt and so on) */
180 setbits_le32(MU0_B_BASE_ADDR + 0x100, BIT(0)); /* set FCR F0 flag of MU0_MUB */
183 * Wait m33 to set FCR F0 flag of MU0_MUA
184 * Clear FCR F0 flag of MU0_MUB after m33 has set FCR F0 flag of MU0_MUA
186 ret = readl_poll_sleep_timeout(MU0_B_BASE_ADDR + 0x104, fsr, fsr & BIT(0), 10, timeout_us);
188 clrbits_le32(MU0_B_BASE_ADDR + 0x100, BIT(0));
193 #define CMC_SRS_TAMPER BIT(31)
194 #define CMC_SRS_SECURITY BIT(30)
195 #define CMC_SRS_TZWDG BIT(29)
196 #define CMC_SRS_JTAG_RST BIT(28)
197 #define CMC_SRS_CORE1 BIT(16)
198 #define CMC_SRS_LOCKUP BIT(15)
199 #define CMC_SRS_SW BIT(14)
200 #define CMC_SRS_WDG BIT(13)
201 #define CMC_SRS_PIN_RESET BIT(8)
202 #define CMC_SRS_WARM BIT(4)
203 #define CMC_SRS_HVD BIT(3)
204 #define CMC_SRS_LVD BIT(2)
205 #define CMC_SRS_POR BIT(1)
206 #define CMC_SRS_WUP BIT(0)
208 static char *get_reset_cause(char *ret)
210 u32 cause1, cause = 0, srs = 0;
211 void __iomem *reg_ssrs = (void __iomem *)(CMC1_BASE_ADDR + 0x88);
212 void __iomem *reg_srs = (void __iomem *)(CMC1_BASE_ADDR + 0x80);
217 srs = readl(reg_srs);
218 cause1 = readl(reg_ssrs);
220 cause = srs & (CMC_SRS_POR | CMC_SRS_WUP | CMC_SRS_WARM);
224 sprintf(ret, "%s", "POR");
227 sprintf(ret, "%s", "WUP");
230 cause = srs & (CMC_SRS_WDG | CMC_SRS_SW |
234 sprintf(ret, "%s", "WARM-WDG");
237 sprintf(ret, "%s", "WARM-SW");
239 case CMC_SRS_JTAG_RST:
240 sprintf(ret, "%s", "WARM-JTAG");
243 sprintf(ret, "%s", "WARM-UNKN");
248 sprintf(ret, "%s-%X", "UNKN", srs);
252 debug("[%X] SRS[%X] %X - ", cause1, srs, srs ^ cause1);
256 #if defined(CONFIG_DISPLAY_CPUINFO)
257 const char *get_imx_type(u32 imxtype)
262 int print_cpuinfo(void)
267 cpurev = get_cpu_rev();
269 printf("CPU: i.MX%s rev%d.%d at %d MHz\n",
270 get_imx_type((cpurev & 0xFF000) >> 12),
271 (cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0,
272 mxc_get_clock(MXC_ARM_CLK) / 1000000);
274 #if defined(CONFIG_IMX_PMC_TEMPERATURE)
275 struct udevice *udev;
278 ret = uclass_get_device(UCLASS_THERMAL, 0, &udev);
280 ret = thermal_get_temp(udev, &temp);
282 printf("CPU current temperature: %d\n", temp);
284 debug(" - failed to get CPU current temperature\n");
286 debug(" - failed to get CPU current temperature\n");
290 printf("Reset cause: %s\n", get_reset_cause(cause));
292 printf("Boot mode: ");
293 switch (get_boot_mode()) {
295 printf("Low power boot\n");
298 printf("Dual boot\n");
302 printf("Single boot\n");
310 #define UNLOCK_WORD0 0xC520 /* 1st unlock word */
311 #define UNLOCK_WORD1 0xD928 /* 2nd unlock word */
312 #define REFRESH_WORD0 0xA602 /* 1st refresh word */
313 #define REFRESH_WORD1 0xB480 /* 2nd refresh word */
315 static void disable_wdog(void __iomem *wdog_base)
317 u32 val_cs = readl(wdog_base + 0x00);
319 if (!(val_cs & 0x80))
323 __raw_writel(REFRESH_WORD0, (wdog_base + 0x04)); /* Refresh the CNT */
324 __raw_writel(REFRESH_WORD1, (wdog_base + 0x04));
327 if (!(val_cs & 800)) {
329 __raw_writel(UNLOCK_WORD0, (wdog_base + 0x04));
330 __raw_writel(UNLOCK_WORD1, (wdog_base + 0x04));
333 while (!(readl(wdog_base + 0x00) & 0x800))
336 writel(0x0, (wdog_base + 0x0C)); /* Set WIN to 0 */
337 writel(0x400, (wdog_base + 0x08)); /* Set timeout to default 0x400 */
338 writel(0x120, (wdog_base + 0x00)); /* Disable it and set update */
340 while (!(readl(wdog_base + 0x00) & 0x400))
346 disable_wdog((void __iomem *)WDG3_RBASE);
349 static struct mm_region imx8ulp_arm64_mem_map[] = {
355 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
356 PTE_BLOCK_OUTER_SHARE
362 .size = 0x08000000UL,
363 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
364 PTE_BLOCK_NON_SHARE |
365 PTE_BLOCK_PXN | PTE_BLOCK_UXN
368 /* SSRAM (align with 2M) */
369 .virt = 0x1FE00000UL,
370 .phys = 0x1FE00000UL,
372 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
373 PTE_BLOCK_OUTER_SHARE |
374 PTE_BLOCK_PXN | PTE_BLOCK_UXN
376 /* SRAM1 (align with 2M) */
377 .virt = 0x21000000UL,
378 .phys = 0x21000000UL,
380 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
381 PTE_BLOCK_OUTER_SHARE |
382 PTE_BLOCK_PXN | PTE_BLOCK_UXN
384 /* SRAM0 (align with 2M) */
385 .virt = 0x22000000UL,
386 .phys = 0x22000000UL,
388 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
389 PTE_BLOCK_OUTER_SHARE |
390 PTE_BLOCK_PXN | PTE_BLOCK_UXN
393 .virt = 0x27000000UL,
394 .phys = 0x27000000UL,
396 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
397 PTE_BLOCK_NON_SHARE |
398 PTE_BLOCK_PXN | PTE_BLOCK_UXN
401 .virt = 0x2D000000UL,
402 .phys = 0x2D000000UL,
404 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
405 PTE_BLOCK_NON_SHARE |
406 PTE_BLOCK_PXN | PTE_BLOCK_UXN
409 .virt = 0x40000000UL,
410 .phys = 0x40000000UL,
411 .size = 0x40000000UL,
412 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
413 PTE_BLOCK_NON_SHARE |
414 PTE_BLOCK_PXN | PTE_BLOCK_UXN
417 .virt = 0x80000000UL,
418 .phys = 0x80000000UL,
419 .size = PHYS_SDRAM_SIZE,
420 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
421 PTE_BLOCK_OUTER_SHARE
424 * empty entrie to split table entry 5
425 * if needed when TEEs are used
429 /* List terminator */
434 struct mm_region *mem_map = imx8ulp_arm64_mem_map;
436 static unsigned int imx8ulp_find_dram_entry_in_mem_map(void)
440 for (i = 0; i < ARRAY_SIZE(imx8ulp_arm64_mem_map); i++)
441 if (imx8ulp_arm64_mem_map[i].phys == CFG_SYS_SDRAM_BASE)
444 hang(); /* Entry not found, this must never happen. */
447 /* simplify the page table size to enhance boot speed */
448 #define MAX_PTE_ENTRIES 512
449 #define MAX_MEM_MAP_REGIONS 16
450 u64 get_page_table_size(void)
452 u64 one_pt = MAX_PTE_ENTRIES * sizeof(u64);
456 * For each memory region, the max table size:
457 * 2 level 3 tables + 2 level 2 tables + 1 level 1 table
459 size = (2 + 2 + 1) * one_pt * MAX_MEM_MAP_REGIONS + one_pt;
462 * We need to duplicate our page table once to have an emergency pt to
463 * resort to when splitting page tables later on
468 * We may need to split page tables later on if dcache settings change,
469 * so reserve up to 4 (random pick) page tables for that.
476 void enable_caches(void)
478 /* If OPTEE runs, remove OPTEE memory from MMU table to avoid speculative prefetch */
479 if (rom_pointer[1]) {
481 * TEE are loaded, So the ddr bank structures
482 * have been modified update mmu table accordingly
485 int entry = imx8ulp_find_dram_entry_in_mem_map();
486 u64 attrs = imx8ulp_arm64_mem_map[entry].attrs;
488 while (i < CONFIG_NR_DRAM_BANKS &&
489 entry < ARRAY_SIZE(imx8ulp_arm64_mem_map)) {
490 if (gd->bd->bi_dram[i].start == 0)
492 imx8ulp_arm64_mem_map[entry].phys = gd->bd->bi_dram[i].start;
493 imx8ulp_arm64_mem_map[entry].virt = gd->bd->bi_dram[i].start;
494 imx8ulp_arm64_mem_map[entry].size = gd->bd->bi_dram[i].size;
495 imx8ulp_arm64_mem_map[entry].attrs = attrs;
496 debug("Added memory mapping (%d): %llx %llx\n", entry,
497 imx8ulp_arm64_mem_map[entry].phys, imx8ulp_arm64_mem_map[entry].size);
506 __weak int board_phys_sdram_size(phys_size_t *size)
511 *size = PHYS_SDRAM_SIZE;
517 unsigned int entry = imx8ulp_find_dram_entry_in_mem_map();
518 phys_size_t sdram_size;
521 ret = board_phys_sdram_size(&sdram_size);
525 /* rom_pointer[1] contains the size of TEE occupies */
527 gd->ram_size = sdram_size - rom_pointer[1];
529 gd->ram_size = sdram_size;
531 /* also update the SDRAM size in the mem_map used externally */
532 imx8ulp_arm64_mem_map[entry].size = sdram_size;
536 int dram_init_banksize(void)
540 phys_size_t sdram_size;
542 ret = board_phys_sdram_size(&sdram_size);
546 gd->bd->bi_dram[bank].start = PHYS_SDRAM;
547 if (rom_pointer[1]) {
548 phys_addr_t optee_start = (phys_addr_t)rom_pointer[0];
549 phys_size_t optee_size = (size_t)rom_pointer[1];
551 gd->bd->bi_dram[bank].size = optee_start - gd->bd->bi_dram[bank].start;
552 if ((optee_start + optee_size) < (PHYS_SDRAM + sdram_size)) {
553 if (++bank >= CONFIG_NR_DRAM_BANKS) {
554 puts("CONFIG_NR_DRAM_BANKS is not enough\n");
558 gd->bd->bi_dram[bank].start = optee_start + optee_size;
559 gd->bd->bi_dram[bank].size = PHYS_SDRAM +
560 sdram_size - gd->bd->bi_dram[bank].start;
563 gd->bd->bi_dram[bank].size = sdram_size;
569 phys_size_t get_effective_memsize(void)
571 /* return the first bank as effective memory */
573 return ((phys_addr_t)rom_pointer[0] - PHYS_SDRAM);
578 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
579 void get_board_serial(struct tag_serialnr *serialnr)
585 ret = ahab_read_common_fuse(1, uid, 4, &res);
587 printf("ahab read fuse failed %d, 0x%x\n", ret, res);
589 printf("UID 0x%x,0x%x,0x%x,0x%x\n", uid[0], uid[1], uid[2], uid[3]);
591 serialnr->low = uid[0];
592 serialnr->high = uid[3];
596 static void set_core0_reset_vector(u32 entry)
598 /* Update SIM1 DGO8 for reset vector base */
599 writel(entry, SIM1_BASE_ADDR + 0x5c);
602 setbits_le32(SIM1_BASE_ADDR + 0x8, 0x1 << 24);
604 /* polling the ack */
605 while ((readl(SIM1_BASE_ADDR + 0x8) & (0x1 << 26)) == 0)
608 /* clear the update */
609 clrbits_le32(SIM1_BASE_ADDR + 0x8, (0x1 << 24));
611 /* clear the ack by set 1 */
612 setbits_le32(SIM1_BASE_ADDR + 0x8, (0x1 << 26));
616 int trdc_set_access(void)
619 * TRDC mgr + 4 MBC + 2 MRC.
621 trdc_mbc_set_access(2, 7, 0, 49, true);
622 trdc_mbc_set_access(2, 7, 0, 50, true);
623 trdc_mbc_set_access(2, 7, 0, 51, true);
624 trdc_mbc_set_access(2, 7, 0, 52, true);
625 trdc_mbc_set_access(2, 7, 0, 53, true);
626 trdc_mbc_set_access(2, 7, 0, 54, true);
628 /* 0x1fff8000 used for resource table by remoteproc */
629 trdc_mbc_set_access(0, 7, 2, 31, false);
631 /* CGC0: PBridge0 slot 47 and PCC0 slot 48 */
632 trdc_mbc_set_access(2, 7, 0, 47, false);
633 trdc_mbc_set_access(2, 7, 0, 48, false);
636 trdc_mbc_set_access(2, 7, 1, 17, false);
637 trdc_mbc_set_access(2, 7, 1, 34, false);
639 /* Iomuxc0: : PBridge1 slot 33 */
640 trdc_mbc_set_access(2, 7, 1, 33, false);
643 trdc_mbc_set_access(2, 7, 0, 57, false);
644 trdc_mrc_region_set_access(0, 7, 0x04000000, 0x0c000000, false);
646 /* tpm0: PBridge1 slot 21 */
647 trdc_mbc_set_access(2, 7, 1, 21, false);
648 /* lpi2c0: PBridge1 slot 24 */
649 trdc_mbc_set_access(2, 7, 1, 24, false);
651 /* Allow M33 to access TRDC MGR */
652 trdc_mbc_set_access(2, 6, 0, 49, true);
653 trdc_mbc_set_access(2, 6, 0, 50, true);
654 trdc_mbc_set_access(2, 6, 0, 51, true);
655 trdc_mbc_set_access(2, 6, 0, 52, true);
656 trdc_mbc_set_access(2, 6, 0, 53, true);
657 trdc_mbc_set_access(2, 6, 0, 54, true);
659 /* Set SAI0 for eDMA 0, NS */
660 trdc_mbc_set_access(2, 0, 1, 28, false);
662 /* Set SSRAM for eDMA0 access */
663 trdc_mbc_set_access(0, 0, 2, 0, false);
664 trdc_mbc_set_access(0, 0, 2, 1, false);
665 trdc_mbc_set_access(0, 0, 2, 2, false);
666 trdc_mbc_set_access(0, 0, 2, 3, false);
667 trdc_mbc_set_access(0, 0, 2, 4, false);
668 trdc_mbc_set_access(0, 0, 2, 5, false);
669 trdc_mbc_set_access(0, 0, 2, 6, false);
670 trdc_mbc_set_access(0, 0, 2, 7, false);
672 writel(0x800000a0, 0x28031840);
677 void lpav_configure(bool lpav_to_m33)
680 setbits_le32(SIM_SEC_BASE_ADDR + 0x44, BIT(7)); /* LPAV to APD */
682 /* PXP/GPU 2D/3D/DCNANO/MIPI_DSI/EPDC/HIFI4 to APD */
683 setbits_le32(SIM_SEC_BASE_ADDR + 0x4c, 0x7F);
685 /* LPAV slave/dma2 ch allocation and request allocation to APD */
686 writel(0x1f, SIM_SEC_BASE_ADDR + 0x50);
687 writel(0xffffffff, SIM_SEC_BASE_ADDR + 0x54);
688 writel(0x003fffff, SIM_SEC_BASE_ADDR + 0x58);
691 void load_lposc_fuse(void)
694 u32 val = 0, val2 = 0, reg;
696 ret = fuse_read(25, 0, &val);
700 ret = fuse_read(25, 1, &val2);
705 reg = readl(0x2802f304);
708 writel(reg, 0x2802f304);
711 void set_lpav_qos(void)
713 /* Set read QoS of dcnano on LPAV NIC */
714 writel(0xf, 0x2e447100);
717 int arch_cpu_init(void)
719 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
720 /* Enable System Reset Interrupt using WDOG_AD */
721 setbits_le32(CMC1_BASE_ADDR + 0x8C, BIT(13));
722 /* Clear AD_PERIPH Power switch domain out of reset interrupt flag */
723 setbits_le32(CMC1_BASE_ADDR + 0x70, BIT(4));
725 if (readl(CMC1_BASE_ADDR + 0x90) & BIT(13)) {
726 /* Clear System Reset Interrupt Flag Register of WDOG_AD */
727 setbits_le32(CMC1_BASE_ADDR + 0x90, BIT(13));
728 /* Reset WDOG to clear reset request */
729 pcc_reset_peripheral(3, WDOG3_PCC3_SLOT, true);
730 pcc_reset_peripheral(3, WDOG3_PCC3_SLOT, false);
736 if (get_boot_mode() == SINGLE_BOOT)
737 lpav_configure(false);
739 lpav_configure(true);
741 /* Release xrdc, then allow A35 to write SRAM2 */
742 if (rdc_enabled_in_boot())
743 release_rdc(RDC_XRDC);
745 xrdc_mrc_region_set_access(2, CONFIG_SPL_TEXT_BASE, 0xE00);
749 spl_pass_boot_info();
752 /* reconfigure core0 reset vector to ROM */
753 set_core0_reset_vector(0x1000);
755 if (is_m33_handshake_necessary()) {
756 /* Start handshake with M33 to ensure TRDC configuration completed */
757 ret = m33_image_handshake(1000);
759 gd->arch.m33_handshake_done = true;
760 else /* Skip and go through to panic in checkcpu as console is ready then */
761 gd->arch.m33_handshake_done = false;
770 if (is_m33_handshake_necessary()) {
771 if (!gd->arch.m33_handshake_done) {
772 puts("M33 Sync: Timeout, Boot Stop!\n");
775 puts("M33 Sync: OK\n");
781 int imx8ulp_dm_post_init(void)
783 struct udevice *devp;
786 struct sentinel_get_info_data *info = (struct sentinel_get_info_data *)SRAM0_BASE;
788 ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(imx8ulp_mu), &devp);
790 printf("could not get S400 mu %d\n", ret);
794 ret = ahab_get_info(info, &res);
796 printf("ahab_get_info failed %d\n", ret);
797 /* fallback to A0.1 revision */
798 memset((void *)info, 0, sizeof(struct sentinel_get_info_data));
799 info->soc = 0xa000084d;
807 static int imx8ulp_evt_dm_post_init(void *ctx, struct event *event)
809 return imx8ulp_dm_post_init();
811 EVENT_SPY(EVT_DM_POST_INIT, imx8ulp_evt_dm_post_init);
813 #if defined(CONFIG_SPL_BUILD)
814 __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
816 debug("image entry point: 0x%lx\n", spl_image->entry_point);
818 set_core0_reset_vector((u32)spl_image->entry_point);
820 /* Enable the 512KB cache */
821 setbits_le32(SIM1_BASE_ADDR + 0x30, (0x1 << 4));
824 setbits_le32(SIM1_BASE_ADDR + 0x30, (0x1 << 16));
831 void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
836 ret = fuse_read(5, 3, &val[0]);
840 ret = fuse_read(5, 4, &val[1]);
845 mac[1] = val[0] >> 8;
846 mac[2] = val[0] >> 16;
847 mac[3] = val[0] >> 24;
849 mac[5] = val[1] >> 8;
851 debug("%s: MAC%d: %02x.%02x.%02x.%02x.%02x.%02x\n",
852 __func__, dev_id, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
856 printf("%s: fuse read err: %d\n", __func__, ret);
859 int (*card_emmc_is_boot_part_en)(void) = (void *)0x67cc;
860 u32 spl_arch_boot_image_offset(u32 image_offset, u32 rom_bt_dev)
862 /* Hard code for eMMC image_offset on 8ULP ROM, need fix by ROM, temp workaround */
863 if (is_soc_rev(CHIP_REV_1_0) && ((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_MMC &&
864 card_emmc_is_boot_part_en())
870 enum env_location env_get_location(enum env_operation op, int prio)
872 enum boot_device dev = get_boot_device();
873 enum env_location env_loc = ENVL_UNKNOWN;
879 #ifdef CONFIG_ENV_IS_IN_SPI_FLASH
881 env_loc = ENVL_SPI_FLASH;
884 #ifdef CONFIG_ENV_IS_IN_MMC
895 #if defined(CONFIG_ENV_IS_NOWHERE)
896 env_loc = ENVL_NOWHERE;