From patchwork Wed Aug 15 13:55:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Erik Floryd X-Patchwork-Id: 957936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rt-labs.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rt-labs-com.20150623.gappssmtp.com header.i=@rt-labs-com.20150623.gappssmtp.com header.b="MhD4+XCQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41r9xK5KWcz9sCD for ; Wed, 15 Aug 2018 23:56:36 +1000 (AEST) Received: from localhost ([::1]:49776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpwHo-0006IA-SX for incoming@patchwork.ozlabs.org; Wed, 15 Aug 2018 09:56:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpwHW-0006Hw-F6 for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpwHS-0003xM-VA for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:56:14 -0400 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:47040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpwHS-0003ns-AM for qemu-devel@nongnu.org; Wed, 15 Aug 2018 09:56:10 -0400 Received: by mail-lf1-x142.google.com with SMTP id l16-v6so923294lfc.13 for ; Wed, 15 Aug 2018 06:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rt-labs-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Kb7aWsu8zS2IOeSg5ko2TIUgTzGM9dkgU/rT5SsqMLM=; b=MhD4+XCQj0BrIes7LClbQxbrP/ngDMfp7Rbizj13fpbfCB6EIsrEe+IgmXzeYpMfYn OHsPCJ388iy5hr8CcZ4sLTo5fZzwC29EwrYSZ3mbZLRe7us1EQKe/fGcIaEBDzqFfps0 MyceSAVmvI9x0GXfnLzcYGLRlgE3/vM9T8NaYuvuSYh2o//TXi53MPqyffcZqCoJ4KP/ 7qjfsBLfoVBk2YM7qWs2tmap6Dudd3FbGUPvuDipesLjc80oVj4Tbkp/3K9qL5QL6dXd wYHIJaxI29lml0wli9dv6uZIGP8hMUAn2KpRlDWNLgXg+mprN13I6XcIQrte9c7nsJvA nv3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Kb7aWsu8zS2IOeSg5ko2TIUgTzGM9dkgU/rT5SsqMLM=; b=CwZ3OHcgBNn8MKSwKXQHE4AX+4fFZqN227BAey3kVBF5X0ymla3h/9RT4qWuCTSAKs ItOsE/tGbaKZuGobhAjHTNcsIPJ3GCX/um3D7wv0JqbM9ke6e+Jtbeb0ii+ZNNF/ggRC p9kAXySTK11SuplhQm0B/RgEh6T1ocbfIKv2TiUzjApfs6xX1fyjA1QvL06h3XiVWOQr dJgygnrNxCvln0QGvYdaegPeESTo/v6IRHeYti5ncw9gXShlCyzU1jsVJNx4dwJf+d/2 /sfebwUaxBpmaUZ2WmW3Xbysg2wBUKoB8dxpzmtysxPLxxwhVHawF0Wybiy8nX7d3DPh 68cg== X-Gm-Message-State: AOUpUlEN2xSvv182PcnNJwrvdYvwp7n4IAv5nsBeWMYdT6iF3RLFPsdc dM9TPZ+cmkeYtv3ZlV5Xi8YPWw== X-Google-Smtp-Source: AA+uWPy/wvH3nxdnS9xPg8r1bqFO4rcb0WSLW9R7ujBPx22euIjoVrJcvXEB/K0bPiph1YQVHCOcvw== X-Received: by 2002:a19:a705:: with SMTP id q5-v6mr17832662lfe.148.1534341368484; Wed, 15 Aug 2018 06:56:08 -0700 (PDT) Received: from rtlap25.rt-labs.intra (h-72-195.A137.corp.bahnhof.se. [212.116.72.195]) by smtp.gmail.com with ESMTPSA id d4-v6sm339900lfc.57.2018.08.15.06.56.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Aug 2018 06:56:07 -0700 (PDT) From: Hans-Erik Floryd To: qemu-trivial@nongnu.org Date: Wed, 15 Aug 2018 15:55:54 +0200 Message-Id: <1534341354-11956-1-git-send-email-hans-erik.floryd@rt-labs.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::142 Subject: [Qemu-devel] [PATCH] imx_serial: Generate interrupt on receive data ready if enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "open list:i.MX31" , Peter Chubb , "open list:All patches CC here" , Hans-Erik Floryd Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Generate an interrupt if USR2_RDR and UCR4_DREN are both set. Signed-off-by: Hans-Erik Floryd --- hw/char/imx_serial.c | 3 ++- include/hw/char/imx_serial.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index 0747db9..1e36319 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -74,8 +74,9 @@ static void imx_update(IMXSerialState *s) mask = (s->ucr1 & UCR1_TXMPTYEN) ? USR2_TXFE : 0; /* * TCEN and TXDC are both bit 3 + * RDR and DREN are both bit 0 */ - mask |= s->ucr4 & UCR4_TCEN; + mask |= s->ucr4 & (UCR4_TCEN | UCR4_DREN); usr2 = s->usr2 & mask; diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h index ee80da1..c8b7428 100644 --- a/include/hw/char/imx_serial.h +++ b/include/hw/char/imx_serial.h @@ -68,6 +68,7 @@ #define UCR2_RXEN (1<<1) /* Receiver enable */ #define UCR2_SRST (1<<0) /* Reset complete */ +#define UCR4_DREN BIT(0) /* Receive Data Ready interrupt enable */ #define UCR4_TCEN BIT(3) /* TX complete interrupt enable */ #define UTS1_TXEMPTY (1<<6)