From patchwork Mon Aug 17 10:45:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 507932 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 0B2D9140134 for ; Mon, 17 Aug 2015 20:46:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=0hehHxT7; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 54C5C4B9B3; Mon, 17 Aug 2015 12:46:48 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ryGU5cZW8L1F; Mon, 17 Aug 2015 12:46:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD95E4B9DD; Mon, 17 Aug 2015 12:46:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 39F7E4B9A1 for ; Mon, 17 Aug 2015 12:46:15 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C0DfAbCi2gFW for ; Mon, 17 Aug 2015 12:46:15 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com [209.85.220.181]) by theia.denx.de (Postfix) with ESMTPS id 84F834B994 for ; Mon, 17 Aug 2015 12:46:11 +0200 (CEST) Received: by qkbm65 with SMTP id m65so44838965qkb.2 for ; Mon, 17 Aug 2015 03:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:mime-version :content-type; bh=1kc134neVz4WJfZV/WyZcWgZWTRG9Lt7kzC4nNvTI3I=; b=0hehHxT7R67vdhXIH+UYdSLJjftFB9q3fOYg1N5MXNGmfXaHH9zMwR6vVF2AIZQA2h tLwQgyADdAzHsWOs7CgN8D/V+StlKlD938CSn3TWw7buXSZubbmSHs72RFtn88Bzfpkf ryM+BxJFHzuWEFzllI4UY0gZNziFRHST9u8vgsCIE11DG4wqXQWOfLJXBradUxhiVeTH ynXNEEOsvTJW4RTkQGgwd68eXtgn09WPTAe50NtOpXUXoyXHKHEIK0eqlmvns9maqO50 pOcINn72pPGLKFlVT+rGdjPunkB5FyTFPPeS4RAvIVrfpuCgzEho78BtesIjyGKpMQSG MLaw== X-Received: by 10.55.40.130 with SMTP id o2mr1175551qko.10.1439808370171; Mon, 17 Aug 2015 03:46:10 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s5.hotmail.com. [134.170.2.220]) by smtp.gmail.com with ESMTPSA id 19sm7957485qhx.39.2015.08.17.03.46.09 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Aug 2015 03:46:09 -0700 (PDT) Received: from BLU436-SMTP188 ([134.170.2.215]) by BLU004-WSS1S5.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 17 Aug 2015 03:46:09 -0700 X-TMN: [0S2HPOdolW6feAB+RV7yhiGp52tqqdBF] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Mon, 17 Aug 2015 18:45:46 +0800 X-Mailer: git-send-email 2.3.2 (Apple Git-55) In-Reply-To: <1439808347-757-1-git-send-email-bmeng.cn@gmail.com> References: <1439808347-757-1-git-send-email-bmeng.cn@gmail.com> X-OriginalArrivalTime: 17 Aug 2015 10:46:08.0319 (UTC) FILETIME=[ECA084F0:01D0D8D9] MIME-Version: 1.0 Subject: [U-Boot] [PATCH 4/5] video: cfb_console: Allow VGA device to work without i8042 keyboard X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" So far if CONFIG_VGA_AS_SINGLE_DEVICE is not defined, the VGA device will try to initialize a keyboard device (for x86, it is i8042). But if i8042 controller initialization fails (eg: there is no keyboard connected to the PS/2 port), drv_video_init() just simply returns. This kills the opportunity of using a usb keyboard later with the vga concole, as the vga initialization part is actually ok, only keyboard part fails. Change the code logic to allow this. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- In the long term, we should remove CONFIG_VGA_AS_SINGLE_DEVICE and treat the cfb_concole an output device only. The keyboard part should be moved out of cfb_console driver and be as a input device driver separately. drivers/video/cfb_console.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 30e0317..aa7ca86 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -2247,16 +2247,17 @@ __weak int board_video_skip(void) int drv_video_init(void) { - int skip_dev_init; struct stdio_dev console_dev; bool have_keyboard; + bool __maybe_unused keyboard_ok = false; /* Check if video initialization should be skipped */ if (board_video_skip()) return 0; /* Init video chip - returns with framebuffer cleared */ - skip_dev_init = (video_init() == -1); + if (video_init() == -1) + return 0; if (board_cfb_skip()) return 0; @@ -2272,11 +2273,9 @@ int drv_video_init(void) if (have_keyboard) { debug("KBD: Keyboard init ...\n"); #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE) - skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1); + keyboard_ok = !(VIDEO_KBD_INIT_FCT == -1); #endif } - if (skip_dev_init) - return 0; /* Init vga device */ memset(&console_dev, 0, sizeof(console_dev)); @@ -2287,7 +2286,7 @@ int drv_video_init(void) console_dev.puts = video_puts; /* 'puts' function */ #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE) - if (have_keyboard) { + if (have_keyboard && keyboard_ok) { /* Also init console device */ console_dev.flags |= DEV_FLAGS_INPUT; console_dev.tstc = VIDEO_TSTC_FCT; /* 'tstc' function */