root/trunk/patches/2.6.22/80-kexec-atags.patch

Revision 896, 3.0 KB (checked in by mwester, 3 years ago)

2.6.22 patches - added kexec command-line patches, defconfig now builds via-velocity driver
into the kernel.

  • linux-2.6.22-rc5-armeb//arch/arm/kernel/setup.c

    old new  
    2323#include <linux/cpu.h> 
    2424#include <linux/interrupt.h> 
    2525#include <linux/smp.h> 
     26#include <linux/kexec.h> 
    2627 
    2728#include <asm/cpu.h> 
    2829#include <asm/elf.h> 
     
    769770} 
    770771arch_initcall(customize_machine); 
    771772 
     773#ifdef CONFIG_KEXEC 
     774 
     775/* Physical addr of where the boot params should be for this machine */ 
     776extern unsigned long kexec_boot_params_address; 
     777 
     778/* Physical addr of the buffer into which the boot params are copied */ 
     779extern unsigned long kexec_boot_params_copy; 
     780 
     781/* Pointer to the boot params buffer, for manipulation and display */ 
     782unsigned long kexec_boot_params; 
     783EXPORT_SYMBOL(kexec_boot_params); 
     784 
     785/* The buffer itself - make sure it is sized correctly */ 
     786static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4]; 
     787 
     788#endif 
     789 
    772790void __init setup_arch(char **cmdline_p) 
    773791{ 
    774792        struct tag *tags = (struct tag *)&init_tags; 
     
    785803        if (mdesc->boot_params) 
    786804                tags = phys_to_virt(mdesc->boot_params); 
    787805 
     806#ifdef CONFIG_KEXEC 
     807        kexec_boot_params_address = mdesc->boot_params; 
     808        kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf); 
     809        kexec_boot_params = (unsigned long)kexec_boot_params_buf; 
     810        if (mdesc->boot_params) 
     811                memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE); 
     812#endif 
    788813        /* 
    789814         * If we have the old style parameters, convert them to 
    790815         * a tag list. 
  • linux-2.6.22-rc5-armeb//arch/arm/kernel/relocate_kernel.S

    old new  
    77        .globl relocate_new_kernel 
    88relocate_new_kernel: 
    99 
     10        /* Move boot params back to where the kernel expects them */ 
     11 
     12        ldr     r0,kexec_boot_params_address 
     13        teq     r0,#0 
     14        beq     8f 
     15         
     16        ldr     r1,kexec_boot_params_copy 
     17        mov     r6,#KEXEC_BOOT_PARAMS_SIZE/4 
     187: 
     19        ldr     r5,[r1],#4 
     20        str     r5,[r0],#4 
     21        subs    r6,r6,#1 
     22        bne     7b 
     23         
     248:       
     25        /* Boot params moved, now go on with the kernel */ 
     26         
    1027        ldr     r0,kexec_indirection_page 
    1128        ldr     r1,kexec_start_address 
    1229 
     
    5067        mov lr,r1 
    5168        mov r0,#0 
    5269        ldr r1,kexec_mach_type 
    53         mov r2,#0 
     70        ldr r2,kexec_boot_params_address 
    5471        mov pc,lr 
    5572 
    5673        .globl kexec_start_address 
     
    6582kexec_mach_type: 
    6683        .long   0x0 
    6784 
     85        /* phy addr where new kernel will expect to find boot params */ 
     86        .globl kexec_boot_params_address 
     87kexec_boot_params_address: 
     88        .long   0x0 
     89 
     90        /* phy addr where old kernel put a copy of orig boot params */ 
     91        .globl kexec_boot_params_copy 
     92kexec_boot_params_copy: 
     93        .long   0x0 
     94 
    6895relocate_new_kernel_end: 
    6996 
    7097        .globl relocate_new_kernel_size 
  • linux-2.6.22-rc5-armeb//include/asm-arm/kexec.h

    old new  
    1414 
    1515#define KEXEC_ARCH KEXEC_ARCH_ARM 
    1616 
     17#define KEXEC_BOOT_PARAMS_SIZE 1536 
     18 
    1719#ifndef __ASSEMBLY__ 
    1820 
    1921struct kimage; 
Note: See TracBrowser for help on using the browser.