]> rtime.felk.cvut.cz Git - linux-imx.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

31 files changed:
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/system.h
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/mach-clps711x/include/mach/system.h
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ebsa110/include/mach/system.h
arch/arm/mach-footbridge/cats-hw.c
arch/arm/mach-footbridge/include/mach/system.h
arch/arm/mach-iop32x/include/mach/system.h
arch/arm/mach-iop33x/include/mach/system.h
arch/arm/mach-ixp4xx/include/mach/system.h
arch/arm/mach-ks8695/include/mach/system.h
arch/arm/mach-mmp/include/mach/system.h
arch/arm/mach-mxs/system.c
arch/arm/mach-pnx4008/include/mach/system.h
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/reset.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-rpc/include/mach/system.h
arch/arm/mach-s3c2410/include/mach/system-reset.h
arch/arm/mach-s3c64xx/include/mach/system.h
arch/arm/mach-sa1100/include/mach/system.h
arch/arm/mach-shmobile/include/mach/system.h
arch/arm/mach-w90x900/include/mach/system.h
arch/arm/mm/idmap.c
arch/arm/mm/nommu.c
arch/arm/plat-mxc/system.c
arch/arm/plat-spear/include/plat/system.h

index 2b0efc3104ac6f73846fb89cdf0761c400676540..bcb0c883e21ed06aa18c9f48354314c877523a8b 100644 (file)
@@ -31,10 +31,10 @@ struct machine_desc {
        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  */
@@ -46,6 +46,7 @@ struct machine_desc {
 #ifdef CONFIG_MULTI_IRQ_HANDLER
        void                    (*handle_irq)(struct pt_regs *);
 #endif
+       void                    (*restart)(char, const char *);
 };
 
 /*
index 984014b92647a8a1a093f8b46ce05dfd729ca473..fe7de7571bacb91d2377018b229533e9cb6093d5 100644 (file)
@@ -101,6 +101,7 @@ extern int __pure cpu_architecture(void);
 extern void cpu_init(void);
 
 void arm_machine_restart(char mode, const char *cmd);
+void soft_restart(unsigned long);
 extern void (*arm_pm_restart)(char str, const char *cmd);
 
 #define UDBG_UNDEFINED (1 << 0)
index e59bbd496c39174da0a6ee4094fe6f717df97a67..29620b632ed945366605b46424df24eb7f369815 100644 (file)
@@ -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;
@@ -113,7 +113,7 @@ void machine_kexec(struct kimage *image)
                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 3d0c6fb74ae4efe521cfc563ea11e0fa9738d465..eeb3e16c60465616067d7681a47b35f8752c4d78 100644 (file)
@@ -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 @@ static int __init hlt_setup(char *__unused)
 __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();
@@ -103,7 +103,7 @@ void arm_machine_restart(char mode, const char *cmd)
         * 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();
@@ -114,18 +114,17 @@ void arm_machine_restart(char mode, const char *cmd)
        /* 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);
 }
 
 /*
@@ -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)
index 8fc2c8fcbdc646a4a8babecbf4a758f88e6d8d60..8b13930cdb0a689c1900a7ad2e568d2bdedda1b8 100644 (file)
@@ -908,8 +908,8 @@ void __init setup_arch(char **cmdline_p)
                arm_dma_zone_size = mdesc->dma_zone_size;
        }
 #endif
-       if (mdesc->soft_reboot)
-               reboot_setup("s");
+       if (mdesc->restart_mode)
+               reboot_setup(&mdesc->restart_mode);
 
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
@@ -928,6 +928,9 @@ void __init setup_arch(char **cmdline_p)
        paging_init(mdesc);
        request_standard_resources(mdesc);
 
+       if (mdesc->restart)
+               arm_pm_restart = mdesc->restart;
+
        unflatten_device_tree();
 
 #ifdef CONFIG_SMP
index f916cd7a477d14ca8b552f6b2a3fe8b231a8d40e..6c119937d398726f55cdd5d0e2cba57f7db000c4 100644 (file)
@@ -34,7 +34,7 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif
index d0ce8abdd4b67d4929d1f66d545004ec0fae3a8d..ce3ed244c4b0319afb3f2ecb0a64fe4cf84e564f 100644 (file)
@@ -283,7 +283,7 @@ MACHINE_START(EBSA110, "EBSA110")
        .atag_offset    = 0x400,
        .reserve_lp0    = 1,
        .reserve_lp2    = 1,
-       .soft_reboot    = 1,
+       .restart_mode   = 's',
        .map_io         = ebsa110_map_io,
        .init_irq       = ebsa110_init_irq,
        .timer          = &ebsa110_timer,
index 9a26245bf1fc58900c39242b90a6e1cabb3eeb14..0d5df72a03f6bb622d4a6b0aa90e07763c7ee462 100644 (file)
@@ -34,6 +34,6 @@ static inline void arch_idle(void)
        asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
 }
 
-#define arch_reset(mode, cmd)  cpu_reset(0x80000000)
+#define arch_reset(mode, cmd)  soft_restart(0x80000000)
 
 #endif
index d5f178540928604b414d538ffd00421c9e07c7b6..60b6774e1eaa069c3e49dd357eb22d1502cad9f3 100644 (file)
@@ -86,7 +86,7 @@ fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
 MACHINE_START(CATS, "Chalice-CATS")
        /* Maintainer: Philip Blundell */
        .atag_offset    = 0x100,
-       .soft_reboot    = 1,
+       .restart_mode   = 's',
        .fixup          = fixup_cats,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
index 0b293156620948269d1b6a6ca6e01079947d5762..249f895910fbaa2decbcd61dd49049e40e44386e 100644 (file)
@@ -24,7 +24,7 @@ static inline void arch_reset(char mode, const char *cmd)
                /*
                 * Jump into the ROM
                 */
-               cpu_reset(0x41000000);
+               soft_restart(0x41000000);
        } else {
                if (machine_is_netwinder()) {
                        /* open up the SuperIO chip
index 5987196b89c4adfdbfc912d90acd5fc3a72e8161..b4f83e5973b297df59cd36df8ef2daff62366d9e 100644 (file)
@@ -28,5 +28,5 @@ static inline void arch_reset(char mode, const char *cmd)
        *IOP3XX_PCSR = 0x30;
 
        /* Jump into ROM at address 0 */
-       cpu_reset(0);
+       soft_restart(0);
 }
index f192a34be0731969dec3547d846db75cd8920fad..86d1b20dd692e879d08a395e03e9a7b07d7a4664 100644 (file)
@@ -19,5 +19,5 @@ static inline void arch_reset(char mode, const char *cmd)
        *IOP3XX_PCSR = 0x30;
 
        /* Jump into ROM at address 0 */
-       cpu_reset(0);
+       soft_restart(0);
 }
