]> Git Repo - J-u-boot.git/blob - common/board_r.c
Merge branch '2023-09-14-remove-NEEDS_MANUAL_RELOC' into next
[J-u-boot.git] / common / board_r.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (c) 2011 The Chromium OS Authors.
4  * (C) Copyright 2002-2006
5  * Wolfgang Denk, DENX Software Engineering, [email protected].
6  *
7  * (C) Copyright 2002
8  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
9  * Marius Groeger <[email protected]>
10  */
11
12 #include <common.h>
13 #include <api.h>
14 #include <bootstage.h>
15 #include <cpu_func.h>
16 #include <cyclic.h>
17 #include <display_options.h>
18 #include <exports.h>
19 #ifdef CONFIG_MTD_NOR_FLASH
20 #include <flash.h>
21 #endif
22 #include <hang.h>
23 #include <image.h>
24 #include <irq_func.h>
25 #include <log.h>
26 #include <net.h>
27 #include <asm/cache.h>
28 #include <asm/global_data.h>
29 #include <u-boot/crc.h>
30 #include <binman.h>
31 #include <command.h>
32 #include <console.h>
33 #include <dm.h>
34 #include <env.h>
35 #include <env_internal.h>
36 #include <fdtdec.h>
37 #include <ide.h>
38 #include <init.h>
39 #include <initcall.h>
40 #include <kgdb.h>
41 #include <irq_func.h>
42 #include <malloc.h>
43 #include <mapmem.h>
44 #include <miiphy.h>
45 #include <mmc.h>
46 #include <mux.h>
47 #include <nand.h>
48 #include <of_live.h>
49 #include <onenand_uboot.h>
50 #include <pvblock.h>
51 #include <scsi.h>
52 #include <serial.h>
53 #include <status_led.h>
54 #include <stdio_dev.h>
55 #include <timer.h>
56 #include <trace.h>
57 #include <watchdog.h>
58 #include <xen.h>
59 #include <asm/sections.h>
60 #include <dm/root.h>
61 #include <dm/ofnode.h>
62 #include <linux/compiler.h>
63 #include <linux/err.h>
64 #include <efi_loader.h>
65 #include <wdt.h>
66 #include <asm-generic/gpio.h>
67 #include <efi_loader.h>
68 #include <relocate.h>
69
70 DECLARE_GLOBAL_DATA_PTR;
71
72 ulong monitor_flash_len;
73
74 __weak int board_flash_wp_on(void)
75 {
76         /*
77          * Most flashes can't be detected when write protection is enabled,
78          * so provide a way to let U-Boot gracefully ignore write protected
79          * devices.
80          */
81         return 0;
82 }
83
84 __weak int cpu_secondary_init_r(void)
85 {
86         return 0;
87 }
88
89 static int initr_trace(void)
90 {
91 #ifdef CONFIG_TRACE
92         trace_init(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE);
93 #endif
94
95         return 0;
96 }
97
98 static int initr_reloc(void)
99 {
100         /* tell others: relocation done */
101         gd->flags |= GD_FLG_RELOC | GD_FLG_FULL_MALLOC_INIT;
102
103         return 0;
104 }
105
106 #if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
107 /*
108  * Some of these functions are needed purely because the functions they
109  * call return void. If we change them to return 0, these stubs can go away.
110  */
111 static int initr_caches(void)
112 {
113         /* Enable caches */
114         enable_caches();
115         return 0;
116 }
117 #endif
118
119 __weak int fixup_cpu(void)
120 {
121         return 0;
122 }
123
124 static int initr_reloc_global_data(void)
125 {
126 #ifdef __ARM__
127         monitor_flash_len = _end - __image_copy_start;
128 #elif defined(CONFIG_RISCV)
129         monitor_flash_len = (ulong)_end - (ulong)_start;
130 #elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2)
131         monitor_flash_len = (ulong)__init_end - gd->relocaddr;
132 #endif
133 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
134         /*
135          * The gd->cpu pointer is set to an address in flash before relocation.
136          * We need to update it to point to the same CPU entry in RAM.
137          * TODO: why not just add gd->reloc_ofs?
138          */
139         gd->arch.cpu += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
140
141         /*
142          * If we didn't know the cpu mask & # cores, we can save them of
143          * now rather than 'computing' them constantly
144          */
145         fixup_cpu();
146 #endif
147 #ifdef CONFIG_SYS_RELOC_GD_ENV_ADDR
148         /*
149          * Relocate the early env_addr pointer unless we know it is not inside
150          * the binary. Some systems need this and for the rest, it doesn't hurt.
151          */
152         gd->env_addr += gd->reloc_off;
153 #endif
154 #ifdef CONFIG_EFI_LOADER
155         /*
156          * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
157          * As this register may be overwritten by an EFI payload we save it here
158          * and restore it on every callback entered.
159          */
160         efi_save_gd();
161
162         efi_runtime_relocate(gd->relocaddr, NULL);
163 #endif
164
165         return 0;
166 }
167
168 __weak int arch_initr_trap(void)
169 {
170         return 0;
171 }
172
173 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
174 static int initr_unlock_ram_in_cache(void)
175 {
176         unlock_ram_in_cache();  /* it's time to unlock D-cache in e500 */
177         return 0;
178 }
179 #endif
180
181 static int initr_barrier(void)
182 {
183 #ifdef CONFIG_PPC
184         /* TODO: Can we not use dmb() macros for this? */
185         asm("sync ; isync");
186 #endif
187         return 0;
188 }
189
190 static int initr_malloc(void)
191 {
192         ulong start;
193
194 #if CONFIG_VAL(SYS_MALLOC_F_LEN)
195         debug("Pre-reloc malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
196               gd->malloc_ptr / 1024);
197 #endif
198         /* The malloc area is immediately below the monitor copy in DRAM */
199         /*
200          * This value MUST match the value of gd->start_addr_sp in board_f.c:
201          * reserve_noncached().
202          */
203         start = gd->relocaddr - TOTAL_MALLOC_LEN;
204         gd_set_malloc_start(start);
205         mem_malloc_init((ulong)map_sysmem(start, TOTAL_MALLOC_LEN),
206                         TOTAL_MALLOC_LEN);
207         return 0;
208 }
209
210 static int initr_of_live(void)
211 {
212         if (CONFIG_IS_ENABLED(OF_LIVE)) {
213                 int ret;
214
215                 bootstage_start(BOOTSTAGE_ID_ACCUM_OF_LIVE, "of_live");
216                 ret = of_live_build(gd->fdt_blob,
217                                     (struct device_node **)gd_of_root_ptr());
218                 bootstage_accum(BOOTSTAGE_ID_ACCUM_OF_LIVE);
219                 if (ret)
220                         return ret;
221         }
222
223         return 0;
224 }
225
226 #ifdef CONFIG_DM
227 static int initr_dm(void)
228 {
229         int ret;
230
231         oftree_reset();
232
233         /* Save the pre-reloc driver model and start a new one */
234         gd->dm_root_f = gd->dm_root;
235         gd->dm_root = NULL;
236 #ifdef CONFIG_TIMER
237         gd->timer = NULL;
238 #endif
239         bootstage_start(BOOTSTAGE_ID_ACCUM_DM_R, "dm_r");
240         ret = dm_init_and_scan(false);
241         bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_R);
242         if (ret)
243                 return ret;
244
245         return 0;
246 }
247 #endif
248
249 static int initr_dm_devices(void)
250 {
251         int ret;
252
253         if (IS_ENABLED(CONFIG_TIMER_EARLY)) {
254                 ret = dm_timer_init();
255                 if (ret)
256                         return ret;
257         }
258
259         if (IS_ENABLED(CONFIG_MULTIPLEXER)) {
260                 /*
261                  * Initialize the multiplexer controls to their default state.
262                  * This must be done early as other drivers may unknowingly
263                  * rely on it.
264                  */
265                 ret = dm_mux_init();
266                 if (ret)
267                         return ret;
268         }
269
270         return 0;
271 }
272
273 static int initr_bootstage(void)
274 {
275         bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
276
277         return 0;
278 }
279
280 __weak int power_init_board(void)
281 {
282         return 0;
283 }
284
285 static int initr_announce(void)
286 {
287         debug("Now running in RAM - U-Boot at: %08lx\n", gd->relocaddr);
288         return 0;
289 }
290
291 static int initr_binman(void)
292 {
293         int ret;
294
295         if (!CONFIG_IS_ENABLED(BINMAN_FDT))
296                 return 0;
297
298         ret = binman_init();
299         if (ret)
300                 printf("binman_init failed:%d\n", ret);
301
302         return ret;
303 }
304
305 #if defined(CONFIG_MTD_NOR_FLASH)
306 __weak int is_flash_available(void)
307 {
308         return 1;
309 }
310
311 static int initr_flash(void)
312 {
313         ulong flash_size = 0;
314         struct bd_info *bd = gd->bd;
315
316         if (!is_flash_available())
317                 return 0;
318
319         puts("Flash: ");
320
321         if (board_flash_wp_on())
322                 printf("Uninitialized - Write Protect On\n");
323         else
324                 flash_size = flash_init();
325
326         print_size(flash_size, "");
327 #ifdef CONFIG_SYS_FLASH_CHECKSUM
328         /*
329          * Compute and print flash CRC if flashchecksum is set to 'y'
330          *
331          * NOTE: Maybe we should add some schedule()? XXX
332          */
333         if (env_get_yesno("flashchecksum") == 1) {
334                 const uchar *flash_base = (const uchar *)CFG_SYS_FLASH_BASE;
335
336                 printf("  CRC: %08X", crc32(0,
337                                             flash_base,
338                                             flash_size));
339         }
340 #endif /* CONFIG_SYS_FLASH_CHECKSUM */
341         putc('\n');
342
343         /* update start of FLASH memory    */
344 #ifdef CFG_SYS_FLASH_BASE
345         bd->bi_flashstart = CFG_SYS_FLASH_BASE;
346 #endif
347         /* size of FLASH memory (final value) */
348         bd->bi_flashsize = flash_size;
349
350 #if defined(CONFIG_SYS_UPDATE_FLASH_SIZE)
351         /* Make a update of the Memctrl. */
352         update_flash_size(flash_size);
353 #endif
354
355 #if defined(CONFIG_OXC) || defined(CONFIG_RMU)
356         /* flash mapped at end of memory map */
357         bd->bi_flashoffset = CONFIG_TEXT_BASE + flash_size;
358 #elif CONFIG_SYS_MONITOR_BASE == CFG_SYS_FLASH_BASE
359         bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */
360 #endif
361         return 0;
362 }
363 #endif
364
365 #ifdef CONFIG_CMD_NAND
366 /* go init the NAND */
367 static int initr_nand(void)
368 {
369         puts("NAND:  ");
370         nand_init();
371         printf("%lu MiB\n", nand_size() / 1024);
372         return 0;
373 }
374 #endif
375
376 #if defined(CONFIG_CMD_ONENAND)
377 /* go init the NAND */
378 static int initr_onenand(void)
379 {
380         puts("NAND:  ");
381         onenand_init();
382         return 0;
383 }
384 #endif
385
386 #ifdef CONFIG_MMC
387 static int initr_mmc(void)
388 {
389         puts("MMC:   ");
390         mmc_initialize(gd->bd);
391         return 0;
392 }
393 #endif
394
395 #ifdef CONFIG_PVBLOCK
396 static int initr_pvblock(void)
397 {
398         puts("PVBLOCK: ");
399         pvblock_init();
400         return 0;
401 }
402 #endif
403
404 /*
405  * Tell if it's OK to load the environment early in boot.
406  *
407  * If CONFIG_OF_CONTROL is defined, we'll check with the FDT to see
408  * if this is OK (defaulting to saying it's OK).
409  *
410  * NOTE: Loading the environment early can be a bad idea if security is
411  *       important, since no verification is done on the environment.
412  *
413  * Return: 0 if environment should not be loaded, !=0 if it is ok to load
414  */
415 static int should_load_env(void)
416 {
417         if (IS_ENABLED(CONFIG_OF_CONTROL))
418                 return ofnode_conf_read_int("load-environment", 1);
419
420         if (IS_ENABLED(CONFIG_DELAY_ENVIRONMENT))
421                 return 0;
422
423         return 1;
424 }
425
426 static int initr_env(void)
427 {
428         /* initialize environment */
429         if (should_load_env())
430                 env_relocate();
431         else
432                 env_set_default(NULL, 0);
433
434         env_import_fdt();
435
436         if (IS_ENABLED(CONFIG_OF_CONTROL))
437                 env_set_hex("fdtcontroladdr",
438                             (unsigned long)map_to_sysmem(gd->fdt_blob));
439
440         #if (IS_ENABLED(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) || \
441                                                 IS_ENABLED(CONFIG_SAVE_PREV_BL_FDT_ADDR))
442                 save_prev_bl_data();
443         #endif
444
445         /* Initialize from environment */
446         image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);
447
448         return 0;
449 }
450
451 #ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
452 static int initr_malloc_bootparams(void)
453 {
454         gd->bd->bi_boot_params = (ulong)malloc(CONFIG_SYS_BOOTPARAMS_LEN);
455         if (!gd->bd->bi_boot_params) {
456                 puts("WARNING: Cannot allocate space for boot parameters\n");
457                 return -ENOMEM;
458         }
459         return 0;
460 }
461 #endif
462
463 #if defined(CONFIG_LED_STATUS)
464 static int initr_status_led(void)
465 {
466 #if defined(CONFIG_LED_STATUS_BOOT)
467         status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING);
468 #else
469         status_led_init();
470 #endif
471         return 0;
472 }
473 #endif
474
475 #if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI)
476 static int initr_scsi(void)
477 {
478         puts("SCSI:  ");
479         scsi_init();
480         puts("\n");
481
482         return 0;
483 }
484 #endif
485
486 #ifdef CONFIG_CMD_NET
487 static int initr_net(void)
488 {
489         puts("Net:   ");
490         eth_initialize();
491 #if defined(CONFIG_RESET_PHY_R)
492         debug("Reset Ethernet PHY\n");
493         reset_phy();
494 #endif
495         return 0;
496 }
497 #endif
498
499 #ifdef CONFIG_POST
500 static int initr_post(void)
501 {
502         post_run(NULL, POST_RAM | post_bootmode_get(0));
503         return 0;
504 }
505 #endif
506
507 #if defined(CFG_PRAM)
508 /*
509  * Export available size of memory for Linux, taking into account the
510  * protected RAM at top of memory
511  */
512 int initr_mem(void)
513 {
514         ulong pram = 0;
515         char memsz[32];
516
517         pram = env_get_ulong("pram", 10, CFG_PRAM);
518         sprintf(memsz, "%ldk", (long int)((gd->ram_size / 1024) - pram));
519         env_set("mem", memsz);
520
521         return 0;
522 }
523 #endif
524
525 static int dm_announce(void)
526 {
527         int device_count;
528         int uclass_count;
529
530         if (IS_ENABLED(CONFIG_DM)) {
531                 dm_get_stats(&device_count, &uclass_count);
532                 printf("Core:  %d devices, %d uclasses", device_count,
533                        uclass_count);
534                 if (CONFIG_IS_ENABLED(OF_REAL))
535                         printf(", devicetree: %s", fdtdec_get_srcname());
536                 printf("\n");
537                 if (IS_ENABLED(CONFIG_OF_HAS_PRIOR_STAGE) &&
538                     (gd->fdt_src == FDTSRC_SEPARATE ||
539                      gd->fdt_src == FDTSRC_EMBED)) {
540                         printf("Warning: Unexpected devicetree source (not from a prior stage)");
541                         printf("Warning: U-Boot may not function properly\n");
542                 }
543                 if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE) &&
544                     (gd->flags & GD_FLG_OF_TAG_MIGRATE))
545                         /*
546                          * U-Boot will silently fail to work after 2023.07 if
547                          * there are old tags present
548                          */
549                         printf("Warning: Device tree includes old 'u-boot,dm-' tags: please fix by 2023.07!\n");
550         }
551
552         return 0;
553 }
554
555 static int run_main_loop(void)
556 {
557 #ifdef CONFIG_SANDBOX
558         sandbox_main_loop_init();
559 #endif
560
561         event_notify_null(EVT_MAIN_LOOP);
562
563         /* main_loop() can return to retry autoboot, if so just run it again */
564         for (;;)
565                 main_loop();
566         return 0;
567 }
568
569 /*
570  * Over time we hope to remove these functions with code fragments and
571  * stub functions, and instead call the relevant function directly.
572  *
573  * We also hope to remove most of the driver-related init and do it if/when
574  * the driver is later used.
575  *
576  * TODO: perhaps reset the watchdog in the initcall function after each call?
577  */
578 static init_fnc_t init_sequence_r[] = {
579         initr_trace,
580         initr_reloc,
581         event_init,
582         /* TODO: could x86/PPC have this also perhaps? */
583 #if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
584         initr_caches,
585         /* Note: For Freescale LS2 SoCs, new MMU table is created in DDR.
586          *       A temporary mapping of IFC high region is since removed,
587          *       so environmental variables in NOR flash is not available
588          *       until board_init() is called below to remap IFC to high
589          *       region.
590          */
591 #endif
592         initr_reloc_global_data,
593 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
594         initr_unlock_ram_in_cache,
595 #endif
596         initr_barrier,
597         initr_malloc,
598         log_init,
599         initr_bootstage,        /* Needs malloc() but has its own timer */
600 #if defined(CONFIG_CONSOLE_RECORD)
601         console_record_init,
602 #endif
603 #ifdef CONFIG_SYS_NONCACHED_MEMORY
604         noncached_init,
605 #endif
606         initr_of_live,
607 #ifdef CONFIG_DM
608         initr_dm,
609 #endif
610 #ifdef CONFIG_ADDR_MAP
611         init_addr_map,
612 #endif
613 #if defined(CONFIG_ARM) || defined(CONFIG_RISCV) || defined(CONFIG_SANDBOX)
614         board_init,     /* Setup chipselects */
615 #endif
616         /*
617          * TODO: printing of the clock inforamtion of the board is now
618          * implemented as part of bdinfo command. Currently only support for
619          * davinci SOC's is added. Remove this check once all the board
620          * implement this.
621          */
622 #ifdef CONFIG_CLOCKS
623         set_cpu_clk_info, /* Setup clock information */
624 #endif
625 #ifdef CONFIG_EFI_LOADER
626         efi_memory_init,
627 #endif
628         initr_binman,
629 #ifdef CONFIG_FSP_VERSION2
630         arch_fsp_init_r,
631 #endif
632         initr_dm_devices,
633         stdio_init_tables,
634         serial_initialize,
635         initr_announce,
636         dm_announce,
637 #if CONFIG_IS_ENABLED(WDT)
638         initr_watchdog,
639 #endif
640         INIT_FUNC_WATCHDOG_RESET
641         arch_initr_trap,
642 #if defined(CONFIG_BOARD_EARLY_INIT_R)
643         board_early_init_r,
644 #endif
645         INIT_FUNC_WATCHDOG_RESET
646 #ifdef CONFIG_POST
647         post_output_backlog,
648 #endif
649         INIT_FUNC_WATCHDOG_RESET
650 #if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
651         /*
652          * Do early PCI configuration _before_ the flash gets initialised,
653          * because PCU resources are crucial for flash access on some boards.
654          */
655         pci_init,
656 #endif
657 #ifdef CONFIG_ARCH_EARLY_INIT_R
658         arch_early_init_r,
659 #endif
660         power_init_board,
661 #ifdef CONFIG_MTD_NOR_FLASH
662         initr_flash,
663 #endif
664         INIT_FUNC_WATCHDOG_RESET
665 #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
666         /* initialize higher level parts of CPU like time base and timers */
667         cpu_init_r,
668 #endif
669 #ifdef CONFIG_EFI_LOADER
670         efi_init_early,
671 #endif
672 #ifdef CONFIG_CMD_NAND
673         initr_nand,
674 #endif
675 #ifdef CONFIG_CMD_ONENAND
676         initr_onenand,
677 #endif
678 #ifdef CONFIG_MMC
679         initr_mmc,
680 #endif
681 #ifdef CONFIG_XEN
682         xen_init,
683 #endif
684 #ifdef CONFIG_PVBLOCK
685         initr_pvblock,
686 #endif
687         initr_env,
688 #ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
689         initr_malloc_bootparams,
690 #endif
691         INIT_FUNC_WATCHDOG_RESET
692         cpu_secondary_init_r,
693 #if defined(CONFIG_ID_EEPROM)
694         mac_read_from_eeprom,
695 #endif
696         INIT_FUNC_WATCHDOG_RESET
697 #if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
698         /*
699          * Do pci configuration
700          */
701         pci_init,
702 #endif
703         stdio_add_devices,
704         jumptable_init,
705 #ifdef CONFIG_API
706         api_init,
707 #endif
708         console_init_r,         /* fully init console as a device */
709 #ifdef CONFIG_DISPLAY_BOARDINFO_LATE
710         console_announce_r,
711         show_board_info,
712 #endif
713 #ifdef CONFIG_ARCH_MISC_INIT
714         arch_misc_init,         /* miscellaneous arch-dependent init */
715 #endif
716 #ifdef CONFIG_MISC_INIT_R
717         misc_init_r,            /* miscellaneous platform-dependent init */
718 #endif
719         INIT_FUNC_WATCHDOG_RESET
720 #ifdef CONFIG_CMD_KGDB
721         kgdb_init,
722 #endif
723         interrupt_init,
724 #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K)
725         timer_init,             /* initialize timer */
726 #endif
727 #if defined(CONFIG_LED_STATUS)
728         initr_status_led,
729 #endif
730         /* PPC has a udelay(20) here dating from 2002. Why? */
731 #ifdef CONFIG_BOARD_LATE_INIT
732         board_late_init,
733 #endif
734 #if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI)
735         INIT_FUNC_WATCHDOG_RESET
736         initr_scsi,
737 #endif
738 #ifdef CONFIG_BITBANGMII
739         bb_miiphy_init,
740 #endif
741 #ifdef CONFIG_PCI_ENDPOINT
742         pci_ep_init,
743 #endif
744 #ifdef CONFIG_CMD_NET
745         INIT_FUNC_WATCHDOG_RESET
746         initr_net,
747 #endif
748 #ifdef CONFIG_POST
749         initr_post,
750 #endif
751         INIT_FUNC_WATCHDOG_RESET
752         INITCALL_EVENT(EVT_LAST_STAGE_INIT),
753 #if defined(CFG_PRAM)
754         initr_mem,
755 #endif
756         run_main_loop,
757 };
758
759 void board_init_r(gd_t *new_gd, ulong dest_addr)
760 {
761         /*
762          * The pre-relocation drivers may be using memory that has now gone
763          * away. Mark serial as unavailable - this will fall back to the debug
764          * UART if available.
765          *
766          * Do the same with log drivers since the memory may not be available.
767          */
768         gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY);
769
770         /*
771          * Set up the new global data pointer. So far only x86 does this
772          * here.
773          * TODO([email protected]): Consider doing this for all archs, or
774          * dropping the new_gd parameter.
775          */
776         if (CONFIG_IS_ENABLED(X86_64) && !IS_ENABLED(CONFIG_EFI_APP))
777                 arch_setup_gd(new_gd);
778
779 #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
780         gd = new_gd;
781 #endif
782         gd->flags &= ~GD_FLG_LOG_READY;
783
784         if (initcall_run_list(init_sequence_r))
785                 hang();
786
787         /* NOTREACHED - run_main_loop() does not return */
788         hang();
789 }
This page took 0.07601 seconds and 4 git commands to generate.