From patchwork Fri Feb 16 15:35:12 2024 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: 773340 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1412888wre; Fri, 16 Feb 2024 07:36:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUpMoKAm0B7CFKTPGW3hnAat4Z13ne5mXqzszSYb9bH90KUrPuzA5albG2wnjjd5zPXMv49J1/BGAciHXVLGWwT X-Google-Smtp-Source: AGHT+IFmCTdWROGYcS9eCLyXQsWINuR6WJhlrpcBDu9vbwIxAvtAap+Zt3P9lxR9W53RGcB6d20+ X-Received: by 2002:a05:620a:2236:b0:787:3304:ce36 with SMTP id n22-20020a05620a223600b007873304ce36mr4600295qkh.26.1708097807325; Fri, 16 Feb 2024 07:36:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097807; cv=none; d=google.com; s=arc-20160816; b=jeE0LXP5zGGdvX9uyy43xDV59Uy/6x1TS/mKhOGsiUl/pFoFFDUXO6W9tXjDI3sMkf 73dn+4OqARMGn2nw+o90ZZQg3VfZ5shdr2/mKQ0mm+ZAD/h/t6AcyZY3q5CqhFT5ekZh 3n0oQw1ObbvpbXm+yxU650jhq57uJxt8CO271UHYQw60vs+/iWU9R7egE7atRJiQ4KYz UKv2twd33GPJbg2n0PvfDSfPl8RZ0cBLJcZeO0d/xjUPyUakzteRzHHg5DyM4U2G6RE6 9aUPoUlDR56hp9moP7bH57AQObW+kzCjddVDhsO/WsSbM7KLy2wQLRnRRdrwOR7CSqx/ OIVw== 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=kV0Ad1FDMlSK0WAR0PyajC3eAS8o+2asLjvJepPvncc=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=IeLLsi31KygUFxttnoRNg8c7mnB4oeNQEDQx5jAtrkTt2+ue2LcDfDcF490B3CsuOU N4aAnM2bD+lDl7ZxwzeHQrpcUPc7RPHpO3thv9d35fou+tEc0/FjFm9b+iec+qSqSRJC rlJxgmfH9kFMsDJgFDTHfoUqtdlyEn8y/2x8QOBu6iKIeylwF9C7WI8wrG8za5A66j6Y IYNDkfU8dmWpB19Lpzqw+RuTed44rw1t/0S9DXA1ReHrbM9OmNTuVBORYos1KxNlOzLx qQqkUL3jUMrspHEgs7WokYVw/3Qx7o6Y69DHaBfEytVC20VoLkwdVJH9bEmtrLab6Huv HwIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HpUsT+Rl; 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 d8-20020a37c408000000b007872e2ba7c4si114542qki.65.2024.02.16.07.36.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:36:47 -0800 (PST) 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=HpUsT+Rl; 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 1rb0FT-00044N-GF; Fri, 16 Feb 2024 10:35:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0FQ-000437-L4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:33 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0FN-0008AI-Ry for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:32 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d220e39907so2713421fa.1 for ; Fri, 16 Feb 2024 07:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097727; x=1708702527; 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=kV0Ad1FDMlSK0WAR0PyajC3eAS8o+2asLjvJepPvncc=; b=HpUsT+RlZVpYnQ6h9RCN+nUP1cq60oJ5XTz2Wtf557ztUG3ojkGYgh7iQLX4BVIO3o UkNYCbIMSd81wxIGBl6GGgQuNJyuM/CcY7MocFJlllFzvm8BbH4d6JWMKFEerpciD18R g10EnuZHiVpMCb8fp08hs2iBjoGAVdNOzjMQkO3dpc67UlaK7KeS35wBBumbHvWV43io 7PlQ2KuqGI/OhY4shGkiws4MZm3hkkKn5N5B2RTk7Q4o1p1n8Ab1Wpj2UWTvAtUeCz0a v8264ovUU+OX/Jc4esMED2EQgeqGOuputz3ngcaDf507JyoY7L6OqntbM2vz2tztaj+Y cvJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097727; x=1708702527; 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=kV0Ad1FDMlSK0WAR0PyajC3eAS8o+2asLjvJepPvncc=; b=rhooZrIReiuYjf/RmtdtS5TkVWQlLTAwkWCiAk+ZRNxgffinsq2zUnKRfYjIj1Wr4c nAgECbpuem/Magi83/EAH3GiRKo/+rcF8hX6ZOOPWly7k78luftYdXpmo7h2u4EdjaSO boN8cQdIcuC3XrrCApczZ4siH3R9r0HQS8qrvuuahQ1RDt/uxJ0VDaPOQ17RlL10qgfw sDPdweOBM9JOHRBMfib2pc7V+CzbIh3eP5vN5/saff/55f4YcZXzWYFAe9fU9Tt0qjZb UUVbFU59AaxYh4kmcxKCjTvW2G0+9eawu8pifMqPg6KhFvM3pFzOce52IdkGZx9kHb/7 B3ag== X-Gm-Message-State: AOJu0Yy6mzoPpBZygBmhkxaMWs5X0zHRgjiwpNyLJ+Xdlw9BmlwgsLUP Iz4x8yy/1QvAmW86h/mphW2uKi2SbClEm7o3MPkyqATQiw5BbarLcQfHDmd4s8wSnjMZA62q2fX f X-Received: by 2002:a05:6512:20ce:b0:511:78bb:1a4d with SMTP id u14-20020a05651220ce00b0051178bb1a4dmr3559454lfr.17.1708097727158; Fri, 16 Feb 2024 07:35:27 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id rn28-20020a170906d93c00b00a36c5b01ef3sm42951ejb.225.2024.02.16.07.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111) Date: Fri, 16 Feb 2024 16:35:12 +0100 Message-ID: <20240216153517.49422-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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, T_SCC_BODY_TEXT_LINE=-0.01 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 We want to set another qdev property (a link) for the pl110 and pl111 devices, we can not use sysbus_create_simple() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 5 ++++- hw/arm/versatilepb.c | 6 +++++- hw/arm/vexpress.c | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 9058f5b414..77300e92e5 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -238,7 +238,10 @@ static void realview_init(MachineState *machine, sysbus_create_simple("pl061", 0x10014000, pic[7]); gpio2 = sysbus_create_simple("pl061", 0x10015000, pic[8]); - sysbus_create_simple("pl111", 0x10020000, pic[23]); + dev = qdev_new("pl111"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[23]); dev = sysbus_create_varargs("pl181", 0x10005000, pic[17], pic[18], NULL); /* Wire up MMC card detect and read-only signals. These have diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index d10b75dfdb..7e04b23af8 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -299,7 +299,11 @@ static void versatile_init(MachineState *machine, int board_id) /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ - dev = sysbus_create_simple("pl110_versatile", 0x10120000, pic[16]); + dev = qdev_new("pl110_versatile"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10120000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[16]); + /* Wire up the mux control signals from the SYS_CLCD register */ qdev_connect_gpio_out(sysctl, 0, qdev_get_gpio_in(dev, 0)); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index aa5f3ca0d4..671986c21e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -276,6 +276,7 @@ static void a9_daughterboard_init(VexpressMachineState *vms, { MachineState *machine = MACHINE(vms); MemoryRegion *sysmem = get_system_memory(); + DeviceState *dev; if (ram_size > 0x40000000) { /* 1GB is the maximum the address space permits */ @@ -297,7 +298,9 @@ static void a9_daughterboard_init(VexpressMachineState *vms, /* Daughterboard peripherals : 0x10020000 .. 0x20000000 */ /* 0x10020000 PL111 CLCD (daughterboard) */ - sysbus_create_simple("pl111", 0x10020000, pic[44]); + dev = qdev_new("pl111"); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[44]); /* 0x10060000 AXI RAM */ /* 0x100e0000 PL341 Dynamic Memory Controller */ @@ -650,7 +653,10 @@ static void vexpress_common_init(MachineState *machine) /* VE_COMPACTFLASH: not modelled */ - sysbus_create_simple("pl111", map[VE_CLCD], pic[14]); + dev = qdev_new("pl111"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, map[VE_CLCD]); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[14]); dinfo = drive_get(IF_PFLASH, 0, 0); pflash0 = ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flash0", From patchwork Fri Feb 16 15:35:13 2024 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: 773338 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1412743wre; Fri, 16 Feb 2024 07:36:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVEabTXsjnDXIV67eMHlSrFygk37FlmZRnDZaQL8vDqKyM2WKgO4RExbXy/lhSgl+jqx0P5iHvyw4nqfJeLtm6w X-Google-Smtp-Source: AGHT+IFO2HKwhDfu4eQNe0nxEHm/ikNoPN+HXmyTECz75Pkd83TTIXTmvcnadvdYBQ6bsXECB65M X-Received: by 2002:a0c:f349:0:b0:68c:92b5:f67c with SMTP id e9-20020a0cf349000000b0068c92b5f67cmr4974774qvm.32.1708097795197; Fri, 16 Feb 2024 07:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097795; cv=none; d=google.com; s=arc-20160816; b=cnkgbi5pZ5YRi6DDAShB09oGqLgE+DzvYTO7jyzaJJoveMqCpOqeSnVpFdR449N0X/ 07NMWGAkr+ssGqXCHq6ApddnYCt9cknKW/Y3Vg6i+w18UDsRTfb+W1Di6uwkYJ6cMAz7 HSbX3Pi56sseFk+JxsS47G9FB0O7Q9diu34Qtozh3U8WOU3Kp5Kxo6RZM1T8IwCaRpm8 8J5r0jE1PZ6hgmi2M98OVkuyUinImkX4r2cZCgHQSZs2Jg/C0grQeXp1aXPZTvHNvIcz 5xta4RQ9s9yCXkp7GHGJEb1BLAXCfSx+8xzVherRww6/+9q1kpAhtOTQEsD+DKAzrLp+ S4cQ== 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=wZ1SK8UcIGNjoS5oUCJZaLlSaFI2o9jBSpbbsKbpCUU=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=nNQN5zBfuJoIcHJWW1nzfVqW2RFWP5KkZ8a8a0bPG+gcKv3stpTmNi2rzR0wH/m8od QGBvh49zkNiaaAu8VX6YPVF2ACXVlvSwfwniub6BekxtQILlQ2SxVFld/4bL3QZ+ZrXD retWDEYlUKqXjmxXndcuenKgEZlDSoGP5BN+B/eCcbLNF7NkEKXKoSvOP9M4mMLBGWPC 0GYDB22PQe9GkegMsDDcy/TR1V8z6obxXrcJGI1lkoip/vJzZAKoCwZYo1cuUMSv7GxN UkO8PXZIjJxcTk5KdumivQ6KdJn29wCxmCGcCV7uol64I29ab+8bdIT3wQy+J1V7eQ7k nBNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CNuSANL2; 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 iw15-20020a0562140f2f00b0068cb7b24a38si4163105qvb.339.2024.02.16.07.36.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:36:35 -0800 (PST) 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=CNuSANL2; 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 1rb0Fd-00048v-GR; Fri, 16 Feb 2024 10:35:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fb-00047P-I3 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -0500 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 1rb0FT-0008BS-NL for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a3566c0309fso266609866b.1 for ; Fri, 16 Feb 2024 07:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097733; x=1708702533; 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=wZ1SK8UcIGNjoS5oUCJZaLlSaFI2o9jBSpbbsKbpCUU=; b=CNuSANL2Eops5l//6bnMB1f2GchJ+D5MDNthI3t2EeyRdclohcB98lzc2IWbt9q6Bj c7nO6O9sViqemSNMKvb11m/VMLi/8J1ZwQcQjbJfhkh+F2goYi+zJNSzTxMkwRkk89x9 UaFfYjlH4MHJ10BUPT9FFyG3+jxTPxW6nNbtoLAZI/sv6OuM9Ml44qjiyKnOrn1THhHH MPTnbUqGZPbO8cRlUKpNNtuCxC7OdkndXgCWBJp1lCXRI23Y4v9ezZE6nNtG0UCQ3QkL r8eaUBlgkeEQYPLv/sYCmXNIzBb7o7gJrjgJduFuFSeriZMlXF2AQhYZvYhmUsun8GoI KCXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097733; x=1708702533; 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=wZ1SK8UcIGNjoS5oUCJZaLlSaFI2o9jBSpbbsKbpCUU=; b=BrjHjBgSbBKCrqVusad1nI6LdiZbat2AT0HhS/3XHSmowgaEW0MvPjLKvvFbLuZjuK pgdkyQ+bBabrdyNEyWLwiIMpmGkILdPIe6T+a42bYKlUNm229u0RzK4DuHoCKojU90yB xBLPC4aI3wdeRpMaHAxfVJHcBz7gub4T2nZGO2fM9P8RtgZRj25aEfVCStZg9H42d4kD JvLYjIsaIGAy8rhUyV51hJmHkAHqoiLo1W6tSmurPWrgJIs5Ul7/cmi/mFI0nE8Ckof/ 7X9m6oG+Ncha7vuWPtd21s5IgYa6WBbrUssdE513fITvE5Bnmrjih4r4CRR0ba77lpfq iaTA== X-Gm-Message-State: AOJu0Yyb2q+/qZD9CKZS2SHAKEnhTweWJloyvk84dagYXpWN3nAzWR8o 2Wy24llEP0WIdwj6nqMcOMGpFuaE1u0stS4ZzKVhpO3mNm5lUZ4Kd+aHeBPGutfuHVuEKA/+mqj u X-Received: by 2002:a17:907:119c:b0:a3d:4037:73e7 with SMTP id uz28-20020a170907119c00b00a3d403773e7mr3369329ejb.48.1708097733048; Fri, 16 Feb 2024 07:35:33 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id qw17-20020a170906fcb100b00a3d25d35ca5sm52716ejb.16.2024.02.16.07.35.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 2/6] hw/display/pl110: Pass frame buffer memory region as link property Date: Fri, 16 Feb 2024 16:35:13 +0100 Message-ID: <20240216153517.49422-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Add the PL110::'framebuffer-memory' property. Have the different ARM boards set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 2 ++ hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 5 +++++ hw/display/pl110.c | 20 ++++++++++++++++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 77300e92e5..b186f965c6 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -239,6 +239,8 @@ static void realview_init(MachineState *machine, gpio2 = sysbus_create_simple("pl061", 0x10015000, pic[8]); dev = qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[23]); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 7e04b23af8..d48235453e 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -300,6 +300,8 @@ static void versatile_init(MachineState *machine, int board_id) /* The versatile/PB actually has a modified Color LCD controller that includes hardware cursor support from the PL111. */ dev = qdev_new("pl110_versatile"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10120000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[16]); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 671986c21e..de815d84cc 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -299,6 +299,9 @@ static void a9_daughterboard_init(VexpressMachineState *vms, /* 0x10020000 PL111 CLCD (daughterboard) */ dev = qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x10020000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[44]); @@ -654,6 +657,8 @@ static void vexpress_common_init(MachineState *machine) /* VE_COMPACTFLASH: not modelled */ dev = qdev_new("pl111"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(sysmem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, map[VE_CLCD]); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[14]); diff --git a/hw/display/pl110.c b/hw/display/pl110.c index 4b83db9322..7f145bbdba 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "hw/irq.h" #include "hw/sysbus.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "ui/console.h" #include "framebuffer.h" @@ -17,6 +18,7 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qapi/error.h" #include "qom/object.h" #define PL110_CR_EN 0x001 @@ -74,6 +76,7 @@ struct PL110State { uint32_t palette[256]; uint32_t raw_palette[128]; qemu_irq irq; + MemoryRegion *fbmem; }; static int vmstate_pl110_post_load(void *opaque, int version_id); @@ -210,7 +213,6 @@ static int pl110_enabled(PL110State *s) static void pl110_update_display(void *opaque) { PL110State *s = (PL110State *)opaque; - SysBusDevice *sbd; DisplaySurface *surface = qemu_console_surface(s->con); drawfn fn; int src_width; @@ -222,8 +224,6 @@ static void pl110_update_display(void *opaque) return; } - sbd = SYS_BUS_DEVICE(s); - if (s->cr & PL110_CR_BGR) bpp_offset = 0; else @@ -290,7 +290,7 @@ static void pl110_update_display(void *opaque) first = 0; if (s->invalidate) { framebuffer_update_memory_section(&s->fbsection, - sysbus_address_space(sbd), + s->fbmem, s->upbase, s->rows, src_width); } @@ -535,11 +535,22 @@ static const GraphicHwOps pl110_gfx_ops = { .gfx_update = pl110_update_display, }; +static Property pl110_properties[] = { + DEFINE_PROP_LINK("framebuffer-memory", PL110State, fbmem, + TYPE_MEMORY_REGION, MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void pl110_realize(DeviceState *dev, Error **errp) { PL110State *s = PL110(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + memory_region_init_io(&s->iomem, OBJECT(s), &pl110_ops, s, "pl110", 0x1000); sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); @@ -577,6 +588,7 @@ static void pl110_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->vmsd = &vmstate_pl110; dc->realize = pl110_realize; + device_class_set_props(dc, pl110_properties); } static const TypeInfo pl110_info = { From patchwork Fri Feb 16 15:35:14 2024 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: 773343 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1412992wre; Fri, 16 Feb 2024 07:37:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8w5z0xF+mbgVbmN5qkMS3k3tiWF/uyESSpvDrPlLVMz+FOkAFp46f113fVFMn2qr0n9mg25NQw+m83SJTKjks X-Google-Smtp-Source: AGHT+IH16sOj4XAcesgh6DWTm0Ev3tZKgQi72q5nUMsVIlSI3S8bvsQEZUA7AjCjaFWc6M3Oomi6 X-Received: by 2002:a9d:7743:0:b0:6e2:d9bc:5dc0 with SMTP id t3-20020a9d7743000000b006e2d9bc5dc0mr4672219otl.38.1708097821806; Fri, 16 Feb 2024 07:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097821; cv=none; d=google.com; s=arc-20160816; b=Glx3YFZg+Ev6OPFd40Dsurl/Mjt+HqvyzDPM1lexaqtzd++N15rBspNPluTUP/rX1C f7X9kYz029sMwpH3ZidmkboHmuvTmycR/dyQDecI7wPJ7bKVxXAbaZoj3aBbSx5PM5tx 0zkPDXwsCOIcCCkvSIwwiemrVYzLkAlaB/MBWNZ/1bkWx1S8jLFXDiRqwgN1ekd2apXr Ai7UjHY5jpy6iIL8CVx5rS3Oxc0ZdSz3OTFi2jFWOCTTGG/WMsANlhZIINLQoZAgatI1 FyE/MDiYr6ESp2kTHEZUFB3FIGFYqsMM2YFCEE5cH2ledMu+jtbuLssXTKPQqyz25ssK hFdQ== 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=FHq12xVLql3ZjDkC8k2lRJAF5RJwUJ4vzRZ5Ca5vbxw=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=ptvr6Gvha7Lr7dMupYSgBljX995qjQQ7JsWWuqUG5Xb3ZR4YbqsQ/AZM+nXpSbCW1D iDSty+vj8gz6mtUX3qq5tE7lLm8ID7XEYUpxCjRiNgyyXMO4CpMalhr7WWo68g0XM8R+ 4PdNsN5JnwWOz2Ebrcb+E2vv8pNpoWLOn+knxH43T6r902n1UiGKKoc+LFnbisoutAJn yy6K4HqtKlDgK/HopIFuShF7DNd5czRDaJpA7FYc03uKwQcvncpOlmMr/VnBnnjvHRTW bOiwXfAz2xP334XD7dUB4xPRScuOwWyQCNHvko14aQxRrR3m0zsHumyyRdK7akvLELFK 0XIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGUvTxVn; 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 b19-20020ac844d3000000b0042c7859cd53si51418qto.247.2024.02.16.07.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:37:01 -0800 (PST) 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=aGUvTxVn; 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 1rb0Fp-0004A8-1G; Fri, 16 Feb 2024 10:35:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fa-00046y-8X for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:43 -0500 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 1rb0FY-0008Fd-GE for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:41 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a3dfb2e03e7so46946666b.3 for ; Fri, 16 Feb 2024 07:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097739; x=1708702539; 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=FHq12xVLql3ZjDkC8k2lRJAF5RJwUJ4vzRZ5Ca5vbxw=; b=aGUvTxVn0CSevQHyBDA9cVw+UVglgY2WrUoRExucsmzbM/eRtrS5afWbUMOl5saiC0 DFasHe2Rr9+TBowErSS1Z8yGmXrQD7zEolWAVbCv3u/pB6icUh03uVvzxSWYi/9GFmGb BP6EInDIox0XWaz7Yp+j+YWO419I9+jWTsAIS5LE6Re2hd5XbihKkBlAQot/4bQEfHbZ /w4luttgu7EWUA9KVsmHc9R1d8NI7mDDKcl5+XcbFZ1KVzA+ZN51Kf3bMD8okv1c4nAj z7aahlG9hehfiZbh8Ys/psowuFQ2tCEiLN30UMG7XBTvZ6kpbggx4yTxdig7KKvFj7aL +UpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097739; x=1708702539; 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=FHq12xVLql3ZjDkC8k2lRJAF5RJwUJ4vzRZ5Ca5vbxw=; b=XmMipHQvcsUOmNJ2F7F9j6PLiTvrEcr1xH6+BwlysCx5EgmCMu4uMZG9/vvS0OsOR2 W11SCbFSU7Aeeq9W3LkK1ZXNlKDD4ulVeVif4L4KnvIti3DxUtmVSJagw1nddIi2CFts Rsgl1Glfq64gAH8jRyFBLtvr9xfeacHTx2JLrvw/SHHhb3/PAuNaeblhLDH8cwpNYPOD jwsMPyr5RU+pM35jjsb7olRX2TPaVy3SFUJb3t6H8iCbO4jCY+6o3GZglBKGoCLRSpt1 ZqbZOBogEh5h6t0jJ0lwZJHeY5edlE2xjOI5Ln8e+igOlXtxCHOESCTEgu7EUlB87G0X BA5g== X-Gm-Message-State: AOJu0YyZDoP4RyaRNMJe9tX7tQqdltxKs7Nd3/1urhh3VFIiRzhpcoa1 SjNxxMmvP1yJC1t3qdrxQ2J48RgVpxN0SjkH58DO9gGvD7tQya/rDlH9qHEgsc92Dbh6rlb2h9K N X-Received: by 2002:a17:907:b9c6:b0:a3d:2e34:30a5 with SMTP id xa6-20020a170907b9c600b00a3d2e3430a5mr3626388ejc.29.1708097738898; Fri, 16 Feb 2024 07:35:38 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id tl7-20020a170907c30700b00a3d1458523esm52110ejc.29.2024.02.16.07.35.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 3/6] hw/arm/exynos4210: Inline sysbus_create_varargs(EXYNOS4210_FIMD) Date: Fri, 16 Feb 2024 16:35:14 +0100 Message-ID: <20240216153517.49422-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 We want to set another qdev property (a link) for the FIMD device, we can not use sysbus_create_varargs() which only passes sysbus base address and IRQs as arguments. Inline it so we can set the link property in the next commit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/exynos4210.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 57c77b140c..ab18836943 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -769,11 +769,13 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) } /*** Display controller (FIMD) ***/ - sysbus_create_varargs("exynos4210.fimd", EXYNOS4210_FIMD0_BASE_ADDR, - s->irq_table[exynos4210_get_irq(11, 0)], - s->irq_table[exynos4210_get_irq(11, 1)], - s->irq_table[exynos4210_get_irq(11, 2)], - NULL); + dev = qdev_new("exynos4210.fimd"); + busdev = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(busdev, &error_fatal); + sysbus_mmio_map(busdev, 0, EXYNOS4210_FIMD0_BASE_ADDR); + for (n = 0; n < 3; n++) { + sysbus_connect_irq(busdev, n, s->irq_table[exynos4210_get_irq(11, n)]); + } sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, s->irq_table[exynos4210_get_irq(28, 3)]); From patchwork Fri Feb 16 15:35:15 2024 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: 773341 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1412909wre; Fri, 16 Feb 2024 07:36:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVidC03gg3k6KtG9Sn9W9nC5AIx6kQSBCHNs9+//k+8rF2aB9t4hsMHRiwAMNKwvHR4DQvIF+DVIX+xMgapD4OL X-Google-Smtp-Source: AGHT+IHAKCeYyf2zBHFvty+0Xa3D5O83G2FUqhQf9PsuZKpxD5Jm7JOwzunWZvqCgHLGDM+Gjkym X-Received: by 2002:a05:6214:4b07:b0:68f:1178:6911 with SMTP id pj7-20020a0562144b0700b0068f11786911mr10793602qvb.12.1708097810067; Fri, 16 Feb 2024 07:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097810; cv=none; d=google.com; s=arc-20160816; b=BfWqq3PBRpbZ/H2gA/JDkpPBKLqNw5ESyqfyDmgV9IolcC12e64klYUQUa8wUyLaoG 24dYCHsQx5H3SAgKz9IgnTRsqAtX5wvQUT4w5JSF+h4nbNt/uRRy60GLuV+c29eSXQrZ VN1fVqq1xf+WG11C7oDQbbyUAk6UJcvUhals5Vpu4Ox0vM0LdIFIVM1iI0LuK/M+DiDU CuRa1+dO3BfyRwY0TfwLdpiJMLcf6LHhJ7t3w9o0RYQPD42dbBER3roXdC83O9pZTLqB zwROMGlHfUBJPi2GvfJ0zbZN7leUnHB1BZCZkMZhovXCJcXYNHJfYr8gigucc58QD5F0 7cwA== 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=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=lo1qpO1/vHRNDCa6eP1+4v3rPdKRNQEYgzURILvyWGTCUX4T5UA48IAwLJSlREYEMY ORb3NCDDLz1YTAgYlu9AWGzO7NUbI+weZQskR6tWecyYY6LtMpyEiGR3sfhRZmwHFIZi TYpCLK+T71x7L+EVC9av9LZyoWql5Pu+aY3S302LhEk73gSd0/9HDGkE6b7ULuM5AhBA Z15N32hEQsVpWZix5N//WlUM+Ssh+po+FA2H/+6+7/MFu3JlD7JsaIUfoDKl55L0yMhG hrgycxDuYFOLAF9zDdRFBA4ikDeLGJJrnvjqLnMyViUl17NJiaXbkusOh+zI74puhd/y Y4eA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OHbhCNXn; 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 l12-20020a05622a174c00b0042da78e93d3si93543qtk.147.2024.02.16.07.36.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:36:50 -0800 (PST) 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=OHbhCNXn; 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 1rb0Fr-0004GI-MZ; Fri, 16 Feb 2024 10:35:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fi-0004AJ-J0 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:54 -0500 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 1rb0Ff-0008Im-Li for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:50 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55a8fd60af0so3193124a12.1 for ; Fri, 16 Feb 2024 07:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097745; x=1708702545; 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=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=OHbhCNXn0vnVsM5RG9SuZuIctabUQbGfbSYJtKURuTuvdJrs+JGCCQqgFNT5r+aZdg r1OCYf0/ro7oFmtLQWz8061n4f5qIJs6UKMdVffDoCeN1LM2mCZj/qBhlQjzGHQBz4FM bacWMeQvkffmzh5BDVCp7LLzGDaxa55LFp8e13xbN9Bp9Lpp59bhH/vlc2O5lNkUnG2k H47gffriNLc1u/GoMNoKMa0VvA+BMKp07abfufSPnZUmo2poQhGyCtG3qwX7AEY5TtZL UkFMD6ZMzFoCleJiSR0zRVZMumLjbm5yJeVcxP6SoRxkD2gfJcXAslAWbiMKp/CuGWz0 DWHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097745; x=1708702545; 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=6ztXjxwe8IKbXpGPRKa7UqA3qhxM54O9HdB2Bhpwj8c=; b=NZ8Stf+axABhOTSqm5EDXnfA5jZ26VBp1iy9TS+HIqG70C9gYn7PTxcK/vVh0FDGg1 z/gBMoYu3u7FpdwtSK8B7S6YTjDc95b+em4Wqw/mqD7uTgzq+0BiEWYfYRTSZdhUSHtM 6PhEhYBfv81qL6SXXPT1FDgwlf/uUpUlZwWQYxycT1CTwJhyuDPHw42IFj0HLdILodnw tZ6puKUxTIc1aCdVd2qUrdn63M5K7tl88BdN4ShaAZJx6Pt28uoAqSJoNZE0R06Hurww S57XaEhUKxC5i/CSVDnhdxwodpnudCyfm/VkQHW9UnM2kRUbTpKE4cYCGUmB32XwHArV C/eg== X-Gm-Message-State: AOJu0YzcXLagCUTMtnClX8EpxGfndTBxveRlOaieQbRwKCWcsTAPV5m7 m02LT9J9hXX4rnMXY3TLYkFjbKR5HhAzuJ7QOE2RGx4l/FLeUdNUcNXapKkLd62XqIR7hvZH0ql P X-Received: by 2002:a05:6402:793:b0:564:1c0:bf4b with SMTP id d19-20020a056402079300b0056401c0bf4bmr836119edy.40.1708097744750; Fri, 16 Feb 2024 07:35:44 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id df13-20020a05640230ad00b005621a9b09fbsm83681edb.41.2024.02.16.07.35.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 4/6] hw/display/exynos4210_fimd: Pass frame buffer memory region as link Date: Fri, 16 Feb 2024 16:35:15 +0100 Message-ID: <20240216153517.49422-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Add the Exynos4210fimdState::'framebuffer-memory' property. Have the board set it. We don't need to call sysbus_address_space() anymore. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/display/exynos4210_fimd.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c index 84687527d5..5712558e13 100644 --- a/hw/display/exynos4210_fimd.c +++ b/hw/display/exynos4210_fimd.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "hw/qdev-properties.h" #include "hw/hw.h" #include "hw/irq.h" #include "hw/sysbus.h" @@ -32,6 +33,7 @@ #include "qemu/bswap.h" #include "qemu/module.h" #include "qemu/log.h" +#include "qapi/error.h" #include "qom/object.h" /* Debug messages configuration */ @@ -302,6 +304,7 @@ struct Exynos4210fimdState { MemoryRegion iomem; QemuConsole *console; qemu_irq irq[3]; + MemoryRegion *fbmem; uint32_t vidcon[4]; /* Video main control registers 0-3 */ uint32_t vidtcon[4]; /* Video time control registers 0-3 */ @@ -1119,7 +1122,6 @@ static void exynos4210_fimd_invalidate(void *opaque) * VIDOSDA, VIDOSDB, VIDWADDx and SHADOWCON registers */ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win) { - SysBusDevice *sbd = SYS_BUS_DEVICE(s); Exynos4210fimdWindow *w = &s->window[win]; hwaddr fb_start_addr, fb_mapped_len; @@ -1147,8 +1149,7 @@ static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win) memory_region_unref(w->mem_section.mr); } - w->mem_section = memory_region_find(sysbus_address_space(sbd), - fb_start_addr, w->fb_len); + w->mem_section = memory_region_find(s->fbmem, fb_start_addr, w->fb_len); assert(w->mem_section.mr); assert(w->mem_section.offset_within_address_space == fb_start_addr); DPRINT_TRACE("Window %u framebuffer changed: address=0x%08x, len=0x%x\n", @@ -1924,6 +1925,12 @@ static const GraphicHwOps exynos4210_fimd_ops = { .gfx_update = exynos4210_fimd_update, }; +static Property exynos4210_fimd_properties[] = { + DEFINE_PROP_LINK("framebuffer-memory", Exynos4210fimdState, fbmem, + TYPE_MEMORY_REGION, MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void exynos4210_fimd_init(Object *obj) { Exynos4210fimdState *s = EXYNOS4210_FIMD(obj); @@ -1944,6 +1951,11 @@ static void exynos4210_fimd_realize(DeviceState *dev, Error **errp) { Exynos4210fimdState *s = EXYNOS4210_FIMD(dev); + if (!s->fbmem) { + error_setg(errp, "'framebuffer-memory' property was not set"); + return; + } + s->console = graphic_console_init(dev, 0, &exynos4210_fimd_ops, s); } @@ -1954,6 +1966,7 @@ static void exynos4210_fimd_class_init(ObjectClass *klass, void *data) dc->vmsd = &exynos4210_fimd_vmstate; dc->reset = exynos4210_fimd_reset; dc->realize = exynos4210_fimd_realize; + device_class_set_props(dc, exynos4210_fimd_properties); } static const TypeInfo exynos4210_fimd_info = { From patchwork Fri Feb 16 15:35:16 2024 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: 773344 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1413096wre; Fri, 16 Feb 2024 07:37:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWwi0S2VECt7ZWA0ysyvqpQzfvnG1twwNikS/f48YkiZHdb6dey894Vj9lppcAdHH+gPNITGrC6NMwNYXNP+EC3 X-Google-Smtp-Source: AGHT+IHNOHy9uvN/0o4wsz7K/ojKAnFctziygj11cYi8O5w5pD1hFTdQGxg2nKQZcwR4t7qbTSWf X-Received: by 2002:a05:620a:2453:b0:787:1e07:d14a with SMTP id h19-20020a05620a245300b007871e07d14amr7613824qkn.66.1708097831673; Fri, 16 Feb 2024 07:37:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097831; cv=none; d=google.com; s=arc-20160816; b=SCXE+LWzHwSnlIu9+it+a+OGdhl7nLEWfFh5gyrK6dnfvCw1ugxikXmM1cXeI20v72 +LUetOUV/3UC1RP3cBvm1Y1WIjf12qLJ5TY/xEuvdt+HIG/moyY7eEpVQSv9L2XCVUch 1R45fo4xUKNXAcz3qRDcJKcPAt1ioZ6mC1o2oO4kdDrm1Qc21HpO+jhAk3fU7Q92wjtL yQv0uuznj7BxGAoeKDgsuMvcf5useh24KDY3zW0vu+G9RaL7KifrS5dPVnGDjhsLV5As NauUkzJMahz9OplU0kHuLfM2pTjmJO+hUACtCagdohPzVRk6rkEL7MJHUXk1lwMcUt1I Ka3Q== 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=6fLBBhh1GSx7gD4Lvttkm3NNOOv+Jojp8q0UUHVCrGQ=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=0w/rA0eM4kup0Xx4+Qcg5DTgC29BWC8t+bj9cj73Dgo5kg7N6BVj1Rcqr8IHMeTfwo 9HGZJQBVFKiyBR8ujTp0YragzoDS5VlLQKSh12wA5xW6gQ4P75vb9l4af4UcZN8+f/eM LqSDzHdeXEdKr566RcBiMRnOsE0A/VjNN2y7O4zBcHXXsKNYIeVlEBcX00nE7eGhqDLr YgYdd3lVlPCEL/fxNGHidrqtNId8EOdS5e4+lGYqhtmo4iN4HKWV5R+cWopYud8iuYgc OMLVfLod7cYMYtatw63y1MFEoMyI6m2NF0Ljy23E7665Bwfr+lLb3i00oDevaHmIV7mZ EdtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zpab49Gd; 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 y6-20020a37e306000000b007873428fc5bsi91784qki.651.2024.02.16.07.37.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:37:11 -0800 (PST) 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=zpab49Gd; 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 1rb0Fu-0004I6-1V; Fri, 16 Feb 2024 10:36:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fp-0004DI-8H for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:58 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rb0Fk-0008Ju-Gw for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:54 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-511ac32fe38so3199942e87.1 for ; Fri, 16 Feb 2024 07:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097750; x=1708702550; 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=6fLBBhh1GSx7gD4Lvttkm3NNOOv+Jojp8q0UUHVCrGQ=; b=zpab49GdHR407PIxh5Gd0ldme4YocbRxvc/IrE1JsLfO29RoA+en4LtQ/YGwzhEk77 52+E4OE0qrGgKBtDIdbnbLwLiD5rsGXzEdqwe79M/iLoF0KfmWSdDbaIQJMj43l8+Mv+ P77mzyX8JiZC29066OSSQQDdNY+3dcpr454PAC6buUD+PTdYkF9E3JH2uhet8om/BkJ/ mPNG9QKNG+R8E/VLcU6yrlfKifhnvgUxtBCPoanApzWEwrocshA6Pwt2G6GeajKtG6P/ PO4BqHdgN2qgK9N5/VLBW9/eODa1rZIFyCTNd6nrEj7+qhi9DZJfzJk2oj2T17hwYO5f LypA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097750; x=1708702550; 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=6fLBBhh1GSx7gD4Lvttkm3NNOOv+Jojp8q0UUHVCrGQ=; b=tQYTmlJb4ZfOPB8sRBGD1mEcINwltGyAIzPxheib/tIZGNeBWx/tR/Xbud/6NtWLZl 1Wj0/jO9BmSImjPLkmgrIuP2j2AvOfj/L3uSus+dNknvoQLKbh7VeKRuhk+ItVV+wvw/ 1Ki4RZhDBJngkwmGWyMdqlZJ/8BzM/HVZ9D/DCc/m03f6QP1MY8L7vpkH4LsUxi+qM4H Xcvlt6ncid6H+fwfgmJtA+o4kfLmoyft8GcXoSwez1T9etuVa/XiMHzFRuBRGliL4P8V 82uy6EO5pUZCiddtUmkofTBuJsfDYDHu+rhaRqTuvwg0I3EW2GSXnHI+CPADtLN1waLX QfXw== X-Gm-Message-State: AOJu0YxZgJrL3hjW+P1KMews6AruVJ2E+08W+BQlGcLoYs++D8pUSoqy vwOphpAAIQR5H/LNNgCjD5IrsjFaJukRCq7jgnhjeIAIyU7vHv8OxOiGhntIT1DQ5uR1LywCN75 4 X-Received: by 2002:a05:6512:224d:b0:512:99ad:d465 with SMTP id i13-20020a056512224d00b0051299add465mr995055lfu.16.1708097750674; Fri, 16 Feb 2024 07:35:50 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id e1-20020aa7d7c1000000b005621b45daffsm85225eds.28.2024.02.16.07.35.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 5/6] hw/i386/kvmvapic: Inline sysbus_address_space() Date: Fri, 16 Feb 2024 16:35:16 +0100 Message-ID: <20240216153517.49422-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=philmd@linaro.org; helo=mail-lf1-x135.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, T_SCC_BODY_TEXT_LINE=-0.01 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_address_space(...) is a simple wrapper to get_system_memory(). Use it in place, since KVM VAPIC doesn't distinct address spaces. Rename the 'as' variable as 'mr' since it is a MemoryRegion type, not an AddressSpace one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i386/kvmvapic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index f2b0aff479..25321d4f66 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -16,6 +16,7 @@ #include "sysemu/hw_accel.h" #include "sysemu/kvm.h" #include "sysemu/runstate.h" +#include "exec/address-spaces.h" #include "hw/i386/apic_internal.h" #include "hw/sysbus.h" #include "hw/boards.h" @@ -57,6 +58,7 @@ typedef struct GuestROMState { struct VAPICROMState { SysBusDevice busdev; + MemoryRegion io; MemoryRegion rom; uint32_t state; @@ -580,19 +582,17 @@ static int vapic_map_rom_writable(VAPICROMState *s) { hwaddr rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK; MemoryRegionSection section; - MemoryRegion *as; + MemoryRegion *mr = get_system_memory(); size_t rom_size; uint8_t *ram; - as = sysbus_address_space(&s->busdev); - if (s->rom_mapped_writable) { - memory_region_del_subregion(as, &s->rom); + memory_region_del_subregion(mr, &s->rom); object_unparent(OBJECT(&s->rom)); } /* grab RAM memory region (region @rom_paddr may still be pc.rom) */ - section = memory_region_find(as, 0, 1); + section = memory_region_find(mr, 0, 1); /* read ROM size from RAM region */ if (rom_paddr + 2 >= memory_region_size(section.mr)) { @@ -613,7 +613,7 @@ static int vapic_map_rom_writable(VAPICROMState *s) memory_region_init_alias(&s->rom, OBJECT(s), "kvmvapic-rom", section.mr, rom_paddr, rom_size); - memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); + memory_region_add_subregion_overlap(mr, rom_paddr, &s->rom, 1000); s->rom_mapped_writable = true; memory_region_unref(section.mr); From patchwork Fri Feb 16 15:35:17 2024 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: 773342 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1412993wre; Fri, 16 Feb 2024 07:37:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW+BAOIj6CGfKQDlN7bCa8/fBO2iZFZMCoPVIDEqxiIaJurpf7ApNEF2+5jriapcZkZVt5XvHWeeRuHrgtXEs41 X-Google-Smtp-Source: AGHT+IGYLbGkugqDShdZXZwqxNYXnvZTtm2OSdhiIK7Xwtyfc8+krQJykxg8EMlwxckjglnUeza5 X-Received: by 2002:a05:6214:c83:b0:68f:30e5:9f89 with SMTP id r3-20020a0562140c8300b0068f30e59f89mr2796400qvr.4.1708097821897; Fri, 16 Feb 2024 07:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708097821; cv=none; d=google.com; s=arc-20160816; b=nBw31fRpSZbQyWy0rZ6WUBfQ3kWcWKeTwLf4KgG7w8qpIc/6EvTO0vJ/3zAXe/li9b swTREbgmCmT6bK8K3NQ8to+teJ7zsSAM5gW0LQFDe+uRFIu1SjcYZgrh782Ya+0QjNQ2 XBb0gDGYzW7A5/LuwfF0m2doakZgiND69tGnEg6QknmRZhlVim7r97XGWnRlRM824L1I xGLvMM+JoBBpCZAImzdrzHXvgQnWskGL2KDOZDCQWqub3PPEmwrITMGaXJKqpvjWOoZC Zh6fJD5DzaDsPfpX8lM41XqSsf/gkXB4XrQEtAmLFP8DhpWSX2uPY+NMRjxwU+x1R795 elwA== 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=hOmGAqEBBOEy9P6DsYyadVIEFCheEXAYvta8nSQ9bhE=; fh=Xd4+DjwsSB15CDSuGqGdsywYntTmak9IX+7zMshVrOw=; b=Jdsdd3vPZc6f89Y5T7D73JY4upN53oyeA9VzimsSbCUo5AZkWwROWR4k0+5SHiuo3p USjaR/VEz3EU4wcAO9QgpqRbUHU5WHxoovJ2GepktC6lVhYc1aUNZx+W/9T8VzlIJljd hb5FF8JUVZzs2CK3CEsh/zzrVz6OS/hRIKfHKO2hU4vWzipfFdTDRH4uWFUzp8sjjvdf /XOG6V/7hrBDnkbObcFp0/4Kys8tp6IUbmbGD7aDWW9qHX+qdYN+NM0w56fftgEOJ2Hs C/oMqgRBCx3eVgDLTnXJS+q0WtZoXrmf/x0fxwevfPojM6shQS3HcICcHLXmGJiC4EHl Hg2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Il9PjfY1; 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 5-20020a0562140d6500b0068f33d4451bsi1281301qvs.264.2024.02.16.07.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 07:37:01 -0800 (PST) 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=Il9PjfY1; 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 1rb0Fu-0004If-UF; Fri, 16 Feb 2024 10:36:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rb0Fs-0004HQ-LK for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:36:00 -0500 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 1rb0Fq-0008L5-Lp for qemu-devel@nongnu.org; Fri, 16 Feb 2024 10:35:59 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a293f2280c7so306499866b.1 for ; Fri, 16 Feb 2024 07:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708097756; x=1708702556; 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=hOmGAqEBBOEy9P6DsYyadVIEFCheEXAYvta8nSQ9bhE=; b=Il9PjfY1GBNrm1H293ZJGyUpt6q+yo6054KPUfrdvkQIPsbWvqWcH5zQYS/5Fol+FA QmgHa0uAzzGuDEX792phmJpBUeTZJvL7JdZ/lbdh1SZfy7diLp1PGHpg3wjGzpLR9hy1 eS8+j0fg7zTlKZU/pTYlf2cTgq2vX0t0mNIPvd+SULimOlZfR0ywlrUFKiYL+IrTEj+O kYDFAyMrHUYpT2e74iCph96d8xGgDyIDlizB1iYRCa5nJ0sFOg0NHRsaDcPS3KveG8BR 0P2YcsTd1tHzYYe4KmpqRWmteowe+pVqDCYc6rKsFVfUmJFFl2/tRGDCp7wiyZdugoA3 QFoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708097756; x=1708702556; 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=hOmGAqEBBOEy9P6DsYyadVIEFCheEXAYvta8nSQ9bhE=; b=WktRJyzJ0PSzKX6nBqIb8+TbnOGJh2EApNmZnE8Vl3ziBZ8K4nNBoOrmYjhEfBPMP5 GUsBu/p6LdHAY695HjJsyQNwQrdEZrW+lJplrvlvL6VMrDYwCXJC3nkE8mbAa3q+bKjh JH9MCLFSm8dxZsWEOBYu1HJwUnZElYEaI53zIgj0AZF4HX0skteLvcksbnUUhOvTVzqQ 2GvkRpWAwQAimlpFzMQgebN5gbMmyqjMQkSxw7+mzJWNTDert5KYXFuoaKDnsZtBlBRK ufaQT0KSBGLF1ZKX8/HLNI9Jvcka5DDhcvIfbEf6fBsEBFp26DKw2N9BbPw1HmG7hrUJ q3UQ== X-Gm-Message-State: AOJu0YxR2qgvJemsiB8TvDTqwlJxnSBsDKEmAYXm5XD2cJC8GIjM9gkb 6lLRq2u+H6CX5Z/TSgEVoxK7055AqQvfJnX/Qm+GuSzOkUrLLrYFPnaGY/9LLN5Y6xnzYEcJRzU B X-Received: by 2002:a17:906:c415:b0:a3d:7d6b:2dc3 with SMTP id u21-20020a170906c41500b00a3d7d6b2dc3mr3608466ejz.73.1708097756627; Fri, 16 Feb 2024 07:35:56 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id fy22-20020a170906b7d600b00a3cf4e8fdf5sm44841ejb.150.2024.02.16.07.35.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 07:35:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , qemu-arm@nongnu.org, kvm@vger.kernel.org, Peter Maydell , Igor Mitsyanko , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 6/6] hw/sysbus: Remove now unused sysbus_address_space() Date: Fri, 16 Feb 2024 16:35:17 +0100 Message-ID: <20240216153517.49422-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216153517.49422-1-philmd@linaro.org> References: <20240216153517.49422-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 sysbus_address_space() is not more used, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/sysbus.h | 1 - hw/core/sysbus.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3564b7b6a2..01d4a400c6 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -85,7 +85,6 @@ void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, void sysbus_mmio_unmap(SysBusDevice *dev, int n); void sysbus_add_io(SysBusDevice *dev, hwaddr addr, MemoryRegion *mem); -MemoryRegion *sysbus_address_space(SysBusDevice *dev); bool sysbus_realize(SysBusDevice *dev, Error **errp); bool sysbus_realize_and_unref(SysBusDevice *dev, Error **errp); diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 35f902b582..5524287730 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -304,11 +304,6 @@ void sysbus_add_io(SysBusDevice *dev, hwaddr addr, memory_region_add_subregion(get_system_io(), addr, mem); } -MemoryRegion *sysbus_address_space(SysBusDevice *dev) -{ - return get_system_memory(); -} - static void sysbus_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass);