From patchwork Tue Jul 4 14:50:05 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: 698954 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp2315247wrs; Tue, 4 Jul 2023 07:53:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlH89ZkQ0QHM7XQNhUGxjeW5dsqi4tD7wUvNg1rIvaKAI/FS4e6NmhiY0t3kpvKNraFSl+VK X-Received: by 2002:a05:620a:4407:b0:767:2021:4997 with SMTP id v7-20020a05620a440700b0076720214997mr17903812qkp.7.1688482386830; Tue, 04 Jul 2023 07:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688482386; cv=none; d=google.com; s=arc-20160816; b=OEqi+6JgiBpCHG/C8YhAXn7NtvvqvMD20kZmctvtwmgt85JU7PC8OTgieMAda4OENp nzBFPPGHh7dEnlAKEV89KYypQTC2YxYtk35Y0ILen0Hf+jYQjAI6aGVLe25uQL8u0qS5 T8jl6nFZCBLWoydEFzBpg8NlQxq/8xvOcAN9NcY0tMJZ6EAmLogTvont5s61xSmu+kKF 0Tq2dbMAF+heQ/Qhvln1rESa6fPFIU67Z+QeCbX8Fdz7QKTAePQ9/V1yz+IIKph7Eerm cpcBxsZCDrbLfrPhpZrCMJEl7uHENVutXZVpY+qkYi1aqKcLUctVkkhRxu8mAhEW2hAc hJDQ== 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=KxfHnKj3l6GtT3pvrUKnD3RECUZu48JxXvoYVsgVb2Y=; fh=Lngrjms14biHE1uwg3hJItOsHUc/fKOP3kWz84zgU0I=; b=caystpNTVpI8OCUCdaWoWbEKRbg0voxuHQbCReqvjasW2WCdHrfajOFjiCMEuP9wru V4l15miwWAxI46wYDCfJEWLo4j89WjdliTqrV2YAZdC0bj1U33tvAsYlvKjZhxJprLr0 TooZK78kK1I2kWwqO7+plzztAMYvb/Pwu6oj9os92mi3OOTdxXcC9iXoWxpYlxr+laO5 MFVBc8VMA11r8yrIhl2ju61xLFoa0OlycBHT0aniuFH8KtcHCMSapWLx9/qUBGlippbZ OXW9wxqCVojmFS6j8J6OnA4T8tt+rSduhmddGEZ/KLuL21pqBtv0WdJOu7UUj/6MN5zm ErQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FavhkjPS; 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 qy1-20020a05620a8bc100b00766f99ebd78si11485741qkn.493.2023.07.04.07.53.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jul 2023 07:53:06 -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=FavhkjPS; 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 1qGhNO-0005BM-FH; Tue, 04 Jul 2023 10:51:34 -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 1qGhNC-0004JX-4T for qemu-devel@nongnu.org; Tue, 04 Jul 2023 10:51:22 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGhNA-0003AT-FV for qemu-devel@nongnu.org; Tue, 04 Jul 2023 10:51:21 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so8636010e87.3 for ; Tue, 04 Jul 2023 07:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688482277; x=1691074277; 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=KxfHnKj3l6GtT3pvrUKnD3RECUZu48JxXvoYVsgVb2Y=; b=FavhkjPSVY75NNK/FISZaV/EhBGjh/nkCkYKrc1hJIO9a8Odm51eDXGcCqAhLlKKBG f9JiHbfMlTsgF0oDI8yGSHr7iLUed7AZ//pqNSZ3flFPMBFzyY15QA0HVI0OpakPfArx EWC/5J9cMViX8jrS3R1GY+HzQrL+cXOKU5WieoqAHdXCEI3ypWTtklwK2xv/w1ZA4tBI m2hPXpEfwaEOZ4vsqFfXRs1iWX1IbZYst8cY5IdVg4O5gXZZ31EsvHhzqqzSBCdC3rGQ LmL45e292GVV8YYhpvkp1uOvv9pvtVsOtU09Ah7F80VbXpGYXTZws4/m/jMv84acI8eU 565w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688482277; x=1691074277; 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=KxfHnKj3l6GtT3pvrUKnD3RECUZu48JxXvoYVsgVb2Y=; b=CELeiMUf6ZXg6oDOfKSs285z8TFu1eCl9iokJt3Aenlf+0oDVvLwsTblBG6Qw7q8HF xJ/+Nt43ECF9T6sJVHAWc53+k1mxXv7LSg7PV4mhWetmQVvDB9M5PfhUAb3pDk7QrtrD ywBtb3sI1B7PtAou0iu2qq5d2u6niQAgiF7jnP/S/0DXN8fxS52H7qRdhCkKC4SCLQ7b /kCl1I+Fiz7GD7AcGHkB6UiNxmlOFjl1VTLpapJ3NIx9zeaO8Miz9UlyrcQw9ET2Gb5q 88J2d+0b2qh7IU9gHiwzmQmOn2wLS/IcpuyBCEsOLQCI0zZ+LW85oTYGI7sdfeTW/x52 +oxw== X-Gm-Message-State: ABy/qLbibKc2Ri+ylnnRLhd37G6EpmSdrpSFyJi7H1ssia8bt6L3amqI Fq4YwNDz3oEewne4GUxtK4Pi3B3V/3RFT4N5sYs= X-Received: by 2002:a19:5f5a:0:b0:4f9:607a:6504 with SMTP id a26-20020a195f5a000000b004f9607a6504mr9739516lfj.29.1688482277092; Tue, 04 Jul 2023 07:51:17 -0700 (PDT) Received: from localhost.localdomain ([176.176.157.122]) by smtp.gmail.com with ESMTPSA id a20-20020a05600c225400b003fbb06af219sm18551427wmm.32.2023.07.04.07.51.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jul 2023 07:51:16 -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 , Paolo Bonzini , Mark Cave-Ayland , Sergey Kambalin , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v2 12/19] hw/timer/arm_timer: Use array of frequency in SP804Timer Date: Tue, 4 Jul 2023 16:50:05 +0200 Message-Id: <20230704145012.49870-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230704145012.49870-1-philmd@linaro.org> References: <20230704145012.49870-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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=ham 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 SP804Timer 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 Reviewed-by: Richard Henderson --- 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 2b5fb75577..0ad0e55df8 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -206,7 +206,7 @@ struct SP804Timer { MemoryRegion iomem; ArmTimer *timer[2]; - uint32_t freq0, freq1; + uint32_t freq[2]; int level[2]; qemu_irq irq; }; @@ -310,15 +310,15 @@ static void sp804_realize(DeviceState *dev, Error **errp) { SP804Timer *s = SP804_TIMER(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); } static Property sp804_properties[] = { - DEFINE_PROP_UINT32("freq0", SP804Timer, freq0, 1000000), - DEFINE_PROP_UINT32("freq1", SP804Timer, freq1, 1000000), + DEFINE_PROP_UINT32("freq0", SP804Timer, freq[0], 1000000), + DEFINE_PROP_UINT32("freq1", SP804Timer, freq[1], 1000000), DEFINE_PROP_END_OF_LIST(), };