From patchwork Thu Nov 13 13:11:24 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaofu Chen X-Patchwork-Id: 71647 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from mail.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 9CBB1832E40A for ; Thu, 13 Nov 2008 14:19:44 +0100 (CET) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by mail.denx.de (Postfix) with ESMTP id 992C6B8539 for ; Thu, 13 Nov 2008 14:20:10 +0100 (CET) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.8) for (single-drop); Thu, 13 Nov 2008 14:20:10 +0100 (CET) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Thu, 13 Nov 2008 14:19:54 +0100 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Thu, 13 Nov 2008 14:17:58 +0100 Received: from scanner-2.m-online.net (scanner-2.m-online.net [192.168.2.220]) by mail.m-online.net (Postfix) with ESMTP id 1F0552000A5; Thu, 13 Nov 2008 14:17:58 +0100 (CET) Received: from mxin-1.m-online.net ([192.168.2.222]) by scanner-2.m-online.net (scanner-2.m-online.net [192.168.2.220]) (amavisd-new, port 10026) with ESMTP id 08922-03-2; Thu, 13 Nov 2008 14:17:56 +0100 (CET) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id 1082D46C0C3; Thu, 13 Nov 2008 14:17:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 718DA28274; Thu, 13 Nov 2008 14:17:48 +0100 (CET) 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 f9Z7GmrgV3Z2; Thu, 13 Nov 2008 14:17:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D490528275; Thu, 13 Nov 2008 14:17:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 094E628270 for ; Thu, 13 Nov 2008 14:17:42 +0100 (CET) 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 GF7U7BywF6kC for ; Thu, 13 Nov 2008 14:17:41 +0100 (CET) X-Greylist: delayed 374 seconds by postgrey-1.27 at theia; Thu, 13 Nov 2008 14:17:40 CET Received: from n76.bullet.mail.sp1.yahoo.com (n76.bullet.mail.sp1.yahoo.com [98.136.44.48]) by theia.denx.de (Postfix) with SMTP id F22EF2826F for ; Thu, 13 Nov 2008 14:17:40 +0100 (CET) Received: from [69.147.65.151] by n76.bullet.mail.sp1.yahoo.com with NNFMP; 13 Nov 2008 13:11:25 -0000 Received: from [69.147.65.167] by t5.bullet.mail.sp1.yahoo.com with NNFMP; 13 Nov 2008 13:11:25 -0000 Received: from [127.0.0.1] by omp502.mail.sp1.yahoo.com with NNFMP; 13 Nov 2008 13:11:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 294868.76332.bm@omp502.mail.sp1.yahoo.com Received: (qmail 34754 invoked by uid 60001); 13 Nov 2008 13:11:25 -0000 X-YMail-OSG: hsvX.osVM1mOV2sHO_TF3HhznB90yYwJ6miSVbjayafSyYv_TCVQdF_.tEmCio1SJvoD5WhV3ZmnNZdp0MY0rDgeilMB5a1Uzo3_BYwsIvJt73sNl6Nfz7KxXpeKuzeguMfSdg-- Received: from [220.166.45.249] by web45012.mail.sp1.yahoo.com via HTTP; Thu, 13 Nov 2008 05:11:24 PST X-Mailer: YahooMailWebService/0.7.260.1 Date: Thu, 13 Nov 2008 05:11:24 -0800 (PST) From: Chaofu Chen To: u-boot MIME-Version: 1.0 Message-ID: <88421.34726.qm@web45012.mail.sp1.yahoo.com> Subject: [U-Boot] [PATCH] bug fix for the delay function of ARM s3c44b0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net The original implementation of delay function of ARM s3c44b0 doesnt' cooperate with U-Boot kernel well, which will cause fake-time-out. What is important is to keep timestamp in unit of millisecond. diff -purN old/cpu/s3c44b0/interrupts.c new/cpu/s3c44b0/interrupts.c --- old/cpu/s3c44b0/interrupts.c 2005-12-17 00:39:27.000000000 +0800 +++ new/cpu/s3c44b0/interrupts.c 2008-11-13 20:36:46.000000000 +0800 @@ -147,7 +147,7 @@ static ulong lastdec; int interrupt_init (void) { TCFG0 = 0x000000E9; - TCFG1 = 0x00000004; + TCFG1 = 0x00000040; TCON = 0x00000900; TCNTB1 = TIMER_LOAD_VAL; TCMPB1 = 0; @@ -185,7 +185,7 @@ void udelay (unsigned long usec) tmo = usec / 1000; tmo *= CFG_HZ; - tmo /= 8; + tmo /= 1000; tmo += get_timer (0); @@ -213,7 +213,7 @@ ulong get_timer_masked (void) } lastdec = now; - return timestamp; + return (timestamp >> 3); } void udelay_masked (unsigned long usec) @@ -225,10 +225,9 @@ void udelay_masked (unsigned long usec) if (usec >= 1000) { tmo = usec / 1000; tmo *= CFG_HZ; - tmo /= 8; + tmo /= 1000; } else { - tmo = usec * CFG_HZ; - tmo /= (1000*8); + tmo = 1; } endtime = get_timer(0) + tmo;