From patchwork Sat Nov 2 13:16:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GslqzL8Y; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdbM1gZFz1xwc for ; Sun, 3 Nov 2024 00:18:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0b-000331-RC; Sat, 02 Nov 2024 09:17:42 -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 1t7E0V-00031p-Ha; Sat, 02 Nov 2024 09:17:37 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0U-0001vU-19; Sat, 02 Nov 2024 09:17:35 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a99e3b3a411so592506366b.0; Sat, 02 Nov 2024 06:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553451; x=1731158251; 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=+kcGj5THgATrhziRVv9fCQe0+3eD5yxcFJLfyqBCQbg=; b=GslqzL8YoE/OnYE5d0JdKGxBMouqhJKkbfxP5Id/dL8nBWSmxMXUoH+Y2A+5ZyUv+8 9NFcTDAgdJgRUPgm0+LQYhO6BaT5pjVjE+RLSAN3zyTpfsIINvlR4v+9kzvga8/Iieyo 92yriv8zY/9Huhx1fep6Xfvzbj9FcgSnHG/Aw6dQ6V6LIcgCEeGqDm3CJgQffUmpQVtu Q7cnpd2A4sUZtga/I74jgLOdKZJdowwIU7x65zRMIftY+CNop2l02b8G0cFQBAZzyHnD zSR4F51lgCv/4rAUWe+kLz7fHCIZPfOX3pjQpswGeKL2AC5efRXuHyhym66zaMyxsOac YdLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553451; x=1731158251; 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=+kcGj5THgATrhziRVv9fCQe0+3eD5yxcFJLfyqBCQbg=; b=bg00uDRet3P44y97g7YdQShWMRc2voWRcxYf4SCmH6F8dJAo3iTnAesl4+GkORNVON sPg/Y4Dw6J9ZyMpPnQn+1AWTCvbXeyVYqnMmF0DQvRpqFNkyM2Ly4Hh67dyf+pwq6Ldo cmZsBQR5kpgWKKjoSsWFDv5pWvsEk62O/6HgVkBZaS1ycOKT+opFZBoaGYNu/StWTtyx 9pKj2ZRfk3PLQpJg3EB3y6EEoriKpRjTlfKOFc511DwZbyq4hbG6zd1bAj+yIiKcwr3I hdF2rAjxffSpILX2wKPNPDB6JQ0byV6AYyWk04F0OiRvb136BiCpcwRXhbpX7mE8wrcZ GnnQ== X-Forwarded-Encrypted: i=1; AJvYcCW/XUsZYgzfZh6EXpc5iqJ7waZjPbJbHBxhXs5QRCcNMX6UVNUhRTgci+z06D3Y99MJAkDi+e0Uuvd6@nongnu.org, AJvYcCXWlrF9c/4oXJ1+J7lOx7ClPrAhlmR77DRLhJuBkicmNzN67+cVkyfxAqFLSj78yw4yfHc/rN8A+Y4=@nongnu.org X-Gm-Message-State: AOJu0Yxed50SsUmtDam4756Swb2LFb9o8oz9GFhIbl/L4gOWDQANstjX zP+60/BaR9LUmbvQsj6PV4Kh+pAD4Ve/O4B4ot672NF6YoKg1BZccuIAJA== X-Google-Smtp-Source: AGHT+IEnxgul9uLhsk3G0xkAYKbKaOFYkGNx2Q+eUGPRAy+dWb6Ln7E7QIKK90Je5/v7ykDPS8QCzw== X-Received: by 2002:a17:907:9487:b0:a99:f5d8:726 with SMTP id a640c23a62f3a-a9e55abecaemr893323566b.23.1730553450734; Sat, 02 Nov 2024 06:17:30 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:29 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 01/26] hw/ppc/e500: Do not leak struct boot_info Date: Sat, 2 Nov 2024 14:16:50 +0100 Message-ID: <20241102131715.548849-2-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The struct is allocated once with g_new0() but never free()'d. Fix the leakage by adding an attribute to struct PPCE500MachineState which avoids the allocation. While at it remove the obsolete /*< private >*/ markers. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.h | 9 +++++++-- hw/ppc/e500.c | 17 ++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h index 8c09ef92e4..4a1b42d44b 100644 --- a/hw/ppc/e500.h +++ b/hw/ppc/e500.h @@ -5,18 +5,23 @@ #include "hw/platform-bus.h" #include "qom/object.h" +struct boot_info { + uint32_t dt_base; + uint32_t dt_size; + uint32_t entry; +}; + struct PPCE500MachineState { - /*< private >*/ MachineState parent_obj; /* points to instance of TYPE_PLATFORM_BUS_DEVICE if * board supports dynamic sysbus devices */ PlatformBusDevice *pbus_dev; + struct boot_info boot_info; }; struct PPCE500MachineClass { - /*< private >*/ MachineClass parent_class; /* required -- must at least add toplevel board compatible */ diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index b760c6d6a2..ba83f33033 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -80,13 +80,6 @@ #define PLATFORM_CLK_FREQ_HZ (400 * 1000 * 1000) -struct boot_info -{ - uint32_t dt_base; - uint32_t dt_size; - uint32_t entry; -}; - static uint32_t *pci_map_create(void *fdt, uint32_t mpic, int first_slot, int nr_slots, int *len) { @@ -919,7 +912,6 @@ void ppce500_init(MachineState *machine) bool kernel_as_payload; hwaddr bios_entry = 0; target_long payload_size; - struct boot_info *boot_info = NULL; int dt_size; int i; unsigned int smp_cpus = machine->smp.cpus; @@ -974,9 +966,8 @@ void ppce500_init(MachineState *machine) /* Register reset handler */ if (!i) { /* Primary CPU */ - boot_info = g_new0(struct boot_info, 1); qemu_register_reset(ppce500_cpu_reset, cpu); - env->load_info = boot_info; + env->load_info = &pms->boot_info; } else { /* Secondary CPUs */ qemu_register_reset(ppce500_cpu_reset_sec, cpu); @@ -1274,9 +1265,9 @@ void ppce500_init(MachineState *machine) } assert(dt_size < DTB_MAX_SIZE); - boot_info->entry = bios_entry; - boot_info->dt_base = dt_base; - boot_info->dt_size = dt_size; + pms->boot_info.entry = bios_entry; + pms->boot_info.dt_base = dt_base; + pms->boot_info.dt_size = dt_size; } static void e500_ccsr_initfn(Object *obj) From patchwork Sat Nov 2 13:16:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005452 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GpNQd3UR; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdbD0K9gz1xy4 for ; Sun, 3 Nov 2024 00:18:31 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0l-00035G-2l; Sat, 02 Nov 2024 09:17:51 -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 1t7E0W-00031w-Ro; Sat, 02 Nov 2024 09:17:37 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0V-0001vl-Dv; Sat, 02 Nov 2024 09:17:36 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5c9693dc739so3637984a12.3; Sat, 02 Nov 2024 06:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553453; x=1731158253; 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=OSUXdq93xqCIzRVUO2sgZ5ZRdMkGuWMIHhF5tQTYyjM=; b=GpNQd3URHhYBFKKzC8pM3uRGkgJk63PNl01wPUAn+DaQiWWmZ2m5dcuK5OUBiK3q+u DIUSxmHlh5NQ91Z6JaVYsJA8PLSJuzCXi0c4gtlo0hpT0x2oGC1iNTR1EEdiO6kijJ0C chW8tmeCxNjP0W5snJIhzS8ihGjVfepIEofPegu5EriB1xGMJPdUaI6/L0mQz8nfivxg qHK5GaSpoM1DkSSOudjmE9dEaqvbmR+QUoDbfBLF8Bezi5Yk3Mp5I2cEvC4JTtR1Tl5T b1c801Cpd3yFb09Ad3zZiOzFsqoXQf7zgnYLkdmMX8ei/Wsqgd1F8WFojybWi8l6jhsY XfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553453; x=1731158253; 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=OSUXdq93xqCIzRVUO2sgZ5ZRdMkGuWMIHhF5tQTYyjM=; b=Y/xDjZUZZk6MdVa60Slduww6II+j3SKXbdmBawtCgQUoKkxvZti2CQyYLGhHvF5Vpr P9I5lORMfbDxSseuz3WN8yiCOiumfcHwijdJwNbbbSY+JrUXV3gc0/NyxEsAJr47Wjh+ ePGhcXW/bMmI4uahdMwtDmGp+lwhb09mz6fGJ9qgDuANWYZCcMNSiidb63A2li9DZVoE MV9gSo6RFKFksK+4+U6Y3Yocr6odhqqzV4r778/82X5H01Zl7CRx/PVtKQSTeZwoPPyB fPhijCxMsudwgE1VtyZXiP8GGyIZR47STpALzXfWHzt/VMFm91aK9Iz6eHkrYsk/uLim fm1Q== X-Forwarded-Encrypted: i=1; AJvYcCWCntg48hLDW4WQKGBoEGliT7wUQjxzEUZsDF44J9OABw1SnpFw1ccv87XMNtDWdXvu9CttfUDAqvc=@nongnu.org, AJvYcCXqRhEXDguhDTZ8gDyBjJqv3NLECYYtgLA0/cWsV/U8aqiuavGhq5Lu92y07H4WkYm34uWTx6KEv8A/@nongnu.org X-Gm-Message-State: AOJu0Yw/fRC+lkBANSM+dDeiuhv2dh1POT+Ciyqiwk2jHqkqhoJBgnhP DnxiX0TvMaD4dyy3sARS0KGgLe+ZZNlT0t64mcj27HDDMeL0ryFFw/tHCg== X-Google-Smtp-Source: AGHT+IH9iMH8Zk6eJd0GZHF92V5rajOnLefPmjJoVEEB5eOKd8KPpQDyTXQlQI4L2GZFB/Ga/wCTrA== X-Received: by 2002:a17:907:2d0d:b0:a99:61d1:348f with SMTP id a640c23a62f3a-a9e655b9703mr610653366b.52.1730553452566; Sat, 02 Nov 2024 06:17:32 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:31 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 02/26] hw/ppc/e500: Remove firstenv variable Date: Sat, 2 Nov 2024 14:16:51 +0100 Message-ID: <20241102131715.548849-3-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The firstenv variable is never read, so remove it. The env variable is then only used inside the loop, so move it there to restrict its scope. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ba83f33033..0683629ac0 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -899,7 +899,6 @@ void ppce500_init(MachineState *machine) const PPCE500MachineClass *pmc = PPCE500_MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_CLASS(pmc); PCIBus *pci_bus; - CPUPPCState *env = NULL; uint64_t loadaddr; hwaddr kernel_base = -1LL; int kernel_size = 0; @@ -921,7 +920,6 @@ void ppce500_init(MachineState *machine) IrqLines *irqs; DeviceState *dev, *mpicdev; DriveInfo *dinfo; - CPUPPCState *firstenv = NULL; MemoryRegion *ccsr_addr_space; SysBusDevice *s; PPCE500CCSRState *ccsr; @@ -930,6 +928,7 @@ void ppce500_init(MachineState *machine) irqs = g_new0(IrqLines, smp_cpus); for (i = 0; i < smp_cpus; i++) { PowerPCCPU *cpu; + CPUPPCState *env; CPUState *cs; cpu = POWERPC_CPU(object_new(machine->cpu_type)); @@ -950,10 +949,6 @@ void ppce500_init(MachineState *machine) &error_abort); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); - if (!firstenv) { - firstenv = env; - } - irqs[i].irq[OPENPIC_OUTPUT_INT] = qdev_get_gpio_in(DEVICE(cpu), PPCE500_INPUT_INT); irqs[i].irq[OPENPIC_OUTPUT_CINT] = @@ -974,8 +969,6 @@ void ppce500_init(MachineState *machine) } } - env = firstenv; - if (!QEMU_IS_ALIGNED(machine->ram_size, RAM_SIZES_ALIGN)) { error_report("RAM size must be multiple of %" PRIu64, RAM_SIZES_ALIGN); exit(EXIT_FAILURE); From patchwork Sat Nov 2 13:16:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005459 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SgPeZdzv; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdck3lw7z1xwc for ; Sun, 3 Nov 2024 00:19:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0l-00036a-VO; Sat, 02 Nov 2024 09:17:52 -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 1t7E0Y-00032W-PG; Sat, 02 Nov 2024 09:17:39 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0W-0001w8-Ka; Sat, 02 Nov 2024 09:17:37 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a9e44654ae3so335513266b.1; Sat, 02 Nov 2024 06:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553454; x=1731158254; 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=tfVJw2OTp+OS1+DvQbkRZgABrzKigE/SljuSUg2aBz4=; b=SgPeZdzvlPmTQoGIKuGTazf0O4cw5UxEYzdQVfRlYFkKTkpHjAfr4uxzBLSNyjjqdC lnRHqk2pfV9iJGF1XKda0/gDyJ3CK7Q16egcTbP3LzT9lo0++ZVb+Liz1yUx7i0HuAaM vIzPXeisxDTGMGF2IGcZq/j0EDNJU19xYUd/Z1YYG7S3Gxeq6C2UT65OLtDJRG2A85a0 KaKHIXsw6GGkc2OtFA9kYdtAvczvAGq+l/yPkCLPJ8xOUjhnmNd58gF8AVrMvzIlXkwR D1knR45+Z2TcxRDsQZNTwyKa22/9SVZOjy/W67+JKB9GMRFL+q9aX53CnSK01+zNjlYC 8f2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553454; x=1731158254; 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=tfVJw2OTp+OS1+DvQbkRZgABrzKigE/SljuSUg2aBz4=; b=qX1OVoX04YUxdQSWq6trnkqpRQD9eWRCVa/DYy58kIBbnDLo0T51Ic3DhBoXjJ9RYQ LUW9CdAuT4urJmEBvqNtCSZMU/ICd29zLUEVuX0504nbMd0gPg3HbMfYNc1t87N6AM/a 2onEnrF7Kf/057k06ucnJHPngbcOp8v7wH5F6EhKTDFYZIUYE+aadbYidNPWBivuXBSy Ta4oQQmp1hYo6BZ2nDiey5nLm8WbF9lXsBpgPL0VSpzxwY+tCtCU7ooSZkPnsJIYTRdO 01w+NsVEeERSM4GRbwb70m4o2YzhbXHuLSgLfc+gQpXzOq8s3Z9QOztpytAiAODfdhWK TcKQ== X-Forwarded-Encrypted: i=1; AJvYcCUgl2ij/q/jsPn8Pgj3ITPzsjKhi8wvVYvXfN17lwJbD3c5a0Q/vN1q78xkmj9F/ZbwFYRWjXhmwpBa@nongnu.org, AJvYcCVxuofdi5A2nU4KGLTdtQHd5FmLZ3BkJIhcI1/et4w/Iuyarbgf9wEYma9MPy69tLkIUcAV8PuXuxk=@nongnu.org X-Gm-Message-State: AOJu0YzlMNUQz6OQ77CEJjweR7wzGrRjhvA6oLBqS4alMYlKZhBkJTAC o4xBJWseg81haylAzzitABEeBOaJFcM4+UqexcKb91yx8WDgEax0L91YqQ== X-Google-Smtp-Source: AGHT+IEY0YtyH2q+SUklW2f073sIE4tcLpdwFgdSDVVDP3MvB/PF+a5hSHmVJc3sfd/xnScpg9HFzw== X-Received: by 2002:a17:907:7208:b0:a9a:15fb:727a with SMTP id a640c23a62f3a-a9e508ac2dcmr1014763466b.13.1730553453917; Sat, 02 Nov 2024 06:17:33 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:33 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard , BALATON Zoltan Subject: [PATCH v3 03/26] hw/ppc/e500: Prefer QOM cast Date: Sat, 2 Nov 2024 14:16:52 +0100 Message-ID: <20241102131715.548849-4-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 0683629ac0..964a22c5b7 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -1008,7 +1008,7 @@ void ppce500_init(MachineState *machine) sysbus_connect_irq(s, 0, qdev_get_gpio_in(mpicdev, MPC8544_I2C_IRQ)); memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET, sysbus_mmio_get_region(s, 0)); - i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); + i2c = I2C_BUS(qdev_get_child_bus(dev, "i2c")); i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET); /* eSDHC */ @@ -1057,7 +1057,7 @@ void ppce500_init(MachineState *machine) memory_region_add_subregion(ccsr_addr_space, MPC8544_PCI_REGS_OFFSET, sysbus_mmio_get_region(s, 0)); - pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0"); + pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0")); if (!pci_bus) printf("couldn't create PCI controller!\n"); From patchwork Sat Nov 2 13:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005453 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ljcOl5+v; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdbG35y4z1xwc for ; Sun, 3 Nov 2024 00:18:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0y-0003DJ-DN; Sat, 02 Nov 2024 09:18:04 -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 1t7E0Z-00032j-Sn; Sat, 02 Nov 2024 09:17:40 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0Y-0001wW-4N; Sat, 02 Nov 2024 09:17:39 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a9a5f555cfbso201796866b.1; Sat, 02 Nov 2024 06:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553455; x=1731158255; 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=n35w2VDiQsxwqNroL2qJeQnt4HfjJdNE+pLX1JQDjcs=; b=ljcOl5+v7+SMpVpuvpi/LqaC9Lcpo/PslmCREfdPC22OLSF5HiLXQKrYOiPShdsiJT JZ/vhNJAyeSVdh3pnHhClH8OWE3H5oOsLeBh7Z0UiD8L2SUdrEFMkcI/e7Iw3Il1AeCf RY4VyF/RlC4HOczmBaeXcFEiBsC0QpKfpzcbYY9jSs7jrnsjmUrC8CMeDWAEKcSsVQ8Q ZuPPbF1qbMi9awFhzbhlJqCQbz1MRy4pRf3zWHPU8O5i/lFTIio/g/UZz9F4t0YGBWS2 O0GMQ5Z1PkIyF3tEV/aZhcE8HHHdhaHQ8pNg0WfVjbKJh0WVvd2PIGcdb9T67HQn7QY0 6DVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553455; x=1731158255; 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=n35w2VDiQsxwqNroL2qJeQnt4HfjJdNE+pLX1JQDjcs=; b=ZAIm+ZaXB9sJw0pHz8FNGh8Y1uQCDyZXpOUdSBJ0wZQtFgqPpTqMVxJ+gCiFzPRrNQ L6eEgzqXem+yqGfSFc0CU1aTjFbp0WnjZxjF94gB2zZk4fBhmG+QfQzIt49oGhMpmqpc g2GfUhdU66e6ZKly/k9AKWvPEusOZh9722sUh1t33/x8Jmr6jmG4uT4uYcRRABagrJpR xDa+FEJT6a4RTxoSeu77h55rXITXHk/xulcGUceeXd4dWT3YTspa+l7CRNU7LGgAIjTh xZK9vY77Q8lBaE3u0fb9nk82W7zdXWRtTgiV1ghVlNKOlVMjRYS+TPnjCWmEMHgiTmU6 +2/w== X-Forwarded-Encrypted: i=1; AJvYcCVU1vX6m9gIJdKsuo7e12bc+5KyG+42Ih+acjGiYtoiMfpe4BwOlbJXf6I9HzUiL9Ymvg1y06fBBCl7@nongnu.org, AJvYcCXNAUyeMLmOqWj5riuIaExyFT5nZEZcmhS59sZHDw4VWhiLoyE4K/6ICZs4qNDEUFq2ZikjGTiYiJo=@nongnu.org X-Gm-Message-State: AOJu0YwOhUZXnJLalPUtgDrG0tjylfIyN/VDfNSxEsuyy3ejMngM4e2R J+09JADJDTCg96S81PHFoeA7JqlMbtINbVyl+y0TBcI9RkdllN+/3IFGrQ== X-Google-Smtp-Source: AGHT+IH0+GjB2T+xG/7LWhUEDx+m5Jcqp2EFl5x8evcmMUqTVigJFrjh8hWMxlOb0egl2uhtTQdobA== X-Received: by 2002:a05:6402:524b:b0:5ce:afba:f48a with SMTP id 4fb4d7f45d1cf-5ceb935bbc3mr8312113a12.27.1730553455039; Sat, 02 Nov 2024 06:17:35 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:34 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard , BALATON Zoltan Subject: [PATCH v3 04/26] hw/ppc/e500: Remove unused "irqs" parameter Date: Sat, 2 Nov 2024 14:16:53 +0100 Message-ID: <20241102131715.548849-5-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 964a22c5b7..ecaaab1558 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -825,7 +825,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500MachineState *pms, } static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, - IrqLines *irqs, Error **errp) + Error **errp) { #ifdef CONFIG_KVM DeviceState *dev; @@ -865,7 +865,7 @@ static DeviceState *ppce500_init_mpic(PPCE500MachineState *pms, Error *err = NULL; if (kvm_kernel_irqchip_allowed()) { - dev = ppce500_init_mpic_kvm(pmc, irqs, &err); + dev = ppce500_init_mpic_kvm(pmc, &err); } if (kvm_kernel_irqchip_required() && !dev) { error_reportf_err(err, From patchwork Sat Nov 2 13:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ht3NmocA; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdbC45Bjz1xwc for ; Sun, 3 Nov 2024 00:18:31 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0t-0003AW-6e; Sat, 02 Nov 2024 09:17:59 -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 1t7E0b-000330-2C; Sat, 02 Nov 2024 09:17:41 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0Z-0001wj-4w; Sat, 02 Nov 2024 09:17:40 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a9a850270e2so437680566b.0; Sat, 02 Nov 2024 06:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553456; x=1731158256; 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=ODth02XHk2l2sGfVJHhWS3UJ9E3eRYVl7bEr+6Us9LU=; b=ht3NmocABLe47de56tPTqmi4JFIWi7LrAjf0G7ZvY4RZaLU0VvJzpxdd980jfZkjGv wW3eO/m+zNUWkDDot6aw3sPZXXX9gVcuVY2Lys4I4r/ft2rWYisgzeSyplZj3Yr1ZCkz qmcqOGdK4bOzNsaEsC+o84vQBNVKlNfh6hY95hBFEI1RiUK8QkMONq2dwGBPdpvxW0b4 aXVgrh912LiwxnRKrCyZrvO4VBRZy5CJrUDQBzwlQa6VaXyu1I+9heRgW+LK0x+vZKQF C66DEL9UzkBS3v+las38nuukRzONHm5CPxlmYRo73Bc7O6zTLgwv3A3CpgHUs2cFiT/d MDVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553456; x=1731158256; 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=ODth02XHk2l2sGfVJHhWS3UJ9E3eRYVl7bEr+6Us9LU=; b=c0wNoB3fXIvKmOnlpUq+bYhvfpG089QKHrMjWybGlmLTF7f71MoyFv2GApehrBzgIu s2ebpUsfCsOn3FL3KYaEz4N2aGuTbAgNXcQQFXwypS14CH4uE1Z+ORLJ9gkuQABNtcXf SXfzLB3pzjIZTy1KPA+ZWIrySpeYjf2Y7o7IdNNrpBQrrSrrJFdGgeAMf2nUmdnDUHmk rGr44rV9OooLQew19hvnURccjYEt9KJaDkTG/5FRIdzi9zIIEysnqOamck1tNivKtzhD h5u+EcZroc2eRMhseuz44EW3d2dwHsuacQ8twM3SJDeYYaWNGm5x5yxw6Ty2sW3RA7K1 IHJQ== X-Forwarded-Encrypted: i=1; AJvYcCUQ5JK+BHR8QPysVxg8TTLrZ6jHg0Ki9goJe0zVrt6Tx2ErFH7X6ZcMgzzoSSozHolSlFLLSP1/etcj@nongnu.org, AJvYcCVEYWTHSZ52LMhULSKQqFAJxwTNbkYG5fsr7l5L9OzhPycD+ZSTj6nEBhm86U+bWR1NSvxNEKeHYfc=@nongnu.org X-Gm-Message-State: AOJu0YxvFoeb9+FgrHUy4L7yDiQagTh4gXDTk8rHbpP0SUzv4OhdCxQl Ua4qVqwzOPqbURVdGuXQICtKfRDI7mjzdwYKn69FfWY4Ikn9m6rC4+frAg== X-Google-Smtp-Source: AGHT+IGr+Keipjacd9uv6zZ0RF1WLIt5xvSWOFxT0zLaUtwAoNTLtlrvuVaD2xSPUDPvn8KdXRjm8w== X-Received: by 2002:a17:907:3f23:b0:a9a:55de:11f4 with SMTP id a640c23a62f3a-a9e658bc988mr512896966b.54.1730553456094; Sat, 02 Nov 2024 06:17:36 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:35 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 05/26] hw/ppc/e500: Add missing device tree properties to i2c controller node Date: Sat, 2 Nov 2024 14:16:54 +0100 Message-ID: <20241102131715.548849-6-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When compiling a decompiled device tree blob created with dumpdtb, dtc complains with: /soc@e0000000/i2c@3000: incorrect #address-cells for I2C bus /soc@e0000000/i2c@3000: incorrect #size-cells for I2C bus Fix this by adding the missing device tree properties. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ecaaab1558..a0c856568b 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -196,6 +196,8 @@ static void dt_i2c_create(void *fdt, const char *soc, const char *mpic, qemu_fdt_setprop_cells(fdt, i2c, "cell-index", 0); qemu_fdt_setprop_cells(fdt, i2c, "interrupts", irq0, 0x2); qemu_fdt_setprop_phandle(fdt, i2c, "interrupt-parent", mpic); + qemu_fdt_setprop_cell(fdt, i2c, "#size-cells", 0); + qemu_fdt_setprop_cell(fdt, i2c, "#address-cells", 1); qemu_fdt_setprop_string(fdt, "/aliases", alias, i2c); g_free(i2c); From patchwork Sat Nov 2 13:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jrgErHtC; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdbd2YmRz1xwc for ; Sun, 3 Nov 2024 00:18:53 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0m-00036W-09; Sat, 02 Nov 2024 09:17:53 -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 1t7E0c-00033N-3u; Sat, 02 Nov 2024 09:17:42 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0a-0001x2-GT; Sat, 02 Nov 2024 09:17:41 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a9a68480164so407177166b.3; Sat, 02 Nov 2024 06:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553458; x=1731158258; 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=scKsKjVwCuGqApOSyGEnsOwcmcTTDBAW30tcpamKwQc=; b=jrgErHtCrjLcKi9cmlkjLO89/eQpgNabmwJDlGntTB0eCGiVOQjCb4XWmsl/OUb79y 6rx7y6hkxTjqMOqn8tcPeBC/qXwJcBHcg4qOE+JOpVx1f5S5V8OKE2z65GYX0MG4gp9Y oBz8KZkWRih54tjF33T2h14JK1duFBQbqCHpPRKNtA4j3TrAnxSLTlRZ0+HyJ3SNr7wB Yb9oDtTaxK8nhTzBqp9poImchUQSBGHkTXyLJ0Z0MnSlHSXlW+tMwdgF96bV4u3IOS+1 LUpfhQyXSBaT6heoOGFUkf4p7eBgt2C96T3aS2/s59t0nzPI6ZjjkueL+KCGEwBrRFHx qvJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553458; x=1731158258; 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=scKsKjVwCuGqApOSyGEnsOwcmcTTDBAW30tcpamKwQc=; b=ovfUIvI+VpOiBh6I9lKDadfql3HTmPvv3Ewlhw5vUZTSS3zR1DM5uNYWPxeufN2thf QQlkTnntRHStIX6ckTpKgNF4EqoXZa7z7xVOUh+FK4h+vVcnSeTrFuE5SGw6kixIXWbe tP7zV1rls9xmKzdmpYagPUrT6RUHT86dtz+67HReooiMK4Dbsxwd4enzuDAoEE29GGsq qsyn0XkYAl21yT3vU9v0PmHU1rz9O/XEaq3s2avPB62InpWuil1BOpKn2nZqKgui5nQ7 znFj4MwPYNqChGW4n7sd75lJ+58I0RDlma8KUU+IlWhwd17dVHt5lwBddq0XSiaUWc3D c8Gw== X-Forwarded-Encrypted: i=1; AJvYcCU1CUKsDvZxVGupEALps2Ypfy5Sr+WtuNfPLoT6mC2z4oPH4z51H+s1LLl/UkmD+yX87FRSWo54hCle@nongnu.org, AJvYcCX9hkJTnEnnSR51hJ/hgti9QZdrxOaEa3OKkrA6RXKzF2dqrCZIts1fe/DqY8eASjINNtw63HvG4ng=@nongnu.org X-Gm-Message-State: AOJu0YzOh0tUrTjaPm1eJfJXntNxMBml2gfTMgLD1VkRez3s654KEhhc ViPJs/PrlOsNDd6VgV7Ozm2chE00/LdXajspTAS3hMYP8ZcQ04FYDZZpOg== X-Google-Smtp-Source: AGHT+IH5iD2Tc0Jah8AtXLEsdsVSLVjz7SsPxZn1HWY1NjSiT4KU6CD5Vl6f9bdezbOv+E5npNJa7w== X-Received: by 2002:a17:906:478f:b0:a99:f56e:ce40 with SMTP id a640c23a62f3a-a9de6166952mr2513568666b.47.1730553457457; Sat, 02 Nov 2024 06:17:37 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:36 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 06/26] hw/ppc/e500: Reuse TYPE_GPIO_PWR Date: Sat, 2 Nov 2024 14:16:55 +0100 Message-ID: <20241102131715.548849-7-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Taking inspiration from the ARM virt machine, port away from qemu_allocate_irq() by reusing TYPE_GPIO_PWR. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 16 ++++------------ hw/ppc/Kconfig | 1 + 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index a0c856568b..5d75a090ee 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -30,7 +30,6 @@ #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "sysemu/reset.h" -#include "sysemu/runstate.h" #include "kvm_ppc.h" #include "sysemu/device_tree.h" #include "hw/ppc/openpic.h" @@ -47,7 +46,6 @@ #include "hw/platform-bus.h" #include "hw/net/fsl_etsec/etsec.h" #include "hw/i2c/i2c.h" -#include "hw/irq.h" #include "hw/sd/sdhci.h" #include "hw/misc/unimp.h" @@ -887,13 +885,6 @@ static DeviceState *ppce500_init_mpic(PPCE500MachineState *pms, return dev; } -static void ppce500_power_off(void *opaque, int line, int on) -{ - if (on) { - qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); - } -} - void ppce500_init(MachineState *machine) { MemoryRegion *address_space_mem = get_system_memory(); @@ -1072,7 +1063,7 @@ void ppce500_init(MachineState *machine) sysbus_create_simple("e500-spin", pmc->spin_base, NULL); if (pmc->has_mpc8xxx_gpio) { - qemu_irq poweroff_irq; + DeviceState *gpio_pwr_dev; dev = qdev_new("mpc8xxx_gpio"); s = SYS_BUS_DEVICE(dev); @@ -1082,8 +1073,9 @@ void ppce500_init(MachineState *machine) sysbus_mmio_get_region(s, 0)); /* Power Off GPIO at Pin 0 */ - poweroff_irq = qemu_allocate_irq(ppce500_power_off, NULL, 0); - qdev_connect_gpio_out(dev, 0, poweroff_irq); + gpio_pwr_dev = sysbus_create_simple("gpio-pwr", -1, NULL); + qdev_connect_gpio_out(dev, 0, qdev_get_gpio_in_named(gpio_pwr_dev, + "shutdown", 0)); } /* Platform Bus Device */ diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index b44d91bebb..12ca3caabf 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -158,6 +158,7 @@ config E500 imply VIRTIO_PCI select ETSEC select GPIO_MPC8XXX + select GPIO_PWR select OPENPIC select PFLASH_CFI01 select PLATFORM_BUS From patchwork Sat Nov 2 13:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jNfyr7OU; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdh31Bgdz1xy7 for ; Sun, 3 Nov 2024 00:22:43 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E12-0003Gv-2i; Sat, 02 Nov 2024 09:18:08 -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 1t7E0d-00034A-Uw; Sat, 02 Nov 2024 09:17:45 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0c-0001xN-Ew; Sat, 02 Nov 2024 09:17:43 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a99e3b3a411so592517566b.0; Sat, 02 Nov 2024 06:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553459; x=1731158259; 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=CdW4RukPeYbtzE571oJ5Ywld87248Qqc7eArKKusu5M=; b=jNfyr7OUQ648aEFVTyDXqJdpemgbXpclTkx7AAYKxzmK7rhgexKBNHDoflA7XmFihj 7pTM55okXRmzHrGvLCCx8r79WPY6iHhInyqrUtkJ+MpiTYrldsozf7weiBsA9zMpwpkO EOYrROD0H79XtxgjRBgS7NRVhwdM2EELzAegNzhiPZ5x/Nrqo2lCzCT9mh7FX/Hy6umi /+fjT/J/i8jkHq/7ogwwZ1prFNNYvjokZ59gB/8fLTJnBgcNY8EaYRK+D4ftphICB8Gr ziSB69ywAOmiCufEy3hZIHs3dOjo5BYMWeYgI7If+KlmC71N42441xJFVwrUkH68Ok+W nNvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553459; x=1731158259; 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=CdW4RukPeYbtzE571oJ5Ywld87248Qqc7eArKKusu5M=; b=g8mRBKvDSWGiikIv3l2F27slwn2K7kgD9bx6UgXO3jVmAQ2ffSDqqPf6SSGakLM2FL pbnD9LRXpwS4AdzvSn550OVMki0IPj/IHvo8x6GLkUeDuBoq27tQwup7MCcJ6LC7qTav cKEt5W97o3r3BVbo2tWAnuGqiHChCk2yedZ5+Le0Ik40pqZjHOEjmrlZB3329yofx4ur xaMfTrCRy1p4rWO+RyxonyNahC8OeV/r6PI75Ixk/uSFzM2NBuAIvHA1B/3CX6E2hH2n Am2ns2NQs6vsbxB+35+OdH5g0tTDA5GpKiXoCDw+WXfalpUwaUAFgErZPJ6utlYrDKgJ bw9w== X-Forwarded-Encrypted: i=1; AJvYcCVPU9rYr0603PWAra3ddw2NAvdQXmuGGaaJYfaJhk3EHIe2aAs53CuXS8LcrEPczyhf98jeBrqLm3Y=@nongnu.org, AJvYcCWRLW3MWkkL63IZXa01dIhn6xmu8EMDrMJOOXavztCswSGUnJ6gNUllPG5kmmpQ0Bqdo2p2l1hrMuf7@nongnu.org X-Gm-Message-State: AOJu0YwmDtO4VY564aUAH0F5IV2tTPbgGuxJnxnGh0jk5gkO1/uQQHuv qecB1c07MhctMv7mpCShVrNaXj2n44pbUftaf8XE03wJSbR7HbcsHFeh2Q== X-Google-Smtp-Source: AGHT+IFWSQiKE/gW1ann498ne4rFAch8m+7o/TqcDPgO1YVFYQGspmdk3Ea7tRpLaT+QlEuF0AVd2w== X-Received: by 2002:a17:907:3e1d:b0:a9e:21e5:d6cc with SMTP id a640c23a62f3a-a9e65435e10mr567903866b.20.1730553458832; Sat, 02 Nov 2024 06:17:38 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:38 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard , BALATON Zoltan Subject: [PATCH v3 07/26] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources Date: Sat, 2 Nov 2024 14:16:56 +0100 Message-ID: <20241102131715.548849-8-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Rather than accessing the attributes of TYPE_CCSR directly, use the SysBusDevice API which exists exactly for that purpose. Furthermore, registering the memory region with the SysBusDevice API makes it show up in QMP's `info qom-tree` command. Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 10 +++++----- hw/ppc/e500.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 95b983b2b3..97e5d47cec 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -16,7 +16,6 @@ #include "qemu/osdep.h" #include "hw/irq.h" -#include "hw/ppc/e500-ccsr.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/pci/pci_device.h" @@ -419,11 +418,12 @@ static const VMStateDescription vmstate_ppce500_pci = { static void e500_pcihost_bridge_realize(PCIDevice *d, Error **errp) { PPCE500PCIBridgeState *b = PPC_E500_PCI_BRIDGE(d); - PPCE500CCSRState *ccsr = CCSR(container_get(qdev_get_machine(), - "/e500-ccsr")); + SysBusDevice *ccsr = SYS_BUS_DEVICE(container_get(qdev_get_machine(), + "/e500-ccsr")); + MemoryRegion *ccsr_space = sysbus_mmio_get_region(ccsr, 0); - memory_region_init_alias(&b->bar0, OBJECT(ccsr), "e500-pci-bar0", &ccsr->ccsr_space, - 0, int128_get64(ccsr->ccsr_space.size)); + memory_region_init_alias(&b->bar0, OBJECT(ccsr), "e500-pci-bar0", + ccsr_space, 0, int128_get64(ccsr_space->size)); pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &b->bar0); } diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 5d75a090ee..2849fba524 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -915,7 +915,6 @@ void ppce500_init(MachineState *machine) DriveInfo *dinfo; MemoryRegion *ccsr_addr_space; SysBusDevice *s; - PPCE500CCSRState *ccsr; I2CBus *i2c; irqs = g_new0(IrqLines, smp_cpus); @@ -971,10 +970,10 @@ void ppce500_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0, machine->ram); dev = qdev_new("e500-ccsr"); + s = SYS_BUS_DEVICE(dev); object_property_add_child(OBJECT(machine), "e500-ccsr", OBJECT(dev)); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - ccsr = CCSR(dev); - ccsr_addr_space = &ccsr->ccsr_space; + sysbus_realize_and_unref(s, &error_fatal); + ccsr_addr_space = sysbus_mmio_get_region(s, 0); memory_region_add_subregion(address_space_mem, pmc->ccsrbar_base, ccsr_addr_space); @@ -1262,6 +1261,7 @@ static void e500_ccsr_initfn(Object *obj) PPCE500CCSRState *ccsr = CCSR(obj); memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", MPC8544_CCSRBAR_SIZE); + sysbus_init_mmio(SYS_BUS_DEVICE(ccsr), &ccsr->ccsr_space); } static const TypeInfo e500_ccsr_info = { From patchwork Sat Nov 2 13:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YijjUyD6; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgddJ5k2Gz1xxy for ; Sun, 3 Nov 2024 00:20:20 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E11-0003Gn-U4; Sat, 02 Nov 2024 09:18:07 -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 1t7E0f-000354-GR; Sat, 02 Nov 2024 09:17:46 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0d-0001xk-Hz; Sat, 02 Nov 2024 09:17:45 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5cec9609303so751470a12.1; Sat, 02 Nov 2024 06:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553461; x=1731158261; 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=Ru1Gt0W7wGFu8fqeS2mXdTbWG17w7ktdLroVRSgCGnU=; b=YijjUyD6ZsELGCJMt1yQehVZcndbnfp75TAh3K9sZGUj3lv3yJuKpmbrD3u+nHc5jt iXEpwFXH28nYo4O8rWRoXqHsY0MpUZcNp8IDfUh2zWzOaE6Z0uDZmH55ALYR2gjiO/+7 qPNVnstW6Ic90+yOzgesK2Ktm8GTY7PDLelv5QQkkIr5eEaWYbidsPhY8R8VNGEYRVkv w034p8gGRE53zVtu+/DdI/tPfUVQ2LoYVj7132s+AcnpRwzk1gIHFdPArKMC+lxxOAbA konsPztF1RaWKBvG6NS/uAIz6cUe3jS5jyMu/CR55ejM4ZgwTK9l3ORPOC46b6If/N6T ApdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553461; x=1731158261; 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=Ru1Gt0W7wGFu8fqeS2mXdTbWG17w7ktdLroVRSgCGnU=; b=JANmCsNQ+VKtrpK9RSufXfSPga+DiPF6Jxob+cX+0yDe6JftQVgyz0Vjr05WejCvp/ gqv12mWc1+9R4ChZsBikaUt8ojpGhk1/b6Rh33ylNTHy33LNE/zezB4vdTQllk38Sk5y mL1316BcUisSmg9vKODRnw9zhVWNKk0KiFf00u+yhsBI7GF7tNeCpZlYb0nbJMRLrYR5 4CP/D4V/zxOEwvu7j3D+sR129FoiIdRvcPjfxpPVr8ynX2LDunem9vqXJHdM4ODPczhG iCnpv577OwFhR9X1KHtkspYMxG12JJroO2XUwUw/mMdJvXCpaWf0kQsLR2eqc6PVsvb2 E2Zw== X-Forwarded-Encrypted: i=1; AJvYcCUwQsV4+cop7HCT0vGZBlKSs9Xgqd8MGstTwe6bU7WhivjkPxwohac6orZwPBw4r0ZL4m6GToKY2RM=@nongnu.org, AJvYcCVDnVMD1NTNEO+seF0jKkcKANLIqdEkV9gP3VD6AYgMupiMuGjKwtv+v9CjKt7VmcSXaW6SxZGZK7T7@nongnu.org X-Gm-Message-State: AOJu0Yzn8/rMwcbvEzJNORqKLZo6roHF3RfoMq3NdE3VYjBLs03+IT5E kUYQ4gyQ+CgH4FQy8RWld4WZiWgVrdaLT9Wrob287LGtPUusyHTo6fjoPQ== X-Google-Smtp-Source: AGHT+IG/Yc5YMoTWuqYnqJ4RBrYXSASOjn6r/l8bn9uUnFX+MCf7ccB+cZc3IhwEIa5/12c9mZ5a1g== X-Received: by 2002:a17:907:940e:b0:a9a:b70:2a92 with SMTP id a640c23a62f3a-a9de5ecc46bmr2647576466b.16.1730553460457; Sat, 02 Nov 2024 06:17:40 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:39 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 08/26] hw/ppc/e500: Extract ppce500_ccsr.c Date: Sat, 2 Nov 2024 14:16:57 +0100 Message-ID: <20241102131715.548849-9-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=shentey@gmail.com; helo=mail-ed1-x529.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The device model already has a header file, so extract its implementation into an accompanying source file like other e500 devices. While at it rename the header file to reflect the name of the structure defined there. This commit is also a preparation for the next commit. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 +- hw/ppc/{e500-ccsr.h => ppce500_ccsr.h} | 8 +++--- hw/ppc/e500.c | 21 ++-------------- hw/ppc/ppce500_ccsr.c | 34 ++++++++++++++++++++++++++ hw/ppc/meson.build | 1 + 5 files changed, 42 insertions(+), 24 deletions(-) rename hw/ppc/{e500-ccsr.h => ppce500_ccsr.h} (71%) create mode 100644 hw/ppc/ppce500_ccsr.c diff --git a/MAINTAINERS b/MAINTAINERS index 1e88b5738c..a8f39aeb6f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1391,7 +1391,7 @@ M: Bernhard Beschow L: qemu-ppc@nongnu.org S: Odd Fixes F: hw/ppc/e500* -F: hw/ppc/ppce500_spin.c +F: hw/ppc/ppce500_* F: hw/gpio/mpc8xxx.c F: hw/i2c/mpc_i2c.c F: hw/net/fsl_etsec/ diff --git a/hw/ppc/e500-ccsr.h b/hw/ppc/ppce500_ccsr.h similarity index 71% rename from hw/ppc/e500-ccsr.h rename to hw/ppc/ppce500_ccsr.h index 249c17be3b..36cbb811ca 100644 --- a/hw/ppc/e500-ccsr.h +++ b/hw/ppc/ppce500_ccsr.h @@ -1,13 +1,13 @@ -#ifndef E500_CCSR_H -#define E500_CCSR_H +#ifndef PPCE500_CCSR_H +#define PPCE500_CCSR_H #include "hw/sysbus.h" #include "qom/object.h" +#define MPC85XX_CCSRBAR_SIZE 0x00100000ULL + struct PPCE500CCSRState { - /*< private >*/ SysBusDevice parent; - /*< public >*/ MemoryRegion ccsr_space; }; diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 2849fba524..f640195e62 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -20,7 +20,7 @@ #include "qemu/guest-random.h" #include "qapi/error.h" #include "e500.h" -#include "e500-ccsr.h" +#include "ppce500_ccsr.h" #include "net/net.h" #include "qemu/config-file.h" #include "hw/block/flash.h" @@ -59,7 +59,6 @@ #define RAM_SIZES_ALIGN (64 * MiB) /* TODO: parameterize */ -#define MPC8544_CCSRBAR_SIZE 0x00100000ULL #define MPC8544_MPIC_REGS_OFFSET 0x40000ULL #define MPC8544_MSI_REGS_OFFSET 0x41600ULL #define MPC8544_SERIAL0_REGS_OFFSET 0x4500ULL @@ -530,7 +529,7 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms, qemu_fdt_setprop_cell(fdt, soc, "#size-cells", 1); qemu_fdt_setprop_cells(fdt, soc, "ranges", 0x0, pmc->ccsrbar_base >> 32, pmc->ccsrbar_base, - MPC8544_CCSRBAR_SIZE); + MPC85XX_CCSRBAR_SIZE); /* XXX should contain a reasonable value */ qemu_fdt_setprop_cell(fdt, soc, "bus-frequency", 0); @@ -1256,21 +1255,6 @@ void ppce500_init(MachineState *machine) pms->boot_info.dt_size = dt_size; } -static void e500_ccsr_initfn(Object *obj) -{ - PPCE500CCSRState *ccsr = CCSR(obj); - memory_region_init(&ccsr->ccsr_space, obj, "e500-ccsr", - MPC8544_CCSRBAR_SIZE); - sysbus_init_mmio(SYS_BUS_DEVICE(ccsr), &ccsr->ccsr_space); -} - -static const TypeInfo e500_ccsr_info = { - .name = TYPE_CCSR, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(PPCE500CCSRState), - .instance_init = e500_ccsr_initfn, -}; - static const TypeInfo ppce500_info = { .name = TYPE_PPCE500_MACHINE, .parent = TYPE_MACHINE, @@ -1281,7 +1265,6 @@ static const TypeInfo ppce500_info = { static void e500_register_types(void) { - type_register_static(&e500_ccsr_info); type_register_static(&ppce500_info); } diff --git a/hw/ppc/ppce500_ccsr.c b/hw/ppc/ppce500_ccsr.c new file mode 100644 index 0000000000..5d0e1e0e89 --- /dev/null +++ b/hw/ppc/ppce500_ccsr.c @@ -0,0 +1,34 @@ +/* + * QEMU PowerPC E500 embedded processors CCSR space emulation + * + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. + * + * Author: Yu Liu, + * + * This 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. + */ + +#include "qemu/osdep.h" +#include "ppce500_ccsr.h" + +static void ppce500_ccsr_init(Object *obj) +{ + PPCE500CCSRState *s = CCSR(obj); + + memory_region_init(&s->ccsr_space, obj, "e500-ccsr", MPC85XX_CCSRBAR_SIZE); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->ccsr_space); +} + +static const TypeInfo types[] = { + { + .name = TYPE_CCSR, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PPCE500CCSRState), + .instance_init = ppce500_ccsr_init, + }, +}; + +DEFINE_TYPES(types) diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index 7cd9189869..43c746795a 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -81,6 +81,7 @@ ppc_ss.add(when: 'CONFIG_MPC8544DS', if_true: files('mpc8544ds.c')) ppc_ss.add(when: 'CONFIG_E500', if_true: files( 'e500.c', 'mpc8544_guts.c', + 'ppce500_ccsr.c', 'ppce500_spin.c' )) # PowerPC 440 Xilinx ML507 reference board. From patchwork Sat Nov 2 13:16:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ltvei1A9; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdfK4yFnz1xwF for ; Sun, 3 Nov 2024 00:21:13 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0z-0003Ed-3H; Sat, 02 Nov 2024 09:18:05 -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 1t7E0g-000359-3M; Sat, 02 Nov 2024 09:17:46 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0e-0001xy-F4; Sat, 02 Nov 2024 09:17:45 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a9a156513a1so466939266b.0; Sat, 02 Nov 2024 06:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553461; x=1731158261; 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=a850vDBXzHXJ7cyIPByVZxmHOqLVyh2zVKfhVANSK04=; b=ltvei1A9Yyg26aOH522sHjqN2XsYQ/iKDd7Ik9SGr9v1b2AxbNrB36qhqJ6j1RsZT4 lE11fFybLthciJW9f1xR1IbjeLoUEp/F79e5JfvvJoHcF5XwdqTLAzWkslz73jR5GHfS gp2la/qdxsqbDoIMmRQODad0acLhH70dCkAVTCl1aVQUwxhXBvfZFbVGZzjZ5jr/fpNG I17GmSYWFSq+CaGQMDTZc3mfQo5ccBxngN4FKmaE/0TJnAamNNduWd/juAqXFyqpzfGl PnK3QdysRkyMliXj5RJqruWjbQOHoyRi5SA4hHDp+TNVjV6DlaBIyowm8W+wGaAbfAS0 hgGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553461; x=1731158261; 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=a850vDBXzHXJ7cyIPByVZxmHOqLVyh2zVKfhVANSK04=; b=CZcitGEHdX4GPQz9koJCkzTp2sY8FIfRQRFLDpC1Pu0j7i6bNA44SeiEsIefnJ7SEQ HGiof3KbvpXtYGWYK2piW4L+c2iD0Q/kJpCCRwdI0pyklT2GNh7CH0xo5YvYE06JvPb3 FwqLr3AACxsJ6mxlRhr7d1zNKAVoPPjHWsk70p6RDBswkuIAwttqP0iD6NOcyvDQ1hE+ b0eHavuiwoTmf71aCYY6HC8hOSMc3FCVWKIEDjhSXulc6MC/SUAPbdHsZ1We0nhjF8rm hPkeTsE1nrE9VNdd/2sI80V4jHe2UpTYKZXj2iAe28Q4PY9BHubQN82FwIhcAP5mEOWm 95pQ== X-Forwarded-Encrypted: i=1; AJvYcCV6x0QaFshPBP6n+4iJiqU9yYFe0orC2XUkIP2GtILro7X4NwBZZJY6H/Ypz1LMM27fl6ocDf/VJCI=@nongnu.org, AJvYcCWpau0qg7lgnt+lrKwWrwcXyOLyrBLVsN6EBvxgLF8wVUtboqwlBLrDhI1Q/0+zcM2rAIcJ0Cj11nR4@nongnu.org X-Gm-Message-State: AOJu0YwPcOaifMYgujln2vJmZnVP2LldGke4VTkvl7yI308GyBC7t1Wj IQEdYf2AfYzYFGZiiG8j7hBwWWrQ+BNDpsftUaD17LeZJ99PhghCo6sf5w== X-Google-Smtp-Source: AGHT+IG7pSL75drlXt+jqIFdGmscG4ofpult5VeikrWGtLFmHWvMKj/e8ZBh6AXNI2qMgz/xrk+/dQ== X-Received: by 2002:a17:907:6d0d:b0:a9a:147d:fe9c with SMTP id a640c23a62f3a-a9de61d5d59mr2694010666b.43.1730553461485; Sat, 02 Nov 2024 06:17:41 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:41 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 09/26] hw/ppc/ppce500_ccsr: Trace access to CCSR region Date: Sat, 2 Nov 2024 14:16:58 +0100 Message-ID: <20241102131715.548849-10-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The CCSR space is just a container which is meant to be covered by platform device memory regions. However, QEMU only implements a subset of these devices. Add some tracing to see which unimplemented devices a guest attempts to access. Signed-off-by: Bernhard Beschow --- hw/ppc/ppce500_ccsr.c | 25 ++++++++++++++++++++++++- hw/ppc/trace-events | 3 +++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/ppc/ppce500_ccsr.c b/hw/ppc/ppce500_ccsr.c index 5d0e1e0e89..dfd8e80c2d 100644 --- a/hw/ppc/ppce500_ccsr.c +++ b/hw/ppc/ppce500_ccsr.c @@ -13,12 +13,35 @@ #include "qemu/osdep.h" #include "ppce500_ccsr.h" +#include "trace.h" + +static uint64_t ppce500_ccsr_io_read(void *opaque, hwaddr addr, unsigned size) +{ + uint64_t value = 0; + + trace_ppce500_ccsr_io_read(addr, value, size); + + return value; +} + +static void ppce500_ccsr_io_write(void *opaque, hwaddr addr, uint64_t value, + unsigned size) +{ + trace_ppce500_ccsr_io_write(addr, value, size); +} + +static const MemoryRegionOps ppce500_ccsr_ops = { + .read = ppce500_ccsr_io_read, + .write = ppce500_ccsr_io_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; static void ppce500_ccsr_init(Object *obj) { PPCE500CCSRState *s = CCSR(obj); - memory_region_init(&s->ccsr_space, obj, "e500-ccsr", MPC85XX_CCSRBAR_SIZE); + memory_region_init_io(&s->ccsr_space, obj, &ppce500_ccsr_ops, obj, + "e500-ccsr", MPC85XX_CCSRBAR_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->ccsr_space); } diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events index 1f125ce841..ca4c231c9f 100644 --- a/hw/ppc/trace-events +++ b/hw/ppc/trace-events @@ -143,6 +143,9 @@ ppc_irq_cpu(const char *action) "%s" ppc_dcr_read(uint32_t addr, uint32_t val) "DRCN[0x%x] -> 0x%x" ppc_dcr_write(uint32_t addr, uint32_t val) "DRCN[0x%x] <- 0x%x" +ppce500_ccsr_io_read(uint32_t index, uint32_t val, uint8_t size) "[0x%" PRIx32 "] -> 0x%08x (size: 0x%" PRIu8 ")" +ppce500_ccsr_io_write(uint32_t index, uint32_t val, uint8_t size) "[0x%" PRIx32 "] <- 0x%08x (size: 0x%" PRIu8 ")" + # prep_systemio.c prep_systemio_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" prep_systemio_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" From patchwork Sat Nov 2 13:16:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nLgd8/Qn; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdjw04BBz1xwF for ; Sun, 3 Nov 2024 00:24:20 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E10-0003Fl-FG; Sat, 02 Nov 2024 09:18:06 -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 1t7E0h-00035i-Pu; Sat, 02 Nov 2024 09:17:50 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0f-0001yE-U8; Sat, 02 Nov 2024 09:17:47 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5cb6ca2a776so4007307a12.0; Sat, 02 Nov 2024 06:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553463; x=1731158263; 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=ek6CJz/W/BZPJLQDBSj5hrEIX9vzfAv/et55GzS0YMU=; b=nLgd8/Qn/FvEGbteKmkT5h/uR7i3CknRldaC041UALlkpPnCWHJ4pGk1p6cGbN3B8V BsTk6y3/Nlj9k0zKoZaO2uraesfcEgF+UJiw05vVPR1GlQjUWgz6cFtkA6Fpw97nLagn MghBs8I3Zselyh9KE9wkyZL5aBxmqazyKK72+qf3DUJzMesQqbape42RHaaRnhQDf+Ro I7+Hx5db9wlP/nAR2SWMb/5NZy7CySSCoGq5VIxAj2TnHxoNwPKLqI+GwC/RVOYMei49 NLHqoHewNYlnz2JhCVlw1HsLyyl0a8P+HirKZ7W6qdzDamerZ8euCPUt2qpHl3dmWPOw bANA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553463; x=1731158263; 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=ek6CJz/W/BZPJLQDBSj5hrEIX9vzfAv/et55GzS0YMU=; b=mRACrC8bJ79lw0guScfASnpFCGoy+pNwCgctxL3H40RsgPWMChT3DawQcNR+k70yHo 7hJ6kWV81tAyyfzEemCNLCvSKgPxn5Pbngh3vLsG71uCoevLFHY3rD69jJLHSJbdKPlh jHT/szLYae/CN7hKPe75wBWZXEpxzULRsKXfaZs/zIOxRgDgT+1U5TqyNzuxPYp8cua0 NESNB9uNsTYD0xCLqKvmNtRdy9cYgP53OsN8lDMy1oTnho8MfkCNXTJOGiocF0H2D+EU 7FqK3/bA5UIXcBjQRSpJ0jmGNvDotsPMMj+4viDrnqk7+AY1Dwkb1VkpcPBJSo2QuY+P thVQ== X-Forwarded-Encrypted: i=1; AJvYcCVjEwV3RylGt+UH0CIfUy7nzxYRt4jyYT5VpK1hXnuKqHWourf5ZGRw9vIn+x5xEBVeUxnwrePJkRg=@nongnu.org, AJvYcCX+1eRpiQnfE/J8nsUeZbvBzTP9rWLoSwBSrealkO2BkzTskYBNP5EVq39SlZ2w5ThhrHDWI0G7PPPZ@nongnu.org X-Gm-Message-State: AOJu0YyuAFKTJxfTfUsXO7G2BCfJ3T/Ei+3eXbgpH9lvXx8grdKegCyf 3yHeujn5xbxf6uJf1VFvYgbQS9zaGJ0VzS+cO70g6nkEa+Nl/hgIY+I+2g== X-Google-Smtp-Source: AGHT+IHWFe6cGCaufEG+XkBAm6iobJJIWeJKqiVLk0VPMUPq9+ZTuBGJOs+xgkYcXFmW8rxUHuS2TA== X-Received: by 2002:a17:907:948a:b0:a9a:238a:381d with SMTP id a640c23a62f3a-a9e3a6ca29cmr1366243366b.52.1730553463105; Sat, 02 Nov 2024 06:17:43 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:42 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard , BALATON Zoltan Subject: [PATCH v3 10/26] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register Date: Sat, 2 Nov 2024 14:16:59 +0100 Message-ID: <20241102131715.548849-11-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Populate this read-only register with some arbitrary values which avoids U-Boot's get_clocks() to hang(). Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/ppc/mpc8544_guts.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index e3540b0281..c02b34ccde 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -29,6 +29,12 @@ #define MPC8544_GUTS_RSTCR_RESET 0x02 #define MPC8544_GUTS_ADDR_PORPLLSR 0x00 +REG32(GUTS_PORPLLSR, 0x00) + FIELD(GUTS_PORPLLSR, E500_1_RATIO, 24, 6) + FIELD(GUTS_PORPLLSR, E500_0_RATIO, 16, 6) + FIELD(GUTS_PORPLLSR, DDR_RATIO, 9, 5) + FIELD(GUTS_PORPLLSR, PLAT_RATIO, 1, 5) + #define MPC8544_GUTS_ADDR_PORBMSR 0x04 #define MPC8544_GUTS_ADDR_PORIMPSCR 0x08 #define MPC8544_GUTS_ADDR_PORDEVSR 0x0C @@ -75,6 +81,12 @@ static uint64_t mpc8544_guts_read(void *opaque, hwaddr addr, addr &= MPC8544_GUTS_MMIO_SIZE - 1; switch (addr) { + case MPC8544_GUTS_ADDR_PORPLLSR: + value = FIELD_DP32(value, GUTS_PORPLLSR, E500_1_RATIO, 6); /* 3:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, E500_0_RATIO, 6); /* 3:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, DDR_RATIO, 12); /* 12:1 */ + value = FIELD_DP32(value, GUTS_PORPLLSR, PLAT_RATIO, 6); /* 6:1 */ + break; case MPC8544_GUTS_ADDR_PVR: value = env->spr[SPR_PVR]; break; From patchwork Sat Nov 2 13:17:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=edC2N3iJ; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdc33xr7z1xwc for ; Sun, 3 Nov 2024 00:19:15 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E19-0003SL-OF; Sat, 02 Nov 2024 09:18:15 -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 1t7E0j-00035v-P5; Sat, 02 Nov 2024 09:17:51 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0h-0001yS-2C; Sat, 02 Nov 2024 09:17:48 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5ceca7df7f0so584202a12.1; Sat, 02 Nov 2024 06:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553464; x=1731158264; 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=QCD24XbECn5QO23uS9iwkiZNOhv+pKq+MzdKGgL8qKM=; b=edC2N3iJyc6FWUiQIJJXWwAwI2UbluuQSYgehgmiyL4N+aGJ+Wqf6Bi046ztKMB46w lWgUdcXSf5pUu66qD2HaGkmu0HQPNiff8mtDJ115U+ojGJRhIcyfFtWz4xCaIRYC1ndB b7MJBtjhOzWcJO8DTxe4Gj6T8UKDHfKNcdjThrvWSAwVpSLQV9h/HoUcOKYowrl41ci6 dLBDusZY10koSbZ2+S1Fan8/Sd8eGX2D0AV3KcgEj0tbNP1iFINnmiQqAlVAeQnWWyU4 Rm6A+ZjdadkkXMxEI11ctvn9QCmYuD6XwTpg80lTU7eYbk3kxJTPDzi0/RT4f3TP5E3i w73g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553464; x=1731158264; 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=QCD24XbECn5QO23uS9iwkiZNOhv+pKq+MzdKGgL8qKM=; b=ZwyJe1XvZAoRWu349aG/Yot55cMwP4wSfhuLM6njRnYbfJH7yl/7bAFy6qUQtEhMm+ 8i9p3xc4pBKdmBSzZCQpvRFa4kuemYkX/61/MdQ9cJK9YmfshtFDO2BDR6eVpxPnsk4o oLa6q4Un71TMUe9aUpDjO/rR7WO37gxtpUyG8OGaffgdz8wuFYdfAWpExjhqXUUyyL00 o/ygApGqPZ3dtnq6MTR6CnNgHTknywxD/XwSd7UvJFiYP8fUlWeKwslTJGncsWYKQYYp auxRPuIr0ZNjIg/Fw79WOnStdY9FXbbeT0/iQ/NpAALPnXQVm8lf/uQ1+Hlsjzr5W8Ck z9ug== X-Forwarded-Encrypted: i=1; AJvYcCVsTl5/As1OEevYoUcx358RPgrY5FwzmUHY3NCCUPgPmJ/nZrLhYx/9pB00I2FHTQZLi11GQgHvFm0q@nongnu.org, AJvYcCXw+MqLMnPHxtIVuxl0oSqX2N1f7RdKZ3O3Xgi2I6T4LIYv7iLjcbF3/dNHb+H4GS+MdhrgKtaN7uY=@nongnu.org X-Gm-Message-State: AOJu0YyD2+z7/Dd4YVCdaynjb7bXewG+glyTHXcsGpLJPAuUkGhWSWrs wjeJWyZV2aDqUZbPgxJ30J5enzRBsX9tGZa6hdGA0NO7xv54dj97Wcc0RQ== X-Google-Smtp-Source: AGHT+IEYnUorv6VbFM+NKFRhQYrsQu6I7fZGWN6MCX0JY0aguL6S8OPZtNKcPGpxExfauUzSHH9mJQ== X-Received: by 2002:a17:907:7e82:b0:a9a:230b:ff2c with SMTP id a640c23a62f3a-a9e654f8c59mr612763066b.30.1730553464362; Sat, 02 Nov 2024 06:17:44 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:43 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 11/26] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access Date: Sat, 2 Nov 2024 14:17:00 +0100 Message-ID: <20241102131715.548849-12-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow Signed-off-by: Corey Minyard Acked-by: Corey Minyard --- hw/i2c/mpc_i2c.c | 9 +++++---- hw/i2c/trace-events | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 2467d1a9aa..3d79c15653 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "trace.h" /* #define DEBUG_I2C */ @@ -224,8 +225,8 @@ static uint64_t mpc_i2c_read(void *opaque, hwaddr addr, unsigned size) break; } - DPRINTF("%s: addr " HWADDR_FMT_plx " %02" PRIx32 "\n", __func__, - addr, value); + trace_mpc_i2c_read(addr, value); + return (uint64_t)value; } @@ -234,8 +235,8 @@ static void mpc_i2c_write(void *opaque, hwaddr addr, { MPCI2CState *s = opaque; - DPRINTF("%s: addr " HWADDR_FMT_plx " val %08" PRIx64 "\n", __func__, - addr, value); + trace_mpc_i2c_write(addr, value); + switch (addr) { case MPC_I2C_ADR: s->adr = value & CADR_MASK; diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 6900e06eda..f708a7ace1 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -35,6 +35,11 @@ aspeed_i2c_bus_write(uint32_t busid, uint64_t offset, unsigned size, uint64_t va aspeed_i2c_bus_send(const char *mode, int i, int count, uint8_t byte) "%s send %d/%d 0x%02x" aspeed_i2c_bus_recv(const char *mode, int i, int count, uint8_t byte) "%s recv %d/%d 0x%02x" +# mpc_i2c.c + +mpc_i2c_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> 0x%02" PRIx32 +mpc_i2c_write(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] <- 0x%02" PRIx32 + # npcm7xx_smbus.c npcm7xx_smbus_read(const char *id, uint64_t offset, uint64_t value, unsigned size) "%s offset: 0x%04" PRIx64 " value: 0x%02" PRIx64 " size: %u" From patchwork Sat Nov 2 13:17:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005480 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Yo1Q0MdL; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdfy5jfyz1xy8 for ; Sun, 3 Nov 2024 00:21:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E17-0003PR-Nz; Sat, 02 Nov 2024 09:18:14 -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 1t7E0j-00035x-VW; Sat, 02 Nov 2024 09:17:51 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0i-0001yw-8F; Sat, 02 Nov 2024 09:17:49 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5cec7cde922so1376040a12.3; Sat, 02 Nov 2024 06:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553466; x=1731158266; 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=yd6NatUTxfChD+GNQ4/iAKaUKLh+xS235Qy81Xz/MlE=; b=Yo1Q0MdLZ+USu8AJ9WtcXUcxQh54iN8BHVQytpqTw9wbegk/sOzsUFc0e+o1BKPrgH 1F5UasMc64mdf1WGAYRKDZnltDjyQluspXzpclAP1iu5hKIoTqLemhgsGuBfeVWh4hIY ZfhEH7aESJ2lekLCoFGy1CjrnbfyhCP5LIVcpEkacx7Qm0l+7qjHRXc0kM/73x0bJhSn N0MG8UlYOFhcvbJ7nnRfj3mDaI2YtqLndJU/3FwwKr6YmxUQp35SMedPxd+eUwHbHGeP BcjmBHQXiP7ngmAlXVC9yDGwwLuxkxJ2YcLly87JFGG/gTik/YT7Z+w8Xttb5Edq5LxJ o3XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553466; x=1731158266; 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=yd6NatUTxfChD+GNQ4/iAKaUKLh+xS235Qy81Xz/MlE=; b=G6ZSb9FLVOvB/3X4dT2OsrN0TNOKPXOrS5Wy48HRBJ7TXlQoe11CpVZqrFF+B3gY+q suHo1Q7QSut62taGy9tDhtCfn3rwTVpQMWSFll8VG6S8wzjgf3dHffB/VSYBkoKfqNj0 cwvrAQ1LSZuTgX6pZtom1VAIulAidY4UJ6cI2+eZZQnx+L4qi0e1klSVVZRS01jaleV0 oYKeu/V3akzWphPFbPgzPpQsFcZehc9IQ384843RC1aMmwlCzExjpW0TTyvK6Tw14IyV uSdSi17m9u6+tZ5Ib++xr6x7eZo1k0WT735wLhXLTLMKEiTtb+c9i+I5Eb6tmW3CsqJO /qYA== X-Forwarded-Encrypted: i=1; AJvYcCUEKreAm5Owb20V6WxB2NXPj2IosrGtOq7U7dR2Sz1hIERTejGTmrIucyu7yW3TEYqc5XzMCeSVIY4=@nongnu.org, AJvYcCUKidZ+DhZT8Bxrv5IrmeWph72wVfjrRg35ch3OCkujSgoSrqBAtfIJyYFjyVSyV6l+JUT+Fia+J2zr@nongnu.org X-Gm-Message-State: AOJu0YxvV1Mjqfir7WYT7GsYKrzu7BLhrkHIyqHfkVT1cP+SRdzDysy+ 8I9ereT6p5bsyLrnWKjO4Eu4tdxsLLZu025Qjcft2BgWeCk/vr8Bd6/yTg== X-Google-Smtp-Source: AGHT+IEWl/Y0wToQaGZaDT0jfnsKwHFZGduR+7+B9RESCEudX/YE6zwVb0e3dgILhCm+rJ2hMvua2w== X-Received: by 2002:a17:907:3f09:b0:a9a:2d04:b577 with SMTP id a640c23a62f3a-a9e3a620e06mr1456125166b.32.1730553465517; Sat, 02 Nov 2024 06:17:45 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:44 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:01 +0100 Message-ID: <20241102131715.548849-13-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=shentey@gmail.com; helo=mail-ed1-x530.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/i2c/mpc_i2c.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 3d79c15653..16f4309ea9 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -20,7 +20,6 @@ #include "qemu/osdep.h" #include "hw/i2c/i2c.h" #include "hw/irq.h" -#include "qemu/module.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" @@ -345,16 +344,13 @@ static void mpc_i2c_class_init(ObjectClass *klass, void *data) dc->desc = "MPC I2C Controller"; } -static const TypeInfo mpc_i2c_type_info = { - .name = TYPE_MPC_I2C, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(MPCI2CState), - .class_init = mpc_i2c_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_MPC_I2C, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(MPCI2CState), + .class_init = mpc_i2c_class_init, + }, }; -static void mpc_i2c_register_types(void) -{ - type_register_static(&mpc_i2c_type_info); -} - -type_init(mpc_i2c_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005479 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=gjw6ILCP; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdfy4BFGz1xy7 for ; Sun, 3 Nov 2024 00:21:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E0z-0003F7-FX; Sat, 02 Nov 2024 09:18:05 -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 1t7E0m-00036v-8E; Sat, 02 Nov 2024 09:17:54 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0k-0001zJ-5Q; Sat, 02 Nov 2024 09:17:51 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a99eb8b607aso334153366b.2; Sat, 02 Nov 2024 06:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553467; x=1731158267; 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=ER63OFaSbqJru3HFylC612MYJYy6isDGIUx/mkHzX+E=; b=gjw6ILCPtPJLkayXIC8yMhiG7RaPcMp5DD79EccVp5mrv/5er75rWIqs/frS4trcU4 781tJtCwGjQcBVr4sDsrsOqN4NtSNzpiROMrxRkvJ35tTzGK98hNO4rpiErPC3gX/9E0 dqxZR8DVECHcJnp64WrVI6zntXPtKu7wkFQXWm1AD6XLMFFSyG6uLvKBLMYdk6C80jsl l2tOET1OktNQpMAuO+ixNo23nPUFFI1b6ldGSGpdPqMXMzuSBq0lBKhJuolzWySQdQM/ n3ai+72oX0C/zrrCasMPa2n49qN2Ygp3Co5aS/x3HZKjy75iQutweIM0b14Ec3vrFca0 ZbJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553467; x=1731158267; 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=ER63OFaSbqJru3HFylC612MYJYy6isDGIUx/mkHzX+E=; b=LQUEtulvuwL6RAxgHD1qYeq3aUoDHfOZKUFQ/u4DTXQh/NSWEL4ag3XpsqB+3rlAY0 apxibnfd8mdOVDiNRv8QqYEnTUd5HnbfCMO9Gd7Dg9U92vFaTwvq3CtJ5rwR8TMw0FIH CfDPniddH9WxMMbwmFi4/5iAbFikuTo3ks6M4P3LhNDKfP25+kV3bNF7s3+t3OZ0QQJG 3BkbB4G1ri2RXoD72SBUl1jg1zab7gS2wrkb+1qSbYpmpqlB4v+IUxS0UBpX3z4wQFDM EGVTPeOOeRPjAYUumbEsYIljbCe6SQEALJ49AscHOrykVuO6iGQ3Xy1eD2J8LT78HQbp X3Qw== X-Forwarded-Encrypted: i=1; AJvYcCVviFqcbukapbyHSWU8F84ppkMJeMfdNd/p4w93ij7efnq/VtltQB3c+H1tqYWdl1AtZXeXz8u/T7w=@nongnu.org, AJvYcCXUUWMYUFBDGOKkdiKpNFuqQ/JNkuDRkIWD7WdY7oKp4xciIErASaEhE9V2VQULu51bnB+DcV2FW35m@nongnu.org X-Gm-Message-State: AOJu0Yz/TZAGHBi8KM4RNJFnmGxRs/r7jbxNMMKbFYdWhtiXeoG2kSnC ZodNAVwl06sbBDlNuyUIYmyLNvSGFCp94yNVWfHiO3Yy7Anmo8hL/K3oLg== X-Google-Smtp-Source: AGHT+IFH3oFSU6oJ/SmEK/L9bQyBHPh3p++0+orlfBFNKHJLlmGm32gOWC51mBxm3bfeTgUV1J4Cdg== X-Received: by 2002:a17:906:dc95:b0:a99:f28f:687 with SMTP id a640c23a62f3a-a9de61d1a52mr2507519366b.40.1730553466792; Sat, 02 Nov 2024 06:17:46 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:46 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard , BALATON Zoltan Subject: [PATCH v3 13/26] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define Date: Sat, 2 Nov 2024 14:17:02 +0100 Message-ID: <20241102131715.548849-14-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Prefer a macro rather than a string literal when instantiaging device models. Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 97e5d47cec..d7ff2ba778 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -475,7 +475,7 @@ static void e500_pcihost_realize(DeviceState *dev, Error **errp) address_space_init(&s->bm_as, &s->bm, "pci-bm"); pci_setup_iommu(b, &ppce500_iommu_ops, s); - pci_create_simple(b, 0, "e500-host-bridge"); + pci_create_simple(b, 0, TYPE_PPC_E500_PCI_BRIDGE); memory_region_init(&s->container, OBJECT(h), "pci-container", PCIE500_ALL_SIZE); memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_be_ops, h, From patchwork Sat Nov 2 13:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=eEBU0QWI; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdkQ127lz1xwF for ; Sun, 3 Nov 2024 00:24:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E15-0003KJ-Av; Sat, 02 Nov 2024 09:18: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 1t7E0m-000372-Te; Sat, 02 Nov 2024 09:17:54 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0l-0001zV-AR; Sat, 02 Nov 2024 09:17:52 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c9404c0d50so3216098a12.3; Sat, 02 Nov 2024 06:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553469; x=1731158269; 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=J0Kw1RPTj8Nz7cZMeaQp/Ezl77GlQeYj69gIDIMTTxE=; b=eEBU0QWITOgVeN8Tk3NJFZG8+LeWrlwBLZqMyZykuF5ei3/z/jZQ28iSek4h7Zvwut k7Rv4hk5Mnm+kFsM2k7XZ0LzQb9rSgYkQ5qw3Fna5yNLmccVpyElHvr1gW8GjI2IPUeO A2vS7kKGsicJEdnhFLq0pnMqjxYiypeINcrEdKnrP3NKZ/wB5YGLW8qX/7NvGsyd6HN6 Fpy1T8wdQv4RqF+e0Nq5iGZU9i1osUcsMUnFg/WS+fReuPvrjt59bjr9Dd8g0EtrOCwq 4UAHcGTmiWodHBDf8sNwAXHT8Q4ACW/8QGzse2zAqDRwFGggbbK4w4H8v+/1jnWvNsE1 XewQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553469; x=1731158269; 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=J0Kw1RPTj8Nz7cZMeaQp/Ezl77GlQeYj69gIDIMTTxE=; b=T7e+sBrQzvED8ZRy/IhOGl33FXi0CvURV+YgGlfVDdB3/oIT4DjmHEH7tgTElfKLIx qNGwyxYyGa8kGXkn/4Dg/dT/gQ0bfYfPZh1DQ/3gTdc2Bd1Xo73TWjJND35kaf7mReK+ B/I+2wKWh2kfvsNK/++aEKUhqEmg7KM1N76KlcnVi1O2cowB0VRZkHC2878NMr6S3oSp 09RpEouG//fJvZcSqaiQrj7aMpcOoBvQTyuqwdfCIpO8jHbeNzq5/RLv8q9bibPBGGBn DD5L+3ILFx518BhKMJXiXwVYp1bVuK5Vr2OLiT5vfGG/p9VsZsxgMs2Vygtyz3Ij5Kuz 9pGQ== X-Forwarded-Encrypted: i=1; AJvYcCWX6a9MNm7NDHM3PwF8ivgJxqcTk7Y2gIRlaxBF1vQgQMN8YCv/DwXI6voSQngcQbG5FyFKnlMRDZs=@nongnu.org, AJvYcCXDBhtdk4pth9ohkgfK+I9PSYAArQr2IQ9Mst5b3z+4MnMjjCQhddYq7C/B6CQaJ8dC9dQeo98RZ+hG@nongnu.org X-Gm-Message-State: AOJu0Yx6d6BtWVj2NSNL5EC87OJwfdhzNeiNcGfzcmKnNdZ26Q7ufDT7 nAzaHLsTGNQq0EkJnyE39mKBdKl3enbuLCSo0fwFYGCNxI7m6iIIhK+CxA== X-Google-Smtp-Source: AGHT+IELY7UBHI4VOSJQkl3jqiquusfrGZoRJ2Dd/2s2Om+3vynANJgOG8Xe7wml05gqO6OJ4UfywA== X-Received: by 2002:a17:906:c106:b0:a99:ff43:ca8f with SMTP id a640c23a62f3a-a9de5d659cdmr2566919966b.10.1730553468807; Sat, 02 Nov 2024 06:17:48 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:47 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 14/26] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:03 +0100 Message-ID: <20241102131715.548849-15-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/pci-host/ppce500.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index d7ff2ba778..1ce79ea20c 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -21,7 +21,6 @@ #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" -#include "qemu/module.h" #include "hw/pci-host/ppce500.h" #include "qom/object.h" @@ -508,17 +507,6 @@ static void e500_host_bridge_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo e500_host_bridge_info = { - .name = TYPE_PPC_E500_PCI_BRIDGE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PPCE500PCIBridgeState), - .class_init = e500_host_bridge_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static Property pcihost_properties[] = { DEFINE_PROP_UINT32("first_slot", PPCE500PCIState, first_slot, 0x11), DEFINE_PROP_UINT32("first_pin_irq", PPCE500PCIState, first_pin_irq, 0x1), @@ -535,17 +523,23 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ppce500_pci; } -static const TypeInfo e500_pcihost_info = { - .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(PPCE500PCIState), - .class_init = e500_pcihost_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_PPC_E500_PCI_BRIDGE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PPCE500PCIBridgeState), + .class_init = e500_host_bridge_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, + { + .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(PPCE500PCIState), + .class_init = e500_pcihost_class_init, + }, }; -static void e500_pci_register_types(void) -{ - type_register_static(&e500_pcihost_info); - type_register_static(&e500_host_bridge_info); -} - -type_init(e500_pci_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005456 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CVWIrmkY; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdbs57GRz1xwc for ; Sun, 3 Nov 2024 00:19:05 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1B-0003eG-HW; Sat, 02 Nov 2024 09:18:17 -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 1t7E0o-00037P-Kl; Sat, 02 Nov 2024 09:17:54 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0m-0001zq-Od; Sat, 02 Nov 2024 09:17:54 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5ceca7df7f0so584295a12.1; Sat, 02 Nov 2024 06:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553470; x=1731158270; 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=FdlRSFSVE5+jilPfwmoz97fjdKJLulipSEMWN67GtgY=; b=CVWIrmkYi0KYpKuOMb1qHxYC1pXe3XDmen5iar5Jdkv/6wqiSeW/p74Rvk9LV2Bpgx nXvTadtsvI6cRiB6w/g6DN/ghUGhUqLwG5/ya7Advoy2llfouEILlUBAgfu8JYascu42 HG4l7XZ4d5PSwbR9+Nlk51E3oATWiVMOcodPL1r3B1nQ1V15kuitC68OZmkIeMTw0WOc 7Ba8fRbFPMSzvCSFlUwepa74rftC2458INif55LSM0tbwO3VP0xEGLY89Fbt8HjOyu+9 2zciP03G5R6t3n/BaBLt+2iDugk9Y53768iCw+eMHKxyawDAMnCGaG1XysyZQD9Whuk3 9kMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553470; x=1731158270; 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=FdlRSFSVE5+jilPfwmoz97fjdKJLulipSEMWN67GtgY=; b=NvMqgiECz4J/eE/YhpfJcCoDEa/vg06t5HnSEAwZot3xJ6fYD0dg+hgoAgU1zOM6o+ u8Y62NxtojC4KXaaVpq9IpdPTvrjXQ8+KiWypRk+3jnLSzADoAurCLZXS+z5746TW+Jc 9UJsRVRF3P/UpZogH27j+evw7F4sxcFaY1sGwU9Nl1RU3e8yXDFVYnPxuyYfCFJ5/g2S DgFcc2T+7MfxFa1qwptwVwNJXgoFzrf3bIx87MdBGnF3I5z5RQpdi6Eu1OJV799jCA3B 7SYFvY603lRxaQqUFbGu4YyG6FM9O99g1+Jxyka9zlT5L2ZRT0P8bADmU+7O26vvFii0 hJcA== X-Forwarded-Encrypted: i=1; AJvYcCXFV0PvnW6+9dpbuJ8EMF4unAll3rgx8l25MFAK4aG8pojYiq62RNkpoTGqIBsz5q1dQu/0y9ijxW78@nongnu.org, AJvYcCXUvytAgyWSnzhZVqTONEYe7Mz+GRJSi8g9nVeKrFedZfS/QXsckReryngX2qwCKYdnbjuaqM7TzNQ=@nongnu.org X-Gm-Message-State: AOJu0YwqsMaVuhpGRtkeVhBhj5Z7kRnq5IoohzG6mxIfb7wxZ6wCFtUr 67EyKn7Uz9wj5CIVpR5tMHNAgtuTi/+JqiebDL+10FnldFjjv5RJwZb+8w== X-Google-Smtp-Source: AGHT+IHWAmadtq2H8x8vkXXajemY4CQNXF+sufmMYE8SBjrdsSdHgXnfrD3qtu/EGtdZe3bNK+Bcug== X-Received: by 2002:a17:907:9407:b0:a77:c30c:341 with SMTP id a640c23a62f3a-a9e652a2f0dmr654804166b.0.1730553469923; Sat, 02 Nov 2024 06:17:49 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:49 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 15/26] hw/net/fsl_etsec/miim: Reuse MII constants Date: Sat, 2 Nov 2024 14:17:04 +0100 Message-ID: <20241102131715.548849-16-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=shentey@gmail.com; helo=mail-ed1-x52a.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Instead of defining redundant constants and using magic numbers reuse the existing MII constants. Signed-off-by: Bernhard Beschow --- hw/net/fsl_etsec/miim.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/net/fsl_etsec/miim.c b/hw/net/fsl_etsec/miim.c index b48d2cb57b..4e9169907a 100644 --- a/hw/net/fsl_etsec/miim.c +++ b/hw/net/fsl_etsec/miim.c @@ -29,13 +29,6 @@ /* #define DEBUG_MIIM */ -#define MIIM_CONTROL 0 -#define MIIM_STATUS 1 -#define MIIM_PHY_ID_1 2 -#define MIIM_PHY_ID_2 3 -#define MIIM_T2_STATUS 10 -#define MIIM_EXT_STATUS 15 - static void miim_read_cycle(eTSEC *etsec) { uint8_t phy; @@ -47,14 +40,14 @@ static void miim_read_cycle(eTSEC *etsec) addr = etsec->regs[MIIMADD].value & 0x1F; switch (addr) { - case MIIM_CONTROL: + case MII_BMCR: value = etsec->phy_control; break; - case MIIM_STATUS: + case MII_BMSR: value = etsec->phy_status; break; - case MIIM_T2_STATUS: - value = 0x1800; /* Local and remote receivers OK */ + case MII_STAT1000: + value = MII_STAT1000_LOK | MII_STAT1000_ROK; break; default: value = 0x0; @@ -84,8 +77,8 @@ static void miim_write_cycle(eTSEC *etsec) #endif switch (addr) { - case MIIM_CONTROL: - etsec->phy_control = value & ~(0x8100); + case MII_BMCR: + etsec->phy_control = value & ~(MII_BMCR_RESET | MII_BMCR_FD); break; default: break; From patchwork Sat Nov 2 13:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=cnad/3dE; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdfK5yjGz1xxy for ; Sun, 3 Nov 2024 00:21:13 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E18-0003Pu-EY; Sat, 02 Nov 2024 09:18:14 -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 1t7E0q-0003A5-Aa; Sat, 02 Nov 2024 09:17:56 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0o-00020G-O8; Sat, 02 Nov 2024 09:17:56 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3807dd08cfcso2276488f8f.1; Sat, 02 Nov 2024 06:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553471; x=1731158271; 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=pyBZgo+H9vb+N+fytpA0S3Ymlld/fAbgfJZrmoRBkU8=; b=cnad/3dErhlR1nya1UDUF9+LWHssO6eBtJVOdIC1GAWqKKkkojCyHJHQvhYS3vsAco JO4MnJ+iYRgFTIl+RpVscVHWsSxnJWBwyf50t3pAk34fLuj67PR+wIAfpgxjoMmIRJGd OwtWyo3ij3A5cFD7TlP3joYPTMac12lQ3qhfYlejOl1UErudb+byNkyLV/ByuqQoTrWg XKy46Of8eNXFVAhuT0Dx4V8hm/YB+E9CiWt6GIOXKRKzJBQxp85LHzdxWO0l46HkWVFu Oxgr8OfLoqas/2Gs0ykx6fAe1VdFK00SbPXQHD4vPGPjVHFyjWtFoSFLaP6XJNYru09P TMHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553471; x=1731158271; 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=pyBZgo+H9vb+N+fytpA0S3Ymlld/fAbgfJZrmoRBkU8=; b=S7LJED5OWjFEN4mER8V3F24OJGd9/q2evvxEYBLYMnizqL87q0IANmrAvfgsVn4ml5 ieqJqO6dO6p3VneSzVIL1RkFJyHKCQgpI21c1JxmNCwOUxWbnfG9LMvXYc+sF+mcQhtc UNmca0UH/orq0mKhQD37JrDjut07YP36c9aziYEXACm8jR8dpMXZzfh4ekgJTQC9H8Gm IXVX/GpO/+E/PDtsTpDh3dB2grIhQH2Z2WZ3c5Lttp1LZ3hGFzcM1ZvcykepC93e5vIP wJcmC9YNi+AJOwqnOu0uyk3LXpjZsWEb3dPVTwqUJPoBZ2XifdkUDXsxDs1k4OHvDb/t m78Q== X-Forwarded-Encrypted: i=1; AJvYcCWwPnhQmpRxgx6GdbfoBWGQrKeu1I9MkkJzo23Mjnph5N9VcWArdpCBOFync6AhQE8eaH8kKj4tqkDH@nongnu.org, AJvYcCXKrHJUNRXEXBQqJ2G8jMk8ledIha7hD2y7RtEZ8lZ2bN4McNJyyC9Q/HBU7ezQ7seLrPJBnIvFiuk=@nongnu.org X-Gm-Message-State: AOJu0Yw2+Qgf4EHhFMTvl3dkGRZFlQ9BWLttwWCkLMu6xAvf7gP6CZFX AT+aV7UjlkIGTGHZKH5gBymP4F81Bpjn18aFovLeXl/mzRFqILhvJYmE6g== X-Google-Smtp-Source: AGHT+IFmo85UhsYj7yM/t9jVFu3LpfoBltx4O9rUXGdXmiiFp+UENhvv8OH+qjBlv8JKsxZ9VkUkAw== X-Received: by 2002:a5d:6d0f:0:b0:37d:9565:4db2 with SMTP id ffacd0b85a97d-381c7a469cemr7604057f8f.6.1730553471197; Sat, 02 Nov 2024 06:17:51 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:50 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 16/26] hw/net/fsl_etsec/etsec: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:05 +0100 Message-ID: <20241102131715.548849-17-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=shentey@gmail.com; helo=mail-wr1-x434.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/net/fsl_etsec/etsec.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 3fdd16ef2e..9bd886b996 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -36,7 +36,6 @@ #include "registers.h" #include "qapi/error.h" #include "qemu/log.h" -#include "qemu/module.h" /* #define HEX_DUMP */ /* #define DEBUG_REGISTER */ @@ -431,17 +430,14 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->user_creatable = true; } -static const TypeInfo etsec_info = { - .name = TYPE_ETSEC_COMMON, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(eTSEC), - .class_init = etsec_class_init, - .instance_init = etsec_instance_init, +static const TypeInfo types[] = { + { + .name = TYPE_ETSEC_COMMON, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(eTSEC), + .class_init = etsec_class_init, + .instance_init = etsec_instance_init, + }, }; -static void etsec_register_types(void) -{ - type_register_static(&etsec_info); -} - -type_init(etsec_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=LZRyGwOS; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdh3073vz1xxy for ; Sun, 3 Nov 2024 00:22:43 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1C-0003jj-Vf; Sat, 02 Nov 2024 09:18:19 -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 1t7E0r-0003AJ-7R; Sat, 02 Nov 2024 09:17:58 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0p-00020Y-8O; Sat, 02 Nov 2024 09:17:56 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a9a628b68a7so414962966b.2; Sat, 02 Nov 2024 06:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553472; x=1731158272; 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=81MfAqqbp66dFfi7sHbuaRksnlomjizHjiUJECLfYTw=; b=LZRyGwOSfekWRcdmRPt/WQpFVCFJZM7lXRN0g8XnVWO2figG0tjqMdMfZQp7hzWMJY tLdeWmKKur/qt7j7mTyS20Wn+1atcakWL7/uXePqw4u9+IAoA94EQK76yGkeQDPZMbLr UJg07qCUHo0PJzq6YzpwrmDi5c62AXMMVjZwS15r19z2Qk9ZlLSeJJdm0b+kP5nNIjr9 NN0bd5vSzwWpsj8Xzx8M1ybixkEGKZXzVfRrGlIBC+5cJoWox/bPBmDSbfI/SweNaBYR 4jS1qQKV8SjloE37hkMttAAiCLwvMhtzjFAq4nBX/3AAt1HOuBVINqofisekWcE5vmF1 oUcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553472; x=1731158272; 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=81MfAqqbp66dFfi7sHbuaRksnlomjizHjiUJECLfYTw=; b=dHcO8kKKD7mJNxlXHfTTwyW8dUHUZsxh1+DLIX2IyJOX1OqyU3hlLFy99LY+fLl84T f7Z3mSJSYFhJsHNgZrUg+faESaK2DbgMahz8RTGe51705tLNpnmt9VhAhy/VHa6OLzaP MAMTOCVftAPlxnM/xDtDPD04tj9w6LN+enJ7wPCv8nbFfSUO7ZjEoV9bVLlUZE530+2R /oOLhpqrs45F0X9jL5MmW6SPbBBavTOmtqzL3oGF89up0eDIjhKCVBeUmxOxsh4jI1k6 vMLOigF2VQMr2ECwYQiufEHNNmztj48HDDzVOtEKPTkH9Mwb6RjlRP9zOS8NB8eSJOOu nagg== X-Forwarded-Encrypted: i=1; AJvYcCVqXsBjOTQ9GWGsDf1wxdK1sehQ29P/cosxSDolMsc241uJaUeSIA9rvjfQ6L93NzU2IyrYsslWYhA=@nongnu.org, AJvYcCX7otU6dwiz91HB2Agec3eqRk4VTU1gHxk67Q93qmucuIbO0cgLof6xgKTvCcIToY3Lw5DXi3Buza4P@nongnu.org X-Gm-Message-State: AOJu0YywQIwklGT5L19rJ6A5GM9YdKszxwud0x3soj6QoXvrxbl2mSLg AymNWlIN4HLlA+vdj8rra18aY9Ynr+/sSEssFJTKzbkJlvM2vd7gHoqqiA== X-Google-Smtp-Source: AGHT+IGE+U9QLMZXheb9qhqDWZ0xMGD2baRMHOfNGy182m2Nn36MBGXMuDzpAjG7Y04w5uDblWgdfg== X-Received: by 2002:a17:906:6a1e:b0:a77:c95e:9b1c with SMTP id a640c23a62f3a-a9e654f89b5mr586975966b.27.1730553472375; Sat, 02 Nov 2024 06:17:52 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:51 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 17/26] hw/gpio/mpc8xxx: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:06 +0100 Message-ID: <20241102131715.548849-18-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/gpio/mpc8xxx.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/gpio/mpc8xxx.c b/hw/gpio/mpc8xxx.c index 63b7a5c881..de183c3be5 100644 --- a/hw/gpio/mpc8xxx.c +++ b/hw/gpio/mpc8xxx.c @@ -23,7 +23,6 @@ #include "hw/irq.h" #include "hw/sysbus.h" #include "migration/vmstate.h" -#include "qemu/module.h" #include "qom/object.h" #define TYPE_MPC8XXX_GPIO "mpc8xxx_gpio" @@ -208,17 +207,14 @@ static void mpc8xxx_gpio_class_init(ObjectClass *klass, void *data) device_class_set_legacy_reset(dc, mpc8xxx_gpio_reset); } -static const TypeInfo mpc8xxx_gpio_info = { - .name = TYPE_MPC8XXX_GPIO, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(MPC8XXXGPIOState), - .instance_init = mpc8xxx_gpio_initfn, - .class_init = mpc8xxx_gpio_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_MPC8XXX_GPIO, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(MPC8XXXGPIOState), + .instance_init = mpc8xxx_gpio_initfn, + .class_init = mpc8xxx_gpio_class_init, + }, }; -static void mpc8xxx_gpio_register_types(void) -{ - type_register_static(&mpc8xxx_gpio_info); -} - -type_init(mpc8xxx_gpio_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Dud91Jgb; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdjG6hcMz1xwF for ; Sun, 3 Nov 2024 00:23:46 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1D-0003lW-Uq; Sat, 02 Nov 2024 09:18:19 -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 1t7E0t-0003Aj-3p; Sat, 02 Nov 2024 09:17:59 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0q-00020l-6P; Sat, 02 Nov 2024 09:17:57 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so359053766b.0; Sat, 02 Nov 2024 06:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553474; x=1731158274; 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=tLhvTnGk1a2G1u/15BCaoUHmTdjX5JW0/q8sRHtkRz0=; b=Dud91Jgb9zX17GtYQTgj0PxozZaT7fObBx2+zgRSFZhmbFm4DaRASPZjrIKvFnFgzb zxB1mHedo5B+zwMX8dtKA0PEtPvNFGgIi+hfnX88hSlKedE/wZKkFeBnPvEE+jjNZc8D j0gWMMkn2GC6Wb8jZqIwRRw3tPR6KApyPkaM4Ukt4gXUNobi7CiMl1h+wUF1tI9tFeTy Bm1UDzl8iZLsnqJkpCNKhe9BenM+geGgwrvHI1OLLElpZ72KoMLPNmjGCy9Cz6TD5ZlZ hWy+a3ICsAoQAoKeYLsIdE8KAF9iJVzLy3Rp32oC7WNZSOXaxVinXh2gAIMAtDNBaYyM esaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553474; x=1731158274; 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=tLhvTnGk1a2G1u/15BCaoUHmTdjX5JW0/q8sRHtkRz0=; b=pd+njKRAYyFiWlW4n1bkyN5TvSXc8hEbB++VQIawtS1Qoew0zAW8v3l/S/mCk6Y3jI DdD5KhQsLzEGlHAMvuuIWl0/tOTLyNtPkzdD0YptqnXl0/ze6yqhTtWPhM80aEAOadEV BdfXb4Ooab2ZELtb6SK411gXVvBhshjYdGBmgUadIghSPUgZ6DLWZQkHSD4UVo34NoLq 7MaXZmIS9/npY+uQO23ygSbg7K2WD6OvEigUWfLqLZ99ZMRC6JsbYYC50I6BUlYwodNw tIhdYU5XqZJhcxzoiYCnR/o+TdD1GMtUZMOos04vH7pHgXGXY7HtvN4z7p7l12cqK/uh x3Ww== X-Forwarded-Encrypted: i=1; AJvYcCUm58i/i08iEH/+J/TppvWdlJZDZtYFeJcH1B7nEfLutQAdZ4CXCAlTL7/FrLm+REQz50NGNrZCB1c=@nongnu.org, AJvYcCVkWWwvmClF+W35OozY1h1AUtf9OKVBD1kk/jputFDh0DONij7SWwPG2IUIUKNbP6JPpS5hMkUeXtv+@nongnu.org X-Gm-Message-State: AOJu0YxalX60z7AS+efTVCxeez6hfVBS7PydTAEMaCJDHcakqRVuy8rC WUWvqfEKg+O9Wh7i/uGWFD1WJr6zR9HzrpvKmUw9zBaFPvjEBJLObykQsw== X-Google-Smtp-Source: AGHT+IG4TqofOzMYlylLy2GxOiNDxCKKG+UEqxBvjxycuEV1l1cK0Pd3FKjpCN8Hz+2FMmc7qUgjow== X-Received: by 2002:a17:907:d1a:b0:a9a:c691:dcb7 with SMTP id a640c23a62f3a-a9e5092d45emr808853166b.30.1730553473527; Sat, 02 Nov 2024 06:17:53 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:52 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 18/26] hw/ppc/mpc8544_guts: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:07 +0100 Message-ID: <20241102131715.548849-19-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/mpc8544_guts.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index c02b34ccde..cf2317b3ab 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -18,7 +18,6 @@ */ #include "qemu/osdep.h" -#include "qemu/module.h" #include "qemu/log.h" #include "sysemu/runstate.h" #include "cpu.h" @@ -141,16 +140,13 @@ static void mpc8544_guts_initfn(Object *obj) sysbus_init_mmio(d, &s->iomem); } -static const TypeInfo mpc8544_guts_info = { - .name = TYPE_MPC8544_GUTS, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(GutsState), - .instance_init = mpc8544_guts_initfn, +static const TypeInfo types[] = { + { + .name = TYPE_MPC8544_GUTS, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(GutsState), + .instance_init = mpc8544_guts_initfn, + }, }; -static void mpc8544_guts_register_types(void) -{ - type_register_static(&mpc8544_guts_info); -} - -type_init(mpc8544_guts_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GIADIxgR; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgddK3Bylz1xy7 for ; Sun, 3 Nov 2024 00:20:21 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E13-0003Iu-Ox; Sat, 02 Nov 2024 09:18:09 -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 1t7E0v-0003Bu-12; Sat, 02 Nov 2024 09:18:01 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0r-00021G-Jq; Sat, 02 Nov 2024 09:18:00 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a9e44654ae3so335543366b.1; Sat, 02 Nov 2024 06:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553475; x=1731158275; 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=9EXWyrH8f7oP41/W4xeKAhIRvW+hPSPt58Osc1OjMy8=; b=GIADIxgRD3TAXKh8jHxDhfmxxZWmVPKqIj0rkXF84eB0GYeAFPLe4/vuGTymgyccRE OM3pJdHeGMhk7Spxq87xLtN2padKkoFVd38dkoU1ImplfMmCisGYUUmdx31uqP3nSVTi qUpbhXFDgOxSEucvOR4190ESJ/J+R8XhnzAaIGVPQck81cCDAJpkpJ4c31LItzjT3Sn9 RjWt6/tAA9xB3NHJHVEB1jOVaUjD+lLNM3iebYJ296X73AS3YmTMHmshc2Zxlri+SGL3 72cWXN66wqxlAnsu2uMKaErpfr2YX1akSQY+wMglFjhoQGkpl6QsOi33TlYtU0maSVzI fjOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553475; x=1731158275; 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=9EXWyrH8f7oP41/W4xeKAhIRvW+hPSPt58Osc1OjMy8=; b=YIMom4rEx0Ll2LWcNcO3RCJxjr6+RGTZqP15slMCJ4hdYRMFQkJM1I0jiWJfrjVulZ 77oRg8tHn290miF4Cwrza3X7jHQ/Zb9mUk5COrwRLM+5abTtnuanHsb6LbSMU5L3CGrE 6kDE897zyeKc6HRs2Vwl/mbTl+8lOSenodnJBbVcIh9OvObkywMeIieCBH5IFYRmmDOo ZYHgbw9aNspTCt7SAlyDJHl1K7Mo2jd3pry82xAxZ7PfDl3pj+g3fRuYAi3DnNu4jy7A 44/1xIGz7JRp8qjfF7kIozsYAK+Omw3aEdRmOT/8gyPVQ87871JAMdcGgnOUlTpzJgky fWZQ== X-Forwarded-Encrypted: i=1; AJvYcCUHEVmrQ9hSQorCGKTztriOkgnPy1Cl1nq8C3CTuSVrQMgaWEkMU+7noFHlbSRcOReOo0ImFk8iYB8X@nongnu.org, AJvYcCX2XIv5C2lKVZKOMKLWjCIFfboUFARjBOzeefV5Hy+KbznjHzaNLqu+5FXfVP/AkFkRwPqeH5qctnA=@nongnu.org X-Gm-Message-State: AOJu0Yy+p0FmtGjXmR7nb3MfseFuEGywYRCBtWHLc7XyQ3UfMHtujSyr 9mwqzk3CWOEJn1+V0aH8dO1ZiQOx7sU32WksSeeLf6MqdRQRLTxI5GmFbQ== X-Google-Smtp-Source: AGHT+IGvCirtSErn9CReobBS4ri5Ijp0aVXZl4rPi6i4m6alC70/1VgOsRcJ82+K/f7vtRkQAEXLAQ== X-Received: by 2002:a17:907:3f19:b0:a9a:835:b4eb with SMTP id a640c23a62f3a-a9e50973610mr964153266b.38.1730553474734; Sat, 02 Nov 2024 06:17:54 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:54 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 19/26] hw/intc: Guard openpic_kvm.c by dedicated OPENPIC_KVM Kconfig switch Date: Sat, 2 Nov 2024 14:17:08 +0100 Message-ID: <20241102131715.548849-20-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Allows to clearly mark code sections relying on this device type. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 2 +- hw/intc/Kconfig | 4 ++++ hw/intc/meson.build | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index f640195e62..f12329feda 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -826,7 +826,7 @@ static DeviceState *ppce500_init_mpic_qemu(PPCE500MachineState *pms, static DeviceState *ppce500_init_mpic_kvm(const PPCE500MachineClass *pmc, Error **errp) { -#ifdef CONFIG_KVM +#ifdef CONFIG_OPENPIC_KVM DeviceState *dev; CPUState *cs; diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig index dd405bdb5d..a3df98ae59 100644 --- a/hw/intc/Kconfig +++ b/hw/intc/Kconfig @@ -16,6 +16,10 @@ config OPENPIC bool select MSI_NONBROKEN +config OPENPIC_KVM + bool + depends on OPENPIC && KVM + config APIC bool select MSI_NONBROKEN diff --git a/hw/intc/meson.build b/hw/intc/meson.build index 6bfdc4eb33..b9de6bf5c6 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -48,8 +48,7 @@ specific_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic.c')) specific_ss.add(when: 'CONFIG_LOONGSON_LIOINTC', if_true: files('loongson_liointc.c')) specific_ss.add(when: 'CONFIG_MIPS_CPS', if_true: files('mips_gic.c')) specific_ss.add(when: 'CONFIG_OMPIC', if_true: files('ompic.c')) -specific_ss.add(when: ['CONFIG_KVM', 'CONFIG_OPENPIC'], - if_true: files('openpic_kvm.c')) +specific_ss.add(when: 'CONFIG_OPENPIC_KVM', if_true: files('openpic_kvm.c')) specific_ss.add(when: 'CONFIG_POWERNV', if_true: files('xics_pnv.c', 'pnv_xive.c', 'pnv_xive2.c')) specific_ss.add(when: 'CONFIG_PPC_UIC', if_true: files('ppc-uic.c')) specific_ss.add(when: 'CONFIG_RX_ICU', if_true: files('rx_icu.c')) From patchwork Sat Nov 2 13:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BFfG5T/r; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XgdcP1BwZz1xwc for ; Sun, 3 Nov 2024 00:19:33 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1F-0003qE-EW; Sat, 02 Nov 2024 09:18:21 -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 1t7E0w-0003CX-Ca; Sat, 02 Nov 2024 09:18:03 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0t-00021Z-Jq; Sat, 02 Nov 2024 09:18:02 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a9a0c40849cso466753266b.3; Sat, 02 Nov 2024 06:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553476; x=1731158276; 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=80K8OEm+6o8+JzT+l+kkS4hvMpMoaCr4IlAQyLMMIO0=; b=BFfG5T/rUvOzrgrN75/IYmqpYe3ifhGfePovRTpqu8n2C79AiVupW1slomcMSHuG7u gG0GmqLm11T64pBzOhF9xMgt/LN77tEhDq8q+1gxs4Fn8NMlxzjICLSReemShzkXsPew hyqPPnYvWhYors8T7ZlvUNoye3AZzWmD3c6zWKj2OvU9aYHdHfJnOrn6l+8fj2+cGZ/9 sCPNpgA1Fw1szgRsCgySkg39wiOwPxofLQetc+TMYyd/Gb68EEMxsxZoj9r3EGcN0Iia H7VyO3lyimT8H253NKLs4nF+bA+1PQ1CHA3IL/oJmgrACrW7xJByQviJJGcRUFKvhKLi Z93g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553476; x=1731158276; 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=80K8OEm+6o8+JzT+l+kkS4hvMpMoaCr4IlAQyLMMIO0=; b=rIRheHFJMT3kdoYlAb8JdtzmFxPXuYGi+P4N6ho1BmYrjIeO63vW6wDARBqMxvoosT eizTUUrgVz9tpzakts0pL+Rqb6wBdlHarqso+E0KSrSI8SG8E0zH6I9vnst7PpqpEkWf vUiH6NuTCBk5ZRAiZmkhThnbkaFicS+DwJMmfmzpkmRwyUJN9WVR1XqjtGsKkXF3X3mz P4+C/02lzpF3kyncjIEiiVqgbACbY0ae+nOvTiLCAtPCVBPcoR8Hwjj0IquzLGGPifv0 vJmBA/INVtoMPRM629gbrratmSODgeOqH3JBzGqrDaXxzYpw3VPvCelQOs4ruKDvgrI9 gsHw== X-Forwarded-Encrypted: i=1; AJvYcCVkiVJ0MtjiPAMLpN7xnJDB5RK7T8x7yErWHUfXkrto6NNqIvDJdPIEXHeRe6c0Hb3R3h4cvToEcO/B@nongnu.org, AJvYcCWOf02X0VJiCyuBqNO6RL0BnKbsndmwCSbkldV2BqnkEf+tvdRuP8T6uir4Nzf8JYuAtjhPL3DxReg=@nongnu.org X-Gm-Message-State: AOJu0Yzz4ouA9n76g65+Rfy3whe7eStiZPMipftXywlgAakele8qR9WM HOVwMC2w+e86DHnM0LREjPKXyH9Yw5vRekym5YSnmn6TRV4PurujTzlJtg== X-Google-Smtp-Source: AGHT+IF7MDxOK6ZyXd9DeicGn8UMo/EyghaXt22av+4QTbbaetScuZ5Elw8H4a1AJwqr9pLayDfjnw== X-Received: by 2002:a17:907:9722:b0:a99:403e:2578 with SMTP id a640c23a62f3a-a9e3a57531amr1445849466b.5.1730553475978; Sat, 02 Nov 2024 06:17:55 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:55 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 20/26] hw/sd/sdhci: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:09 +0100 Message-ID: <20241102131715.548849-21-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 62 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ed01499391..aa89513796 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -37,7 +37,6 @@ #include "migration/vmstate.h" #include "sdhci-internal.h" #include "qemu/log.h" -#include "qemu/module.h" #include "trace.h" #include "qom/object.h" @@ -1598,15 +1597,6 @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) sdhci_common_class_init(klass, data); } -static const TypeInfo sdhci_sysbus_info = { - .name = TYPE_SYSBUS_SDHCI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(SDHCIState), - .instance_init = sdhci_sysbus_init, - .instance_finalize = sdhci_sysbus_finalize, - .class_init = sdhci_sysbus_class_init, -}; - /* --- qdev bus master --- */ static void sdhci_bus_class_init(ObjectClass *klass, void *data) @@ -1617,13 +1607,6 @@ static void sdhci_bus_class_init(ObjectClass *klass, void *data) sbc->set_readonly = sdhci_set_readonly; } -static const TypeInfo sdhci_bus_info = { - .name = TYPE_SDHCI_BUS, - .parent = TYPE_SD_BUS, - .instance_size = sizeof(SDBus), - .class_init = sdhci_bus_class_init, -}; - /* --- qdev i.MX eSDHC --- */ #define USDHC_MIX_CTRL 0x48 @@ -1882,12 +1865,6 @@ static void imx_usdhc_init(Object *obj) s->quirks = SDHCI_QUIRK_NO_BUSY_IRQ; } -static const TypeInfo imx_usdhc_info = { - .name = TYPE_IMX_USDHC, - .parent = TYPE_SYSBUS_SDHCI, - .instance_init = imx_usdhc_init, -}; - /* --- qdev Samsung s3c --- */ #define S3C_SDHCI_CONTROL2 0x80 @@ -1946,18 +1923,31 @@ static void sdhci_s3c_init(Object *obj) s->io_ops = &sdhci_s3c_mmio_ops; } -static const TypeInfo sdhci_s3c_info = { - .name = TYPE_S3C_SDHCI , - .parent = TYPE_SYSBUS_SDHCI, - .instance_init = sdhci_s3c_init, +static const TypeInfo types[] = { + { + .name = TYPE_SDHCI_BUS, + .parent = TYPE_SD_BUS, + .instance_size = sizeof(SDBus), + .class_init = sdhci_bus_class_init, + }, + { + .name = TYPE_SYSBUS_SDHCI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(SDHCIState), + .instance_init = sdhci_sysbus_init, + .instance_finalize = sdhci_sysbus_finalize, + .class_init = sdhci_sysbus_class_init, + }, + { + .name = TYPE_IMX_USDHC, + .parent = TYPE_SYSBUS_SDHCI, + .instance_init = imx_usdhc_init, + }, + { + .name = TYPE_S3C_SDHCI, + .parent = TYPE_SYSBUS_SDHCI, + .instance_init = sdhci_s3c_init, + }, }; -static void sdhci_register_types(void) -{ - type_register_static(&sdhci_sysbus_info); - type_register_static(&sdhci_bus_info); - type_register_static(&imx_usdhc_info); - type_register_static(&sdhci_s3c_info); -} - -type_init(sdhci_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=cnBX5jFi; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdj35mk4z1xy7 for ; Sun, 3 Nov 2024 00:23:35 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E14-0003Ix-2O; Sat, 02 Nov 2024 09:18:10 -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 1t7E0w-0003Cc-VT; Sat, 02 Nov 2024 09:18:03 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0v-000226-Db; Sat, 02 Nov 2024 09:18:02 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5cb6704ff6bso3692481a12.3; Sat, 02 Nov 2024 06:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553478; x=1731158278; 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=aMacwjv/1tKmK7lCv+ouUwchF1w/lla9CPW970fanmM=; b=cnBX5jFiMlhYxMkorxY2T92m/Up9BmsdU2HbeCVbTA56rKxux3r/HPsMX/Adt8fDTs tCqNR2mnOBnnQ1H1cgdbG67YXdEiETOF8G0nE4GXuIlAP8AxxatGcCYn/03jgeaABj6L dOQC3xuk7n1MT/xMBu2Z7DDLSlklY6nJrzMYlfXmgpAQkdfEYHiPnC+fe9xYpbPuEtUT hBronKnFV7w3xnJQg9Ghme0on/O++liWyfYjimI0ZGxDNxi6l42LqwtGkJNDp6RrQvjL iNtlQtNv3YNsyoFfGJ/OSt/gDeXM/HMk21PYHZ9W1iamurp5aP3VPOCemX5jt3kp/ref 481g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553478; x=1731158278; 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=aMacwjv/1tKmK7lCv+ouUwchF1w/lla9CPW970fanmM=; b=C3fYL2/OVM0WwkjTWp7q9z2oIxAAhwYF7bzbmNe/6gvpg4s+KTvVSbiTAAPbbPsBVh KnHLrevoHbNKPRv7YTQ+k/51wvClOJxohgSox/uVN52qMaNFzWupbgR7IW0t7A6Ntz06 LbKO0fTit8Gn6Aea6+xAMH4Wx2e011IE/o+wApX59fulm3oPLQc3pInKy69xM19yGrik Ms747qUnFOmdE8/MP8+jvb6FBCA872+fkb/OcllOfTbDB+VYb/uUszmd/phnovvDqdZL 4qkrVx8aTdRHXd2nnVxaFqB4/vgYay5kUZatHFAHQR7JaJTpoYZ9hoKbOqZKghBS/aqQ l8cA== X-Forwarded-Encrypted: i=1; AJvYcCUH3BmpGxpvSuDWeq0dexOZvCgGhqUmfgk8Xk90Th92G2eNEv3WQ1ta/HJDMLmd3HzzIeo0cRNQV6Q=@nongnu.org, AJvYcCVDNnBtdKZnfHBnDoA13+2ayvqgxSFaAezP587/wTa1EYmdnIoyesQygcdoD8sflokwW9QBMd3SpKH+@nongnu.org X-Gm-Message-State: AOJu0YxBUGX1ubt8z2rHiDudFjZNdttnW4MLXgovLPTdNzW9F3TaA2Du Q/Ijp0k86+5Rcjh9J7J9fcIcWUPu1CKbvfj7qzGd9aLvO4/GuxgVSl0YnA== X-Google-Smtp-Source: AGHT+IHmzBK2nHNbkuuv3TBwHol7fRMYRf6oiJXrXY1RJZroGDeb3A+rQl1bIiKjTU9hg84bo3RpFg== X-Received: by 2002:a17:906:db08:b0:a9a:1165:1bb with SMTP id a640c23a62f3a-a9e658c1759mr685727666b.65.1730553477526; Sat, 02 Nov 2024 06:17:57 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:56 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 21/26] hw/block/pflash_cfi01: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:10 +0100 Message-ID: <20241102131715.548849-22-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=shentey@gmail.com; helo=mail-ed1-x52a.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Reviewed-by: Kevin Wolf Signed-off-by: Bernhard Beschow --- hw/block/pflash_cfi01.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index 7b6ec64442..cf11dada29 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -47,7 +47,6 @@ #include "qemu/bitops.h" #include "qemu/host-utils.h" #include "qemu/log.h" -#include "qemu/module.h" #include "qemu/option.h" #include "hw/sysbus.h" #include "migration/vmstate.h" @@ -947,20 +946,16 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } - -static const TypeInfo pflash_cfi01_info = { - .name = TYPE_PFLASH_CFI01, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(PFlashCFI01), - .class_init = pflash_cfi01_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_PFLASH_CFI01, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(PFlashCFI01), + .class_init = pflash_cfi01_class_init, + }, }; -static void pflash_cfi01_register_types(void) -{ - type_register_static(&pflash_cfi01_info); -} - -type_init(pflash_cfi01_register_types) +DEFINE_TYPES(types) PFlashCFI01 *pflash_cfi01_register(hwaddr base, const char *name, From patchwork Sat Nov 2 13:17:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Vwbi71CY; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgddt36vkz1xwF for ; Sun, 3 Nov 2024 00:20:50 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E14-0003Jm-Nr; Sat, 02 Nov 2024 09:18: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 1t7E0x-0003Cd-Bg; Sat, 02 Nov 2024 09:18:03 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0v-00022M-SE; Sat, 02 Nov 2024 09:18:03 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a99f3a5a44cso378959166b.3; Sat, 02 Nov 2024 06:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553479; x=1731158279; 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=XUm8qjOgywmx7gvdmgv03kZ9/zFDrArayrTzSFDEf8g=; b=Vwbi71CYTVH1cgw4KOUxs6FBs3+G7TJe+mZOtBG8TiZRZjuBBTN1RJfzy9ju1htIU7 DSLSKzRC8BEjfVH8kPolXN4mXl7OVorNyeIGZvYH9Snmsnsk3auUxXulvGbCcUcZPzsr dSgVuHAqE20oSEoKY07uZwg7X242rJeswwLmY9X6ofeChSZNKreOEI/mTKW9PvA5OA+A OCdLU9P88nxmANX8+uR/y+gVGkMkzlrrMaZ/cR6cHHI19fiGH7d4kKpM8eydxay5JN8g z6apnoFDD0joWNyjTe+GiuzmuH5urqRWoxbC18zRyaYKXKmlE+vTxqr8h+Y4HLFR6bWf 1APA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553479; x=1731158279; 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=XUm8qjOgywmx7gvdmgv03kZ9/zFDrArayrTzSFDEf8g=; b=Ue2aJivvYfcnf9e/XWdDT5DC+w6LFQHwyC+hRynMI4OQ4wCNlhnGsxQGG4NK8DLaAn Tw0igBDYjppLX0y8lQpgIaisZ8Bv2aSWTiINxs5W62yH9ITr4GfewZlvsjGakuu+IA9F zDKQd0w2t4m5YsmWoqgCYwF27YwqR+LumshUweorrjEtaiEgWcwFOdWzYpXmE8hM9Xu3 Y5Py13Vec1HgdlFaXXkbWz25hG8Wx7n4pT3sCK83Fbbr7swgSpkmknEOF68wXOhhNox1 H8RaVFxP9/ofExRwFxKl9iP72pOImoE0XzdgAZpTgwSer8QzeaIsMFU8bDw9AvttFyhr lYLA== X-Forwarded-Encrypted: i=1; AJvYcCX7+8ZEy9D9V4/gYnVqW2n4SnYs5/Bm6T1S4o6zwogRFRcZdWdJBtW7/fOYAx6dlS+xhGPprT4S8TMX@nongnu.org, AJvYcCXui6lh3ZuEIk5n7A9MLXYNKFaxTzLuL7j6FcB5X3O8WVEXzf0GXZhl/A09p22+Bk61xZRSaDEIiLs=@nongnu.org X-Gm-Message-State: AOJu0YyvYhWv3mEKgHyXcG9MZkyS74FBdJOKHxc1b3JEuX6zoo/4CP3o WIKR71UOOD77PtBv02M3Z+gCbwAgXt6sZXfQw6LMHdAtUOkIbZwAs8mOXA== X-Google-Smtp-Source: AGHT+IFSs1F7VA7Fsy1GjJjGW/RL7wWm5sFOwhjWJKnYkvHtFSxVAslTGo5TJB9Pvf3myPzzPLGeZQ== X-Received: by 2002:a17:907:7dab:b0:a9a:55dd:4d52 with SMTP id a640c23a62f3a-a9de633078bmr2039459366b.63.1730553479141; Sat, 02 Nov 2024 06:17:59 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:58 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 22/26] hw/i2c/smbus_eeprom: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:11 +0100 Message-ID: <20241102131715.548849-23-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/i2c/smbus_eeprom.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 9e62c27a1a..1d4d9704bf 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -151,19 +151,16 @@ static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo smbus_eeprom_info = { - .name = TYPE_SMBUS_EEPROM, - .parent = TYPE_SMBUS_DEVICE, - .instance_size = sizeof(SMBusEEPROMDevice), - .class_init = smbus_eeprom_class_initfn, +static const TypeInfo types[] = { + { + .name = TYPE_SMBUS_EEPROM, + .parent = TYPE_SMBUS_DEVICE, + .instance_size = sizeof(SMBusEEPROMDevice), + .class_init = smbus_eeprom_class_initfn, + }, }; -static void smbus_eeprom_register_types(void) -{ - type_register_static(&smbus_eeprom_info); -} - -type_init(smbus_eeprom_register_types) +DEFINE_TYPES(types) void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom_buf) { From patchwork Sat Nov 2 13:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mJxTvW21; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdkr23fLz1xwF for ; Sun, 3 Nov 2024 00:25:08 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1A-0003Yr-Nq; Sat, 02 Nov 2024 09:18:16 -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 1t7E0y-0003DL-A9; Sat, 02 Nov 2024 09:18:04 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0w-00022r-QI; Sat, 02 Nov 2024 09:18:04 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a9a0f198d38so437994366b.1; Sat, 02 Nov 2024 06:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553480; x=1731158280; 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=tZZ+5ovmnVpC5NTiYuiewUtYnzTYhlFm/LIFM9Feu0w=; b=mJxTvW21uoBNQo37IZMR/3KURVEf6SGa9wbVUZDbWZTmZg2iVNmVkEzT18N5H1eqC+ CkAtl0RrdqPKl35HSiJulJf+rtR2KUx8JYA6DZ3hdCNSO+kUOxjm5pTk3V6yYzNOYzs1 rUCrtXt03n/0XxnqDIXGA+0HUiSPYYAoscqeNDaHJdQ+tRlXZ4cY0bAFn7vCQNYOXmFc ECbi4ioZ4iD0gNZbf9k6GAEDVtg1+0tRUN+kiBjwoiWVxWkaLy6ENRBtL0RfM6QSIRli hkRYqFDKRKCl7Q2wZXS0rguUIj8o2rGUogBOVG0x3K8uB8JRCfn3JtLBcyv9KIYOi1Yf Vhyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553480; x=1731158280; 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=tZZ+5ovmnVpC5NTiYuiewUtYnzTYhlFm/LIFM9Feu0w=; b=vFfXlHYUdZUkMQowvnGS7RJ9+3QfybefNOTMO42YFIWpmNthjnsQtzSaCwksVy4Iyu c4eqHlPIAJdWbOPKwHn3ZHeMtBETcUrC3sH3DaN3sQy83NV99ikA5q6p4YpRfRj/IPK7 HmgCXjaNP1LBg12XAJlGxwn5/TMUSLz15WaDAeZXhB8Mgi6NVT/Ng6WYr/r6ZJzIcfXd tS+BfQSMWtdQ1khE5s1nhMg1CNTWAKLHFCkB/YiYJBn4FPMT1r1DG80iBvNfTjHxjVlS WeNcJWkl4Ohh6JaZdMTy08IadABPk73fHjoQXRn4FGfiQfaaQUtyMT0ZXpUc/kqsk6Dh zZdg== X-Forwarded-Encrypted: i=1; AJvYcCUAsc287hOEzdkb1in/S0/tYup4qWBa8pVRp9D9PQJ5qrdzVFaqLCtRAf918cdDEDkxBeivHOJ2FkwT@nongnu.org, AJvYcCUysmX1iLp7BD+xmT+UExTt+b9//g7v8wLLtgUw1LhCKYgQ81t7twZVuDqCHlWflrTTg/Xq9IgpILU=@nongnu.org X-Gm-Message-State: AOJu0YxmJf8oBZskOc4ukzu7NU0NnFRPN0pcXXbcpKm09xSHsC0c+YS2 TZlcRMyytClXOLL6rK5anmIBOX0RGrsbNO8KBTMfJymxA3gjXPV5zfw4cA== X-Google-Smtp-Source: AGHT+IEbTuNte3+yzDCLPvNybPA71+5Bp9DMg0Md9ijXvAmgES/u4yIHdInF4foVrMZOkAqom7LZQQ== X-Received: by 2002:a17:906:f596:b0:a99:5773:3612 with SMTP id a640c23a62f3a-a9e65507131mr558075366b.36.1730553480366; Sat, 02 Nov 2024 06:18:00 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:59 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 23/26] hw/rtc/ds1338: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:12 +0100 Message-ID: <20241102131715.548849-24-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Bernhard Beschow --- hw/rtc/ds1338.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index a5fe221418..6de13caf99 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -14,7 +14,6 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qemu/bcd.h" -#include "qemu/module.h" #include "qom/object.h" #include "sysemu/rtc.h" @@ -227,16 +226,13 @@ static void ds1338_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ds1338; } -static const TypeInfo ds1338_info = { - .name = TYPE_DS1338, - .parent = TYPE_I2C_SLAVE, - .instance_size = sizeof(DS1338State), - .class_init = ds1338_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_DS1338, + .parent = TYPE_I2C_SLAVE, + .instance_size = sizeof(DS1338State), + .class_init = ds1338_class_init, + }, }; -static void ds1338_register_types(void) -{ - type_register_static(&ds1338_info); -} - -type_init(ds1338_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=i4fzzXvd; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdh31jWCz1xy8 for ; Sun, 3 Nov 2024 00:22:43 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E16-0003Kt-Jl; Sat, 02 Nov 2024 09:18:12 -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 1t7E10-0003FR-0q; Sat, 02 Nov 2024 09:18:06 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0y-00023F-5Q; Sat, 02 Nov 2024 09:18:05 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a9a2cdc6f0cso397990366b.2; Sat, 02 Nov 2024 06:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553482; x=1731158282; 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=8EgEQlxpALUpuI+hbJduRS0cA3mxUkzxDFRDbbfbr3U=; b=i4fzzXvdDphOF9pTttn6gQaVKk2Ac0g3BFeJn2SF6LKMExMrE/8ujG+iH8IHwTumIO djFVUC9zg/Sw4GnCwiS1eoyVX9QoWJ6IgTs67Zb4RU5uWGwWFl5EB/xB/sRxdEraERSh 8/xsrNRRhk4xZ1DoxMR5+6P63EcUUnHHczQgDhoGPbMyWfkAP1EMhd/qzXjd1C3GPoZm aPQdEdSOFK6qB0UEeNS2rmh+vR65+bV5PFB/tkOr/Dm6es5Tz2hb3S9i1lHvCQ7xRCKG vO/1lznzL4iZA0knret14KDHhxC/WP3uSTzXBkWX/+klF+1wIcQqViXXlxcJSSB8IkJ9 ZHXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553482; x=1731158282; 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=8EgEQlxpALUpuI+hbJduRS0cA3mxUkzxDFRDbbfbr3U=; b=lWuw+gP8W7bKc0tYv8eD23mac3c8H1j3CJXMRJUlJGR4iEeGbL3kPGXvUfori1F68c jK9jDvvIWqkiQsiPMDtY4aJK+JV4wHL/Lcgb0WqSCPIroSDM2szfsFuqlAO1dk6WCnFe 9CvjGNVDy1wkjrFcS4TFLgjSQzHoHB/2PVgcFloqd6iNjQaksouV2k4gx5ARCalmRx7h MWWatoMhhqxviFN1RV/m5CLVToWCVSsSF8XY9UtOymMkpvDmvi8p43raidCnmAYrTrMV d325f6zXuxq3S4XpUS5jdb2yfKalgM5aXIraMBrv11o/nLbN1XxQRKEfnlnrRIEsiB6y IyhQ== X-Forwarded-Encrypted: i=1; AJvYcCXJmO36dNkRjYajBnggPKv2WnZFL+mCEYYpB5rGUWn9lNbFv64VytDIAYgN8WXVpHpeccFZ9nxGuag=@nongnu.org, AJvYcCXnDAiRSgtwMGKFkIp63vE/fbvPIamMyiuWRWk3ixhG9UZ5EHnUzqgA3aOpJDiurKfZQOivdpoLRTBD@nongnu.org X-Gm-Message-State: AOJu0YxoXYWj6uythZwrh4qa2MHqFad0uGSqjUJe9Prt4EIJfFCIFR2u P+tvROXGnYXXoBoDIzq/aZjqMzVjLwxxMfXc7tmOfZnvuUgx4U6RHbifGg== X-Google-Smtp-Source: AGHT+IGjYismwkMa8WykNrz3odcA+GIEeIv28ItGF69z4MfB05nvmt9eDudRgDFV7r80fyLbyOkNXg== X-Received: by 2002:a17:907:72d6:b0:a9a:14fc:9868 with SMTP id a640c23a62f3a-a9e5089b6b2mr873736866b.4.1730553481475; Sat, 02 Nov 2024 06:18:01 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:18:00 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 24/26] hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:13 +0100 Message-ID: <20241102131715.548849-25-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/usb/hcd-ehci-sysbus.c | 118 +++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 68 deletions(-) diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index 2b1652f7a8..87a3bebe3e 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -19,7 +19,6 @@ #include "hw/qdev-properties.h" #include "hw/usb/hcd-ehci.h" #include "migration/vmstate.h" -#include "qemu/module.h" static const VMStateDescription vmstate_ehci_sysbus = { .name = "ehci-sysbus", @@ -97,17 +96,6 @@ static void ehci_sysbus_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_type_info = { - .name = TYPE_SYS_BUS_EHCI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(EHCISysBusState), - .instance_init = ehci_sysbus_init, - .instance_finalize = ehci_sysbus_finalize, - .abstract = true, - .class_init = ehci_sysbus_class_init, - .class_size = sizeof(SysBusEHCIClass), -}; - static void ehci_platform_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -118,12 +106,6 @@ static void ehci_platform_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_platform_type_info = { - .name = TYPE_PLATFORM_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_platform_class_init, -}; - static void ehci_exynos4210_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -134,12 +116,6 @@ static void ehci_exynos4210_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_exynos4210_type_info = { - .name = TYPE_EXYNOS4210_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_exynos4210_class_init, -}; - static void ehci_aw_h3_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -150,12 +126,6 @@ static void ehci_aw_h3_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_aw_h3_type_info = { - .name = TYPE_AW_H3_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_aw_h3_class_init, -}; - static void ehci_npcm7xx_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -168,12 +138,6 @@ static void ehci_npcm7xx_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_npcm7xx_type_info = { - .name = TYPE_NPCM7XX_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_npcm7xx_class_init, -}; - static void ehci_tegra2_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc); @@ -184,12 +148,6 @@ static void ehci_tegra2_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_tegra2_type_info = { - .name = TYPE_TEGRA2_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_tegra2_class_init, -}; - static void ehci_ppc4xx_init(Object *o) { EHCISysBusState *s = SYS_BUS_EHCI(o); @@ -207,13 +165,6 @@ static void ehci_ppc4xx_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_ppc4xx_type_info = { - .name = TYPE_PPC4xx_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .class_init = ehci_ppc4xx_class_init, - .instance_init = ehci_ppc4xx_init, -}; - /* * Faraday FUSBH200 USB 2.0 EHCI */ @@ -282,24 +233,55 @@ static void fusbh200_ehci_class_init(ObjectClass *oc, void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } -static const TypeInfo ehci_fusbh200_type_info = { - .name = TYPE_FUSBH200_EHCI, - .parent = TYPE_SYS_BUS_EHCI, - .instance_size = sizeof(FUSBH200EHCIState), - .instance_init = fusbh200_ehci_init, - .class_init = fusbh200_ehci_class_init, +static const TypeInfo types[] = { + { + .name = TYPE_SYS_BUS_EHCI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(EHCISysBusState), + .instance_init = ehci_sysbus_init, + .instance_finalize = ehci_sysbus_finalize, + .abstract = true, + .class_init = ehci_sysbus_class_init, + .class_size = sizeof(SysBusEHCIClass), + }, + { + .name = TYPE_PLATFORM_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_platform_class_init, + }, + { + .name = TYPE_EXYNOS4210_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_exynos4210_class_init, + }, + { + .name = TYPE_AW_H3_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_aw_h3_class_init, + }, + { + .name = TYPE_NPCM7XX_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_npcm7xx_class_init, + }, + { + .name = TYPE_TEGRA2_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_tegra2_class_init, + }, + { + .name = TYPE_PPC4xx_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .class_init = ehci_ppc4xx_class_init, + .instance_init = ehci_ppc4xx_init, + }, + { + .name = TYPE_FUSBH200_EHCI, + .parent = TYPE_SYS_BUS_EHCI, + .instance_size = sizeof(FUSBH200EHCIState), + .instance_init = fusbh200_ehci_init, + .class_init = fusbh200_ehci_class_init, + }, }; -static void ehci_sysbus_register_types(void) -{ - type_register_static(&ehci_type_info); - type_register_static(&ehci_platform_type_info); - type_register_static(&ehci_exynos4210_type_info); - type_register_static(&ehci_aw_h3_type_info); - type_register_static(&ehci_npcm7xx_type_info); - type_register_static(&ehci_tegra2_type_info); - type_register_static(&ehci_ppc4xx_type_info); - type_register_static(&ehci_fusbh200_type_info); -} - -type_init(ehci_sysbus_register_types) +DEFINE_TYPES(types) From patchwork Sat Nov 2 13:17:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=MiUXX3Oi; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdd35kjPz1xwc for ; Sun, 3 Nov 2024 00:20:07 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1F-0003pF-36; Sat, 02 Nov 2024 09:18:21 -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 1t7E11-0003GB-7K; Sat, 02 Nov 2024 09:18:07 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0z-00023W-OA; Sat, 02 Nov 2024 09:18:06 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a9a3dc089d8so443081666b.3; Sat, 02 Nov 2024 06:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553483; x=1731158283; 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=uVflLGHPyO3cQe2iVaao8/FC1//CU9ki9Sx4TSq7Uus=; b=MiUXX3OizJENZUznn57QnhRV8HgCt0IhxwOJs1GE4iqmBpdwgECyqw9opm1kpzZ0L9 0bRYoxiv5+GFwVuBMMnd5vT3y0jn473eTE6Kv+QdYwjDstGcOmlt04NaVooXZQHspkuj Agrw+5wvoTfThKt1tBZFhPwRKHvDLqYX/Ow0bz3KtokaEEhH9Fp0MaM+5DHkr2Zmzn72 2cwCtIN2pOkcNkDuDf95jBsMMkqaSfmUCiCnLZy+P6SdANxGnKcMvsEjlbV6v/NtH/Qg VhPegXiR3iPRuyAwCDGYmmEOEuSQoK0fm1EpalN9bKu8vq/zXFbm2Fb1kdRRUGEHABMm qgmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553483; x=1731158283; 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=uVflLGHPyO3cQe2iVaao8/FC1//CU9ki9Sx4TSq7Uus=; b=Dax8xFjpVZZ9fl/2fldtoTEXbNsinQ6N70XkwBQWnjOtKkJebUOpPoq3txpd7NP3o1 q0R8WUdJT8c8ZdLedpsYNhPuwLB64NfaHshAzcvMVC26TUQ30wSe26qyIOVwx9/gmkfw aKw77GrdbN5PLflAybmr0BohJ3d756ptKvj2uJlZivAQ5de2XrOvHS948GA+drRezPWD TJwuLPx6GfCpUCgGlCSnWYQLbueC5XQPoiY6erFI0ikuHqJMHodNF/7I6lEEVMczBlkx ulxEUsv82VX7vj0VvWGsGRtaDrIi5Fp7VBTyAOANYKGzeapuHdRzh1LXOiaPVrk03DL4 sRpw== X-Forwarded-Encrypted: i=1; AJvYcCUVxiiZxXjqngd9EOE+a6gpzn7voguMnfQPRCxCzC7Vy9spXJiYEKqqB5yoTl8Qw9jXcv9tl7aW//U=@nongnu.org, AJvYcCWCfxBOIO3/nu1kq75GNKn7EhMT0s80RKJ4fFiIFiFCUM4fuv1nHBM3dgEQghKoLRAZilLzeHe6hnoP@nongnu.org X-Gm-Message-State: AOJu0Ywb1OZ0AY168Jznb9OP0USqcm5sdQoOKh4kSRAU/e1qQIKVbrjR NSe51FJa+L4eKK2IWtZ6y9Jh+6pOlXOYrGgNr+v30rsaqxWNMDvLNv+5Mw== X-Google-Smtp-Source: AGHT+IH5PGDTc6SlGfbnhzBXuo3b+WgsM54VmDBAmCKbB/wOziGCVfWNp3CiR7zv6m7Q2Drvy//8SQ== X-Received: by 2002:a17:907:1c85:b0:a9a:1f38:e736 with SMTP id a640c23a62f3a-a9e654fb423mr655357866b.31.1730553482796; Sat, 02 Nov 2024 06:18:02 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:18:02 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 25/26] hw/vfio/platform: Let vfio_start_eventfd_injection() take VFIOPlatformDevice pointer Date: Sat, 2 Nov 2024 14:17:14 +0100 Message-ID: <20241102131715.548849-26-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Avoids one downcast, making the code more type-safe. Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow --- hw/vfio/platform.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index a85c199c76..77bbfbf62c 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -318,13 +318,12 @@ static void vfio_platform_eoi(VFIODevice *vbasedev) /** * vfio_start_eventfd_injection - starts the virtual IRQ injection using * user-side handled eventfds - * @sbdev: the sysbus device handle + * @vdev: the VFIO platform device handle * @irq: the qemu irq handle */ -static void vfio_start_eventfd_injection(SysBusDevice *sbdev, qemu_irq irq) +static void vfio_start_eventfd_injection(VFIOPlatformDevice *vdev, qemu_irq irq) { - VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev); VFIOINTp *intp; QLIST_FOREACH(intp, &vdev->intp_list, next) { @@ -417,7 +416,7 @@ fail_vfio: kvm_irqchip_remove_irqfd_notifier(kvm_state, intp->interrupt, irq); abort(); fail_irqfd: - vfio_start_eventfd_injection(sbdev, irq); + vfio_start_eventfd_injection(vdev, irq); return; } From patchwork Sat Nov 2 13:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 2005460 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SiSuRbGe; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xgdcq3HWPz1xwc for ; Sun, 3 Nov 2024 00:19:55 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E19-0003R1-9a; Sat, 02 Nov 2024 09:18:15 -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 1t7E12-0003HT-DD; Sat, 02 Nov 2024 09:18:08 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E10-00023w-UV; Sat, 02 Nov 2024 09:18:08 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a9a2cdc6f0cso397994866b.2; Sat, 02 Nov 2024 06:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553484; x=1731158284; 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=dKFAh2MnjhZ1jF0dRDKV/YEAdE5+3y61mz+4DueAPJw=; b=SiSuRbGeGOC6u73/z7BYM9M2rPX2PsrI7EuocAZEdiJDF/T0/o+3BroTh7OZ5yvV7D /D7ZK6TOKsJczmG/3ufGv/1DJbb1IdW+XqgsB9Z+1RVD66AC5W1lnUVXAnxKXf9nhlRc D8HnbUJlRa5B4KJiW/RkqRFM/ZPe/ghhWEFfzFffYq/wCrMNYNmOgarPtMT2CZj3tjkH 0Ku7dF0QQY6MHrZ6/WwTrPazlOEb+u8+Yiu5YYr5AlxXauBmaVtOoFgeu0Mjm4b6eXGL 7Ydp/GdCkZMEC5PNQP7Ja7DA1cZAsD8jm/ihAqd3zQtRtY0qHXacGY1rHjZWtAW1Uh0m /N5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553484; x=1731158284; 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=dKFAh2MnjhZ1jF0dRDKV/YEAdE5+3y61mz+4DueAPJw=; b=D8jZE2fUmIKsc3Cp1GbRfP31SQZd9pPacPYsW1H7YZ1LNsnD4OUksaVJidqsbZ+mRL dAnFvBjRwbpgnDhf0g+sWbNXootLMfABlkrB9Vc8tdNjfc9KnYAQHYCVrv1ZQX9Gds8J Yny5TAsvVZS75VtYxdZH8jqAsF7OZ2eYH0iwC40Zt0L1hCJ+t64h6/xGzCAppGkMs3Qg FbhRLBv2xKo4iPjW5WDFbvOUuvo01+38KBB43A3spprDtSdgoQ1lGGvyG8KdYFQnT/r1 KE/ADQW2mRbnozlHJ3RUKKmba9qkI3tz6rLDi2NmJgsLx7kwUwoZEVc8JSS5CioXz60M SaAQ== X-Forwarded-Encrypted: i=1; AJvYcCVkGBgOS65DCYgo0Hh3Ge49733ir4TohIBFEkzKZUjWT/IUyDhwjoMmG6aZyJsStyqnx1LZHrhDqNg=@nongnu.org, AJvYcCWLxU8RmY690kDOCtwJDwG9CU944Uegdggfxx2dtJmT4XOLLEanDmWpxegETmV9G4oj+bERB8scrum7@nongnu.org X-Gm-Message-State: AOJu0YxAVC5Tayt08LeF8L/ne+IVM1Kuo9FF7eRL6K8BtDTooFH+z8mD 24+Pg+tyrAfhjWk6mki6WHTk0Lhu0mdfdepd8kG+ffQCFOcq0mDYoKi7nw== X-Google-Smtp-Source: AGHT+IFYwWYuRSHPcE/X4S/cTrh8u2hOfrffeR3dINDkdm1bHtWiGVWbKE6vZGcEzjkGcVuzykYvdA== X-Received: by 2002:a17:907:9706:b0:a9a:5004:cecf with SMTP id a640c23a62f3a-a9e5089f85fmr965614866b.9.1730553484389; Sat, 02 Nov 2024 06:18:04 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:18:04 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 26/26] MAINTAINERS: Add hw/gpio/gpio_pwr.c Date: Sat, 2 Nov 2024 14:17:15 +0100 Message-ID: <20241102131715.548849-27-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.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=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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The device is only used in the ARM virt machine and designed to be used on top of pl061 for use cases such as ARM Trusted Firmware. Add it to the same section as hw/gpio/pl061.c. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index a8f39aeb6f..5dd35f87ff 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -651,6 +651,7 @@ F: hw/display/pl110* F: hw/dma/pl080.c F: include/hw/dma/pl080.h F: hw/dma/pl330.c +F: hw/gpio/gpio_pwr.c F: hw/gpio/pl061.c F: hw/input/pl050.c F: include/hw/input/pl050.h