From patchwork Fri Aug 19 16:29:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9290563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 776CC607FF for ; Fri, 19 Aug 2016 16:31:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69283294D2 for ; Fri, 19 Aug 2016 16:31:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C4F2294DC; Fri, 19 Aug 2016 16:31:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6283294D2 for ; Fri, 19 Aug 2016 16:31:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bamfz-0008N3-UR; Fri, 19 Aug 2016 16:29:47 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bamfh-0008Hv-Kk for linux-arm-kernel@lists.infradead.org; Fri, 19 Aug 2016 16:29:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:To:From; bh=KKSxNMO9sVkU/7kS7v9sU1pbZMgD9VbpQX2nCCzcqvs=; b=WfCcc8mBvMNgwhueokZm9fyv+XK8ROmt6GIv3PQvUUPx0DICYE0ucsVNfp0S+B9nUgC0kJIQlCHDHunSXyjSGc0uNL7KHqSa53oedOaq8B0O4M3faE/aFyu4Wtwn84lDlnt2Qg+C7JkNamPK5CT6MtBbNLWBiaCgCoh1Re3b2Wk=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:49916 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1bamfH-0003Ij-MK for linux-arm-kernel@lists.infradead.org; Fri, 19 Aug 2016 17:29:03 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1bamfG-0002WE-49 for linux-arm-kernel@lists.infradead.org; Fri, 19 Aug 2016 17:29:02 +0100 From: Russell King To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: sa1100: clear reset status prior to reboot MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 19 Aug 2016 17:29:02 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160819_092930_077007_61DA887A X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Clear the current reset status prior to rebooting the platform. This adds the bit missing from 04fef228fb00 ("[ARM] pxa: introduce reset_status and clear_reset_status for driver's usage"). Signed-off-by: Russell King --- arch/arm/kernel/setup.c | 2 +- arch/arm/mach-sa1100/assabet.c | 25 +++++++++++++++++++------ arch/arm/mach-sa1100/generic.c | 3 +++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index aca999e17184..511d86d60119 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1157,7 +1157,7 @@ static int __init topology_init(void) return 0; } -subsys_initcall(topology_init); +postcore_initcall(topology_init); #ifdef CONFIG_HAVE_PROC_CPU static int __init proc_cpu_init(void) diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index d28ecb9ef172..efb8ebecff9b 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -63,6 +63,11 @@ EXPORT_SYMBOL(SCR_value); static unsigned long BCR_value = ASSABET_BCR_DB1110; +void assabet_debug_bcr(const char *msg) +{ + pr_info("Assabet: %s: BCR=%08lx\n", msg, BCR_value); +} + void ASSABET_BCR_frob(unsigned int mask, unsigned int val) { unsigned long flags; @@ -340,7 +345,7 @@ static void assabet_lcd_set_visual(u32 visual) #ifndef ASSABET_PAL_VIDEO static void assabet_lcd_backlight_power(int on) { - if (on) + if (on && 0) ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON); else ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON); @@ -353,9 +358,10 @@ static void assabet_lcd_backlight_power(int on) */ static void assabet_lcd_power(int on) { - if (on) { + if (on && 0) { + msleep(500); ASSABET_BCR_set(ASSABET_BCR_LCD_ON); - udelay(500); + msleep(500); } else ASSABET_BCR_clear(ASSABET_BCR_LCD_ON); } @@ -448,8 +454,8 @@ static void __init assabet_init(void) * Set up registers for sleep mode. */ PWER = PWER_GPIO0; - PGSR = 0; - PCFR = 0; + PGSR = GPIO_GPIO(17); + PCFR = PCFR_OPDE | PCFR_FP; PSDR = 0; PPDR |= PPC_TXD3 | PPC_TXD1; PPSR |= PPC_TXD3 | PPC_TXD1; @@ -530,6 +536,11 @@ static void __init get_assabet_scr(void) SCR_value = scr; } +static char neponset_cmdline[] __initdata = "console=ttySA0,38400n8 " +"cpufreq=221200 rw root=/dev/mtdblock2 " +"mtdparts=sa1100:512K(boot),1M(kernel),2560K(initrd),4M(root) " +"load_ramdisk=1 prompt_ramdisk=0 mem=32M noinitrd initrd=0xc0800000,3M profile=2"; + static void __init fixup_assabet(struct tag *tags, char **cmdline) { @@ -537,8 +548,10 @@ fixup_assabet(struct tag *tags, char **cmdline) map_sa1100_gpio_regs(); get_assabet_scr(); - if (machine_has_neponset()) + if (machine_has_neponset()) { printk("Neponset expansion board detected\n"); + *cmdline = neponset_cmdline; + } } diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 2e2c35b8e0d4..3e09beddb6e8 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -34,6 +34,7 @@ #include #include +#include #include "generic.h" #include @@ -95,6 +96,8 @@ static void sa1100_power_off(void) void sa11x0_restart(enum reboot_mode mode, const char *cmd) { + clear_reset_status(RESET_STATUS_ALL); + if (mode == REBOOT_SOFT) { /* Jump into ROM at address 0 */ soft_restart(0);