index 54c0af7fa2d42296cb393c9d84456c22c3597480..24337d9d275bbebbf722e3b194a1f0e3b65070f2 100644 (file)
@@ -26,7 +26,7 @@ static inline void arch_reset(char mode, const char *cmd)
 {
        if ( 1 && mode == 's') {
                /* Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
        } else {
                /* Use on-chip reset capability */
 
index fb1dda9be2d0a8c7fd6a032fb06417af1499455d..ceb19c90aa529509cf7c392392113c5397447f9b 100644 (file)
@@ -32,7 +32,7 @@ static void arch_reset(char mode, const char *cmd)
        unsigned int reg;
 
        if (mode == 's')
-               cpu_reset(0);
+               soft_restart(0);
 
        /* disable timer0 */
        reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
index 1a8a25edb1b422ace6925e07171953390b51bc11..cb0637933a85b89051f0b48e09051adcd0fb1306 100644 (file)
@@ -19,8 +19,8 @@ static inline void arch_idle(void)
 static inline void arch_reset(char mode, const char *cmd)
 {
        if (cpu_is_pxa168())
-               cpu_reset(0xffff0000);
+               soft_restart(0xffff0000);
        else
-               cpu_reset(0);
+               soft_restart(0);
 }
 #endif /* __ASM_MACH_SYSTEM_H */
index 20ec3bddf7cde3581503c3182b74a0e83bf25257..cab88364e7c1475be90503c5aaa6c000ebeaea73 100644 (file)
@@ -53,7 +53,7 @@ void arch_reset(char mode, const char *cmd)
        mdelay(50);
 
        /* We'll take a jump through zero as a poor second */
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 static int __init mxs_arch_reset_init(void)
index 5dda2bb55f8d838fb817877572feafb7fc076004..5d6384a6128c661fbff12254954bbf1331bdf4ee 100644 (file)
@@ -32,7 +32,7 @@ static void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif
index b938fc2c316a7d7145423e96396d84ebae27afc6..4f47a760398ff379bddb73c24d47e48fc021c219 100644 (file)
@@ -752,6 +752,7 @@ static void mioa701_machine_exit(void)
 
 MACHINE_START(MIOA701, "MIO A701")
        .atag_offset    = 0x100,
+       .restart_mode   = 's',
        .map_io         = &pxa27x_map_io,
        .init_irq       = &pxa27x_init_irq,
        .handle_irq     = &pxa27x_handle_irq,
index 01e9d643394a9d28160a98ccaee118761d8fb75f..b8bcda15da81024212f443a9403b1658f31f422a 100644 (file)
@@ -88,7 +88,7 @@ void arch_reset(char mode, const char *cmd)
        switch (mode) {
        case 's':
                /* Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
                break;
        case 'g':
                do_gpio_reset();
index 953a9195f9e5bdd9850f62c2632c8f62c27fc9b2..2f57d94de727ab9881a1c55677181baf5291a1db 100644 (file)
@@ -982,6 +982,7 @@ static void __init spitz_fixup(struct tag *tags, char **cmdline,
 
 #ifdef CONFIG_MACH_SPITZ
 MACHINE_START(SPITZ, "SHARP Spitz")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
@@ -993,6 +994,7 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_BORZOI
 MACHINE_START(BORZOI, "SHARP Borzoi")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
@@ -1004,6 +1006,7 @@ MACHINE_END
 
 #ifdef CONFIG_MACH_AKITA
 MACHINE_START(AKITA, "SHARP Akita")
+       .restart_mode   = 'g',
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
index 402b0c96613baa424941d50e650ca4d5b51cc882..ef6453041cf13454b0baa4042993707616d7865a 100644 (file)
@@ -970,6 +970,7 @@ static void __init fixup_tosa(struct tag *tags, char **cmdline,
 }
 
 MACHINE_START(TOSA, "SHARP Tosa")
+       .restart_mode   = 'g',
        .fixup          = fixup_tosa,
        .map_io         = pxa25x_map_io,
        .nr_irqs        = TOSA_NR_IRQS,
index 45c7b935dc45b768aea310c398411a22ed4e1e02..a354f4d092c8b55dcfe536d1950f9f79da4efb25 100644 (file)
@@ -23,5 +23,5 @@ static inline void arch_reset(char mode, const char *cmd)
        /*
         * Jump into the ROM
         */
-       cpu_reset(0);
+       soft_restart(0);
 }
index 6faadcee7729bd525553bad354738fb66d87d94b..913893d446502981e6e268b4dc5ac3e9536b3109 100644 (file)
@@ -19,7 +19,7 @@ static void
 arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
-               cpu_reset(0);
+               soft_restart(0);
        }
 
        if (s3c24xx_reset_hook)
@@ -28,5 +28,5 @@ arch_reset(char mode, const char *cmd)
        arch_wdt_reset();
 
        /* we'll take a jump through zero as a poor second */
-       cpu_reset(0);
+       soft_restart(0);
 }
