From nobody Tue Nov 26 09:21:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709041046; cv=none; d=zohomail.com; s=zohoarc; b=ZfLXgwaztvu4xoAy8fBhuHiCy+Y+z2kKw37eT7T6s1ATC/gTC38nLi14n6enr7qTXizmUv3dLjS53h28XzYfkcAPdT9tXZvdlGNw4ipKKaFM8d8k9xg4vRGmKUekdBhp94RHPJUPrCahVm+ZZJ9pTej6gmo2ayg6EQqOu4pKm7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709041046; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=SGfW+9SUKwb0elju7hK2I/Wy4ErwX11QN2o0E9hUpIA=; b=a4qGNCmV7Uxe0iL/oG0Aprd6VyF+Gm+S5kXniC3jkZjZauDN+XN8Bx6PWaCCz9FovsCQaogaDkupFWpDIFzn2XDzZn5GH5+asA1retUp+SBVlMzcjOmflUq1UVqmniJOptFWUIh6AhTDslfXu6+fDsnbPWww+swg4oPq/rRXX1U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709041045996152.35497741521021; Tue, 27 Feb 2024 05:37:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rexb6-0001Ca-Br; Tue, 27 Feb 2024 08:34:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rexaf-0000rG-9l for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:50 -0500 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rexaV-0002vy-4L for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:49 -0500 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2d29111272eso20739431fa.0 for ; Tue, 27 Feb 2024 05:33:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i13-20020adfe48d000000b0033ae7d768b2sm11319552wrm.117.2024.02.27.05.33.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 05:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709040817; x=1709645617; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SGfW+9SUKwb0elju7hK2I/Wy4ErwX11QN2o0E9hUpIA=; b=WQAAwZDLheYUCHzEJCNprP6Y7n/esHCATFKEgIj/afZ12Ec0llju79Shjyb5/as3iN EMf8W8aSAC5ye7Hu4prMErB9EEzUYRfuAFlHict/oCuUPVUrApyrpaCjDa+yNt/Iwk+c jeHEdUacogAnS8GUfbOGk5M/VhXNpyJNz/JU+9WToEkVjh66s744+AYlXHkMBzZ/oO/U YsHbRXcbb9+HrHTKVQutP8LLX8K++qmYx6CgQTvrqv7CcetlWWKSPL2N1LW31GukumEB sJuLmjzIgGWznTIZeOugmqJMx3pzxZztm3x4IGjjmPIJ7LEIbZ/S3xnZTTJemhuZq45f bIbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709040817; x=1709645617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SGfW+9SUKwb0elju7hK2I/Wy4ErwX11QN2o0E9hUpIA=; b=M5I8grofDPjasK4tWo0DmjfUwUf6vdQ+RbumE33xs4a4seT7tGVcprALUw9OvJj5OP pXKZeA7TTkGZf+01WnXCbRL5l6Lebm0lIC128oO/usEDOOymAf3uKLJ6Dk9hyjdtmKkv 1EuX8OL+4OeeQTLBDtbLzc/Tegn8HWFM/USyJ2e3HcLx/8mAqyi8RrnGZLx9SJJbv80F ogr9qFV8mwtGE0b/H72c4OBS9tnM3O+rmaiHb/liGD8e0mExzGfD16CrrwDXIlSjfinC NA5aRd6R8quOkZJxoqauL7Z9FIApXtwLVQS09MFRsgM9Wxq0skn17pAtU2EA8oufB0fV BcdQ== X-Gm-Message-State: AOJu0YwUHEp9SwIf5qII9JjMaUgw86sUwEG+t6BjyGL7P6bBH3IBkpou 2Vo2RokYUps1oLguMDlqoaq84+l/643qE0+PWxOcSPmtII/4UIuEkOJa7EIXACiiDDik3x8dZ0g r X-Google-Smtp-Source: AGHT+IG07qBoxH2DiQCESt4QeLeeaBB3CeK8D6AmHiMvymuNkCcRGD9gJ9yeD8T7xdES0Uft9KuliQ== X-Received: by 2002:a2e:2ac5:0:b0:2d2:a302:c626 with SMTP id q188-20020a2e2ac5000000b002d2a302c626mr1022181ljq.33.1709040817295; Tue, 27 Feb 2024 05:33:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 41/45] tests/qtest/bcm2828-mailbox: Add mailbox property tests. Part 2 Date: Tue, 27 Feb 2024 13:33:10 +0000 Message-Id: <20240227133314.1721857-42-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227133314.1721857-1-peter.maydell@linaro.org> References: <20240227133314.1721857-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709041047354100003 Content-Type: text/plain; charset="utf-8" From: Sergey Kambalin Signed-off-by: Sergey Kambalin Message-id: 20240226000259.2752893-38-sergey.kambalin@auriga.com Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- tests/qtest/bcm2838-mbox-property-test.c | 196 ++++++++++++++++++++++- 1 file changed, 195 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838= -mbox-property-test.c index 1361e84a988..63f1f577f17 100644 --- a/tests/qtest/bcm2838-mbox-property-test.c +++ b/tests/qtest/bcm2838-mbox-property-test.c @@ -50,7 +50,8 @@ FIELD(GET_CLOCK_STATE_CMD, NPRES, 1, 1) (TEST_TAG_TYPE(testname) * tag); = \ static void CHECK_FN_NAME(testname, __VA_ARGS__) = \ (TEST_TAG_TYPE(testname) *tag); = \ - static void TEST_FN_NAME(testname, __VA_ARGS__)(void) { = \ + static void TEST_FN_NAME(testname, __VA_ARGS__)(void) = \ + { = \ struct { = \ MboxBufHeader header; = \ TEST_TAG_TYPE(testname) tag; = \ @@ -188,6 +189,179 @@ DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, EMMC) { tag->request.value.clock_id =3D CLOCK_ID_EMMC; } =20 +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, UART) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UART); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_UART); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, UART) { + tag->request.value.clock_id =3D CLOCK_ID_UART; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, CORE) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_CORE); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_CORE); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, CORE) { + tag->request.value.clock_id =3D CLOCK_ID_CORE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MIN_CLOCK_RATE, ANY) { + g_assert_cmphex(tag->response.value.clock_id, =3D=3D, CLOCK_ID_UNDEFIN= ED); + g_assert_cmphex(tag->response.value.rate, =3D=3D, CLOCK_RATE_ANY); +} +DECLARE_TEST_CASE_SETUP(GET_MIN_CLOCK_RATE, ANY) { + tag->request.value.clock_id =3D CLOCK_ID_UNDEFINED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_TEMPERATURE) { + g_assert_cmphex(tag->response.value.temperature_id, =3D=3D, TEMPERATUR= E_ID_SOC); + g_assert_cmpint(tag->response.value.temperature, =3D=3D, TEMPERATURE_S= OC); +} +DECLARE_TEST_CASE_SETUP(GET_TEMPERATURE) { + tag->request.value.temperature_id =3D TEMPERATURE_ID_SOC; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_MAX_TEMPERATURE) { + g_assert_cmphex(tag->response.value.temperature_id, =3D=3D, TEMPERATUR= E_ID_SOC); + g_assert_cmpint(tag->response.value.temperature, =3D=3D, TEMPERATURE_S= OC_MAX); +} +DECLARE_TEST_CASE_SETUP(GET_MAX_TEMPERATURE) { + tag->request.value.temperature_id =3D TEMPERATURE_ID_SOC; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_ALLOCATE) { + g_assert_cmphex(tag->response.value.base, =3D=3D, VC_FB_BASE); + g_assert_cmphex(tag->response.value.size, =3D=3D, VC_FB_SIZE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_ALLOCATE) { + tag->request.value.alignment =3D ALIGN_4K; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_RELEASE) { + /* No special checks are needed for this test */ +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_BLANK) { + g_assert_cmphex(tag->response.value.on, =3D=3D, 0); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_BLANK) { + tag->request.value.on =3D 0; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, DUMMY_VALUE); + g_assert_cmpint(tag->response.value.height, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT) { + tag->request.value.width =3D DUMMY_VALUE; + tag->request.value.height =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, INITIAL) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 640); + g_assert_cmpint(tag->response.value.height, =3D=3D, 480); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 800); + g_assert_cmpint(tag->response.value.height, =3D=3D, 600); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT) { + tag->request.value.width =3D 800; + tag->request.value.height =3D 600; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, DUMMY_VALUE); + g_assert_cmpint(tag->response.value.height, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT) { + tag->request.value.width =3D DUMMY_VALUE; + tag->request.value.height =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT, INITIAL) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 640); + g_assert_cmpint(tag->response.value.height, =3D=3D, 480); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT) { + g_assert_cmpint(tag->response.value.width, =3D=3D, 800); + g_assert_cmpint(tag->response.value.height, =3D=3D, 600); +} +DECLARE_TEST_CASE_SETUP(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT) { + tag->request.value.width =3D 800; + tag->request.value.height =3D 600; +} + /*------------------------------------------------------------------------= ----*/ int main(int argc, char **argv) { @@ -202,6 +376,26 @@ int main(int argc, char **argv) QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, EMMC); QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, EMMC); QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, EMMC); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, UART); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, CORE); + QTEST_ADD_TEST_CASE(GET_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_MAX_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_MIN_CLOCK_RATE, ANY); + QTEST_ADD_TEST_CASE(GET_TEMPERATURE); + QTEST_ADD_TEST_CASE(GET_MAX_TEMPERATURE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_ALLOCATE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_RELEASE); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_BLANK); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, INITIAL); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT, INITIAL); + QTEST_ADD_TEST_CASE(FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT); =20 return g_test_run(); } --=20 2.34.1