]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
Merge branch 'restart-cleanup' into restart
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:56:44 +0000 (12:56 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:56:44 +0000 (12:56 +0000)
Conflicts:
arch/arm/kernel/setup.c

1  2 
arch/arm/include/asm/mach/arch.h
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/plat-mxc/system.c

index 6fe6cf0895c94e7c191a8592a2218c91bd916005,2b0efc3104ac6f73846fb89cdf0761c400676540..bcb0c883e21ed06aa18c9f48354314c877523a8b
@@@ -13,6 -13,7 +13,7 @@@
  struct tag;
  struct meminfo;
  struct sys_timer;
+ struct pt_regs;
  
  struct machine_desc {
        unsigned int            nr;             /* architecture number  */
        unsigned int            video_start;    /* start of video RAM   */
        unsigned int            video_end;      /* end of video RAM     */
  
 -      unsigned int            reserve_lp0 :1; /* never has lp0        */
 -      unsigned int            reserve_lp1 :1; /* never has lp1        */
 -      unsigned int            reserve_lp2 :1; /* never has lp2        */
 -      unsigned int            soft_reboot :1; /* soft reboot          */
 +      unsigned char           reserve_lp0 :1; /* never has lp0        */
 +      unsigned char           reserve_lp1 :1; /* never has lp1        */
 +      unsigned char           reserve_lp2 :1; /* never has lp2        */
 +      char                    restart_mode;   /* default restart mode */
        void                    (*fixup)(struct tag *, char **,
                                         struct meminfo *);
        void                    (*reserve)(void);/* reserve mem blocks  */
@@@ -45,7 -46,6 +46,7 @@@
  #ifdef CONFIG_MULTI_IRQ_HANDLER
        void                    (*handle_irq)(struct pt_regs *);
  #endif
 +      void                    (*restart)(char, const char *);
  };
  
  /*
index cc40b965d42a5b2d9c19e8dd5bd086412b4cca43,e59bbd496c39174da0a6ee4094fe6f717df97a67..29620b632ed945366605b46424df24eb7f369815
@@@ -16,7 -16,7 +16,7 @@@
  extern const unsigned char relocate_new_kernel[];
  extern const unsigned int relocate_new_kernel_size;
  
 -extern void setup_mm_for_reboot(char mode);
 +extern void setup_mm_for_reboot(void);
  
  extern unsigned long kexec_start_address;
  extern unsigned long kexec_indirection_page;
@@@ -32,24 -32,6 +32,6 @@@ static atomic_t waiting_for_crash_ipi
  
  int machine_kexec_prepare(struct kimage *image)
  {
-       unsigned long page_list;
-       void *reboot_code_buffer;
-       page_list = image->head & PAGE_MASK;
-       reboot_code_buffer = page_address(image->control_code_page);
-       /* Prepare parameters for reboot_code_buffer*/
-       kexec_start_address = image->start;
-       kexec_indirection_page = page_list;
-       kexec_mach_type = machine_arch_type;
-       kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
-       /* copy our kernel relocation code to the control code page */
-       memcpy(reboot_code_buffer,
-              relocate_new_kernel, relocate_new_kernel_size);
-       flush_icache_range((unsigned long) reboot_code_buffer,
-                          (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
        return 0;
  }
  
@@@ -100,21 -82,38 +82,38 @@@ void (*kexec_reinit)(void)
  
  void machine_kexec(struct kimage *image)
  {
+       unsigned long page_list;
        unsigned long reboot_code_buffer_phys;
        void *reboot_code_buffer;
  
+       page_list = image->head & PAGE_MASK;
        /* we need both effective and real address here */
        reboot_code_buffer_phys =
            page_to_pfn(image->control_code_page) << PAGE_SHIFT;
        reboot_code_buffer = page_address(image->control_code_page);
  
+       /* Prepare parameters for reboot_code_buffer*/
+       kexec_start_address = image->start;
+       kexec_indirection_page = page_list;
+       kexec_mach_type = machine_arch_type;
+       kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
+       /* copy our kernel relocation code to the control code page */
+       memcpy(reboot_code_buffer,
+              relocate_new_kernel, relocate_new_kernel_size);
+       flush_icache_range((unsigned long) reboot_code_buffer,
+                          (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
        printk(KERN_INFO "Bye!\n");
  
        if (kexec_reinit)
                kexec_reinit();
        local_irq_disable();
        local_fiq_disable();
 -      setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
 +      setup_mm_for_reboot();
        flush_cache_all();
        outer_flush_all();
        outer_disable();
index 1e8b3e2de7a3b0ead2cfd2aaa87de146d3fc8325,3d0c6fb74ae4efe521cfc563ea11e0fa9738d465..eeb3e16c60465616067d7681a47b35f8752c4d78
@@@ -57,7 -57,7 +57,7 @@@ static const char *isa_modes[] = 
    "ARM" , "Thumb" , "Jazelle", "ThumbEE"
  };
  
 -extern void setup_mm_for_reboot(char mode);
 +extern void setup_mm_for_reboot(void);
  
  static volatile int hlt_counter;
  
@@@ -92,7 -92,7 +92,7 @@@ static int __init hlt_setup(char *__unu
  __setup("nohlt", nohlt_setup);
  __setup("hlt", hlt_setup);
  
 -void arm_machine_restart(char mode, const char *cmd)
 +void soft_restart(unsigned long addr)
  {
        /* Disable interrupts first */
        local_irq_disable();
         * we may need it to insert some 1:1 mappings so that
         * soft boot works.
         */
 -      setup_mm_for_reboot(mode);
 +      setup_mm_for_reboot();
  
        /* Clean and invalidate caches */
        flush_cache_all();
        /* Push out any further dirty data, and ensure cache is empty */
        flush_cache_all();
  
 -      /*
 -       * Now call the architecture specific reboot code.
 -       */
 -      arch_reset(mode, cmd);
 +      cpu_reset(addr);
 +}
  
 -      /*
 -       * Whoops - the architecture was unable to reboot.
 -       * Tell the user!
 -       */
 -      mdelay(1000);
 -      printk("Reboot failed -- System halted\n");
 -      while (1);
 +void arm_machine_restart(char mode, const char *cmd)
 +{
 +      /* Disable interrupts first */
 +      local_irq_disable();
 +      local_fiq_disable();
 +
 +      /* Call the architecture specific reboot code. */
 +      arch_reset(mode, cmd);
  }
  
  /*
@@@ -191,6 -192,9 +191,9 @@@ void cpu_idle(void
  #endif
  
                        local_irq_disable();
+ #ifdef CONFIG_PL310_ERRATA_769419
+                       wmb();
+ #endif
                        if (hlt_counter) {
                                local_irq_enable();
                                cpu_relax();
@@@ -249,15 -253,7 +252,15 @@@ void machine_power_off(void
  void machine_restart(char *cmd)
  {
        machine_shutdown();
 +
        arm_pm_restart(reboot_mode, cmd);
 +
 +      /* Give a grace period for failure to restart of 1s */
 +      mdelay(1000);
 +
 +      /* Whoops - the platform was unable to reboot. Tell the user! */
 +      printk("Reboot failed -- System halted\n");
 +      while (1);
  }
  
  void __show_regs(struct pt_regs *regs)
diff --combined arch/arm/kernel/setup.c
index a753880e984b9c74822763963a0ec43e5db8d60a,8fc2c8fcbdc646a4a8babecbf4a758f88e6d8d60..8b13930cdb0a689c1900a7ad2e568d2bdedda1b8
@@@ -461,8 -461,10 +461,10 @@@ static void __init setup_processor(void
               cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
               proc_arch[cpu_architecture()], cr_alignment);
  
-       sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
-       sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
+       snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
+                list->arch_name, ENDIANNESS);
+       snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c",
+                list->elf_name, ENDIANNESS);
        elf_hwcap = list->elf_hwcap;
  #ifndef CONFIG_ARM_THUMB
        elf_hwcap &= ~HWCAP_THUMB;
@@@ -893,8 -895,6 +895,6 @@@ void __init setup_arch(char **cmdline_p
  {
        struct machine_desc *mdesc;
  
-       unwind_init();
        setup_processor();
        mdesc = setup_machine_fdt(__atags_pointer);
        if (!mdesc)
        machine_desc = mdesc;
        machine_name = mdesc->name;
  
 -      if (mdesc->soft_reboot)
 -              reboot_setup("s");
+ #ifdef CONFIG_ZONE_DMA
+       if (mdesc->dma_zone_size) {
+               extern unsigned long arm_dma_zone_size;
+               arm_dma_zone_size = mdesc->dma_zone_size;
+       }
+ #endif
 +      if (mdesc->restart_mode)
 +              reboot_setup(&mdesc->restart_mode);
  
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
        paging_init(mdesc);
        request_standard_resources(mdesc);
  
 +      if (mdesc->restart)
 +              arm_pm_restart = mdesc->restart;
 +
        unflatten_device_tree();
  
  #ifdef CONFIG_SMP
  
        tcm_init();
  
- #ifdef CONFIG_ZONE_DMA
-       if (mdesc->dma_zone_size) {
-               extern unsigned long arm_dma_zone_size;
-               arm_dma_zone_size = mdesc->dma_zone_size;
-       }
- #endif
  #ifdef CONFIG_MULTI_IRQ_HANDLER
        handle_arch_irq = mdesc->handle_irq;
  #endif
index b1cfc6a49715f96a1aa663a3f338f3a23af4756a,d65fb31a55ca47ef350e38da864b6d34cf5295f9..7e5c76ea4466a425a49ba8e64f450403f58733ab
@@@ -21,6 -21,7 +21,7 @@@
  #include <linux/io.h>
  #include <linux/err.h>
  #include <linux/delay.h>
+ #include <linux/module.h>
  
  #include <mach/hardware.h>
  #include <mach/common.h>
@@@ -28,8 -29,8 +29,8 @@@
  #include <asm/system.h>
  #include <asm/mach-types.h>
  
- void (*imx_idle)(void) = NULL;
  void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL;
+ EXPORT_SYMBOL_GPL(imx_ioremap);
  
  static void __iomem *wdog_base;
  
@@@ -70,7 -71,7 +71,7 @@@ void arch_reset(char mode, const char *
        mdelay(50);
  
        /* we'll take a jump through zero as a poor second */
 -      cpu_reset(0);
 +      soft_restart(0);
  }
  
  void mxc_arch_reset_init(void __iomem *base)