Changeset 4872160 in mainline for kernel/arch/ppc32/src


Ignore:
Timestamp:
2010-05-04T10:44:55Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
568db0f
Parents:
bb252ca
Message:

new boot infrastructure

  • more code and metadata unification
  • import of up-to-date implementations from the kernel
  • the boot loaders should behave more similarly on all platforms
  • support for deflate compressed (LZ77) boot components
    • this again allows feasible boot images to be created on mips32
  • IA64 is still not booting
    • the broken forked GNU EFI library has been removed, a replacement of the functionality is on its way
Location:
kernel/arch/ppc32/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/boot/boot.S

    rbb252ca r4872160  
    4747       
    4848        # r3 contains physical address of bootinfo_t
    49         # r4 contains size of bootinfo_t
    50        
    51         cmpwi r4, 0
    52         beq bootinfo_end
    5349       
    5450        addis r3, r3, 0x8000
    55        
    56         lis r31, bootinfo@ha
    57         addi r31, r31, bootinfo@l  # r31 = bootinfo
    58        
    59         bootinfo_loop:
    60                
    61                 lwz r30, 0(r3)
    62                 stw r30, 0(r31)
    63                
    64                 addi r3, r3, 4
    65                 addi r31, r31, 4
    66                 subi r4, r4, 4
    67                
    68                 cmpwi r4, 0
    69                 bgt bootinfo_loop
    70                
    71         bootinfo_end:
    72        
    7351        bl arch_pre_main
    7452        b main_bsp
  • kernel/arch/ppc32/src/mm/frame.c

    rbb252ca r4872160  
    2727 */
    2828
    29 /** @addtogroup ppc32mm 
     29/** @addtogroup ppc32mm
    3030 * @{
    3131 */
     
    4141
    4242uintptr_t last_frame = 0;
     43memmap_t memmap;
    4344
    4445void physmem_print(void)
     
    4950        printf("---------- ----------\n");
    5051               
    51         for (i = 0; i < bootinfo.memmap.count; i++) {
    52                 printf("%#10x %#10x\n", bootinfo.memmap.zones[i].start,
    53                         bootinfo.memmap.zones[i].size);
     52        for (i = 0; i < memmap.cnt; i++) {
     53                printf("%#10x %#10x\n", memmap.zones[i].start,
     54                        memmap.zones[i].size);
    5455        }
    5556}
     
    6263        size_t size;
    6364       
    64         for (i = 0; i < bootinfo.memmap.count; i++) {
    65                 start = ADDR2PFN(ALIGN_UP(bootinfo.memmap.zones[i].start, FRAME_SIZE));
    66                 size = SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, FRAME_SIZE));
     65        for (i = 0; i < memmap.cnt; i++) {
     66                start = ADDR2PFN(ALIGN_UP((uintptr_t) memmap.zones[i].start, FRAME_SIZE));
     67                size = SIZE2FRAMES(ALIGN_DOWN(memmap.zones[i].size, FRAME_SIZE));
    6768               
    6869                if ((minconf < start) || (minconf >= start + size))
     
    7273               
    7374                zone_create(start, size, conf, 0);
    74                 if (last_frame < ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE))
    75                         last_frame = ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE);
     75                if (last_frame < ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE))
     76                        last_frame = ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE);
    7677        }
    7778       
  • kernel/arch/ppc32/src/mm/page.c

    rbb252ca r4872160  
    4545}
    4646
    47 
    4847uintptr_t hw_map(uintptr_t physaddr, size_t size)
    4948{
  • kernel/arch/ppc32/src/ppc32.c

    rbb252ca r4872160  
    6565
    6666/** Performs ppc32-specific initialization before main_bsp() is called. */
    67 void arch_pre_main(void)
    68 {
    69         init.cnt = bootinfo.taskmap.count;
    70        
    71         uint32_t i;
    72        
    73         for (i = 0; i < min3(bootinfo.taskmap.count, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) {
    74                 init.tasks[i].addr = bootinfo.taskmap.tasks[i].addr;
    75                 init.tasks[i].size = bootinfo.taskmap.tasks[i].size;
     67void arch_pre_main(bootinfo_t *bootinfo)
     68{
     69        /* Copy tasks map. */
     70        init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
     71        size_t i;
     72        for (i = 0; i < init.cnt; i++) {
     73                init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;
     74                init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
    7675                str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
    77                     bootinfo.taskmap.tasks[i].name);
     76                    bootinfo->taskmap.tasks[i].name);
     77        }
     78       
     79        /* Copy physical memory map. */
     80        memmap.total = bootinfo->memmap.total;
     81        memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS);
     82        for (i = 0; i < memmap.cnt; i++) {
     83                memmap.zones[i].start = bootinfo->memmap.zones[i].start;
     84                memmap.zones[i].size = bootinfo->memmap.zones[i].size;
    7885        }
    7986       
    8087        /* Copy boot allocations info. */
    81         ballocs.base = bootinfo.ballocs.base;
    82         ballocs.size = bootinfo.ballocs.size;
    83        
    84         ofw_tree_init(bootinfo.ofw_root);
     88        ballocs.base = bootinfo->ballocs.base;
     89        ballocs.size = bootinfo->ballocs.size;
     90       
     91        /* Copy OFW tree. */
     92        ofw_tree_init(bootinfo->ofw_root);
    8593}
    8694
Note: See TracChangeset for help on using the changeset viewer.