From patchwork Mon May 13 04:20:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 243261 X-Patchwork-Delegate: sonic.adi@gmail.com 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 4F3FE2C00A4 for ; Mon, 13 May 2013 14:24:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A1224A025; Mon, 13 May 2013 06:24:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 7M5jBPMHpQvz; Mon, 13 May 2013 06:24:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E07A4A032; Mon, 13 May 2013 06:24:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3A3424A032 for ; Mon, 13 May 2013 06:24:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 2gjT7ez4BNzT for ; Mon, 13 May 2013 06:24:20 +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 am1outboundpool.messaging.microsoft.com (am1ehsobe002.messaging.microsoft.com [213.199.154.205]) by theia.denx.de (Postfix) with ESMTPS id 1B0974A03B for ; Mon, 13 May 2013 06:23:15 +0200 (CEST) Received: from mail18-am1-R.bigfish.com (10.3.201.232) by AM1EHSOBE017.bigfish.com (10.3.207.139) with Microsoft SMTP Server id 14.1.225.23; Mon, 13 May 2013 04:23:14 +0000 Received: from mail18-am1 (localhost [127.0.0.1]) by mail18-am1-R.bigfish.com (Postfix) with ESMTP id 91E5F2A0094; Mon, 13 May 2013 04:23:14 +0000 (UTC) X-Forefront-Antispam-Report: CIP:137.71.25.55; KIP:(null); UIP:(null); IPV:NLI; H:nwd2mta1.analog.com; RD:nwd2mail10.analog.com; EFVD:NLI X-SpamScore: 12 X-BigFish: VS12(zzzz1f42h1ee6h1ce5h1fdah1202h1fd0h1e76h1d1ah1cabh1d2ah1fc6hzz8275bhz2ei87h2a8h668h839hd24he5bh1288h12a5h12a9h12bdh12e5h1354h137ah139eh13b6h13eah1441h1504h1537h15a8h162dh1631h1758h17eeh1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fhff4m1355m129fi1155h) Received-SPF: neutral (mail18-am1: 137.71.25.55 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.55; envelope-from=sonic.adi@gmail.com; helo=nwd2mta1.analog.com ; 1.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail18-am1 (localhost.localdomain [127.0.0.1]) by mail18-am1 (MessageSwitch) id 1368418993311385_28727; Mon, 13 May 2013 04:23:13 +0000 (UTC) Received: from AM1EHSMHS021.bigfish.com (unknown [10.3.201.247]) by mail18-am1.bigfish.com (Postfix) with ESMTP id 4904230004B; Mon, 13 May 2013 04:23:13 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by AM1EHSMHS021.bigfish.com (10.3.207.150) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 13 May 2013 04:23:12 +0000 Received: from NWD2HUBCAS5.ad.analog.com (nwd2hubcas5.ad.analog.com [10.64.72.161]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id r4D4MViF018861 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 12 May 2013 21:22:31 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS5.ad.analog.com (10.64.72.161) with Microsoft SMTP Server id 14.3.123.3; Mon, 13 May 2013 00:22:10 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id r4D4M9h1011127; Mon, 13 May 2013 00:22:09 -0400 Received: from localhost.localdomain (unknown [10.99.22.72]) by linux.site (Postfix) with ESMTP id 7947D4270F17; Sun, 12 May 2013 14:55:43 -0600 (MDT) From: Sonic Zhang To: Date: Mon, 13 May 2013 12:20:17 +0800 Message-ID: <1368418817-27670-3-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1368418817-27670-1-git-send-email-sonic.adi@gmail.com> References: <1368418817-27670-1-git-send-email-sonic.adi@gmail.com> MIME-Version: 1.0 Cc: u-boot-devel@blackfin.uclinux.org, Sonic Zhang Subject: [U-Boot] [PATCH v1 3/3] blackfin: Uart divisor should be set after their values are generated. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 From: Sonic Zhang Signed-off-by: Sonic Zhang --- arch/blackfin/cpu/initcode.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c index 4b10b6c..8ef0b92 100644 --- a/arch/blackfin/cpu/initcode.c +++ b/arch/blackfin/cpu/initcode.c @@ -715,8 +715,8 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB) * for dividing which means we'd generate a libgcc reference. */ unsigned int sdivR, vcoR; - unsigned int dividend = sdivB * divB * vcoR; - unsigned int divisor = vcoB * sdivR; + unsigned int dividend; + unsigned int divisor; unsigned int quotient; serial_putc('a'); @@ -729,6 +729,9 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint divB, uint vcoB) sdivR = bfin_read_PLL_DIV() & 0xf; vcoR = (bfin_read_PLL_CTL() >> 9) & 0x3f; #endif + + dividend = sdivB * divB * vcoR; + divisor = vcoB * sdivR; quotient = early_division(dividend, divisor); serial_early_put_div(quotient - ANOMALY_05000230); serial_putc('c');