From patchwork Sat Sep 4 14:17:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 63779 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 55FB3B710D for ; Sun, 5 Sep 2010 00:20:56 +1000 (EST) Received: from localhost ([127.0.0.1]:60529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ortbv-0002HN-LL for incoming@patchwork.ozlabs.org; Sat, 04 Sep 2010 10:20:51 -0400 Received: from [140.186.70.92] (port=60413 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrtZR-0001BO-Bg for qemu-devel@nongnu.org; Sat, 04 Sep 2010 10:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrtZQ-000847-IM for qemu-devel@nongnu.org; Sat, 04 Sep 2010 10:18:17 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:37512) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrtZQ-0007xn-Eu for qemu-devel@nongnu.org; Sat, 04 Sep 2010 10:18:16 -0400 Received: by mail-qw0-f45.google.com with SMTP id 5so2800166qwh.4 for ; Sat, 04 Sep 2010 07:18:16 -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=hb0OnA7mEUsWfFIK439OuNfqoxRceptrNJiJyY2B5TA=; b=Ui8W0F04x9zbyfKwT5RWCH2DkwcxeyHuZY8PJJf3waBgT5e79dsObdflE587eWDICP KT0CXB1J0EnVGJRZb4bnQyKvsBr+VW2OynWAQ53fXCJUX3UzHiWf4jQB3xUwQC9oIksn nhnYv0trj+S/zMDl8Jz9lzl600hFoQbR1QO/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=GGy/jM+pexeAUPZ4IXDiu38NXvoQcBWmncLWo+9C6m1O1ZPMeY0Wje3ED5qZ8EAT8m O8H1NtLYzXMle4FbkvLL75jTFtrtTJj53UPMTzKLO9bLg0WrT6tfXqR0yTvxMYTfGKwF JRuY9fcgcht3MOXO5tD8ccZN0N659SyCeLRjc= Received: by 10.229.2.42 with SMTP id 42mr1228189qch.235.1283609896156; Sat, 04 Sep 2010 07:18:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.240.135 with HTTP; Sat, 4 Sep 2010 07:17:56 -0700 (PDT) From: Blue Swirl Date: Sat, 4 Sep 2010 14:17:56 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 4/5] 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 fixes 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 3c06bf9..ec7fd68 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; }