blob: 2348132bf751d3aa6d0ab19158ffe32ac9565346 [file] [log] [blame]
Peng Fan5c2218a2021-08-07 16:00:31 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2021 NXP
4 */
5
Peng Fan72530162021-08-07 16:00:33 +08006#include <asm/io.h>
7#include <asm/arch/clock.h>
8#include <asm/arch/imx-regs.h>
Peng Fan5c2218a2021-08-07 16:00:31 +08009#include <asm/arch/sys_proto.h>
Peng Fanb15705a2021-08-07 16:00:35 +080010#include <asm/armv8/mmu.h>
Peng Fan72530162021-08-07 16:00:33 +080011#include <asm/mach-imx/boot_mode.h>
Ye Li88044c72021-08-07 16:01:01 +080012#include <asm/global_data.h>
Ye Li6dd43022021-08-07 16:00:48 +080013#include <efi_loader.h>
14#include <spl.h>
Peng Fan9c87e462021-08-07 16:00:59 +080015#include <asm/arch/rdc.h>
Ye Li853cc9d2021-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 Li7bea5b02021-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 Li72012622021-10-29 09:46:15 +080026#include <fuse.h>
Peng Fan5c2218a2021-08-07 16:00:31 +080027
Peng Fanb15705a2021-08-07 16:00:35 +080028DECLARE_GLOBAL_DATA_PTR;
29
Ye Li7a71c612021-08-07 16:00:39 +080030struct rom_api *g_rom_api = (struct rom_api *)0x1980;
31
Ye Li88044c72021-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 Fan5c2218a2021-08-07 16:00:31 +0800115u32 get_cpu_rev(void)
116{
117 return (MXC_CPU_IMX8ULP << 12) | CHIP_REV_1_0;
118}
Peng Fan72530162021-08-07 16:00:33 +0800119
120enum bt_mode get_boot_mode(void)
121{
122 u32 bt0_cfg = 0;
123
Ye Li0e358052021-08-07 16:01:07 +0800124 bt0_cfg = readl(SIM_SEC_BASE_ADDR + 0x24);
Peng Fan72530162021-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 Fanaf4f3b32021-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 Fanaf4f3b32021-08-07 16:00:34 +0800153static char *get_reset_cause(char *ret)
154{
155 u32 cause1, cause = 0, srs = 0;
Peng Fanb15705a2021-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 Fanaf4f3b32021-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 Fan0d720e22021-08-07 16:01:06 +0800165 cause = srs & (CMC_SRS_POR | CMC_SRS_WUP | CMC_SRS_WARM);
Peng Fanaf4f3b32021-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 Fan0d720e22021-08-07 16:01:06 +0800175 cause = srs & (CMC_SRS_WDG | CMC_SRS_SW |
Peng Fanaf4f3b32021-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 Fan0d720e22021-08-07 16:01:06 +0800193 sprintf(ret, "%s-%X", "UNKN", srs);
Peng Fanaf4f3b32021-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 Fan72530162021-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
214 printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n",
215 get_imx_type((cpurev & 0xFF000) >> 12),
216 (cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0,
217 mxc_get_clock(MXC_ARM_CLK) / 1000000);
218
Peng Fanaf4f3b32021-08-07 16:00:34 +0800219 printf("Reset cause: %s\n", get_reset_cause(cause));
220
Peng Fan72530162021-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 Fanb15705a2021-08-07 16:00:35 +0800238
Peng Fanc84bc102021-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 Fanb15705a2021-08-07 16:00:35 +0800273void init_wdog(void)
274{
Peng Fanc84bc102021-08-07 16:00:49 +0800275 disable_wdog((void __iomem *)WDG3_RBASE);
Peng Fanb15705a2021-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 Riniae21e7f2021-08-30 09:16:29 -0400409#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Peng Fanb15705a2021-08-07 16:00:35 +0800410void get_board_serial(struct tag_serialnr *serialnr)
411{
Ye Li7bea5b02021-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 Fanb15705a2021-08-07 16:00:35 +0800424}
425#endif
426
Ye Li6ee435eb2021-08-07 16:00:50 +0800427static void set_core0_reset_vector(u32 entry)
Peng Fanb15705a2021-08-07 16:00:35 +0800428{
Ye Li6dd43022021-08-07 16:00:48 +0800429 /* Update SIM1 DGO8 for reset vector base */
Ye Li6ee435eb2021-08-07 16:00:50 +0800430 writel(entry, SIM1_BASE_ADDR + 0x5c);
Ye Li6dd43022021-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 Li6ee435eb2021-08-07 16:00:50 +0800444}
445
Peng Fan9c87e462021-08-07 16:00:59 +0800446static int trdc_set_access(void)
Peng Fanb5c41b12021-08-07 16:00:58 +0800447{
448 /*
Peng Fan9c87e462021-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 Fanb5c41b12021-08-07 16:00:58 +0800452 */
Peng Fan9c87e462021-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 Fanb5c41b12021-08-07 16:00:58 +0800459
Peng Fan9c87e462021-08-07 16:00:59 +0800460 /* CGC0: PBridge0 slot 47 */
461 trdc_mbc_set_access(2, 7, 0, 47, false);
Peng Fanb5c41b12021-08-07 16:00:58 +0800462
Peng Fan9c87e462021-08-07 16:00:59 +0800463 /* Iomuxc0: : PBridge1 slot 33 */
464 trdc_mbc_set_access(2, 7, 1, 33, false);
Peng Fanb5c41b12021-08-07 16:00:58 +0800465
Ye Lid325d372021-10-29 09:46:20 +0800466 /* flexspi0 */
467 trdc_mrc_region_set_access(0, 7, 0x04000000, 0x0c000000, false);
Ye Li27666ca2021-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 Fanb5c41b12021-08-07 16:00:58 +0800473 return 0;
474}
475
Ye Li43819eb2021-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 Fanfa609b42021-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 Li43819eb2021-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 Li715cfa02021-10-29 09:46:23 +0800488}
Ye Lia0311552021-10-29 09:46:22 +0800489
Ye Li715cfa02021-10-29 09:46:23 +0800490void set_lpav_qos(void)
491{
Ye Lia0311552021-10-29 09:46:22 +0800492 /* Set read QoS of dcnano on LPAV NIC */
493 writel(0xf, 0x2e447100);
Ye Li43819eb2021-10-29 09:46:16 +0800494}
495
Ye Li6ee435eb2021-08-07 16:00:50 +0800496int arch_cpu_init(void)
497{
498 if (IS_ENABLED(CONFIG_SPL_BUILD)) {
Ye Li72012622021-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 Li853cc9d2021-08-07 16:00:55 +0800503 /* Disable wdog */
504 init_wdog();
505
Ye Li72012622021-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 Fanb5c41b12021-08-07 16:00:58 +0800511 if (get_boot_mode() == SINGLE_BOOT) {
Ye Li72012622021-10-29 09:46:15 +0800512 if (rdc_en)
513 release_rdc(RDC_TRDC);
514
Peng Fanb5c41b12021-08-07 16:00:58 +0800515 trdc_set_access();
Ye Li43819eb2021-10-29 09:46:16 +0800516
517 lpav_configure();
Peng Fanb5c41b12021-08-07 16:00:58 +0800518 }
Peng Fanfa55b212021-08-07 16:00:57 +0800519
Ye Li72012622021-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 Li853cc9d2021-08-07 16:00:55 +0800524 xrdc_mrc_region_set_access(2, CONFIG_SPL_TEXT_BASE, 0xE00);
525
Ye Li6ee435eb2021-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 Li7bea5b02021-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 Li6ee435eb2021-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 Li6dd43022021-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 Fanfa6ae052021-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 Li479fd4a2021-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}