From patchwork Fri Oct 23 01:39:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 534681 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 90C0E14130F for ; Fri, 23 Oct 2015 12:37:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VPJ7MNs7; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 542C8B3810; Fri, 23 Oct 2015 03:37:25 +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 FmOGOkmLVAUH; Fri, 23 Oct 2015 03:37:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 39FB1B3812; Fri, 23 Oct 2015 03:37:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D14FB37D9 for ; Fri, 23 Oct 2015 03:36:47 +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 3vP0aO-kNI5a for ; Fri, 23 Oct 2015 03:36:47 +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-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by theia.denx.de (Postfix) with ESMTPS id 28FDDB37D1 for ; Fri, 23 Oct 2015 03:36:42 +0200 (CEST) Received: by padhk11 with SMTP id hk11so102441770pad.1 for ; Thu, 22 Oct 2015 18:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=SML4GnZ3TdCqX+b/nbJCuc+ppzrvmF45dapjR2Ht0qk=; b=VPJ7MNs7hEkFqXj7Ux8mIfrHbmsKyDBtF8uZX7TH+wN1J4J8ev8shyx5L84z3cgh2s OC/4m6NL6+I+ovhYGxR5f0MjtjwjycCsKWF8Y03RyMfCAVgQekGsNvr9dSGd/kyiTS1p 6O5c/XzMC1KIeCFefN8eQm9G8cQQMKnjR2UIQP+rwNaqBYthGKsbRXWJF8swmF721v9K 4jzRkIfWRtOk1BFBYWAIkJWMgon9TivblE6ovopAJn6XiDYfq8oZvjY/PnyTXu3CwcO5 nu+fBhjoChrpuBiM/sdMlSn49iwTxxo825cvnIUzX9Z6xDm15qe/bAib2HOzXWYzLlC9 s+/g== X-Received: by 10.66.90.165 with SMTP id bx5mr1578439pab.87.1445564201323; Thu, 22 Oct 2015 18:36:41 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id nz4sm15938360pbb.47.2015.10.22.18.36.40 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Oct 2015 18:36:40 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Thu, 22 Oct 2015 18:39:11 -0700 Message-Id: <1445564355-19911-5-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1445564355-19911-1-git-send-email-bmeng.cn@gmail.com> References: <1445564355-19911-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 4/8] x86: Initialize i8254 timer counter 1 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Initialize counter 1, used to refresh request signal. This is required for legacy purpose as some codes like vgabios utilizes counter 1 to provide delay functionality. Signed-off-by: Bin Meng Acked-by: Simon Glass --- arch/x86/lib/pcat_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/lib/pcat_timer.c b/arch/x86/lib/pcat_timer.c index ce15818..347cdda 100644 --- a/arch/x86/lib/pcat_timer.c +++ b/arch/x86/lib/pcat_timer.c @@ -9,11 +9,21 @@ #include #include +#define TIMER1_VALUE 18 /* 15.6us */ #define TIMER2_VALUE 0x0a8e /* 440Hz */ int pcat_timer_init(void) { /* + * Initialize counter 1, used to refresh request signal. + * This is required for legacy purpose as some codes like + * vgabios utilizes counter 1 to provide delay functionality. + */ + outb(PIT_CMD_CTR1 | PIT_CMD_LOW | PIT_CMD_MODE2, + PIT_BASE + PIT_COMMAND); + outb(TIMER1_VALUE, PIT_BASE + PIT_T1); + + /* * Initialize counter 2, used to drive the speaker. * To start a beep, set both bit0 and bit1 of port 0x61. * To stop it, clear both bit0 and bit1 of port 0x61.