From patchwork Fri Feb 15 08:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10814399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C92B13B5 for ; Fri, 15 Feb 2019 09:04:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 203C52E041 for ; Fri, 15 Feb 2019 09:04:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 146AB2E060; Fri, 15 Feb 2019 09:04:54 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDB772E041 for ; Fri, 15 Feb 2019 09:04:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 53FE56EB53; Fri, 15 Feb 2019 09:04:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A69B6EB3B for ; Fri, 15 Feb 2019 09:04:30 +0000 (UTC) Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id cwzN1z00n3XaVaC01wzNQf; Fri, 15 Feb 2019 09:59:25 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1guZL7-0004hQ-TY; Fri, 15 Feb 2019 09:59:21 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1guZKo-0005bK-T8; Fri, 15 Feb 2019 09:59:02 +0100 From: Geert Uytterhoeven To: Bartlomiej Zolnierkiewicz , Michael Schmitz Subject: [PATCH 3/4] fbdev: atafb: Fix broken frame buffer after kexec Date: Fri, 15 Feb 2019 09:59:00 +0100 Message-Id: <20190215085901.21479-4-geert@linux-m68k.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190215085901.21479-1-geert@linux-m68k.org> References: <20190215085901.21479-1-geert@linux-m68k.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Gortmaker , linux-fbdev@vger.kernel.org, Geert Uytterhoeven , linux-m68k@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Falcon, Atari frame buffer initialization relies on preprogrammed register values. These register values are changed to blank the console. Hence when using kexec to boot into a new kernel while the console is blanked, the new kernel cannot determine the current video configuration, and the Atari frame buffer driver fails to initialize: atafb: phys_screen_base 6ce000 screen_len 4096 Fix this by doing a straight-forward conversion of the driver to a platform device driver, and adding a shutdown handler that unblanks the display. Signed-off-by: Geert Uytterhoeven --- drivers/video/fbdev/atafb.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index d82007c113e6303c..4db8166d11b30409 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -3072,7 +3073,7 @@ int __init atafb_setup(char *options) return 0; } -int __init atafb_init(void) +static int __init atafb_probe(struct platform_device *pdev) { int pad, detected_mode, error; unsigned int defmode = 0; @@ -3084,9 +3085,6 @@ int __init atafb_init(void) atafb_setup(option); printk("atafb_init: start\n"); - if (!MACH_IS_ATARI) - return -ENODEV; - do { #ifdef ATAFB_EXT if (external_addr) { @@ -3247,4 +3245,32 @@ int __init atafb_init(void) return 0; } +static void atafb_shutdown(struct platform_device *pdev) +{ + /* Unblank before kexec */ + if (fbhw->blank) + fbhw->blank(0); +} + +static struct platform_driver atafb_driver = { + .shutdown = atafb_shutdown, + .driver = { + .name = "atafb", + }, +}; + +static int __init atafb_init(void) +{ + struct platform_device *pdev; + + if (!MACH_IS_ATARI) + return -ENODEV; + + pdev = platform_device_register_simple("atafb", -1, NULL, 0); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + + return platform_driver_probe(&atafb_driver, atafb_probe); +} + device_initcall(atafb_init);