index 2e58cb7a71479d79181416714990cc6fb3a4509a..d8ca5786ba251ea158e6c79b5eee95f49f35943e 100644 (file)
@@ -24,7 +24,7 @@ static void arch_reset(char mode, const char *cmd)
                arch_wdt_reset();
 
        /* if all else fails, or mode was for soft, jump to 0 */
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif /* __ASM_ARCH_IRQ_H */
index ba9da9f7f1837cc0a94667ad3e0377dbba762237..345d35b7450cfc956399337218e7939c01271d1c 100644 (file)
@@ -14,7 +14,7 @@ static inline void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                /* Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
        } else {
                /* Use on-chip reset capability */
                RSRR = RSRR_SWR;
index 76a687eeaa22d706ca6c3d08cba1ebf6c9721896..956ac18ddbf9c58931503e9d0f5410179d3c81cd 100644 (file)
@@ -8,7 +8,7 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode, const char *cmd)
 {
-       cpu_reset(0);
+       soft_restart(0);
 }
 
 #endif
index ce228bdc66dd64ca3cf10d410138d68c6b25edc5..68875a1c16bed36402e1266d8437cbbce0252d85 100644 (file)
@@ -33,7 +33,7 @@ static void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                /* Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
        } else {
                __raw_writel(WTE | WTRE | WTCLK, WTCR);
        }
index 2be9139a4ef3cc5af97f03a30eefefe7d019740e..296ad2eaddb0565f3a14f4ab94b957a0d87c17e5 100644 (file)
@@ -78,7 +78,7 @@ void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
  * the user-mode pages.  This will then ensure that we have predictable
  * results when turning the mmu off
  */
-void setup_mm_for_reboot(char mode)
+void setup_mm_for_reboot(void)
 {
        /*
         * We need to access to user-mode page tables here. For kernel threads
index 941a98c9e8aaf327b5131227ccaddb1d697ad2e5..88417514b2c66b32375e79434d49d2900253bef4 100644 (file)
@@ -43,7 +43,7 @@ void __init paging_init(struct machine_desc *mdesc)
 /*
  * We don't need to do anything here for nommu machines.
  */
-void setup_mm_for_reboot(char mode)
+void setup_mm_for_reboot(void)
 {
 }
 
index d65fb31a55ca47ef350e38da864b6d34cf5295f9..7e5c76ea4466a425a49ba8e64f450403f58733ab 100644 (file)
@@ -71,7 +71,7 @@ void arch_reset(char mode, const char *cmd)
        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)
index a235fa0ca7778e922c39b6eca0426e369dae38de..1171f228d7188782b7be28db8b9baf21903192b0 100644 (file)
@@ -31,7 +31,7 @@ static inline void arch_reset(char mode, const char *cmd)
 {
        if (mode == 's') {
                /* software reset, Jump into ROM at address 0 */
-               cpu_reset(0);
+               soft_restart(0);
        } else {
                /* hardware reset, Use on-chip reset capability */
                sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);