From patchwork Sun Jan 15 21:10:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 9517867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 40CC2600F6 for ; Sun, 15 Jan 2017 21:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0299026CF9 for ; Sun, 15 Jan 2017 21:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAC0E28410; Sun, 15 Jan 2017 21:15:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93E7B26CF9 for ; Sun, 15 Jan 2017 21:15:46 +0000 (UTC) Received: from localhost ([::1]:52969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSs9R-00025H-U0 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Jan 2017 16:15:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSs4r-0006EX-84 for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:11:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSs4o-0002rJ-2r for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:11:01 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSs4n-0002rD-Tj for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:10:58 -0500 Received: by mail-pf0-x244.google.com with SMTP id e4so2469944pfg.0 for ; Sun, 15 Jan 2017 13:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JdeLh6+q3QCEvY9B/U737s/Dn4YYq4MGGG8Jno5dHi4=; b=dcj+gugq5fYJi4nrINKej5vxMBSRlDLE63d5cX2XG/+uKWmDVejDGyb0PDK60i9JNe 8WnyochV7dwXlxHaAyh5lkQAyOdwvp4j4DrH1O7/+PKDKnDc4Miqqjaak4qKC41bLaay txIg2S/++/hgWTIB4nlh3xY9c9kYVQBWIRxnkSx3gLfx83knA6QbAXVsnWqiUTJiMulV yL4XTmUZ1mb/oH0NwDFd0SZwNNAka7oidcITeFH8iOdnrsUlovZeI+xId5xviX3rOOXC ZKrnid5L818o4orCC6DxtYBluMlwxvUGF1tHpClBAvA2V38O4RyO4/k5+1iVbWjUQD9I oUaw== 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:in-reply-to :references; bh=JdeLh6+q3QCEvY9B/U737s/Dn4YYq4MGGG8Jno5dHi4=; b=DU5uMf/W8WNXp5atH36PtMl8M66wAFh0wCnkUNStsDfQ1PM21zkhkaNCcaE2ck7Ioc 78LYRhqEPDLdpFCg0gBUAwoeSKizeNQyUyHdl3gzuwQkKj+GU7sSZhsi0acsYHRkyEA+ 4SPpNpV4NObUUFFjQuDUJ/3e9A0ClmvG8TcZGi2Y7PJOaRUcb64U3MxMilmDUiZHiKPS Ntf7/wAtp4SEdYk1qTaAq6jsJOyBIGdrYolkHOWAuLeIHGQeQ0ssnxO3L3jy0CC75lCl 7LAX/iPlQsj6sq3NBBYQk9ba2morbPNr80zqkzm2xVyHD6ChyIURL8A+ROcqdRKcq/OK lT7Q== X-Gm-Message-State: AIkVDXKPKa72exUkW4YgND1zc5ypRIEvI5qQQGDcxGZrSCQ3rvBtn25g2C2Rej1Viw9/6Q== X-Received: by 10.98.57.154 with SMTP id u26mr33729221pfj.136.1484514656824; Sun, 15 Jan 2017 13:10:56 -0800 (PST) Received: from octofox.net (c-73-202-152-109.hsd1.ca.comcast.net. [73.202.152.109]) by smtp.gmail.com with ESMTPSA id y15sm42626323pgc.43.2017.01.15.13.10.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Jan 2017 13:10:55 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 15 Jan 2017 13:10:17 -0800 Message-Id: <1484514617-11726-8-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484514617-11726-1-git-send-email-jcmvbkbc@gmail.com> References: <1484514617-11726-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 7/7] target/xtensa: tests: add ccount write tests 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: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Check that CCOUNT SR is writable and that CCOMPARE timers are updated when CCOUNT is written to. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_timer.S | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/tcg/xtensa/test_timer.S b/tests/tcg/xtensa/test_timer.S index 844c032..6cda71a 100644 --- a/tests/tcg/xtensa/test_timer.S +++ b/tests/tcg/xtensa/test_timer.S @@ -19,6 +19,40 @@ test ccount assert ne, a3, a4 test_end +test ccount_write + rsr a3, ccount + rsr a4, ccount + sub a4, a4, a3 + movi a2, 0x12345678 + wsr a2, ccount + esync + rsr a3, ccount + sub a3, a3, a2 + slli a4, a4, 2 + assert ltu, a3, a4 +test_end + +test ccount_update_deadline + movi a2, 0 + wsr a2, intenable + rsr a2, interrupt + wsr a2, intclear + movi a2, 0 + wsr a2, ccompare1 + wsr a2, ccompare2 + movi a2, 0x12345678 + wsr a2, ccompare0 + rsr a3, interrupt + assert eqi, a3, 0 + movi a2, 0x12345677 + wsr a2, ccount + esync + nop + rsr a2, interrupt + movi a3, 1 << XCHAL_TIMER0_INTERRUPT + assert eq, a2, a3 +test_end + test ccompare movi a2, 0 wsr a2, intenable