From patchwork Wed Oct 18 13:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 735048 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp986061wro; Wed, 18 Oct 2023 06:16:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAQms0hCLvxWIAkR+U0NpFzqDlwnXZGh04MBs/C9ArRt+cNXPNZ/lqTtja8Z4E6TPOI/zE X-Received: by 2002:a05:620a:1a89:b0:769:89c8:4fae with SMTP id bl9-20020a05620a1a8900b0076989c84faemr6407559qkb.52.1697634975722; Wed, 18 Oct 2023 06:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697634975; cv=none; d=google.com; s=arc-20160816; b=eoGW/dUMFxBh1ssSja6ehsDwtYG0UymihfD3hpW1P9+H2RQ0w4j3GqtypD4S6e9KZC 8KKub7akcBw6r5qift2Kr+RRjOOA53Wp+zIevsUk2iX6BxbG7O4OlSbqj/sfz6aV7bhm xx3faaFyFrmt/CfTwSe1AXyHIZKqmE766jMUHwKYPqs5H/CdKWUsjKh5DLkftxH0kseL 1Dhfg2snV1eGipH9VD8yvIAA9Pkzx1joA8IhuBDzOf+UcobPzP7cExkITygytHqMs/3A YUVUuqHfvugJYydQDPwhNWyJcfvlG+JiqmTT6k31leNGLEHpdNKRxKWKZ4qLhQydY6MH INCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=WCPjmrE//uKyoW/UQ4wPU4y7ivG6ELRqC04xm0Bo59FicV2ebgbhBv/xC4eIybacHo sYx5w502S/aWK5oj0C054L/wje1wu9YnTpvs3Qgq9kO6FosoF9/TRQ8jpbCLNzklRGiC KX9MC9BFx0OeQPWqN2Tu6qyxlMHgFSxM7MX7TIN4KmZjt3Y2hnYFX2LcQL5soxRU62Q3 s8Mm5XjwTbJg6C7TLwwkuT3ZvZNkDAc8J2uz6LVOscZcBEzhxs1E0RV8PSqR0PiwLO1a mgbLfkpSd5nzd0Q0EkltY+y8a4FRhHdhTeESYEwHi1lfxACVZ8kE0oomZRa7PWlled33 SHFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNZvZ6K0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d24-20020a05620a137800b0077419b27784si2606187qkl.21.2023.10.18.06.16.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 06:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNZvZ6K0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6N4-00007B-VM; Wed, 18 Oct 2023 09:14:00 -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 1qt6MN-0007b3-0g for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:13:16 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6ML-0000of-39 for qemu-devel@nongnu.org; Wed, 18 Oct 2023 09:13:14 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-53b32dca0bfso14261878a12.0 for ; Wed, 18 Oct 2023 06:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697634790; x=1698239590; 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=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; b=YNZvZ6K0YcIXBcbBIDv4OiqqgWqEh/JmrCof4jtgfbzYl5zPwvcXU4rbO1j+QKKa7+ FDXL6agrVGyveRgM7zycpXbIXfCKViargDR9ZtHFwmT1Y58sZXmeTiBnlY73iDoqFUPG ZM42Yjh9pUIooDHqJLOWqFjCSSPZy+E1dNXA1nLrDHMGXSt35Kb80mJqSk0tY1buKi9c v/DXxE7WCMSK7RfIYs1YfTDeWuOCAqvBUg0rLFCnO6jknWtFaavCysgv5D614w7uLze/ H8wgoeAtkz0K7MaZdW1mRq5cqX9wgBSY9z6U85Ut3NzNYqpqajGovXRMCqSF9Ww335l2 FUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697634790; x=1698239590; 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=jWeKlxu/1oSXjew02PYYb/4LgtdqaZA73Poob6GIouM=; b=ntC+tfzMyDPme5UjyRMEJMFY6JRkG4AYq8SL5xhyO0bKkb5ZqZcYwU14iB9Royjl1x p0+McjlyJug7xtxgwhjc2x1i51bVRjCYUa/p0LeGxxTeNfS75LYso5USDa48FMp4rno0 45vExGo9KcaCtkxihUZiMj/LGIXp7MJcZjClWVPG0nNAvO3uyZ6DJ6RwLpS8uAG/hg0L jyvaZ0UF5KNQ16NLH5Bs91ju3rZKVh4bjBw6OgDImVXEF82zi8nLJseqUF0WVyG30/GO pMj4XudGUDFNMeU8FKsLpDgMJw0QUYSBHAeURINkp8rfve8fL8Q5nONYg9F9mJrABN/j tNgQ== X-Gm-Message-State: AOJu0YzvKnx2kI6kNJ0gMnrAHH6Ep+QNEt05LcEHJJiRHi8fITDWjhmP vYxNYGtIZjbhOh4BDR+Z0VyQTyFZQKFNe19sxtw= X-Received: by 2002:a50:cb88:0:b0:533:4a89:5b2e with SMTP id k8-20020a50cb88000000b005334a895b2emr4718728edi.1.1697634790666; Wed, 18 Oct 2023 06:13:10 -0700 (PDT) Received: from m1x-phil.lan (gyl59-h01-176-171-218-149.dsl.sta.abo.bbox.fr. [176.171.218.149]) by smtp.gmail.com with ESMTPSA id k3-20020aa7c043000000b0053ecef8786asm2763606edo.75.2023.10.18.06.13.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 18 Oct 2023 06:13:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 8/8] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Date: Wed, 18 Oct 2023 15:12:20 +0200 Message-ID: <20231018131220.84380-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018131220.84380-1-philmd@linaro.org> References: <20231018131220.84380-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/pxa2xx_pic.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 7e180635c2..1373a0d275 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -287,12 +287,18 @@ static void pxa2xx_pic_reset_hold(Object *obj) DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) { DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC); - PXA2xxPICState *s = PXA2XX_PIC(dev); object_property_set_link(OBJECT(dev), "arm-cpu", OBJECT(cpu), &error_abort); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); + + return dev; +} + +static void pxa2xx_pic_realize(DeviceState *dev, Error **errp) +{ + PXA2xxPICState *s = PXA2XX_PIC(dev); qdev_init_gpio_in(dev, pxa2xx_pic_set_irq, PXA2XX_PIC_SRCS); @@ -300,12 +306,9 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) memory_region_init_io(&s->iomem, OBJECT(s), &pxa2xx_pic_ops, s, "pxa2xx-pic", 0x00100000); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); /* Enable IC coprocessor access. */ - define_arm_cp_regs_with_opaque(cpu, pxa_pic_cp_reginfo, s); - - return dev; + define_arm_cp_regs_with_opaque(s->cpu, pxa_pic_cp_reginfo, s); } static const VMStateDescription vmstate_pxa2xx_pic_regs = { @@ -335,6 +338,7 @@ static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) ResettableClass *rc = RESETTABLE_CLASS(klass); device_class_set_props(dc, pxa2xx_pic_properties); + dc->realize = pxa2xx_pic_realize; dc->desc = "PXA2xx PIC"; dc->vmsd = &vmstate_pxa2xx_pic_regs; rc->phases.hold = pxa2xx_pic_reset_hold;