From patchwork Wed May 31 20:35:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 687314 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1460248wru; Wed, 31 May 2023 13:39:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+5tA9sE/cFFBU0Iapjkc0Y3XOt7qmxpAW3Hdup0IuyPpDOK3i7fzqieYI5gqoSLnzhu1z X-Received: by 2002:a05:6214:29ec:b0:625:b517:6dcb with SMTP id jv12-20020a05621429ec00b00625b5176dcbmr7500792qvb.5.1685565596424; Wed, 31 May 2023 13:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685565596; cv=none; d=google.com; s=arc-20160816; b=ZUAWSTPDNNYZJ6+dizrf4PLXJ35Edy5NvuFm5uAQHAHqxQIy4xf7sneDGkmIvm7DuS QkH2sMZtf1hxrNuS2ut6BOhZ9uihgSQ+w7Mc4fAiLNZ0GCuaBzV2sTlveF3x++IpNjXC hQ3R1172PuSIv8y301FAvZiJhXi8fJNhtt+fw0gw811GOmo/3PhFv80tSEkc66biQn3O N9msR+eJkvPbjU8GxuexeKKEyyqb0ybj+h3+L39S7IC8x2utrMf1Q3G0h9LDQy8Xa81J KfBzvoxMX55v0vMsMEYM04Gzvlx+fulVB/Z6uWhedcIPA48TFOEX/eDK0nZgaa+0SH/C LgCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uEwvjd8H0pBzSI4zIAJ+UnyR+kTgNch6Orzmem2MX0A=; b=cF8sUOS47Nh2/CW518GNAmWCtoeSmwqyPFSizd9InCerOZnHMuKYZPpBQC+dFKwA2L T/uuDc4rmacjFKlx0ebYiKwd0uxCyvrifmaxg4pZONaq0K7JYNqL2edC3+iPgd74U1He yxz8f6aiJQpIYqO1TygMiCuGW6HIXVUs2mlXga/cTiQHojUvklyet/RXgOyauHLelHfX p0eGTJjBf5HtpT8uj7oov/Smqulwc2j+XQvTyWDoqzQEGydgpnxD/RmYqkQeEpydQbk1 g1I9qOS3QeSmWR4SMY5T8JjRu497zLLSGz5Pt1ZAh0iNH7HDZu0gq0u5SgRwv2vFcYX+ X64g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWIISxO9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gc6-20020a056214230600b00620cb906a49si8692326qvb.281.2023.05.31.13.39.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2023 13:39:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWIISxO9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4SZD-0000Rh-AH; Wed, 31 May 2023 16:37:11 -0400 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 1q4SZ4-0000AV-5j for qemu-devel@nongnu.org; Wed, 31 May 2023 16:37:02 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4SZ2-0003NI-Jf for qemu-devel@nongnu.org; Wed, 31 May 2023 16:37:01 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f601c57d8dso1388085e9.0 for ; Wed, 31 May 2023 13:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685565419; x=1688157419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uEwvjd8H0pBzSI4zIAJ+UnyR+kTgNch6Orzmem2MX0A=; b=YWIISxO9hQd5X9nGqB5u96JUNy3fPpsO7x9uZgjm3fkI+GMCo4/lJq+GTqQXwV6QJ7 c3Fl8UvYgu5xmQUz0n4rlDV9tJmqTwHvQ2T+REUhpM7mQKFsgK6uxBMHgaE4YCxbG1vu 3uJrv/nLewPkNiPYQKJ77fl8xR6L4bhTVj4mMzZXYToiijdIXzOkKikCrNM3AGMgDXqk R0luTWqA4cslZrtbGpw2Pi/gzrRxmxwxEk4nqEFglmUI4IYJ3CvSQFSpgClV08/pCraR XIDqaE7jlYa39fWjJ4O5Dg7PjDCeCgWHKMLX4J43PM88I3RPBdStXneXc8IjySRtQraL OKcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685565419; x=1688157419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uEwvjd8H0pBzSI4zIAJ+UnyR+kTgNch6Orzmem2MX0A=; b=EkrPeAaoiIy1shSnFLON4TezzZzCwAYHgr02ug6V+UDIKBBSDJ4righTkfDIQVlToy 2dHjzGmVRuCbcnEuJPDCSYpevmTwRmbmpxCap7J+C0qBvozOmARPklgZqDB645ubBz9J 7nX+zQEorlJo7nhEZNpzEiwmNYeoONSHD9yaEv7B8CCuP1z+U1ut3pjUATd/aEDSSGYL x4O9B29OmvRnFoFJU5BwWUVqJBL07SBORdGtsRGd3FRlJs+LmNdxIaBjtQYbtyS2RDbm SwoI6Xpawm/aS6uG33+TAMazNfNp+a6o/if75fHXbe9NwHnkUUoLQ2D9bpwHTnN1ux+j kwRQ== X-Gm-Message-State: AC+VfDyFkf6y1gw/MB6tIyoXTnM5uO98o30hrroBKR0hfmo2Dbjg4uC1 nT4CLVYNm/5BvtHmFwJcWJGf4pyIo7EsFfY6hRU= X-Received: by 2002:a05:600c:3d1b:b0:3f5:867:1aba with SMTP id bh27-20020a05600c3d1b00b003f508671abamr301535wmb.15.1685565418864; Wed, 31 May 2023 13:36:58 -0700 (PDT) Received: from localhost.localdomain ([176.176.146.12]) by smtp.gmail.com with ESMTPSA id k15-20020a05600c0b4f00b003f611b2aedesm22011624wmr.38.2023.05.31.13.36.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 31 May 2023 13:36:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-arm@nongnu.org, Peter Maydell , Sergey Kambalin , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 10/15] hw/timer/arm_timer: Use array of frequency in SP804State Date: Wed, 31 May 2023 22:35:54 +0200 Message-Id: <20230531203559.29140-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230531203559.29140-1-philmd@linaro.org> References: <20230531203559.29140-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org SP804State use arrays for timers and IRQ levels. Be consistent and use another one for the frequencies. This will allow to simplify using for() loop statement in the next commit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/timer/arm_timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 510ec74a51..4d31f917f6 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -204,7 +204,7 @@ struct SP804State { MemoryRegion iomem; ArmTimerState *timer[2]; - uint32_t freq0, freq1; + uint32_t freq[2]; int level[2]; qemu_irq irq; }; @@ -308,8 +308,8 @@ static void sp804_realize(DeviceState *dev, Error **errp) { SP804State *s = SP804(dev); - s->timer[0] = arm_timer_new(s->freq0); - s->timer[1] = arm_timer_new(s->freq1); + s->timer[0] = arm_timer_new(s->freq[0]); + s->timer[1] = arm_timer_new(s->freq[1]); s->timer[0]->irq = qemu_allocate_irq(sp804_set_irq, s, 0); s->timer[1]->irq = qemu_allocate_irq(sp804_set_irq, s, 1); } @@ -324,8 +324,8 @@ static void sp804_unrealize(DeviceState *dev) } static Property sp804_properties[] = { - DEFINE_PROP_UINT32("freq0", SP804State, freq0, 1000000), - DEFINE_PROP_UINT32("freq1", SP804State, freq1, 1000000), + DEFINE_PROP_UINT32("freq0", SP804State, freq[0], 1000000), + DEFINE_PROP_UINT32("freq1", SP804State, freq[1], 1000000), DEFINE_PROP_END_OF_LIST(), };