blob: d9dca21e8c74bdf70e06d8456df2a9a978632484 [file] [log] [blame]
Peng Fan331d40d2021-08-07 16:00:31 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2021 NXP
4 */
5
Peng Fan77c3b9c2021-08-07 16:00:33 +08006#include <asm/io.h>
7#include <asm/arch/clock.h>
8#include <asm/arch/imx-regs.h>
Peng Fan331d40d2021-08-07 16:00:31 +08009#include <asm/arch/sys_proto.h>
Peng Fan9ef89ea2021-08-07 16:00:35 +080010#include <asm/armv8/mmu.h>
Peng Fan77c3b9c2021-08-07 16:00:33 +080011#include <asm/mach-imx/boot_mode.h>
Ye Li619412a2021-08-07 16:01:01 +080012#include <asm/global_data.h>
Ye Li610083e2021-08-07 16:00:48 +080013#include <efi_loader.h>
14#include <spl.h>
Peng Fan3912d4b2021-08-07 16:00:59 +080015#include <asm/arch/rdc.h>
Ye Liba472a22021-08-07 16:00:55 +080016#include <asm/arch/s400_api.h>
17#include <asm/arch/mu_hal.h>
18#include <cpu_func.h>
19#include <asm/setup.h>
Ye Lia7990a82021-08-07 16:01:00 +080020#include <dm.h>
21#include <dm/device-internal.h>
22#include <dm/lists.h>
23#include <dm/uclass.h>
24#include <dm/device.h>
25#include <dm/uclass-internal.h>
Ye Li961ac782021-10-29 09:46:15 +080026#include <fuse.h>
Peng Fan331d40d2021-08-07 16:00:31 +080027
Peng Fan9ef89ea2021-08-07 16:00:35 +080028DECLARE_GLOBAL_DATA_PTR;
29
Ye Li6f3858d2021-08-07 16:00:39 +080030struct rom_api *g_rom_api = (struct rom_api *)0x1980;
31
Ye Li619412a2021-08-07 16:01:01 +080032enum boot_device get_boot_device(void)
33{
34 volatile gd_t *pgd = gd;
35 int ret;
36 u32 boot;
37 u16 boot_type;
38 u8 boot_instance;
39 enum boot_device boot_dev = SD1_BOOT;
40
41 ret = g_rom_api->query_boot_infor(QUERY_BT_DEV, &boot,
42 ((uintptr_t)&boot) ^ QUERY_BT_DEV);
43 set_gd(pgd);
44
45 if (ret != ROM_API_OKAY) {
46 puts("ROMAPI: failure at query_boot_info\n");
47 return -1;
48 }
49
50 boot_type = boot >> 16;
51 boot_instance = (boot >> 8) & 0xff;
52
53 switch (boot_type) {
54 case BT_DEV_TYPE_SD:
55 boot_dev = boot_instance + SD1_BOOT;
56 break;
57 case BT_DEV_TYPE_MMC:
58 boot_dev = boot_instance + MMC1_BOOT;
59 break;
60 case BT_DEV_TYPE_NAND:
61 boot_dev = NAND_BOOT;
62 break;
63 case BT_DEV_TYPE_FLEXSPINOR:
64 boot_dev = QSPI_BOOT;
65 break;
66 case BT_DEV_TYPE_USB:
67 boot_dev = USB_BOOT;
68 break;
69 default:
70 break;
71 }
72
73 return boot_dev;
74}
75
76bool is_usb_boot(void)
77{
78 return get_boot_device() == USB_BOOT;
79}
80
81#ifdef CONFIG_ENV_IS_IN_MMC
82__weak int board_mmc_get_env_dev(int devno)
83{
84 return devno;
85}
86
87int mmc_get_env_dev(void)
88{
89 volatile gd_t *pgd = gd;
90 int ret;
91 u32 boot;
92 u16 boot_type;
93 u8 boot_instance;
94
95 ret = g_rom_api->query_boot_infor(QUERY_BT_DEV, &boot,
96 ((uintptr_t)&boot) ^ QUERY_BT_DEV);
97 set_gd(pgd);
98
99 if (ret != ROM_API_OKAY) {
100 puts("ROMAPI: failure at query_boot_info\n");
101 return CONFIG_SYS_MMC_ENV_DEV;
102 }
103
104 boot_type = boot >> 16;
105 boot_instance = (boot >> 8) & 0xff;
106
107 /* If not boot from sd/mmc, use default value */
108 if (boot_type != BOOT_TYPE_SD && boot_type != BOOT_TYPE_MMC)
109 return env_get_ulong("mmcdev", 10, CONFIG_SYS_MMC_ENV_DEV);
110
111 return board_mmc_get_env_dev(boot_instance);
112}
113#endif
114
Peng Fan331d40d2021-08-07 16:00:31 +0800115u32 get_cpu_rev(void)
116{
117 return (MXC_CPU_IMX8ULP << 12) | CHIP_REV_1_0;
118}
Peng Fan77c3b9c2021-08-07 16:00:33 +0800119
120enum bt_mode get_boot_mode(void)
121{
122 u32 bt0_cfg = 0;
123
Ye Li27b6a452021-08-07 16:01:07 +0800124 bt0_cfg = readl(SIM_SEC_BASE_ADDR + 0x24);
Peng Fan77c3b9c2021-08-07 16:00:33 +0800125 bt0_cfg &= (BT0CFG_LPBOOT_MASK | BT0CFG_DUALBOOT_MASK);
126
127 if (!(bt0_cfg & BT0CFG_LPBOOT_MASK)) {
128 /* No low power boot */
129 if (bt0_cfg & BT0CFG_DUALBOOT_MASK)
130 return DUAL_BOOT;
131 else
132 return SINGLE_BOOT;
133 }
134
135 return LOW_POWER_BOOT;
136}
137
Peng Fanc17f5932021-08-07 16:00:34 +0800138#define CMC_SRS_TAMPER BIT(31)
139#define CMC_SRS_SECURITY BIT(30)
140#define CMC_SRS_TZWDG BIT(29)
141#define CMC_SRS_JTAG_RST BIT(28)
142#define CMC_SRS_CORE1 BIT(16)
143#define CMC_SRS_LOCKUP BIT(15)
144#define CMC_SRS_SW BIT(14)
145#define CMC_SRS_WDG BIT(13)
146#define CMC_SRS_PIN_RESET BIT(8)
147#define CMC_SRS_WARM BIT(4)
148#define CMC_SRS_HVD BIT(3)
149#define CMC_SRS_LVD BIT(2)
150#define CMC_SRS_POR BIT(1)
151#define CMC_SRS_WUP BIT(0)
152
Peng Fanc17f5932021-08-07 16:00:34 +0800153static char *get_reset_cause(char *ret)
154{
155 u32 cause1, cause = 0, srs = 0;
Peng Fan9ef89ea2021-08-07 16:00:35 +0800156 void __iomem *reg_ssrs = (void __iomem *)(CMC1_BASE_ADDR + 0x88);
157 void __iomem *reg_srs = (void __iomem *)(CMC1_BASE_ADDR + 0x80);
Peng Fanc17f5932021-08-07 16:00:34 +0800158
159 if (!ret)
160 return "null";
161
162 srs = readl(reg_srs);
163 cause1 = readl(reg_ssrs);
164
Peng Fan8a588972021-08-07 16:01:06 +0800165 cause = srs & (CMC_SRS_POR | CMC_SRS_WUP | CMC_SRS_WARM);
Peng Fanc17f5932021-08-07 16:00:34 +0800166
167 switch (cause) {
168 case CMC_SRS_POR:
169 sprintf(ret, "%s", "POR");
170 break;
171 case CMC_SRS_WUP:
172 sprintf(ret, "%s", "WUP");
173 break;
174 case CMC_SRS_WARM:
Peng Fan8a588972021-08-07 16:01:06 +0800175 cause = srs & (CMC_SRS_WDG | CMC_SRS_SW |
Peng Fanc17f5932021-08-07 16:00:34 +0800176 CMC_SRS_JTAG_RST);
177 switch (cause) {
178 case CMC_SRS_WDG:
179 sprintf(ret, "%s", "WARM-WDG");
180 break;
181 case CMC_SRS_SW:
182 sprintf(ret, "%s", "WARM-SW");
183 break;
184 case CMC_SRS_JTAG_RST:
185 sprintf(ret, "%s", "WARM-JTAG");
186 break;
187 default:
188 sprintf(ret, "%s", "WARM-UNKN");
189 break;
190 }
191 break;
192 default:
Peng Fan8a588972021-08-07 16:01:06 +0800193 sprintf(ret, "%s-%X", "UNKN", srs);
Peng Fanc17f5932021-08-07 16:00:34 +0800194 break;
195 }
196
197 debug("[%X] SRS[%X] %X - ", cause1, srs, srs ^ cause1);
198 return ret;
199}
200
Peng Fan77c3b9c2021-08-07 16:00:33 +0800201#if defined(CONFIG_DISPLAY_CPUINFO)
202const char *get_imx_type(u32 imxtype)
203{
204 return "8ULP";
205}
206
207int print_cpuinfo(void)
208{
209 u32 cpurev;
210 char cause[18];
211
212 cpurev = get_cpu_rev();
213
Ye Li112b4ca2021-10-29 09:46:24 +0800214 printf("CPU: i.MX%s rev%d.%d at %d MHz\n",
Peng Fan77c3b9c2021-08-07 16:00:33 +0800215 get_imx_type((cpurev & 0xFF000) >> 12),
216 (cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0,
217 mxc_get_clock(MXC_ARM_CLK) / 1000000);
218
Peng Fanc17f5932021-08-07 16:00:34 +0800219 printf("Reset cause: %s\n", get_reset_cause(cause));
220
Peng Fan77c3b9c2021-08-07 16:00:33 +0800221 printf("Boot mode: ");
222 switch (get_boot_mode()) {
223 case LOW_POWER_BOOT:
224 printf("Low power boot\n");
225 break;
226 case DUAL_BOOT:
227 printf("Dual boot\n");
228 break;
229 case SINGLE_BOOT:
230 default:
231 printf("Single boot\n");
232 break;
233 }
234
235 return 0;
236}
237#endif
Peng Fan9ef89ea2021-08-07 16:00:35 +0800238
Peng Fan3a01f722021-08-07 16:00:49 +0800239#define UNLOCK_WORD0 0xC520 /* 1st unlock word */
240#define UNLOCK_WORD1 0xD928 /* 2nd unlock word */
241#define REFRESH_WORD0 0xA602 /* 1st refresh word */
242#define REFRESH_WORD1 0xB480 /* 2nd refresh word */
243
244static void disable_wdog(void __iomem *wdog_base)
245{
246 u32 val_cs = readl(wdog_base + 0x00);
247
248 if (!(val_cs & 0x80))
249 return;
250
251 dmb();
252 __raw_writel(REFRESH_WORD0, (wdog_base + 0x04)); /* Refresh the CNT */
253 __raw_writel(REFRESH_WORD1, (wdog_base + 0x04));
254 dmb();
255
256 if (!(val_cs & 800)) {
257 dmb();
258 __raw_writel(UNLOCK_WORD0, (wdog_base + 0x04));
259 __raw_writel(UNLOCK_WORD1, (wdog_base + 0x04));
260 dmb();
261
262 while (!(readl(wdog_base + 0x00) & 0x800))
263 ;
264 }
265 writel(0x0, (wdog_base + 0x0C)); /* Set WIN to 0 */
266 writel(0x400, (wdog_base + 0x08)); /* Set timeout to default 0x400 */
267 writel(0x120, (wdog_base + 0x00)); /* Disable it and set update */
268
269 while (!(readl(wdog_base + 0x00) & 0x400))
270 ;
271}
272
Peng Fan9ef89ea2021-08-07 16:00:35 +0800273void init_wdog(void)
274{
Peng Fan3a01f722021-08-07 16:00:49 +0800275 disable_wdog((void __iomem *)WDG3_RBASE);
Peng Fan9ef89ea2021-08-07 16:00:35 +0800276}
277
278static struct mm_region imx8ulp_arm64_mem_map[] = {
279 {
280 /* ROM */
281 .virt = 0x0,
282 .phys = 0x0,
283 .size = 0x40000UL,
284 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
285 PTE_BLOCK_OUTER_SHARE
286 },
287 {
288 /* FLEXSPI0 */
289 .virt = 0x04000000,
290 .phys = 0x04000000,
291 .size = 0x08000000UL,
292 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
293 PTE_BLOCK_NON_SHARE |
294 PTE_BLOCK_PXN | PTE_BLOCK_UXN
295 },
296 {
297 /* SSRAM (align with 2M) */
298 .virt = 0x1FE00000UL,
299 .phys = 0x1FE00000UL,
300 .size = 0x400000UL,
301 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
302 PTE_BLOCK_OUTER_SHARE |
303 PTE_BLOCK_PXN | PTE_BLOCK_UXN
304 }, {
305 /* SRAM1 (align with 2M) */
306 .virt = 0x21000000UL,
307 .phys = 0x21000000UL,
308 .size = 0x200000UL,
309 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
310 PTE_BLOCK_OUTER_SHARE |
311 PTE_BLOCK_PXN | PTE_BLOCK_UXN
312 }, {
313 /* SRAM0 (align with 2M) */
314 .virt = 0x22000000UL,
315 .phys = 0x22000000UL,
316 .size = 0x200000UL,
317 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
318 PTE_BLOCK_OUTER_SHARE |
319 PTE_BLOCK_PXN | PTE_BLOCK_UXN
320 }, {
321 /* Peripherals */
322 .virt = 0x27000000UL,
323 .phys = 0x27000000UL,
324 .size = 0x3000000UL,
325 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
326 PTE_BLOCK_NON_SHARE |
327 PTE_BLOCK_PXN | PTE_BLOCK_UXN
328 }, {
329 /* Peripherals */
330 .virt = 0x2D000000UL,
331 .phys = 0x2D000000UL,
332 .size = 0x1600000UL,
333 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
334 PTE_BLOCK_NON_SHARE |
335 PTE_BLOCK_PXN | PTE_BLOCK_UXN
336 }, {
337 /* FLEXSPI1-2 */
338 .virt = 0x40000000UL,
339 .phys = 0x40000000UL,
340 .size = 0x40000000UL,
341 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
342 PTE_BLOCK_NON_SHARE |
343 PTE_BLOCK_PXN | PTE_BLOCK_UXN
344 }, {
345 /* DRAM1 */
346 .virt = 0x80000000UL,
347 .phys = 0x80000000UL,
348 .size = PHYS_SDRAM_SIZE,
349 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
350 PTE_BLOCK_OUTER_SHARE
351 }, {
352 /*
353 * empty entrie to split table entry 5
354 * if needed when TEEs are used
355 */
356 0,
357 }, {
358 /* List terminator */
359 0,
360 }
361};
362
363struct mm_region *mem_map = imx8ulp_arm64_mem_map;
364
365/* simplify the page table size to enhance boot speed */
366#define MAX_PTE_ENTRIES 512
367#define MAX_MEM_MAP_REGIONS 16
368u64 get_page_table_size(void)
369{
370 u64 one_pt = MAX_PTE_ENTRIES * sizeof(u64);
371 u64 size = 0;
372
373 /*
374 * For each memory region, the max table size:
375 * 2 level 3 tables + 2 level 2 tables + 1 level 1 table
376 */
377 size = (2 + 2 + 1) * one_pt * MAX_MEM_MAP_REGIONS + one_pt;
378
379 /*
380 * We need to duplicate our page table once to have an emergency pt to
381 * resort to when splitting page tables later on
382 */
383 size *= 2;
384
385 /*
386 * We may need to split page tables later on if dcache settings change,
387 * so reserve up to 4 (random pick) page tables for that.
388 */
389 size += one_pt * 4;
390
391 return size;
392}
393
394void enable_caches(void)
395{
396 /* TODO: add TEE memmap region */
397
398 icache_enable();
399 dcache_enable();
400}
401
402int dram_init(void)
403{
404 gd->ram_size = PHYS_SDRAM_SIZE;
405
406 return 0;
407}
408
Tom Rinib9d66a02021-08-30 09:16:29 -0400409#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Peng Fan9ef89ea2021-08-07 16:00:35 +0800410void get_board_serial(struct tag_serialnr *serialnr)
411{
Ye Lia7990a82021-08-07 16:01:00 +0800412 u32 uid[4];
413 u32 res;
414 int ret;
415
416 ret = ahab_read_common_fuse(1, uid, 4, &res);
417 if (ret)
418 printf("ahab read fuse failed %d, 0x%x\n", ret, res);
419 else
420 printf("UID 0x%x,0x%x,0x%x,0x%x\n", uid[0], uid[1], uid[2], uid[3]);
421
422 serialnr->low = uid[0];
423 serialnr->high = uid[3];
Peng Fan9ef89ea2021-08-07 16:00:35 +0800424}
425#endif
426
Ye Liaadd6ca2021-08-07 16:00:50 +0800427static void set_core0_reset_vector(u32 entry)
Peng Fan9ef89ea2021-08-07 16:00:35 +0800428{
Ye Li610083e2021-08-07 16:00:48 +0800429 /* Update SIM1 DGO8 for reset vector base */
Ye Liaadd6ca2021-08-07 16:00:50 +0800430 writel(entry, SIM1_BASE_ADDR + 0x5c);
Ye Li610083e2021-08-07 16:00:48 +0800431
432 /* set update bit */
433 setbits_le32(SIM1_BASE_ADDR + 0x8, 0x1 << 24);
434
435 /* polling the ack */
436 while ((readl(SIM1_BASE_ADDR + 0x8) & (0x1 << 26)) == 0)
437 ;
438
439 /* clear the update */
440 clrbits_le32(SIM1_BASE_ADDR + 0x8, (0x1 << 24));
441
442 /* clear the ack by set 1 */
443 setbits_le32(SIM1_BASE_ADDR + 0x8, (0x1 << 26));
Ye Liaadd6ca2021-08-07 16:00:50 +0800444}
445
Peng Fan3912d4b2021-08-07 16:00:59 +0800446static int trdc_set_access(void)
Peng Fana443ec22021-08-07 16:00:58 +0800447{
448 /*
Peng Fan3912d4b2021-08-07 16:00:59 +0800449 * TRDC mgr + 4 MBC + 2 MRC.
450 * S400 should already configure when release RDC
451 * A35 only map non-secure region for pbridge0 and 1, set sec_access to false
Peng Fana443ec22021-08-07 16:00:58 +0800452 */
Peng Fan3912d4b2021-08-07 16:00:59 +0800453 trdc_mbc_set_access(2, 7, 0, 49, false);
454 trdc_mbc_set_access(2, 7, 0, 50, false);
455 trdc_mbc_set_access(2, 7, 0, 51, false);
456 trdc_mbc_set_access(2, 7, 0, 52, false);
457 trdc_mbc_set_access(2, 7, 0, 53, false);
458 trdc_mbc_set_access(2, 7, 0, 54, false);
Peng Fana443ec22021-08-07 16:00:58 +0800459
Peng Fan3912d4b2021-08-07 16:00:59 +0800460 /* CGC0: PBridge0 slot 47 */
461 trdc_mbc_set_access(2, 7, 0, 47, false);
Peng Fana443ec22021-08-07 16:00:58 +0800462
Peng Fan3912d4b2021-08-07 16:00:59 +0800463 /* Iomuxc0: : PBridge1 slot 33 */
464 trdc_mbc_set_access(2, 7, 1, 33, false);
Peng Fana443ec22021-08-07 16:00:58 +0800465
Ye Li608ed202021-10-29 09:46:20 +0800466 /* flexspi0 */
467 trdc_mrc_region_set_access(0, 7, 0x04000000, 0x0c000000, false);
Ye Li9dde3902021-10-29 09:46:21 +0800468
469 /* tpm0: PBridge1 slot 21 */
470 trdc_mbc_set_access(2, 7, 1, 21, false);
471 /* lpi2c0: PBridge1 slot 24 */
472 trdc_mbc_set_access(2, 7, 1, 24, false);
Peng Fana443ec22021-08-07 16:00:58 +0800473 return 0;
474}
475
Ye Lid563d292021-10-29 09:46:16 +0800476void lpav_configure(void)
477{
478 /* LPAV to APD */
479 setbits_le32(SIM_SEC_BASE_ADDR + 0x44, BIT(7));
480
Peng Fan99de1682021-10-29 09:46:17 +0800481 /* PXP/GPU 2D/3D/DCNANO/MIPI_DSI/EPDC/HIFI4 to APD */
482 setbits_le32(SIM_SEC_BASE_ADDR + 0x4c, 0x7F);
Ye Lid563d292021-10-29 09:46:16 +0800483
484 /* LPAV slave/dma2 ch allocation and request allocation to APD */
485 writel(0x1f, SIM_SEC_BASE_ADDR + 0x50);
486 writel(0xffffffff, SIM_SEC_BASE_ADDR + 0x54);
487 writel(0x003fffff, SIM_SEC_BASE_ADDR + 0x58);
Ye Libd8b6732021-10-29 09:46:23 +0800488}
Ye Li16062f92021-10-29 09:46:22 +0800489
Ye Libd8b6732021-10-29 09:46:23 +0800490void set_lpav_qos(void)
491{
Ye Li16062f92021-10-29 09:46:22 +0800492 /* Set read QoS of dcnano on LPAV NIC */
493 writel(0xf, 0x2e447100);
Ye Lid563d292021-10-29 09:46:16 +0800494}
495
Ye Liaadd6ca2021-08-07 16:00:50 +0800496int arch_cpu_init(void)
497{
498 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
Ye Li961ac782021-10-29 09:46:15 +0800499 u32 val = 0;
500 int ret;
501 bool rdc_en = true; /* Default assume DBD_EN is set */
502
Ye Liba472a22021-08-07 16:00:55 +0800503 /* Disable wdog */
504 init_wdog();
505
Ye Li961ac782021-10-29 09:46:15 +0800506 /* Read DBD_EN fuse */
507 ret = fuse_read(8, 1, &val);
508 if (!ret)
509 rdc_en = !!(val & 0x4000);
510
Peng Fana443ec22021-08-07 16:00:58 +0800511 if (get_boot_mode() == SINGLE_BOOT) {
Ye Li961ac782021-10-29 09:46:15 +0800512 if (rdc_en)
513 release_rdc(RDC_TRDC);
514
Peng Fana443ec22021-08-07 16:00:58 +0800515 trdc_set_access();
Ye Lid563d292021-10-29 09:46:16 +0800516
517 lpav_configure();
Peng Fana443ec22021-08-07 16:00:58 +0800518 }
Peng Fan3df56492021-08-07 16:00:57 +0800519
Ye Li961ac782021-10-29 09:46:15 +0800520 /* Release xrdc, then allow A35 to write SRAM2 */
521 if (rdc_en)
522 release_rdc(RDC_XRDC);
523
Ye Liba472a22021-08-07 16:00:55 +0800524 xrdc_mrc_region_set_access(2, CONFIG_SPL_TEXT_BASE, 0xE00);
525
Ye Liaadd6ca2021-08-07 16:00:50 +0800526 clock_init();
527 } else {
528 /* reconfigure core0 reset vector to ROM */
529 set_core0_reset_vector(0x1000);
530 }
531
532 return 0;
533}
534
Ye Lia7990a82021-08-07 16:01:00 +0800535int arch_cpu_init_dm(void)
536{
537 struct udevice *devp;
538 int node, ret;
539
540 node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "fsl,imx8ulp-mu");
541
542 ret = uclass_get_device_by_of_offset(UCLASS_MISC, node, &devp);
543 if (ret) {
544 printf("could not get S400 mu %d\n", ret);
545 return ret;
546 }
547
548 return 0;
549}
550
Ye Liaadd6ca2021-08-07 16:00:50 +0800551#if defined(CONFIG_SPL_BUILD)
552__weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
553{
554 debug("image entry point: 0x%lx\n", spl_image->entry_point);
555
556 set_core0_reset_vector((u32)spl_image->entry_point);
Ye Li610083e2021-08-07 16:00:48 +0800557
558 /* Enable the 512KB cache */
559 setbits_le32(SIM1_BASE_ADDR + 0x30, (0x1 << 4));
560
561 /* reset core */
562 setbits_le32(SIM1_BASE_ADDR + 0x30, (0x1 << 16));
563
564 while (1)
565 ;
566}
567#endif
Peng Fan525a28c2021-08-07 16:01:03 +0800568
569void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
570{
571 memset(mac, 0, 6);
572}
Ye Lie8b68042021-08-07 16:01:08 +0800573
574int (*card_emmc_is_boot_part_en)(void) = (void *)0x67cc;
575u32 spl_arch_boot_image_offset(u32 image_offset, u32 rom_bt_dev)
576{
577 /* Hard code for eMMC image_offset on 8ULP ROM, need fix by ROM, temp workaround */
578 if (((rom_bt_dev >> 16) & 0xff) == BT_DEV_TYPE_MMC && card_emmc_is_boot_part_en())
579 image_offset = 0;
580
581 return image_offset;
582}