Lines Matching +full:protected +full:- +full:clocks

1 // SPDX-License-Identifier: GPL-2.0+
4 * (C) Copyright 2002-2006
8 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
37 #include <asm/mach-types.h>
87 * global data for all modules, so that post-reloc we can avoid the massive
123 gd->baudrate = env_get_ulong("baudrate", 10, CONFIG_BAUDRATE); in init_baud_rate()
141 debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n", in display_text_info()
189 dev->name, ret); in print_cpuinfo()
214 size += gd->bd->bi_dram[i].size; in show_dram_config()
216 (unsigned long long)(gd->bd->bi_dram[i].start)); in show_dram_config()
218 print_size(gd->bd->bi_dram[i].size, "\n"); in show_dram_config()
223 size = gd->ram_size; in show_dram_config()
236 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; in dram_init_banksize()
237 gd->bd->bi_dram[0].size = get_effective_memsize(); in dram_init_banksize()
267 gd->mon_len = (ulong)&__bss_end - (ulong)_start; in setup_mon_len()
269 gd->mon_len = (ulong)&_end - (ulong)_init; in setup_mon_len()
271 gd->mon_len = CONFIG_SYS_MONITOR_LEN; in setup_mon_len()
273 gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start); in setup_mon_len()
275 /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ in setup_mon_len()
276 gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; in setup_mon_len()
284 gd->spl_handoff = bloblist_find(BLOBLISTT_SPL_HANDOFF, in setup_spl_handoff()
286 debug("Found SPL hand-off info %p\n", gd->spl_handoff); in setup_spl_handoff()
308 * 32-bit address space. If so, clip the usable RAM so it doesn't. in board_get_usable_ram_top()
310 if (gd->ram_top < CONFIG_SYS_SDRAM_BASE) in board_get_usable_ram_top()
312 * Will wrap back to top of 32-bit space when reservations in board_get_usable_ram_top()
317 return gd->ram_top; in board_get_usable_ram_top()
322 debug("Monitor len: %08lX\n", gd->mon_len); in setup_dest_addr()
326 debug("Ram size: %08lX\n", (ulong)gd->ram_size); in setup_dest_addr()
330 * get "touched" at all by U-Boot. By fixing up gd->ram_size in setup_dest_addr()
338 gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; in setup_dest_addr()
341 gd->ram_base = CONFIG_SYS_SDRAM_BASE; in setup_dest_addr()
343 gd->ram_top = gd->ram_base + get_effective_memsize(); in setup_dest_addr()
344 gd->ram_top = board_get_usable_ram_top(gd->mon_len); in setup_dest_addr()
345 gd->relocaddr = gd->ram_top; in setup_dest_addr()
346 debug("Ram top: %08lX\n", (ulong)gd->ram_top); in setup_dest_addr()
350 * boot code is reserved and not used by any part of u-boot in setup_dest_addr()
352 if (gd->relocaddr > determine_mp_bootpg(NULL)) { in setup_dest_addr()
353 gd->relocaddr = determine_mp_bootpg(NULL); in setup_dest_addr()
354 debug("Reserving MP boot page to %08lx\n", gd->relocaddr); in setup_dest_addr()
361 /* reserve protected RAM */
367 gd->relocaddr -= (reg << 10); /* size is in kB */ in reserve_pram()
368 debug("Reserving %ldk for protected RAM at %08lx\n", reg, in reserve_pram()
369 gd->relocaddr); in reserve_pram()
377 gd->relocaddr &= ~(4096 - 1); in reserve_round_4k()
386 gd->arch.tlb_size = PGTABLE_SIZE; in reserve_mmu()
387 gd->relocaddr -= gd->arch.tlb_size; in reserve_mmu()
390 gd->relocaddr &= ~(0x10000 - 1); in reserve_mmu()
392 gd->arch.tlb_addr = gd->relocaddr; in reserve_mmu()
393 debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, in reserve_mmu()
394 gd->arch.tlb_addr + gd->arch.tlb_size); in reserve_mmu()
398 * Record allocated tlb_addr in case gd->tlb_addr to be overwritten in reserve_mmu()
401 gd->arch.tlb_allocated = gd->arch.tlb_addr; in reserve_mmu()
415 addr = gd->relocaddr; in reserve_video()
419 gd->relocaddr = addr; in reserve_video()
422 gd->fb_base = CONFIG_FB_ADDR; in reserve_video()
425 gd->relocaddr = lcd_setmem(gd->relocaddr); in reserve_video()
426 gd->fb_base = gd->relocaddr; in reserve_video()
433 gd->relocaddr = video_setmem(gd->relocaddr); in reserve_video()
434 gd->fb_base = gd->relocaddr; in reserve_video()
443 gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE; in reserve_trace()
444 gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE); in reserve_trace()
446 CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr); in reserve_trace()
454 if (!(gd->flags & GD_FLG_SKIP_RELOC)) { in reserve_uboot()
456 * reserve memory for U-Boot code, data & bss in reserve_uboot()
459 gd->relocaddr -= gd->mon_len; in reserve_uboot()
460 gd->relocaddr &= ~(4096 - 1); in reserve_uboot()
463 gd->relocaddr &= ~(65536 - 1); in reserve_uboot()
466 debug("Reserving %ldk for U-Boot at: %08lx\n", in reserve_uboot()
467 gd->mon_len >> 10, gd->relocaddr); in reserve_uboot()
470 gd->start_addr_sp = gd->relocaddr; in reserve_uboot()
478 gd->start_addr_sp = gd->start_addr_sp - TOTAL_MALLOC_LEN; in reserve_malloc()
480 TOTAL_MALLOC_LEN >> 10, gd->start_addr_sp); in reserve_malloc()
487 if (!gd->bd) { in reserve_board()
488 gd->start_addr_sp -= sizeof(bd_t); in reserve_board()
489 gd->bd = (bd_t *)map_sysmem(gd->start_addr_sp, sizeof(bd_t)); in reserve_board()
490 memset(gd->bd, '\0', sizeof(bd_t)); in reserve_board()
492 sizeof(bd_t), gd->start_addr_sp); in reserve_board()
500 gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ in setup_machine()
507 gd->start_addr_sp -= sizeof(gd_t); in reserve_global_data()
508 gd->new_gd = (gd_t *)map_sysmem(gd->start_addr_sp, sizeof(gd_t)); in reserve_global_data()
510 sizeof(gd_t), gd->start_addr_sp); in reserve_global_data()
522 if (gd->fdt_blob) { in reserve_fdt()
523 gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); in reserve_fdt()
525 gd->start_addr_sp -= gd->fdt_size; in reserve_fdt()
526 gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size); in reserve_fdt()
528 gd->fdt_size, gd->start_addr_sp); in reserve_fdt()
540 gd->start_addr_sp -= size; in reserve_bootstage()
541 gd->new_bootstage = map_sysmem(gd->start_addr_sp, size); in reserve_bootstage()
543 gd->start_addr_sp); in reserve_bootstage()
556 /* make stack pointer 16-byte aligned */ in reserve_stacks()
557 gd->start_addr_sp -= 16; in reserve_stacks()
558 gd->start_addr_sp &= ~0xf; in reserve_stacks()
561 * let the architecture-specific code tailor gd->start_addr_sp and in reserve_stacks()
562 * gd->irq_sp in reserve_stacks()
570 gd->start_addr_sp -= CONFIG_BLOBLIST_SIZE; in reserve_bloblist()
571 gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE); in reserve_bloblist()
579 debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp); in display_new_sp()
588 bd_t *bd = gd->bd; in setup_board_part1()
593 bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ in setup_board_part1()
594 bd->bi_memsize = gd->ram_size; /* size in bytes */ in setup_board_part1()
597 bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ in setup_board_part1()
598 bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ in setup_board_part1()
602 bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ in setup_board_part1()
605 bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ in setup_board_part1()
608 bd->bi_immrbar = CONFIG_SYS_IMMR; in setup_board_part1()
618 bd_t *bd = gd->bd; in setup_board_part2()
620 bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ in setup_board_part2()
621 bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ in setup_board_part2()
623 bd->bi_cpmfreq = gd->arch.cpm_clk; in setup_board_part2()
624 bd->bi_brgfreq = gd->arch.brg_clk; in setup_board_part2()
625 bd->bi_sccfreq = gd->arch.scc_clk; in setup_board_part2()
626 bd->bi_vco = gd->arch.vco_out; in setup_board_part2()
629 bd->bi_pcifreq = gd->pci_clk; in setup_board_part2()
632 bd->bi_inpfreq = gd->arch.inp_clk; /* input Freq in Hz */ in setup_board_part2()
633 bd->bi_vcofreq = gd->arch.vco_clk; /* vco Freq in Hz */ in setup_board_part2()
634 bd->bi_flbfreq = gd->arch.flb_clk; /* flexbus Freq in Hz */ in setup_board_part2()
654 if (gd->flags & GD_FLG_SKIP_RELOC) in reloc_fdt()
656 if (gd->new_fdt) { in reloc_fdt()
657 memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); in reloc_fdt()
658 gd->fdt_blob = gd->new_fdt; in reloc_fdt()
668 if (gd->flags & GD_FLG_SKIP_RELOC) in reloc_bootstage()
670 if (gd->new_bootstage) { in reloc_bootstage()
674 gd->bootstage, gd->new_bootstage, size); in reloc_bootstage()
675 memcpy(gd->new_bootstage, gd->bootstage, size); in reloc_bootstage()
676 gd->bootstage = gd->new_bootstage; in reloc_bootstage()
686 if (gd->flags & GD_FLG_SKIP_RELOC) in reloc_bloblist()
688 if (gd->new_bloblist) { in reloc_bloblist()
692 gd->bloblist, gd->new_bloblist, size); in reloc_bloblist()
693 memcpy(gd->new_bloblist, gd->bloblist, size); in reloc_bloblist()
694 gd->bloblist = gd->new_bloblist; in reloc_bloblist()
703 if (gd->flags & GD_FLG_SKIP_RELOC) { in setup_reloc()
710 gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start; in setup_reloc()
716 gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400); in setup_reloc()
718 gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; in setup_reloc()
721 memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); in setup_reloc()
723 debug("Relocation Offset is: %08lx\n", gd->reloc_off); in setup_reloc()
725 gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd), in setup_reloc()
726 gd->start_addr_sp); in setup_reloc()
734 return board_fix_fdt((void *)gd->fdt_blob); in fix_fdt()
744 if (gd->flags & GD_FLG_SKIP_RELOC) in jump_to_copy()
761 arch_setup_gd(gd->new_gd); in jump_to_copy()
762 board_init_f_r_trampoline(gd->start_addr_sp); in jump_to_copy()
764 relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr); in jump_to_copy()
786 if (ret && ret != -ENOENT) { in initf_bootstage()
826 /* Architecture-specific memory reservation */
864 /* get CPU and bus clocks according to the environment variable */
865 get_clocks, /* get CPU and bus clocks (etc.) */
925 * - area that won't get touched by U-Boot and Linux (optional)
926 * - kernel log buffer
927 * - protected RAM
928 * - LCD framebuffer
929 * - monitor code
930 * - board info struct
988 gd->flags = boot_flags; in board_init_f()
989 gd->have_console = 0; in board_init_f()
997 /* NOTREACHED - jump_to_copy() does not return */ in board_init_f()
1007 * U-Boot is executing from Flash with a semi-limited 'C' environment.
1010 * - 'static' variables are read-only
1011 * - Global Data (gd->xxx) is read/write
1013 * The '_f_r' sequence must, as a minimum, copy U-Boot to RAM (if
1034 * The pre-relocation drivers may be using memory that has now gone in board_init_f_r()
1035 * away. Mark serial as unavailable - this will fall back to the debug in board_init_f_r()
1040 gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY); in board_init_f_r()
1042 gd->timer = NULL; in board_init_f_r()
1046 * U-Boot has been copied into SDRAM, the BSS has been cleared etc. in board_init_f_r()
1048 * of the in-RAM copy of board_init_r() and calling it in board_init_f_r()
1050 (board_init_r + gd->reloc_off)((gd_t *)gd, gd->relocaddr); in board_init_f_r()
1052 /* NOTREACHED - board_init_r() does not return */ in board_init_f_r()