From patchwork Fri Oct 20 13:03:29 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: 736243 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp288484wrl; Fri, 20 Oct 2023 06:06:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFndml91psWY5fH08chTkpNiT0knhvquNqTrLwM4hirkcuOOsyu0rdkfcD2iTWsWbcsrYOs X-Received: by 2002:a05:6358:a084:b0:13c:a9c9:c04a with SMTP id u4-20020a056358a08400b0013ca9c9c04amr1606488rwn.20.1697807166395; Fri, 20 Oct 2023 06:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697807166; cv=none; d=google.com; s=arc-20160816; b=p6Vm+n70JUjRl+9c/sa4BmoPSVap4d5Gr0OCQtT6NEkZKNKvf1g4XmVnOVNHS1HN8H xv8Cs6AiXLOkSrhK9irhSLD7PFwZvuc9NYs0TRxhsQuMLcYG0LwF7B797j4NVevq1EFM oT5PajuMNHAlbmpj/nNYyk9wdXHn/1SGILKWqJ4b/DNZe6OKAI0GdfTN+5euemjHbRSj db5azllA6ZxT/Hv0RWkRSBuGOStHKk9ig5dDE3StcGPgGhGLJRHfte8eCsgGpLwtVFQ9 NOSNIjW+ShiMGbOFMF/jqx2izviGwDCfJkW3w0PX7Wc+X9H4BPTTHGOx3Jw+V3Q33poD 1rTg== 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=QWGggua+3ufs1S3QlzhTWcDhlhc7bBCtXi/Y+/UuB8A=; b=q8bTy8GY0Ai+Pd2Lih3kQIXh+v/zICxfTu5MNTN6WXtryXJ3n2YHq8eqHOXDk+arPn Pjhe/fzJpo/zi7+MG0yeGXfWheF2F7v8+kbjkGqRWUqy0bBRPll/XuIy2CMHUYvECuwP u3QaYgsp3/wP8JekDGv1E8ZhCuGtHSolkayIKiv2IBG3BLWNEaPLqfwZIG/QPFivx2Ny YZ4QMI78QVacBzgYnb2i9hDA74PiLlLvzmJefKsifK+71bgASWv1iiGcKwNZuiWmuRjG YuXswxLulCxQKzIsOoOzpbVO2TaJu/7wjE+BOiDrpGWODBAhLDXsmpcrXKlnNsswblKF di/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIs5MwA9; 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 v16-20020ac85790000000b0041cc4706f49si1226521qta.26.2023.10.20.06.06.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 06:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIs5MwA9; 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 1qtpAz-0001td-Cu; Fri, 20 Oct 2023 09:04:29 -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 1qtpAv-0001Tj-87 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:25 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAt-0005O9-B9 for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:24 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e855d7dacso1197152a12.0 for ; Fri, 20 Oct 2023 06:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807061; x=1698411861; 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=XIs5MwA96Z1GkELKWrGRCGQIwtM5xqQMwBunRMxLHBh2vqPMO8dHjjDM87iGe7ejIe U6o7czKjElGfPjvAWxtXECaRFSu3JqB0bYck0LdQ/xI72WyJCPUKndNfdeDSY/Dqa5lB ZEc9AizjrrGQAG8StbKoLENga7zD7pOgcZ6XEPW0nSkzb8QHGCrKxegdNUD53KUHjjDZ zszwyjcCS35XsyyaebksYOTkn09cidtxEi9YH5XjnU6rYSxcQeGoJ0iglKZ2+WQrd2mU ycnqnhlQTsad0/AvA8P+nThOcweYrF78V6WrW+rZxMEvRUQZ52c0dvsTF5BvznyQHnLW pKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807061; x=1698411861; 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=TyginWVURyyAhmyGII5QwuSaVVxa1xWflt492S1lQgT6hE1YFcIMcHHbS0svPWtVOU RKnLeyFqgIR1/tKgm5GjuE15QbK1gaddm26KgoLxy3KTlB05YbBKZR9voxstRtQDHAOC EZBVSuLWbx8yOQTfTfSSYciHbz+0poGerA/ITfWPayO6fKN6OufUEUjfqrQiKGYOpvBb 3ZEU4apzRo41fnWYiCrH5i58ZP3kk32+3+II5hxGRduySf9oZ44JuLkGkS2pB6CVt1OF tXCKAnZHdCiFsY9sWPMvwe9xLC2mVFoG6th7ZlljKH0YdYJxx9kiEPvuYpu5ZDIcVhd9 XiQg== X-Gm-Message-State: AOJu0YxBTg64sMFwZcPRNnZpSd44Gxt+gS1CjhUjDqsF5GWp0srpVJk7 uy1h+TdPaWUHV8k0DbyZXmIqYuibZlrjJAgbV08= X-Received: by 2002:a50:9519:0:b0:53e:2409:d6f3 with SMTP id u25-20020a509519000000b0053e2409d6f3mr1309839eda.6.1697807061542; Fri, 20 Oct 2023 06:04:21 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id q20-20020aa7da94000000b0053e9352643csm1404589eds.62.2023.10.20.06.04.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:04:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 8/9] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Date: Fri, 20 Oct 2023 15:03:29 +0200 Message-ID: <20231020130331.50048-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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é Reviewed-by: Thomas Huth --- 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;