From patchwork Mon Mar 8 17:32:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1449310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=hBx+OZat; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvRT54Ngcz9sCD for ; Tue, 9 Mar 2021 05:19:53 +1100 (AEDT) Received: from localhost ([::1]:50850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJKTv-0000Ma-Jy for incoming@patchwork.ozlabs.org; Mon, 08 Mar 2021 13:19:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJJl3-00075z-NT for qemu-devel@nongnu.org; Mon, 08 Mar 2021 12:33:30 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:43695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJJkm-00076q-Aw for qemu-devel@nongnu.org; Mon, 08 Mar 2021 12:33:29 -0500 Received: by mail-wr1-x42c.google.com with SMTP id w11so12318681wrr.10 for ; Mon, 08 Mar 2021 09:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+UAH9jldTpiu2zS2S4ZOTd3U0GZLp/CiokZFgy1K23U=; b=hBx+OZatB3odYuwrrU/FskvqyIFCMoO2Fcjf5Cjjuq4mOoP77OhIvOOmG5SRZLwlCF ivX5OkDK3RmUaQH8/cfqRPI9sgmXljC8neqXpYg/vW51Ku1Qm12dSKivb1l9oh6oWXh8 C4JXa1DQKxCbZnrRGFmJgi9qeIdWqH0iP+Q7leN1yHdWXo2Dh0JA3y+SFkMknvZVlW4e uBDWehJ4merEnvcncLvx/Qk74hhvZ+T9di6XM2HE8/31u/ZmUoaucK7oMsX4+BHfMcUi +ad/Ehp2kjlnr+aN51eh/a9k5oZC50nf7wU1KXcQVFEBWWO+m9rFRkjqepuKvwT3XpiS K8fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+UAH9jldTpiu2zS2S4ZOTd3U0GZLp/CiokZFgy1K23U=; b=gEuK4iaTx6slMVnKeVXeJPCFsY+XJ8vqoRaKCgbs2hip04jdwqXptvfBZ/9/6RysFA 0rZyVwh5NQ/LNHyQ4MJsqu6kj2LzmMSwkdT4rNb1pFB4zwAT1XJq+lvANGmBH/uMiiB5 ZLiiyKBpN0Ocg2usTOqmcCI8VtAQDJikeaRmUZl1jRsG4eRTsjWGOGSOpveCSNTEMFeT lUr5WB+U6OjJRAdcpauON7v+Y6acR2/Jj1t4mjSaEMIm18VJMxnQEDXjGNEaXkzxJ+5a 0BbjP0oGuQ7opE3DRBpQdTVeBi88etfEAt4BOUgcoda0/BwVqBhWHmlZQ+36dsQIUZBp ETPA== X-Gm-Message-State: AOAM531YtfzH5W7qxc5ZC0hdBFFTz9a4ApXZl7TzJ3Td92hIxgvvOWLA u8AQUkgX94rxvRwDmsyz9JIoYzQupKHTtQ== X-Google-Smtp-Source: ABdhPJyrn0+G/MfzRok8OhSMV58z217ItYf9CXGUYW12YlTjxoPZKGYP33WVyKAdVB4C91ryX7/tQA== X-Received: by 2002:adf:ebc9:: with SMTP id v9mr24182472wrn.387.1615224790942; Mon, 08 Mar 2021 09:33:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i10sm18628217wrs.11.2021.03.08.09.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:33:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/54] hw/arm/armsse: Add support for TYPE_SSE_TIMER in ARMSSEDeviceInfo Date: Mon, 8 Mar 2021 17:32:23 +0000 Message-Id: <20210308173244.20710-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308173244.20710-1-peter.maydell@linaro.org> References: <20210308173244.20710-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SSE-300 has four timers of type TYPE_SSE_TIMER; add support in the code for having these in an ARMSSEDeviceInfo array. Signed-off-by: Peter Maydell Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210219144617.4782-34-peter.maydell@linaro.org --- include/hw/arm/armsse.h | 2 ++ hw/arm/armsse.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 149f17dfc88..f4e2b680479 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -98,6 +98,7 @@ #include "hw/timer/cmsdk-apb-timer.h" #include "hw/timer/cmsdk-apb-dualtimer.h" #include "hw/timer/sse-counter.h" +#include "hw/timer/sse-timer.h" #include "hw/watchdog/cmsdk-apb-watchdog.h" #include "hw/misc/iotkit-sysctl.h" #include "hw/misc/iotkit-sysinfo.h" @@ -166,6 +167,7 @@ struct ARMSSE { CMSDKAPBWatchdog cmsdk_watchdog[3]; SSECounter sse_counter; + SSETimer sse_timer[4]; IoTKitSysCtl sysctl; IoTKitSysCtl sysinfo; diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 4387e98376c..ec9c30e0996 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -578,6 +578,11 @@ static void armsse_init(Object *obj) assert(devinfo->index == 0); object_initialize_child(obj, devinfo->name, &s->dualtimer, TYPE_CMSDK_APB_DUALTIMER); + } else if (!strcmp(devinfo->type, TYPE_SSE_TIMER)) { + assert(devinfo->index < ARRAY_SIZE(s->sse_timer)); + object_initialize_child(obj, devinfo->name, + &s->sse_timer[devinfo->index], + TYPE_SSE_TIMER); } else if (!strcmp(devinfo->type, TYPE_CMSDK_APB_WATCHDOG)) { assert(devinfo->index < ARRAY_SIZE(s->cmsdk_watchdog)); object_initialize_child(obj, devinfo->name, @@ -1058,6 +1063,16 @@ static void armsse_realize(DeviceState *dev, Error **errp) return; } mr = sysbus_mmio_get_region(sbd, 0); + } else if (!strcmp(devinfo->type, TYPE_SSE_TIMER)) { + sbd = SYS_BUS_DEVICE(&s->sse_timer[devinfo->index]); + + assert(info->has_sse_counter); + object_property_set_link(OBJECT(sbd), "counter", + OBJECT(&s->sse_counter), &error_abort); + if (!sysbus_realize(sbd, errp)) { + return; + } + mr = sysbus_mmio_get_region(sbd, 0); } else if (!strcmp(devinfo->type, TYPE_CMSDK_APB_WATCHDOG)) { sbd = SYS_BUS_DEVICE(&s->cmsdk_watchdog[devinfo->index]);