Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2EF11D1D89F for ; Thu, 4 Dec 2025 09:36:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vR5ko-0001t0-QW; Thu, 04 Dec 2025 04:36:02 -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 1vR5kA-0001Du-E6 for qemu-arm@nongnu.org; Thu, 04 Dec 2025 04:35:24 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vR5k6-0003Sa-Qa for qemu-arm@nongnu.org; Thu, 04 Dec 2025 04:35:22 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-6431b0a1948so1129373a12.3 for ; Thu, 04 Dec 2025 01:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764840917; x=1765445717; darn=nongnu.org; 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=YDQJUrQzwQ5JOi2EX7Frys9dODpqxnEfpv5EfNFdo4A=; b=J89ySl6z1EDkevZk80qgeUx3u8zec3qIylU32/0gtxdNFag3TtVC9LliTcR3/sCdtq fB6Y111Rtl8Dz0pk/ohmX4fcNLGtZB5iPq9ojMGzyfL6IwC8iFnvh7y/iCRPhXYu6L1p PS5sn1ZvrQVft4pgmAaEo+sFVv6qLClW3SI5jgszJ3HpoOyGuCd7QinOL+XcgCbLhKhw 9k2B0RaNk4bLDfD5k6K2ah4QkAOcMInNNeEz0NNq9LoQJbhVVugi027U3WR/NFhxRFyD JfqKpNMtFiYA7ADTMOcCpOC2ExnnXTLMjAAAXHL9wAWQHH13+H/RHRjuodfOxsp03hAw QIqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764840917; x=1765445717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YDQJUrQzwQ5JOi2EX7Frys9dODpqxnEfpv5EfNFdo4A=; b=WyGU1xytgFsbmJZWj8NHB3MlplP83dTCSkpwfb4RhzSOtKb8r0ikGQgQ46Ie5rPK/f 74qnb7308P53DcPbV6uUsn5MsCrR9YCivQ24y03ohSDKYqKWi3jSNoE+R08352OoEB+u yH5u9Hw6tY9+IUm4wwvZCgeaO8xYBSNZn8Ph+kns2n31wGUX/vcfVIBaIM+af3Kbk52N Cp+FAf+I3SGtN6KWbzgAwFDmzS9Mk8I1wcTs+wTMSq4JxPHQwIR0tPJwWPutbpkaWxs8 sB7dO0Umv1jLguVHKgXVkjhuLFrc4OGl1Ada4E5yVqCRPybqtiDXRlnyDsOtKhMbKJ2q Bxwg== X-Forwarded-Encrypted: i=1; AJvYcCWvVzYlwmW/uKGm3S6S3zqCUZ7PrJzEYBAi+FoepHMLUdWR9yDseeS//brWx0qiWyq7AQ5hju5GZA==@nongnu.org X-Gm-Message-State: AOJu0Yz7jLbRAAm+SsufERvFoJSkGQmUz9+XIT8ZUp0WimwGeQRulNu6 tn+nTbXcoNLzUuH1dRaaQRblkGYpLa0a0PJoxiiHbV+Kdi3xfoRcnujt X-Gm-Gg: ASbGncsHcoASHV4YYmgJDgAjXgwC4fpFU+3G1xXgt9VP9aCN/Q7PknNtfT8efxWfTRK kCs4q4zaG2AxjCXYjEo4HhWUfMCwaMp8wD4zsZXj6GEKxgpnLAzzuv5W9IcZRsgfEXe4hWBW4Sh uSwOr3wkMGde5KXV3wZiRGqhgNeVg6zL2OMFBw5o41YMA2T/JZSOAb9JwZ//VAPx0looljHcYKq 4b5ZI2tNxUR1WNRi2qtmDXDPIXHT6ijnkkzSHAuASF3dXG6gtoIqxQ6kO5yJ4vpPenDoBFdGPWH nfc3CSr0m5Kp8pCalRR/Gxgmeo6qrM14st+fbXoKk/gBoBAh/ChiGRSNAtvyUwx+lki6RW8UZjo MdBJRdqEfhq1D2vVrpMlDYV+dCaAkhmKO7qXI6+h2Eg9Esn50ntKWBgiGp1glENrp+eGjnwO7n9 yu8Sk0ywwCkzbNKwL5nnPdReyEQIDoka4= X-Google-Smtp-Source: AGHT+IFq1Dj2cz1jPd1sM4YW1icb+M+nQwDN4Zgyx9JcbDECbN+4vyvd2TJyB3LCHde5Q7QFDa2PTw== X-Received: by 2002:a05:6402:26c5:b0:647:5c87:8668 with SMTP id 4fb4d7f45d1cf-647abda024dmr1934226a12.14.1764840917071; Thu, 04 Dec 2025 01:35:17 -0800 (PST) Received: from PC-DA2D10.beckhoff.com ([195.226.174.194]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-647b2edf72asm856573a12.11.2025.12.04.01.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 01:35:16 -0800 (PST) From: =?UTF-8?q?Corvin=20K=C3=B6hne?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Alistair Francis , qemu-arm@nongnu.org, Peter Maydell , Kevin Wolf , qemu-block@nongnu.org, =?UTF-8?q?Corvin=20K=C3=B6hne?= , Hanna Reitz , =?UTF-8?q?Yannick=20Vo=C3=9Fen?= , YannickV Subject: [PATCH v5 12/15] hw/arm/xilinx_zynq: Split xilinx_zynq into header and implementation files Date: Thu, 4 Dec 2025 10:34:59 +0100 Message-ID: <20251204093502.50582-13-corvin.koehne@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204093502.50582-1-corvin.koehne@gmail.com> References: <20251204093502.50582-1-corvin.koehne@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=corvin.koehne@gmail.com; helo=mail-ed1-x531.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org From: YannickV Create xilinx_zynq.h header file to expose ZynqMachineState and related definitions for machine inheritance. This enables creation of derived machines based on the Zynq platform. Signed-off-by: YannickV --- hw/arm/xilinx_zynq.c | 13 +------------ include/hw/arm/xilinx_zynq.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 include/hw/arm/xilinx_zynq.h diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index c03ed09a67..4d095ab6f3 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -41,9 +41,7 @@ #include "exec/tswap.h" #include "target/arm/cpu-qom.h" #include "qapi/visitor.h" - -#define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") -OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE) +#include "hw/arm/xilinx_zynq.h" /* board base frequency: 33.333333 MHz */ #define PS_CLK_FREQUENCY (100 * 1000 * 1000 / 3) @@ -87,15 +85,6 @@ static const int dma_irqs[8] = { 0xe3401000 + ARMV7_IMM16(extract32((val), 16, 16)), /* movt r1 ... */ \ 0xe5801000 + (addr) -#define ZYNQ_MAX_CPUS 2 - -struct ZynqMachineState { - MachineState parent; - Clock *ps_clk; - ARMCPU *cpu[ZYNQ_MAX_CPUS]; - uint8_t boot_mode; -}; - static void zynq_write_board_setup(ARMCPU *cpu, const struct arm_boot_info *info) { diff --git a/include/hw/arm/xilinx_zynq.h b/include/hw/arm/xilinx_zynq.h new file mode 100644 index 0000000000..ec80441e7c --- /dev/null +++ b/include/hw/arm/xilinx_zynq.h @@ -0,0 +1,36 @@ +/* + * Xilinx Zynq Baseboard System emulation. + * + * Copyright (c) 2010 Xilinx. + * Copyright (c) 2012 Peter A.G. Crosthwaite (peter.croshtwaite@petalogix.com) + * Copyright (c) 2012 Petalogix Pty Ltd. + * Written by Haibing Ma + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#ifndef QEMU_ARM_ZYNQ_H +#define QEMU_ARM_ZYNQ_H + +#include "target/arm/cpu-qom.h" +#include "hw/qdev-clock.h" + +#define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") +OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE) + +#define ZYNQ_MAX_CPUS 2 + +struct ZynqMachineState { + MachineState parent; + Clock *ps_clk; + ARMCPU *cpu[ZYNQ_MAX_CPUS]; + uint8_t boot_mode; +}; + +#endif /* QEMU_ARM_ZYNQ_H */ -- 2.47.3