From patchwork Fri Sep 10 21:00:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 64463 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E09EDB70A5 for ; Sat, 11 Sep 2010 07:11:59 +1000 (EST) Received: from localhost ([127.0.0.1]:36271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuAt1-00064h-MV for incoming@patchwork.ozlabs.org; Fri, 10 Sep 2010 17:11:55 -0400 Received: from [140.186.70.92] (port=52175 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuAi0-00020B-UM for qemu-devel@nongnu.org; Fri, 10 Sep 2010 17:00:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuAhz-0001kB-LB for qemu-devel@nongnu.org; Fri, 10 Sep 2010 17:00:32 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:36853) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuAhz-0001ej-IC for qemu-devel@nongnu.org; Fri, 10 Sep 2010 17:00:31 -0400 Received: by mail-qw0-f45.google.com with SMTP id 4so10818qwi.4 for ; Fri, 10 Sep 2010 14:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=Q71qzH5mQLWz7A1di4jRCJakl2hC8BPYqnM+5XluOyY=; b=QC2NWigxHEz9Ile/SAWTKaGdLmkDJcELQBgYsf8bD1R+5MYv/RJJyhlStG+RAZo4Bx iRkTH6uSzLvxPL7d96YmyIXvLpc3F5yykkE2RQPlF8DN8JGbH2x0uIlS76wuA+VhU1Kl BRFiClvh7ySeX60Bm4KWcH6g60WVipW2tSh9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=noPmJWhUJBrAF9iq/SOLqZ8rrqivkQ9Q+f3G8hboMcAq902VYD1/oLJtZygCmFeo9J 7ZiX+BgK6uoz30cHnA3ucBHoH1Am3MGzF04vxpCVDPyN4OZecstGRot222qW26ApEHPS bgx0yOk0XPhitDTkiApbouWH8xsGwvyi9Z1Tg= Received: by 10.224.113.1 with SMTP id y1mr729144qap.333.1284152431271; Fri, 10 Sep 2010 14:00:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.240.135 with HTTP; Fri, 10 Sep 2010 14:00:11 -0700 (PDT) From: Blue Swirl Date: Fri, 10 Sep 2010 21:00:11 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 11/15] pxa2xx: fix SSSR TFN logic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix SSSR TFN logic: TX FIFO is never filled, so it is always in underrun condition if SSP is enabled. This also avoids a gcc warning with -Wtype-limits. Signed-off-by: Blue Swirl --- hw/pxa2xx.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c index faa3d95..88f61c0 100644 --- a/hw/pxa2xx.c +++ b/hw/pxa2xx.c @@ -636,6 +636,7 @@ static void pxa2xx_ssp_fifo_update(PXA2xxSSPState *s) { s->sssr &= ~(0xf << 12); /* Clear RFL */ s->sssr &= ~(0xf << 8); /* Clear TFL */ + s->sssr &= ~SSSR_TFS; s->sssr &= ~SSSR_TNF; if (s->enable) { s->sssr |= ((s->rx_level - 1) & 0xf) << 12; @@ -643,14 +644,13 @@ static void pxa2xx_ssp_fifo_update(PXA2xxSSPState *s) s->sssr |= SSSR_RFS; else s->sssr &= ~SSSR_RFS; - if (0 <= SSCR1_TFT(s->sscr[1])) - s->sssr |= SSSR_TFS; - else - s->sssr &= ~SSSR_TFS; if (s->rx_level) s->sssr |= SSSR_RNE; else s->sssr &= ~SSSR_RNE; + /* TX FIFO is never filled, so it is always in underrun + condition if SSP is enabled */ + s->sssr |= SSSR_TFS; s->sssr |= SSSR_TNF; }