From patchwork Thu Oct 19 13:09:16 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: 735546 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507579wro; Thu, 19 Oct 2023 06:12:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdnpMwTOb/E3g2eZ8ExRAaN9mTKmnGpKv2c49sOOTTZLZ8x2V3y4ddGf/nITGhxOc0oKIn X-Received: by 2002:a5d:534c:0:b0:32d:a4c9:8ab4 with SMTP id t12-20020a5d534c000000b0032da4c98ab4mr1597155wrv.65.1697721131434; Thu, 19 Oct 2023 06:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721131; cv=none; d=google.com; s=arc-20160816; b=iazkZ7AbrvDvIHXEQx1GE3QSkoL5QdJ2DSf6QjonKLzK2VcZSNZexo+Fw1UxaKF4zn bBikq6BwgAJ19zmfZE5g8PYgXxPv3jwjdFM/Eg8kC+jQz67+uk6iKhBqCc8Id7chfa0H /UauusxvOdTPZBmAhOAeBfYCJoxQR6wHt+FwRk6z3H3eGxDpnTi8DoVoaCXmIBqEXqeh +IKGkuWCzE+b1+Jrrkjyvo+AMCatsj927bWsqaTtcDt2QxAK41qguBqqPsxMl6D+zCcc GTscKfSaomRSNdydi9L+9GNzSDti7GhGuHtidxnGU/3y+CDHoeYj0+TxfGr2rmKmwgsx qq1Q== 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=Gq37DVZ2SxwzGOAF4za0iGcWPUKgdLu6dndZSN5cA3PJphYCbNvkVboa3jliGvD5s7 GZryUTroRhLwSIX/eiF+ymeCu1+WNQEOTQtsTFeVk3c8jz35tf0+cHgP4nj0ytUDU5jj Wq9X70TsDIsTLL1rmGHwtITzAi4WHF2K7HJnceFfEeWFdlmwipig3MnreBS9xZRkErRT C9ZvSI8vBFIZpq1wsGlYQ1q4b8pEtRrrxIgVrznvCsQd2n8ykaQiDAWSEzYlm4FBZd8k aHlwmcDTXAEF+IoLh51WEwUsSDofcjHgbRM45c469jGkSpjLhyVfRp8x/QArw3TamJAt tEDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i92aIzOU; 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 g9-20020adff409000000b0032d83568f47si2557904wro.457.2023.10.19.06.12.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12:11 -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=i92aIzOU; 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 1qtSmj-0004aE-Iw; Thu, 19 Oct 2023 09:09:57 -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 1qtSmR-0004MB-7t for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:47 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmO-0007Dn-TC for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:38 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083f61322fso13215055e9.1 for ; Thu, 19 Oct 2023 06:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720974; x=1698325774; 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; b=i92aIzOUdayOZ6agwNL5c/JOzhuUpczsum+3ccFhwjCw7yhD5w3NoB3EuG8SQNvuCs rQOGKXYmUBaoS7hkozxUD5KLB4HLTI837EctSTMVUE5VbVHKpvO1QYcKKx/hpEpaqqyo edvg095qMpRhc3jbPMyhBz9RdPUPxYu9yUJVltu0m7Fz6UNCFyDUKN19M8RoMSPsVtqt kw6Zwd7Q5pEwDzu6NWukXQejItc0qS/vJWh2RiXXNjCd9OikwnWxRHVcMKvQ6mM/kcoM EB6eq5miedZM7319qkIExGlaN3JtKB0/BuMQEPyfxdIMu35MvCerQaHzbQ1OxPYgrpro iaTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720974; x=1698325774; 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=WuH7XtOKs5G9Ns2H+BnAt+HjsoiLIzrJP7Sikrea0Vo=; b=qzqpTIHAKj+9odJcgDqOC8c1P0Ll0O4fT+4DAREGHaa7SzE5Mq0L6vczuwbIqVrzYn FzToDdnKcL7/ScJv7CHkrIRKPvhiLCMi4Dc8qobmKedyN8rZtq0v7Jl+0R7tlYhzwHTI TgLabnNXSCGSxjA1ITKXagbyg8+oJeGY5aBnQJKTAx9sf/xASvwqNXu0l1U+ft/byWhU Z0WT/TQFBzdcG9woRajRREqpO4xMBN8tlo2GzAiYKNx2OZZo3iamrpR/G9lkrD1zl0Hp 0TSCdluvUxMwUeumUdwwfMxtU2v14x/y+opRC/jUzhZoYFgYGamn/ZcWkJ97saKK6vVO ZYCw== X-Gm-Message-State: AOJu0YyklxUg9WP3ojmixoxIC9mSKayGZjI2/VSSwfkgrkxVJvswzyW0 0oZNOJxNf0rmrFq6+x+qhgDrf4ucDZ+q6BMIY9TjcQ== X-Received: by 2002:a05:600c:4588:b0:3fb:a102:6d7a with SMTP id r8-20020a05600c458800b003fba1026d7amr1762628wmo.28.1697720973980; Thu, 19 Oct 2023 06:09:33 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c231100b00401d8181f8bsm4373980wmo.25.2023.10.19.06.09.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/9] hw/sd/pxa2xx: Realize sysbus device before accessing it Date: Thu, 19 Oct 2023 15:09:16 +0200 Message-ID: <20231019130925.18744-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 sysbus_mmio_map() and sysbus_connect_irq() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Reviewed-by: Thomas Huth --- hw/sd/pxa2xx_mmci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 124fbf8bbd..9f7a880bac 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -483,11 +483,11 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, dev = qdev_new(TYPE_PXA2XX_MMCI); sbd = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(sbd, &error_fatal); sysbus_mmio_map(sbd, 0, base); sysbus_connect_irq(sbd, 0, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); - sysbus_realize_and_unref(sbd, &error_fatal); return PXA2XX_MMCI(dev); } From patchwork Thu Oct 19 13:09:17 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: 735543 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507512wro; Thu, 19 Oct 2023 06:12:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIv5djXLI9bHvx1vRYDmvETiAsxC8BmD748HTmmQ5K5qor1rDFr6Xl4mC9LV335LP1FC7A X-Received: by 2002:a2e:be9a:0:b0:2c5:292f:e1cb with SMTP id a26-20020a2ebe9a000000b002c5292fe1cbmr1792793ljr.34.1697721125278; Thu, 19 Oct 2023 06:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721125; cv=none; d=google.com; s=arc-20160816; b=xYRm/WBdFOBZARyTxEs1VBfHvNkxGsE7d0ywUDF61dilZOAR/uwOo4rhC604duPWP/ NcAedihIxkH64hJYeXNjH79CfgQyKr7jFg38IuJgPcrfxBlMTh/9JFeS6Z/5Uq/CkjDo 2IcUIKjam2R4EN5IzqbX8UaMJGni6f6Ip7v8YX8TePTxfZ98WujE+pPj9KuAEV2udWlj yxr0FPq171nHjTRNTmWq/vjwzCrPrvulPOE97gobVPkABHDkh+wbwnJSUKEblVggn0mT F5kZYTrT5C6eHhsDz97U8zSrW7ylFNSXaB5Tbsy5V2vxEUSBoEL8RWhwZu77QTtk9VKe czyA== 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=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=oOSTrqG+CsbvhyA4HPI0SM2HmiBzOUjIzlkqGK5UxjCO+uqVcGKZkG3AXbmhGdsuTu HUEmVHw64eHIRtKWKKsVvi8o2rDHY64Hr8dRc8Y85qyxuZXw8DYFabMJIYagOodt8z/f dZfPZpGJ9gf/sEcpAOzrE3zmKWJk8RQnLg5oHwHMlrAsAUDIwRHimwmy8LiFqUZIw2dH BcAdgpLqUve9mnqkSiNfZHfUETRNnPCZpe+jAvcuZUrvBj5kEXNW8Gr6R4V89R+jThhv HgpX5gOwC5FZ3YXad4YttCoOmsOaa08UYlEw6TxGjZUDAt/Zx5FqfnOi9cq4KVwfgea2 CJPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=myfnfk+7; 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 t7-20020a05600001c700b003296a1e4b89si2688209wrx.261.2023.10.19.06.12.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12:05 -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=myfnfk+7; 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 1qtSmv-0005CT-17; Thu, 19 Oct 2023 09:10: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 1qtSmU-0004Mf-Su for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmT-0007Qp-E4 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:42 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4084e49a5e5so233115e9.3 for ; Thu, 19 Oct 2023 06:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720980; x=1698325780; 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=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; b=myfnfk+7mIjhUyLOgjIuqBOvgkunFxpV8p6QoSIsE90YbAFZjQFeoK3GFU26NwjV06 qbbVM3Y/lNOsLMHMbW6EgVam7EM96pzXNc/0y3G2D6L/yadkU6sGiTiQBe56oglF4kPL KMtxYaXQfEFC7ONn6Myg2yu+FSRFgiwX7sfwKZI3BRyHJcH6aG/Zmr1nmxxWD4WmuGvJ do6UaeI3q0Mo5/sbk6XPEN37VLkys/rtv9X9T0atMXnoP2f1sM1YsM+8H5VAf4tZ01P/ XyYqmQDxcHYaOmMBtZUVHZMkB6mlc2tNjxjxEF7CnslgO4YRXbUFh8WuqH/URYL77DrB Z7uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720980; x=1698325780; 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=AJfJ06RDafLRLEOQTU58KKvhb0KtBRhLr9Bft9JesEY=; b=tBIWBJULFdip63imSSJea/wflarOIUb84eNkl2WpW+1Y+9uOX180IHp7kLGptDJUr7 JCrjpzgy4AtouZxzpJGq+xi+Ne+lewzl9vSAkTjfauBSj8NJZueX8QGCsLfaesmdZBTY FmetWzEpbpSYI+bhPdtWyqZfVzNLnq3olJBavJsOJVWJqZ0Tb9vYumNhMlu8O5jaUHhX ZJebrh1a54R5+b65PI2zp1AYxjyZREkFJKOG6iq57a8YbDYI42ftMuxVU/Nvcmn8rD0w hS4cWw5Hr0I3zJZ8IgSaLzXqT8hdx8Mlbv2w9YmrGA3sh4vcW5WrFlM5nyOl0JiZZCdG MlDQ== X-Gm-Message-State: AOJu0Yw5hPbVw5WZDRDmeY/iSsj5YCInQkkbrC9Gw3NTeg3WrozdRqxc no76QzHRaYgFeSD2xSV1EnpfjUeVotSgCfcbMK+FeQ== X-Received: by 2002:a05:600c:3591:b0:405:375d:b860 with SMTP id p17-20020a05600c359100b00405375db860mr1884089wmq.21.1697720979709; Thu, 19 Oct 2023 06:09:39 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id l32-20020a05600c1d2000b00402f713c56esm4494647wms.2.2023.10.19.06.09.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/9] hw/sd/pxa2xx: Do not open-code sysbus_create_simple() Date: Thu, 19 Oct 2023 15:09:17 +0200 Message-ID: <20231019130925.18744-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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/sd/pxa2xx_mmci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 9f7a880bac..4749e935d8 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -479,13 +479,8 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma) { DeviceState *dev; - SysBusDevice *sbd; - dev = qdev_new(TYPE_PXA2XX_MMCI); - sbd = SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(sbd, &error_fatal); - sysbus_mmio_map(sbd, 0, base); - sysbus_connect_irq(sbd, 0, irq); + dev = sysbus_create_simple(TYPE_PXA2XX_MMCI, base, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); From patchwork Thu Oct 19 13:09:18 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: 735538 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1506699wro; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHACAjFtLUiDg/6E0TTL5VPVzYzBWOPpyayhggTKKK/ZJRXCiv+tMwtMbCb3ayQ9iSYcKcm X-Received: by 2002:a5d:42d1:0:b0:32d:a369:1820 with SMTP id t17-20020a5d42d1000000b0032da3691820mr1412276wrr.64.1697721032645; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721032; cv=none; d=google.com; s=arc-20160816; b=KOMI4fMsjD+FDuntLafCSp1wl0UCGiHwMWlyFF/pZfVUPJcyZQZqidsawg5HwyEfkF nK3pYx86LSW8EV5xeTQd1lEsmixq/pRePz/s8z6T+iQDsKnnvKlhkyWCcOSFhIUUw//i O0n0nzqZ7HBXGzm+/RYnV1fqjR+bBDucW6KVumxkP0bqlb9zLrXQekLikw5FNLyOKLev a9eiT+W/rnjFwpDjhEKWFHE91XDyEMW1fy+hWfuDgyxMyLqXLbURJEy5MxDRi6rVwGIU Ygv3V+dqgccG8Q8lx3QvvZCFC8naODVAx7zOmVtBy12k0KwSwl/BGAZxNK5BZ17FxyQK tdrQ== 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=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=sXc9/pQuXBeb2G89MN99jF+3wEwiLUBd64V9196qSkU+Ew16JoI08qiQ7tMV7kLZQ3 IXi+crFA6Ar8GNd1lEUZNgK118oTGrVX6DNBD/iSqocxV3zj/aIseUi2zmrbsRjMNLW4 amE7X/aeeGB879AChw44tdxGm3cMyWGus8j3mPpjmsZAy34wsgJ/RcdSHw7YOpwOP1kv Y7G39I6PLizMqU1XW5fuSi1Nh8rQ8c+dp+fler5hW/Yca6AaJUBAqiBUJgh+Ei0AXWMa nEoPRtsp832yvxtVxtqdXUwFgzPiNLJ2+TGeXgHoixGdFpb/rorq6+hlp17JCX9V4zT6 Oodg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zbK9Zyo4; 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 d4-20020a056000114400b0032d9d845f47si2560710wrx.375.2023.10.19.06.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:10:32 -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=zbK9Zyo4; 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 1qtSmq-0004wn-Bg; Thu, 19 Oct 2023 09:10: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 1qtSma-0004N6-BT for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:53 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmY-0007bT-Qh for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:48 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32d8c2c6dfdso7085965f8f.1 for ; Thu, 19 Oct 2023 06:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720985; x=1698325785; 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=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; b=zbK9Zyo417DCzyH8E4A2HqVhjOUKdl3LFcSRuAj0WoDsv5eHBCDCMtpLheDO6Iy6fJ 2UQBb/wFbEXf/J1V7NkpTbd1gVVRirNQkErukNcO/9rST5QWUhZipCO40GjqYzQE2yim Mf9lh0NitDKZIfPqBjmFAFjL0KMQumHvDUjYjj33IImM7f6+Lnn7baha9O2U/JZRCtc/ SSweHfJhqk6P1AFaEqgh2SmqVc9zEMXaHl/FYEeueJQFJy7PrpdmAdQqHQybk298gtrS gKMtfdbUlE0juqPMOh6Kq+ATOgUt8ZNfKFslTz0d0/H0i1FbmH052alT+Jpf7wZfEq/L XKdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720985; x=1698325785; 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=e3Wrm2+hEgcQGJPeHM5sv3LDR90OXcyWyLu0fpUZ2rw=; b=o9wPyL7LC9SmriqJ9yG18r3bBkKah6YJ24EI3yPDmFEwj+uPnHdJS9g5nnFOR5lWeR dEVBxeQ/rE0vzZveCtG5FLvl9g1khhfA+GHcNKjyWNK8MQ6V6xGCdlucwPGO59o5Flyf 4wYLztY/rN0fzSQAuy3I8EMAghj8wc23ifOtm1xg5ttdpJsYg2N9Mc7KWZmWj1xNn7Yb GSWqPWfyqGyDpgjaWSgWB5vcd2Z0HMFuAeGYpmgfXUz/H0IJQ3rXxsEhMAsjmLW4RK3c p1nQ6Lacw/IygfTFQHi04kgB26YM6O3bsnHzRVRQzXejQza5zAaZcsfY/gC4jadK6BrA tIlw== X-Gm-Message-State: AOJu0Ywu8t6dzzv3qHqs8CRqrbkg9LkoXQ/ELlDhuTDqMheMmUpJhDru 83l9uv99Qe0pFxcOYydGKq3K9aZsxQdeuPQLy39gFA== X-Received: by 2002:adf:db4b:0:b0:32d:b06c:80b5 with SMTP id f11-20020adfdb4b000000b0032db06c80b5mr1581493wrj.2.1697720985190; Thu, 19 Oct 2023 06:09:45 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id k1-20020a5d66c1000000b0032dbf99bf4fsm4439609wrw.89.2023.10.19.06.09.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/9] hw/pcmcia/pxa2xx: Realize sysbus device before accessing it Date: Thu, 19 Oct 2023 15:09:18 +0200 Message-ID: <20231019130925.18744-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/pcmcia/pxa2xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index fcca7e571b..e7264feb45 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -142,15 +142,12 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base) { DeviceState *dev; - PXA2xxPCMCIAState *s; dev = qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - s = PXA2XX_PCMCIA(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - return s; + return PXA2XX_PCMCIA(dev); } static void pxa2xx_pcmcia_initfn(Object *obj) From patchwork Thu Oct 19 13:09:19 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: 735537 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1506697wro; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQF2uWeDBNJjN+lHfPjCB6sp4jSsyiEmeCcQ0SoUEGjXX+vcY7lAafnfq/2/Fph4nSJMwn X-Received: by 2002:ac2:54af:0:b0:502:9fce:b6cc with SMTP id w15-20020ac254af000000b005029fceb6ccmr1470180lfk.11.1697721032600; Thu, 19 Oct 2023 06:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721032; cv=none; d=google.com; s=arc-20160816; b=RWMx4MfAVvcIH0zZW6EJpyL9BsAQLKvgBDPpZJpez3zic7zMwhlger6xd0EambjuZO A9hf2Kn/3nph3Bf9MyI0CLEKQw0WbNgVOQdZTr9DvT+ys6/t5SyUeBK/aEdcqiLENec+ VlLE/IB7SpbqF6gd5MjCLzq4kweCh/KZK/vZametqcglO6h4LmRbqwePyPfKsEUqOzWj 876wQDlIOYVrjW1mDpHf02wOUW8EEwBoKzxDdYFwfgvFns4Z0FqdWSH+P6Yz3wocWiN3 6sOEKVzoYwLu2mYz9mX4Qyok7NW4hcjL98cl6gnn8CDMg8GDmckqgKTTALeG1yBrvW/f eYnw== 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=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=HWflSQ1Z2K9jDO3jaHnmPrOaNzM9r/YJ59p92zhRU9YiUIbt+bLzloXNdIeJ8u0i3g CrHfaqL9mLrEhoPQFfO1j2tLPE30IAYYB6/rI5wM/2eoL2LhLLY9JX7JZAbm6GumUJjX 0LIJuc57N93Ygtv3FYMnkslBFtFO/F7Z8pHPLW0UbwTWTP/KmzaDmUEJixcoUIxBQwJf qXAc/oCatLm/Fkim7oWjfUFKt78fCmOtDdmkP6M4jptK6N/wDuaSjIPYgr166ICQbZNG UmF7Dogs+i/tJ+6iNe9A2A6S93SuU1Q9F7pmJtqD1tc3VvWmJDbIJ9TwTZUb461AvNUK kvxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JahDwffL; 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 b15-20020a5d4d8f000000b0032d81fd5ab6si2693071wru.668.2023.10.19.06.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:10:32 -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=JahDwffL; 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 1qtSn1-0005Qa-AL; Thu, 19 Oct 2023 09:10: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 1qtSmg-0004Nz-KK for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:55 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmf-0007l7-0g for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:09:54 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507c78d258fso2896871e87.2 for ; Thu, 19 Oct 2023 06:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720991; x=1698325791; 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=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; b=JahDwffL68LEt9Uk5iYJov1n9unlLPEk/J3is+0Nc19fPd1w75kQ+Kmax+XVGG2z+6 Zlu6TWtbdMKeELOhR8mXXQz0WJ1F5QGyr0r7mrbVy9ZcR5Jya8gFmrC8sOhc42Q7fiY8 W25Z+TTdj94I0j2qHBgih1NoN8aXqNqoX4bGFy+z3LbKLuEYGjS+dXEceOqp8+Ax+dpE XPP671FVDyXtvwD30+OSYvpKiOmiQrjvPSIbjzEwdQ9k/nt0dZ8qYQ4Bu/FyBIpUNmPA l2QVxGDOvq1YM7DgR2WefMA3/AXtpSYW8d1AewBbjcmZf+FjxjByOVD1rJy/471geRrr i4CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720991; x=1698325791; 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=IrXKI6jVLRlYzi/YxZFiozSO1YVRsr5CmuAToS28wAk=; b=Ofgd/GAgH+Q2BGl8N7KkEEIuEIHPXPe40JsYEfq+YdGEXoD7stZINDHZlwu1JfscTM 1pJfarSRBbUZWrlTD96i3stw/gX+vMYhXgG9NWqEFiAMcHy5uPIhg6uc3xk3ssN5u8Bs 6cz+YFFkYJRWtIhtkG7Qd7YLIa62xpKN7tovYXeVSiWErd13kkDpGkh4UxHb879tVA42 3KSLBwhXdlHvIxScVQv/GPMbGgMqcelQMx/m4r/g0J5w7Mcun4CF/BsWjV+E0KiJiw3a HezGHCjWBb8s8LUqWEKyZsJuEpSyZcKXhyvC+YEt3b0ZirXhofqXqe2ypcSs3aZSD2CH BdQg== X-Gm-Message-State: AOJu0YzXPFE814mhN4PchxvSHA3yn0741U4+jQP7moyXS5RqNtRRQxPz Lu1WqoI53FFa59diKFGzv5CTYiUKVetmxpjtMzx7ow== X-Received: by 2002:a05:6512:3d25:b0:507:a0d7:bd19 with SMTP id d37-20020a0565123d2500b00507a0d7bd19mr1989067lfv.13.1697720990921; Thu, 19 Oct 2023 06:09:50 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id e38-20020a05600c4ba600b004075d5664basm4324622wmp.8.2023.10.19.06.09.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/9] hw/pcmcia/pxa2xx: Do not open-code sysbus_create_simple() Date: Thu, 19 Oct 2023 15:09:19 +0200 Message-ID: <20231019130925.18744-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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/pcmcia/pxa2xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index e7264feb45..a2ab96d749 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -141,13 +141,7 @@ static void pxa2xx_pcmcia_set_irq(void *opaque, int line, int level) PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base) { - DeviceState *dev; - - dev = qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - - return PXA2XX_PCMCIA(dev); + return PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NULL)); } static void pxa2xx_pcmcia_initfn(Object *obj) From patchwork Thu Oct 19 13:09: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: 735542 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507502wro; Thu, 19 Oct 2023 06:12:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2LiHGQ5QV6g2vRyyDcriETVF0ya4rpqeuDqqPx9aV2Y3o1funO45MVdSS4RX8krXeQVKM X-Received: by 2002:a2e:b616:0:b0:2c5:1482:719a with SMTP id r22-20020a2eb616000000b002c51482719amr1421637ljn.21.1697721124362; Thu, 19 Oct 2023 06:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721124; cv=none; d=google.com; s=arc-20160816; b=io9WDydG1iuRdzpwa19hfua8SqJHsM8kO6WPF+7VkdxN/JhtoaVDv3dj9XXuAVGCY1 Ugv+JNtNksZzwSJkLadygz+lZAbGYHT4dVrFQIhLmmem1k6cOvVGfMT+PzsLMmrxwlso CPPgY3rYu2Z9YLQkxvA6i+3k0lb7Jb7GHsXWJ0ptt9lBQelF8Wn2foGe1ISQTLH918nb E7J/HP9zYq/EpIMDc0MbO8JRudk6Y7GSNKHyOck7lSHwLL6c7SlJC7LA8bQGQfLkfcHo ISkNKgqJbcbRg++nOo6ZUjVrAzcyxWHvkU2NsVcVw+2WSWF9RNmmPmk+MYaZLIRQczTb c7EA== 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=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=zaQasWc8m/VxPSYnDpeEkrChGdxpl3lyVmGN5Qt+nffBbd/buMaM1iQCBRU0zsOn8R 5YRooxegGY/3fY6NS4xmAWu3X1A4gp2eO4nrIETn4ZWHP6B/trU801L+4xlexpxwLD0v mrF7tMdYMxzkwoZhbVNi4KA4zMLA4x6+ntIUCdhV/WX8kuvllp0zk07aVPml9maKnaOg +kW35GEGDmkd0FLERYNdvFJGbUFMa/8G6xn/h04nMyzSL92VF/DhjI9+pwt8NXI47cdn k6FaMBc+nmAvmOtZ+rzrLImbxjJyLBvUTmIAPzNKIYyj1GRWVDSc6RIN0kRxp/1m5s9g NfCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XeP2VzGj; 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 y13-20020adff14d000000b0032c879927f7si2597725wro.558.2023.10.19.06.12.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12:04 -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=XeP2VzGj; 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 1qtSmt-00054Y-3p; Thu, 19 Oct 2023 09:10: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 1qtSmn-0004qZ-EA for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:01 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSml-0007lr-6c for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:00 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5046bf37ec1so10019963e87.1 for ; Thu, 19 Oct 2023 06:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697720997; x=1698325797; 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=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; b=XeP2VzGjGC5sm1fK9s87Nzoq2buKj95HByZEIs9Jctr+TkbyFYtmxE+WEDcRILUTuC maHMhc9wLUPFTkSiRm2Gkum/YBOVa5Sf/O5fMI/2XXKmhUgEaBZDIHT6pkIbHs0ZMv5m HcG6Euz+x0VzQTyQvh9ObWCpOTcNejMmXLftlDQ3VwsfUn6E4sig8XcUqhH1v1gisE+k Y0oD1uvqcPi83Y6OnoDlm3VerffpMMsoaDibDD8KH/hAEErIcJZ6PfJ3+EwqqBPW4iL7 rBrorCy+we2cpQiDtVUK8ZH66eSMYkq/pFTT8cP9isIpxZavFuJxAIRkyBfZBeSJysFK jgZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697720997; x=1698325797; 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=kCYRI8Q1kvi4VpcB4GZtS6fXIL0c6XiuN6TOx6QUjpw=; b=sg/C29TN1WtkrHZvZZU0b3/MnEebn+INTAx9ChgfQzuG5MIVmz8IV54SJ239TRMG0k LBhRN60QwZ2D9TH1uJR3l6aPXui3FrhyIBki/YcwFmeQkioDhhk7hMmN5NOe2z81EN9v j944K/YYye9gbeMZthYouA0W79mSNWi3je8udeLIfl+N9u+ftnSOxRk980WgxI6HV89c lRAASTESb/QGjKQnmIi+LN01RusDEhpdU5TRuisJLGnZZ2nc+mNx5fLZhKFUpbIOOJuZ UtlUO587A4CjRyh5VUD88BgSX+If/85N9JYDvfMEF+DhE0sRFu0/0lhK6MSBwesmbkxW wy9A== X-Gm-Message-State: AOJu0Yyh7MwDne1AmwZYDZGiwcg0K7walmoiHBCMXSsVNVB4afwW/0XX f/g3yrMo9FQvFFFdCXxS6KYmg0A7NOudpM/O6ptlsA== X-Received: by 2002:a05:6512:b9f:b0:507:a650:991d with SMTP id b31-20020a0565120b9f00b00507a650991dmr1840661lfv.58.1697720997128; Thu, 19 Oct 2023 06:09:57 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c028100b004077219aed5sm4324781wmk.6.2023.10.19.06.09.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:09:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/9] hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() Date: Thu, 19 Oct 2023 15:09:20 +0200 Message-ID: <20231019130925.18744-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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 --- include/hw/arm/pxa.h | 2 -- hw/arm/pxa2xx.c | 12 ++++++++---- hw/pcmcia/pxa2xx.c | 6 ------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 54eb895e42..4c6caee113 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -100,8 +100,6 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly, #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia" OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPCMCIAState, PXA2XX_PCMCIA) -PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, - hwaddr base); int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card); int pxa2xx_pcmcia_detach(void *opaque); void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq); diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 07d5dd8691..601ddd8766 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2205,8 +2205,10 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *cpu_type) sysbus_create_simple("sysbus-ohci", 0x4c000000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_USBH1)); - s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000); - s->pcmcia[1] = pxa2xx_pcmcia_init(address_space, 0x30000000); + s->pcmcia[0] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x20000000, NULL)); + s->pcmcia[1] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x30000000, NULL)); sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM)); @@ -2338,8 +2340,10 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) s->ssp[i] = (SSIBus *)qdev_get_child_bus(dev, "ssi"); } - s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000); - s->pcmcia[1] = pxa2xx_pcmcia_init(address_space, 0x30000000); + s->pcmcia[0] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x20000000, NULL)); + s->pcmcia[1] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, + 0x30000000, NULL)); sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000, qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM)); diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index a2ab96d749..e3111fdf1a 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -138,12 +138,6 @@ static void pxa2xx_pcmcia_set_irq(void *opaque, int line, int level) qemu_set_irq(s->irq, level); } -PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, - hwaddr base) -{ - return PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA, base, NULL)); -} - static void pxa2xx_pcmcia_initfn(Object *obj) { SysBusDevice *sbd = SYS_BUS_DEVICE(obj); From patchwork Thu Oct 19 13:09:21 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: 735539 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1506724wro; Thu, 19 Oct 2023 06:10:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+b7/66h/MvRw7kAWCIGiaCjYs+ezJ4n9r1Q+5EZQ8ZRKE1EDj6upJKRXdQWbueHtR1THh X-Received: by 2002:adf:ef12:0:b0:32d:a10d:90dd with SMTP id e18-20020adfef12000000b0032da10d90ddmr1574954wro.50.1697721034066; Thu, 19 Oct 2023 06:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721034; cv=none; d=google.com; s=arc-20160816; b=0O8EB1xb/WGZp7dSPGGxeiKWIl4bp40tRxxpucYOWP8K5pGUdjcKgmT+dFl4qp183v INeP1FDXUL3J9hhBZOKySql44Aq2Aa/KNHscPJv1/7OeNmMz2bdCGEFKqHBQrYkAkI4r UOQMkc0fYHEWgrQF9jv/Dq/8Qd6jAZA3+Pwf6PD+AXvjMxqbc+AZv7WwXYXWIebpGkDo kzmMjnVQXHfHTc3S7f8jRmtOTVqknLXPPbsatHYp7whpLqQOx2Mo4wjlbCsNe5M0ROL+ LfscoOE5oQ5lDGP5wG2wWcH5+OZsOgjufwEyNT/K38r4gAsTKp+BZTfvyaPxGigdt905 f24w== 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=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=NISluXhFH12n+/KxgaIPzyIru/Nf/cFyC4P3fekKUr+MdpDHDdznBiZ6/yGC7wvhCg HNXb5DcEjQrjyjJKGmCNcvOyStyV5lPF89p3Us5PQpzwyHMEp/oweCj2FCPHItN7IIpS +uzLflqb/dk9aeYgFkOolXbYcfsGRmS8+PnvE4sxcCutAS6wchNoyDluaITZeP7nvW1r 2iXzH7WKjPxB4kTneFSBEbBbjbbRn1UOGFP4hBtz4hDfDxZ3Tz7O7rAKj9DWdyFI08J2 s47TgOfhbWfPsOkCy9SOt8v+yfvG0+Hz6iEo/xHwHtyUSzyAzz6oqG0MAyBKqq6PgIXN MokQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qkr/v8nX"; 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 k5-20020adff285000000b0032d9756f644si2715015wro.148.2023.10.19.06.10.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:10:34 -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="qkr/v8nX"; 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 1qtSn0-0005Gu-Hz; Thu, 19 Oct 2023 09:10: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 1qtSms-000558-MA for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:06 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmq-0007n0-P8 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:06 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50797cf5b69so8474347e87.2 for ; Thu, 19 Oct 2023 06:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721003; x=1698325803; 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=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; b=qkr/v8nXIhz3SoD89Vr1W3sHlI/AXRfkyxtWvpdpwmBXUJYqE0igSD538JhtCDCkmH VKuwEPjOCELSOW0Zzbv+ZaF0SsCBB9DK0UehHrz6zPQPSs90XrOr13vZSLckpqfBkF28 5PSEviougYHkfPxPnxaP901dqXAKaScxh7yT7eVSW7+BDFfvh7wvuH2hMivvPggmLh7D +8YV5R/tRkbT+gL/Q8zVXq4JGOBWrsq8cI2VnrdDOsshG4znZrhaZBPNUUrjETme+nlG HMWSLCrnUn5bnWH8K+8UMcFcCOergOPpT56/MTEKjrNlI0iBBAuhaGwtPbOWroUr4OBI Y+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721003; x=1698325803; 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=LSmy0AQ2ctzt4sBy/4+sAM4ntN11b2Cq/iHR2Msv118=; b=MhRjBUWcIvauVI8cYNSpetH4bxwOQ8C0ZKEsu6xrvnqzA50cKCR0ANpnupGeqPfLXu ig9+XueZ8OwYUA7aWwThE7i42mq+qSSWnKQ1gkRnmXUTXu1p11gjFGchSQP+JKA2VtkC zQBgJpdtezVGO05LhAcbYir+mdngrwMuj0U1oajZ6ajP3QPZAjJWGR90hwi6xAhFpwfK o9J60ZRFeXEFTiQxB4ke0mQcd38fFFGvTw0SeYyYxvMbSrwTX07PrmWQnXV/ldvtpCwe 32FZa15+EjCZ7SMutPYU0v109xXEtARA66vTW7FJ8Mc92zUC9yGFsP/DxbrX13zx2xYo oaeA== X-Gm-Message-State: AOJu0YzASH5YBUbcos01WpIcFFrLHcYRA8/+PFxpAF5Kn0SEZowzYfk8 Hm6by3pWaNGENqn3xoTTuzIYnNDgTgEzGo8CngMxTw== X-Received: by 2002:a05:6512:701:b0:503:655:12e7 with SMTP id b1-20020a056512070100b00503065512e7mr1356840lfs.62.1697721002787; Thu, 19 Oct 2023 06:10:02 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id bt14-20020a056000080e00b0032da4f70756sm4518629wrb.5.2023.10.19.06.10.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/9] hw/intc/pxa2xx: Convert to Resettable interface Date: Thu, 19 Oct 2023 15:09:21 +0200 Message-ID: <20231019130925.18744-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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 Factor reset code out of the DeviceRealize() handler. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/pxa2xx_pic.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 47132ab982..2eb869a605 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -271,12 +271,9 @@ static int pxa2xx_pic_post_load(void *opaque, int version_id) return 0; } -DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) +static void pxa2xx_pic_reset_hold(Object *obj) { - DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC); - PXA2xxPICState *s = PXA2XX_PIC(dev); - - s->cpu = cpu; + PXA2xxPICState *s = PXA2XX_PIC(obj); s->int_pending[0] = 0; s->int_pending[1] = 0; @@ -284,6 +281,14 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) s->int_enabled[1] = 0; s->is_fiq[0] = 0; s->is_fiq[1] = 0; +} + +DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) +{ + DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC); + PXA2xxPICState *s = PXA2XX_PIC(dev); + + s->cpu = cpu; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -319,9 +324,11 @@ static const VMStateDescription vmstate_pxa2xx_pic_regs = { static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); dc->desc = "PXA2xx PIC"; dc->vmsd = &vmstate_pxa2xx_pic_regs; + rc->phases.hold = pxa2xx_pic_reset_hold; } static const TypeInfo pxa2xx_pic_info = { From patchwork Thu Oct 19 13:09:22 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: 735544 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507524wro; Thu, 19 Oct 2023 06:12:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWuTrkvcTMF4OmZHiO/asPZHyXNO7LOpjZ8rMl/AigWrlvO9uhdDxRZwIgK/6iNzLvOF5I X-Received: by 2002:a05:600c:35c4:b0:406:c6de:2bea with SMTP id r4-20020a05600c35c400b00406c6de2beamr1844491wmq.17.1697721126524; Thu, 19 Oct 2023 06:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721126; cv=none; d=google.com; s=arc-20160816; b=0lhqihTggKGKOFkJPFDwlpaAd6Xb7Bq1JP905bWkjLCByD/EtlhHIj2hGdJp9dYzHY rSTNJeC5Zja/gI36zJvWMWkNp1CCluMex5ZV4cVdZMPpHMPwG9lqPIqqY1U0wTq0Y5pS gJDSet/OlL23CjsXpuhobG+Mm70xyIf5FGG+5SuzZYunwFLBjQTebyKBqom95fOj5mqI 75BwHGpjU4merkA2/6ZDnU558kfugFlboP8mYZbnlFA/l3MwRrJnlMwjQVGibDw+SPq0 I2DUHs+fd3Fb0B+56sbnH2W/S2Z2oZ/R5lzpTpFUnXNECe6zdxlFCW2CIO3y3gdf1bBc XOnA== 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=P7lOMMVZ0k3kr3Gw2scoCKlOl/88LjZpUwUjKaLeNvA5IcEQqKLmyUckaKP7ETEN/H XXuefUyWgbXBdeyZ1qPv9eIaiJdMyWTm9IiKTFUFierB/920gBWC47MuZWeGboP8a3KL F7eF7JSR19wREu41T4W6N0jbBUNQUPIDNmfbfqYGN/c2pYvQzGh7BuPJgYBr+k8ds/OM 6NqkyLWJRk7J26bdbovWY1Yuou9KQZMeE+edALqE/U7W03jOFKa4KSo4rBkMmaXlC1jx mgx12uKF+OkQA6JgfOo61cKyJdKRhH3pnl76QHxuEwPbv4+D2RoYcTlHxx0o2wQp5PDr i3yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWD6Xe2o; 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 n4-20020a05600c3b8400b004083e1d6de3si2328551wms.51.2023.10.19.06.12.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12: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=RWD6Xe2o; 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 1qtSn7-0005h6-LS; Thu, 19 Oct 2023 09:10: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 1qtSn0-0005OE-30 for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:14 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSmx-0007z8-QH for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:13 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406609df1a6so72834785e9.3 for ; Thu, 19 Oct 2023 06:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721009; x=1698325809; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=RWD6Xe2o+7QqJPE/q0O/ioZ6oa6/FeioX42H3ci+ZkC0xlXqvGcWUdZPtG6DohKyMM 4YXeJ/ZyYJcXuxV6Y5ANEfh1Sw/qDjFkvcpMk67/FfQDC29D31VHzpnFrGCfowrKI7BM DdVxZEetBnixBT1MLTp7waEkZ218k9hZACsybrywvFrjReWYGhNVTjjirNJWU6DUzwQ3 iKjj1szTRt7THElIGZYDXPxe5vRSjNRY34IDpCFGQIasITr6uWGtlX5mAbcxhrNe7/Si IJKKSscCj/qxnuJ71sudOtkctqbuaozrYKo7eFD1BYlxu1kibz4mggJMFNgu+5ltpHSK Ch3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721009; x=1698325809; 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=RG5zLlWN/LC4pJbPVJoFLnGQz4i0tpH2bVvTXsYTeOI=; b=LW6m9ZdOV8a5A8kqw7Anu+SjIlNbVrH/Q5O+eqr0TeMNncvj5cN8eKdpZuVVHMBA7w 50tDYUIVjyc1IpnU+jqPJaaD0+ronBiFx873rBVLMB8k+ylD8xsA2dxLc90Ow654eEqS a5jnxOwaxFM7V1tnb0t08vQk18oB3UItKe+LnbwVgN5E5a5mfjYsjZwY4+hdM3QuHG0k Vw6M28XD2vnBUqSCLbThN3UFsIICSvrYcvIXvw14o81hx+Ra0ON73cdGBh+hyoT2FpXF QC6SpeL8YSN/UyMhqI/qUWNdPZTAeuLwuSRUKoOprjwMXpuBLRS2Ew9aos8uqwl9mzSW +7FQ== X-Gm-Message-State: AOJu0YzvVlc5M/qS3qjGvEMzouI3lpoMqytCkLxx5ZZYbpu6N/I4hv17 6VmdKfx7h0vIJxTPzs3ZA6mSW3mMuwsfuX2AsV2Ycw== X-Received: by 2002:a05:600c:a07:b0:408:3f64:6553 with SMTP id z7-20020a05600c0a0700b004083f646553mr1746777wmp.16.1697721008600; Thu, 19 Oct 2023 06:10:08 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id r16-20020a05600c459000b00405391f485fsm4456618wmo.41.2023.10.19.06.10.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 7/9] hw/intc/pxa2xx: Pass CPU reference using QOM link property Date: Thu, 19 Oct 2023 15:09:22 +0200 Message-ID: <20231019130925.18744-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.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 QOM objects shouldn't access each other internals fields except using the QOM API. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/pxa2xx_pic.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index 2eb869a605..7e180635c2 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -15,6 +15,7 @@ #include "cpu.h" #include "hw/arm/pxa.h" #include "hw/sysbus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" #include "target/arm/cpregs.h" @@ -288,7 +289,8 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu) DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC); PXA2xxPICState *s = PXA2XX_PIC(dev); - s->cpu = cpu; + object_property_set_link(OBJECT(dev), "arm-cpu", + OBJECT(cpu), &error_abort); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -321,11 +323,18 @@ static const VMStateDescription vmstate_pxa2xx_pic_regs = { }, }; +static Property pxa2xx_pic_properties[] = { + DEFINE_PROP_LINK("arm-cpu", PXA2xxPICState, cpu, + TYPE_ARM_CPU, ARMCPU *), + DEFINE_PROP_END_OF_LIST(), +}; + static void pxa2xx_pic_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); ResettableClass *rc = RESETTABLE_CLASS(klass); + device_class_set_props(dc, pxa2xx_pic_properties); dc->desc = "PXA2xx PIC"; dc->vmsd = &vmstate_pxa2xx_pic_regs; rc->phases.hold = pxa2xx_pic_reset_hold; From patchwork Thu Oct 19 13:09:23 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: 735545 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1507551wro; Thu, 19 Oct 2023 06:12:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEa97uG37qFEg+SHn7S54GldTvAKJMIRW3urwdXCmyeO758rItdX22OKGUf/OGCCZJEjzKl X-Received: by 2002:a05:600c:4714:b0:405:3d41:5646 with SMTP id v20-20020a05600c471400b004053d415646mr1994219wmo.2.1697721127690; Thu, 19 Oct 2023 06:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721127; cv=none; d=google.com; s=arc-20160816; b=Y7EYL6n9YWqgB8XtHlpdnFe1AuG+8NahdphQvr0v0WK9Z5zs0j+J9fk9kTkhWQw01n P0Gy3saeAni0owuly3lsyNZK1xBhGBMHk+xnuwLc0hqzwljQgfjCaVgsMak3owLpt/Uh AKHGwvhhIcMstmV4vB1Rr5sc9fFFm+fAgoacFRxB5dkyNIP+QnYpKuGGFomRtd8fEAN3 bwKJaorq3EfXFVrrEUznmFn9tVKKokbz+xp5/JkXm32l5eNKW4Y/8BknKCmZxTygNnOF U7+H2sCmIJG9G+SZnNEL1xbOkWcp5CM64bm1VnVvm75OL9yfppVgQvjbyH54qhG79bzb IrMA== 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=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=WQVDUmpgXkccH6iQrljC6f9tqt8RbqoV6mRCus1T1+D+nua8k1O74uaJnsssQPGlWT doJ5jZMc/4c5a+LYpzncSrd2F3StfYe9xfTKxiJVu+ZwSVOA/8Mo/E8uhjiN/I9iuEiv hgnV665D88PdGoiaU5dG93iGJ0xOY2gfOSm3vsdSX71+s1CGfd7pd84NZ/H66R20h/1L 8/27TQHcJQr193KT89dil/IBYAaM1rGRdl9udQYfBjIHwe9nTCgLwd+MLFvInPArYrrl l9yTx4DYe77UN5Crivp60IiifLRsqhCv+m1oGZFboT6r91zXL8BEisGVGLNTlQN07f6A sKGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RkTgFM8f; 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 e11-20020adfef0b000000b0032d9056da79si2697399wro.599.2023.10.19.06.12.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:12:07 -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=RkTgFM8f; 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 1qtSn7-0005h9-PQ; Thu, 19 Oct 2023 09:10: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 1qtSn5-0005dJ-BD for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:19 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSn3-00085K-6K for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:18 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31f71b25a99so6853312f8f.2 for ; Thu, 19 Oct 2023 06:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721015; x=1698325815; 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=RkTgFM8fg6H1DlCEBPBowU4aLivDDNyXf1c5QGyIjjhldO98ezgd4C+eSURS5cbq2x GNlifTc+fazdYfAN2tl6pg4Y6aATiEg1aB/WgWVSnvcDtBOs67QwfI1zmRmTdJJOQTEZ gVRycj/9Arw6t6JiBD2W6fiY0hdXJ/RqZPrmVnm+ckae9f+BuPh3Rv3IJ7ZnKQ5o+hDA PVXXm1Ur1K/Bq1QlZr31e+ekpwfT8PB34JLnBxlImHjqeULKyzWLFBbBlh59AMEkvrLJ vTHez2BNCHCJt73c3j22DDoRKXrjaw/qFtBpzvqK5+GnMC39lWmXUGnhZwqwXWtDzAPQ VgOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721015; x=1698325815; 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=ITePQk8wBGmHw/tB+NNXr4lzfM0dSnA666aa/gOVtPjLqZEW21kYZGZCeUYpRUhBtp u6//nyvD2Qk7riToRKFxi+lLXMnySG5AIoe8kQPOyc8ER6Q5ivNje785Aw9YZY7kStOc /PKLPO6QB6dcd4DhZY35mw6eNhNzjYEPU6Z1uooYyhaH5mSjZVpZ3JPFpisTLp4fExp4 RoH8uxaYPLsjoyExgFQzFdtsqrH49EzAIdUgHyVQItf8dRs4SVd3d3qrPPkuqk+Qa4Ti 5d03zlYMP9vOQvFANE9cD4jz9uTxCA+woO8p6XlBur2V3yEuENfwdMGx5LuWTqUn74fT Xytg== X-Gm-Message-State: AOJu0Yze3jkCoi9eyd3Pz2MY40k0DWi6e3WmNn8CLNOzd3kfWNdoDQ2I xUzOKBi5/T+f3FqHh67c4hOn1OmN/SSsiLM27AVphQ== X-Received: by 2002:a5d:66cd:0:b0:321:677d:98b0 with SMTP id k13-20020a5d66cd000000b00321677d98b0mr1477106wrw.11.1697721015193; Thu, 19 Oct 2023 06:10:15 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id l16-20020a5d4bd0000000b00323293bd023sm4461613wrt.6.2023.10.19.06.10.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 8/9] hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() Date: Thu, 19 Oct 2023 15:09:23 +0200 Message-ID: <20231019130925.18744-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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; From patchwork Thu Oct 19 13:09:24 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: 735540 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1506778wro; Thu, 19 Oct 2023 06:10:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrPdMEJroS/kL1OvZQ6FRSwXDqcc46AYnWuE2LFBWR4gw3w/sgNnKQidylMYrayCBR6lhz X-Received: by 2002:a05:600c:470e:b0:407:5b54:bb18 with SMTP id v14-20020a05600c470e00b004075b54bb18mr1836558wmo.12.1697721040170; Thu, 19 Oct 2023 06:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721040; cv=none; d=google.com; s=arc-20160816; b=AD3DVoLJPKcul5bn4+DrAIYKYBWPLVZo+pH3DmV8Xora82lzql7cooN8Cn/who255l JnThF8Y8SE8OOBda5JaEBwdzf1BukmtJCj7taqzYMdfcKdsJeyAZNn6/i5VAGJHJzHaR RmKYd1H0TCcCU1nlLw44Tq/rdvNYK9knkGTT0ElK83UmMFxfYghc490N3AUDN9L+jQ5T M9iSg+mt7ylcX4O6IMtmVEaU+uWca0W3rj45de5XDF1hlWMrULtGz+ixXm2Q50o6d4ia h0hOwbaYoPBlXRqhmQwB46h0vMWwOnV8B9IwHK0hkDAW08L8Tb7YPQULR7gUsFRy9KAB 534w== 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=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; fh=rYBZhAJdgCvxZRRcO2tKw9iXjHkAG8ZfVdmqU/2KeAE=; b=K3VgFLL+qPmIM937rbEkwK/kuMh/XBLnMJHFmpBpNs8HZEz5QNizKYPlTkRKVqJli6 5OQCn72QCfxP3SLZC8Nc79m+mcBEMf95uhAWXrwUBDSI0Nkk1LF9BNaIUkdLPfYbAOoX QFi1ivS67VfXReUUFNwbMgXzrH2pdJstHoa/UGFGVhJbvbJ7VZSjs8YdoBNnicRHeY35 yA/fpcadQO8aWA0ADJhS967aVgqIMDVl3dhWpO0mtDnMoHtTQ4DgW11NimjafYHcjdbD HT0p7GhAqtz2GTYQf3bhQy1ovpcYpauDmULGKV13enbrhkF0sa/r6WPwqykEdA9kx9jA 1uxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tTlJfgfF; 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 4-20020a05600c024400b004064123c69esi2393972wmj.92.2023.10.19.06.10.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 06:10:40 -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=tTlJfgfF; 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 1qtSnE-0006KV-NT; Thu, 19 Oct 2023 09:10:28 -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 1qtSnC-0005wY-1u for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:26 -0400 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtSn8-0008ED-TB for qemu-devel@nongnu.org; Thu, 19 Oct 2023 09:10:25 -0400 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso116091921fa.1 for ; Thu, 19 Oct 2023 06:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697721021; x=1698325821; 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=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; b=tTlJfgfFTTti9T7ef2mjZmwlgwquxMQHtMBIfvTBQPlHRKPiaZIc3HTOU6opKGCJdL Inbe6F7veaVsjcf09k0wNWrDA5zj70/uFO0aauYPVYXW0TM4MtuzS+YxyDqJeQFWR64E ImSFy7CYO/gle+5yJ+C0CGaTNEtl4SSa0ITq4LfvqlkrZyzJApMFR4dHBPNvHSZfN60q 6hljErKdy3oio3Vyu3Th2hVhBiYrl3ZbX6fYn8btEIqTED6Sm6HJ4GGdwqthl0y45g+4 BhGRDWk2CWqdmJyGMRsv/LcweeSj4kbJw6tINhiQObzTNYkc9rt+8/eBcksakjLOiFYY EGkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697721021; x=1698325821; 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=7XHyEIGArD78mgw8R7PN08IB8dbr9alKW/qdS4/dSAc=; b=nvsYoDhuJpY05Y4qyY5SEjNpaA3khd1LsqkCT4xlrU6XwHEJ7DI0ly706/bR1OjjYW 6Xmh0+2X5dgm+JBjaRAcQ8x0eZRdvCfEDGy62FD989IQeddy5hhxuhoI+scMV+U8ZZhr lCbt4DLxA8M8tH6NuSWlKjR89/sblEhSZc7bXigiRFFQTYDcvXe+qAgU0N9rbb5yGiUw FKQln+9dZnxJ09c90aiqPR2G8KxaH+cpKcfNfOP75xd+K2B8uTEn7HJtvwAXvTiRSh6y rskFZpkGf26KslFA5UuU8Wmd8zq+N+vrdemOv+RtpAQtH22O+l8J07WsWki4N8XP/ATH Gr5A== X-Gm-Message-State: AOJu0YwWtEbGgTsUXyOqzQm2FQ9lRthWMov5lbGcl6b66lscHY7z++M/ 86Y3D9hbd9OgnOPxRHKC3r64S+UYn4tVFDQlcLEegw== X-Received: by 2002:a2e:b601:0:b0:2c5:1a89:41c0 with SMTP id r1-20020a2eb601000000b002c51a8941c0mr1329995ljn.23.1697721020837; Thu, 19 Oct 2023 06:10:20 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id p15-20020a05600c1d8f00b00402d34ea099sm4421837wms.29.2023.10.19.06.10.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 06:10:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 9/9] hw/arm/pxa2xx: Realize PXA2XX_I2C device before accessing it Date: Thu, 19 Oct 2023 15:09:24 +0200 Message-ID: <20231019130925.18744-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019130925.18744-1-philmd@linaro.org> References: <20231019130925.18744-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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 qbus_new(), called in i2c_init_bus(), should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/pxa2xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 601ddd8766..f0bf407e66 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -1513,14 +1513,15 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, qdev_prop_set_uint32(dev, "size", region_size + 1); qdev_prop_set_uint32(dev, "offset", base & region_size); + /* FIXME: Should the slave device really be on a separate bus? */ + i2cbus = i2c_init_bus(dev, "dummy"); + i2c_dev = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(i2c_dev, &error_fatal); sysbus_mmio_map(i2c_dev, 0, base & ~region_size); sysbus_connect_irq(i2c_dev, 0, irq); s = PXA2XX_I2C(i2c_dev); - /* FIXME: Should the slave device really be on a separate bus? */ - i2cbus = i2c_init_bus(dev, "dummy"); s->slave = PXA2XX_I2C_SLAVE(i2c_slave_create_simple(i2cbus, TYPE_PXA2XX_I2C_SLAVE, 0));