From patchwork Mon Feb 26 17:37:59 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: 775950 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1500222lte; Mon, 26 Feb 2024 09:40:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVTmj9d4gXO1pv9O4ElhUQkMLiN09h3ibABhbmwJs61c6XnP9jHycSP0H4Lx/S98vc/NBHElhwkkhcINfoW93hM X-Google-Smtp-Source: AGHT+IEa78EBtJAK9taDOlAiQz3A4v0uScYkAY/oNf/fNYoHvkiwtyByJCXAX1/nxeeVrIro1ogG X-Received: by 2002:a05:620a:1133:b0:787:dea6:f018 with SMTP id p19-20020a05620a113300b00787dea6f018mr1047737qkk.53.1708969201222; Mon, 26 Feb 2024 09:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969201; cv=none; d=google.com; s=arc-20160816; b=Mm7PKI1tUf9/1jeTz1jfxnmsRgmaTDM6V91liRpWe6hujnTC0jS5OJQDXXSFi2LiNT gWlm5u+QrbZw6xQq03Tk2yB90O2yZGy116BbO/beHCxBFYBkfbJ/HlLjW9RjmlrmpJNc 6XEdJsSkYLovhziwX1dEwhwbO5WaDnVMCC4+epzJf7Z0IjJEZGzMZHkdtqniOmh9A6FH GPLo730EhKiruNFBXS6MBFtV+VUPBjxkFw5wnymOPpkSRIK77DqmW4JIfENJRgTa3BpU Ip8+pMP1AUrzGL2yeNtLFLvbXuYEmi/eiUDAGgPcISBUp+iiGVYykjJ696DgUpmi3pwv 5gYg== 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=pYkVqFHaNeYFq74/W6niP/tmlfQNyHPTT4iDH8DS3Ls=; fh=nvo5RjCIyzrsfNZsFyc8KAYF9iiDE6P73sa+fgZTnCQ=; b=jFXjboM28Lvg7Uq5zZQi4fW2Mv+QQAxVz26LjNNO4cjv7+ezz+DcjJQB04eSc7zeCf FiyMiDdRupDoXqGryx/wjzZRZnkIzx6u0Gz8gKR1a6TcslPpxc+7x9AySGlYGA3QNz5R 5pCkYLnAOeYADKWRLSpRvCGWKnw0AlfPyz+DRlRTx5OfCLz1H5YPzea0LDhxFWGDUpia 7xLsKbK2odrvk4j8bE+fPEF7mw4vGYR8UTLLyAHxg+PlrOaJRIKU2fOlVHuwBegqwVCJ uDKpv4iqV7PZIQyqoZK9sloYA2aOyJg7QmeM/DPrSo5hsmO+lWqiqE7+DHokatl/EUN0 eFmQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kmYX7tMP; 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 k13-20020ae9f10d000000b00787ded9bb55si546554qkg.779.2024.02.26.09.40.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:40: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=kmYX7tMP; 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 1reew6-0004M0-7l; Mon, 26 Feb 2024 12:38:42 -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 1reevg-0003ur-S2 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:16 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reevf-00075H-6q for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:16 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d094bc2244so38909731fa.1 for ; Mon, 26 Feb 2024 09:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969093; x=1709573893; 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=pYkVqFHaNeYFq74/W6niP/tmlfQNyHPTT4iDH8DS3Ls=; b=kmYX7tMPkirHAn2C3iewuPl0Kg/upksx1hDE0JgYb5aD2MY+em74uOPXqDROZ4MPlz 1T4UHwAH+gz8zjrlYHJVV+LMXENv8mM6GDDCX6Q/HZgLlzWS8qztYgzJgLcrpuWN+Tq3 4XDP0Uq8ksMi1hDBYuDN3GGnvTUUAgKhIxHmKDe0yJxjjgJeOSTwYK4We9WsGE7CiS3D CR7lHbk0bmVIR0uA09N9qFd0nsSY+jLHMjVlRMxtT1+nfjPIzKcQGiw3JUeb2xuZvevH 1zP1cmO7k9be5ioBrAIucjlDu/nXptHsSonaGcCCdNsaz336bWSrL3e121t/TlPypV4u rDEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969093; x=1709573893; 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=pYkVqFHaNeYFq74/W6niP/tmlfQNyHPTT4iDH8DS3Ls=; b=W8WuVT/1Rcp6B9dfoDhT6fY8nOAit6PvLlyO05PuRUt647DcR2MxDp2i4KEb7ifm4y VS4Xr+GocStu71V1j6bA9t6xOLPb8PA8g+2qlRIm/HCZ5hvYTcptTfy11lKZaMsCwlOL Er8C/oJ41KJod+0G3BgMV+F/s6vBdGgSB43RO8sdPMC173GBahzPsmzufFUflMUpwoqY zy769CeKNWjaOogUdW0drnp+tXGv3X9r8lf3GIBZz4i7iNFvtGwp98SE9GPlPBJVN6qb 2ybHtgv0M/cQ53rDnF4ReX/Gtwq2LTIDSQjUbwyp/YSPikLPxpDSGq603T7LScIV+Q+m 146A== X-Gm-Message-State: AOJu0YwJOwCoWQ8p4rDphJ0G+8rQgfsIM51u1OnfZ2/xw0SYROFoDDqq t/YshyXyU0A1VOkRGKOZmA4/FyRR1EAzq32GjHDdPabL+5tQL32kHLhZNpVKp/5V09B9mrDPEWV 9 X-Received: by 2002:a2e:b8c7:0:b0:2d2:4ee4:c8a5 with SMTP id s7-20020a2eb8c7000000b002d24ee4c8a5mr5108039ljp.50.1708969093150; Mon, 26 Feb 2024 09:38:13 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id k22-20020a7bc416000000b0041061f094a2sm12474343wmi.11.2024.02.26.09.38.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PATCH v2 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111) Date: Mon, 26 Feb 2024 18:37:59 +0100 Message-ID: <20240226173805.289-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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/integratorcp.c | 5 ++++- hw/arm/realview.c | 5 ++++- hw/arm/versatilepb.c | 6 +++++- hw/arm/vexpress.c | 10 ++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index f016d20485..5b002da350 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -670,7 +670,10 @@ static void integratorcp_init(MachineState *machine) smc91c111_init(0xc8000000, pic[27]); } - sysbus_create_simple("pl110", 0xc0000000, pic[22]); + dev = qdev_new("pl110"); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0xc0000000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[22]); integrator_binfo.ram_size = ram_size; arm_load_kernel(cpu, machine, &integrator_binfo); 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 Mon Feb 26 17:38:00 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: 775947 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1499947lte; Mon, 26 Feb 2024 09:39:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWLwkzHA2H4cUb+aVBk/5OdALoOleg2JtNdemHrchcz7S61bg7AIgG0aetQqlDKVYyqmgkbrT33Lo8R1xt9fiOG X-Google-Smtp-Source: AGHT+IEAUil/XPxjxiYgAzb5vjr0VLLV+sBvijkT+f65yyIQ0QZRqAwuiQdIHCW614xmC/sEmqK3 X-Received: by 2002:a05:6214:e65:b0:68f:b8e0:aa3b with SMTP id jz5-20020a0562140e6500b0068fb8e0aa3bmr10215227qvb.14.1708969165257; Mon, 26 Feb 2024 09:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969165; cv=none; d=google.com; s=arc-20160816; b=rgA9OD6DhwEvFzVZRtHj2CCNYwFLBDp4HwNksiA7ruVyxKkBinlBOW4+N0xFP34cIz PnjfaN7HRSFGh/+jkxSuNx5g3Fz4LGV3jQ8Xgyd02mlMEW+ssPfSTzZpHJthE1Q+sH2P DvM8d+onhVfKa6vcIFzReRyxiw3JJrtB9QE+iGC2j5MDowaSkoZYOmIBOHBFAg0CaxtS cuNcArtMuykfHdH8KWxWtsVLRbZE03C13r3WsXjDaDUaquj1jNW1IHMn6pE2RZYLKZ6w fW6cr+EbMJcvGrCPZqaZTT795XztUYWIILYbQ9XpvIvr3DEzjJNGuVc0SwYWkqXx6Nc5 EL+A== 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=HOtPbIv+bN4xewQdXjZPgqbIWit4/WmbOrW33B3V7po=; fh=nvo5RjCIyzrsfNZsFyc8KAYF9iiDE6P73sa+fgZTnCQ=; b=I4DgstcbMoaxWrgWRb/O/cPghyVjMkOTJFT+7Kep49l47fVO3yG0gog3KjR/4Mp+Cm 2/JQWazy39B6UHDUvIdN18X5BJOKH3QOZj/bR4Qewoal2MIfm41f+D5WpB6NQEYAq954 LqQCt3EYTYsaewEt+gerCA5muNAU7JlglPVBFVEf209JHtFYOiBHU2bz3Yk+w3PauZCC c7ZASensMAKhu5eXFkboGUIl0HTTF7FeVpLSDnyY/PSHAwzcc3JM0Yskq7BQaixcXdls tgViG1/0sYIK567NF0efnz6xJrsllDuW4B60jf4LvdxR6yzlDg+HoFgpSPUUCeOg7uRe SolQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IMKmZlIU; 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 iv5-20020ad45ce5000000b0068ce8b50553si5567687qvb.426.2024.02.26.09.39.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:39:25 -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=IMKmZlIU; 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 1reew5-0004De-Kq; Mon, 26 Feb 2024 12:38:41 -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 1reevo-0003yx-JD for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:25 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reevl-000775-GX for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:23 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33dd2f0a0c4so993154f8f.0 for ; Mon, 26 Feb 2024 09:38:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969098; x=1709573898; 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=HOtPbIv+bN4xewQdXjZPgqbIWit4/WmbOrW33B3V7po=; b=IMKmZlIURxNnQV9sRdtLNlZd+J8f/BYh5OKxdkUsIqs3doT7evRK4at5cHJevIijOj tCOzvY4IDMFpInJs4eeC9Vxj2dyCDC8/wX1h25FiQHwaqb4mDydkKcgnNM39Pbn6ZJzH y6xor66iya8shFHQIxexdIc3Ayedb4V5Fo/LCos60s30dshtjDQZLNKgRRO+w6hTHvGa OTwceHeHVpB/ioCFYHPayMGoa0OnnVCd+rWrTRiKeunP3Y9viCmsUmXekc/XP3/T06TD VhgIiH0MiN5LlECWuRgyIIxtmCJMQQWEwhbYG3X3gpSk/KU0MyRF4lVtMB9m90BDyWo6 J4hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969098; x=1709573898; 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=HOtPbIv+bN4xewQdXjZPgqbIWit4/WmbOrW33B3V7po=; b=Ge43yKilhnVfTpMWcDymNBUSXZb6A1f0NpB70U6xVkGAs+c/5innisAn+YA3TqXgh9 qjkTPIQDJDe69kHvUU1ilXf6hjrE35qLVDf2EIoEe9LksUf3Cqt460snfq1WjelYx9J3 cjrsQzP3ughsDdethFhlZ7JoBDX5ZJzMguL9nGp0vaaldZVsyRwOCyWuivPYpwuwr5xR dOPT3W+BDS87LIfLy2h0SsuX/D2Hj6nL4h1GmzLGtIbWei8FWhekl4yWHEEXZcPY4dvs KriJRyp/d+cS+7HoEp+MInBmNxQ3vBnY6q1VfrBbHL03K1DJ7R1HyfhybrjAazrJH6XF CI8w== X-Gm-Message-State: AOJu0YyWTrJTEEDIPObR+ATpknAuW/XQ7AMtkPEtsW9SEADmadOt8YkN p0+knh5xymtz5DqcMPp2d75bxzy3NAd4Fp1cvFCcImDTXuZs4nI+bd7e8EB57Vv5e/O4xNp5oqC Q X-Received: by 2002:a5d:5048:0:b0:33d:6309:75a with SMTP id h8-20020a5d5048000000b0033d6309075amr5037247wrt.67.1708969098709; Mon, 26 Feb 2024 09:38:18 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id g7-20020adfe407000000b0033d2ae84fafsm8819797wrm.52.2024.02.26.09.38.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PATCH v2 2/6] hw/display/pl110: Pass frame buffer memory region as link property Date: Mon, 26 Feb 2024 18:38:00 +0100 Message-ID: <20240226173805.289-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 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/integratorcp.c | 2 ++ hw/arm/realview.c | 2 ++ hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 5 +++++ hw/display/pl110.c | 20 ++++++++++++++++---- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 5b002da350..feb0dd63df 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -671,6 +671,8 @@ static void integratorcp_init(MachineState *machine) } dev = qdev_new("pl110"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(address_space_mem), &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0xc0000000); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[22]); 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 Mon Feb 26 17:38:01 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: 775949 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1500191lte; Mon, 26 Feb 2024 09:39:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWz3nZcGUNCI9pIYl9jqpuEJUaweVMYvv4JM5g4TKPnzSA19wZH+2j/imlj8KDUjMqPZLNW1hBgctIcVcsuENi5 X-Google-Smtp-Source: AGHT+IFbHNmLzlPrdu2LdZAMAB2NcYRlXYO4yyv/Hkuz0RKKL7A0Muai5UqQNyH2rChrMrVW+fUa X-Received: by 2002:a05:622a:309:b0:42e:60c2:45de with SMTP id q9-20020a05622a030900b0042e60c245demr9855724qtw.66.1708969194438; Mon, 26 Feb 2024 09:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969194; cv=none; d=google.com; s=arc-20160816; b=HdVV8hSalp14C+SdnX66YgzDaTZ0bIVmcHdDARGyi+5/5kObHC9VI3ePTYDYwBmnx7 kjFGvuaGkMtVrrbbX4MMtaenDmYCaU0gHvIVIyXvJoz4TtXlF13vS3ZOu0YZDmffA1ee i6Tv2z83nFwDqpuwYtA+ajvPbFisFR2/mwYu/6lILjw4+R6j/Cnt3uWtIIKSOAGmJB8S 5145EHZlj7/ZytNwxtV8e/IMRL+u11wXi7vqcc28RiP1H7lir1wSTS7KH6fAmMAf8LVh +yUIHjTBoVpahk2n88JQ2ccUIv4UwdTYSi1n7IC9hwj8hxbQmTsMc/GXKFVH0W65fbRM +BvA== 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=MDIRaAfrV77mDOzirHYEWIS1MDxHTben8a6a1zFSPbk=; fh=hXBz7qm8Kf5b78SvQ683p6CidcN0HSYS2W160lsNAR0=; b=b3mX1Q21PrP/THEr0xsahNnk+GMzX1bjQXvsjhP8STvJj7FOH2YhD6M2y/NZwWdzH8 U6RlZr2gRKYa8dl7GE6sxeK4X4A/kBThBMZQV8WtrKwqYEQfUdkJEqAzZ7/xBvGTtwqi nryW3fWJ7b5QZXfvFpMpltLYKE+7ublCMXKgHF71ulRkZj0FM9R1AuENHpiEDj2C8KNe WsOzBDtO8e236QE+pQJpYrtz0qCfEpzC5QQO0A+k8kp6GybciHEsaAspYU0R2nHrJk40 Su167k/nVR5r+gUzLBfecWedK0XURlmE+QLUTmdk2oxk3MEbzMPdiqDCnMiFS/G7xY2i uvJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tP415/iw"; 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 s6-20020ac85cc6000000b0042e74a3402asi5694397qta.479.2024.02.26.09.39.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:39:54 -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="tP415/iw"; 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 1reew6-0004PU-K1; Mon, 26 Feb 2024 12:38:42 -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 1reevt-00042Y-No for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:32 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reevp-00077T-RG for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:29 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412a9a3dba2so3269205e9.2 for ; Mon, 26 Feb 2024 09:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969104; x=1709573904; 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=MDIRaAfrV77mDOzirHYEWIS1MDxHTben8a6a1zFSPbk=; b=tP415/iwp966js4vZxd6sxUzV4Ch8rJnlrAe7NLpqir/bqbhtKeR39k/USXBU4NjQF gYV5cOq+ZXnCvZPyUKBKlsV6+r3Wqlc6gJqoY4kQkfrDZs+gsxFuyrC0I2Egtrxq3QyM hCnp8zBJhKz1Fd3iRypZYKcZ1M9FNL0AB2bzV+WwHz1geqKag0rTS3uPoNRgu3E9eRVE kFvREn0OLBX6S5qcBb6Gb8CIKXk2kuWPF14CP/JnCLrm2oZCt8+Pbxy1jPBrvycXlH2e Rj/ygwqZrIrPxQqezEC/p81OAWoAmVwUZ1gv0gfK04PxVPawOXkBFVk4344TfPWFclpM 7XLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969104; x=1709573904; 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=MDIRaAfrV77mDOzirHYEWIS1MDxHTben8a6a1zFSPbk=; b=kgxF+kDkFdsLHZvP5EnNj1PlE34WksUzizcUyOktpD/xS+q0YuYwd8BTIebOE7T5La DZkzhLIeQFsVFi/Fjk2OC/GuiwFYIC4vDdOBBTb/4sp7KBNU3hqZUxAoCrN4jnMsuGfM EL06TO4e0CuHGuGX8OsT1IptyDCk79oNwBarCa0ulk/POk9ELCYN/pqozeqspc8p2Pmk 4L1DPx8rXasnwe/c6VlzoeiQaI27LolHsMj8L/1TL5+kHkwwc+hXNhDA+V70JcEZ6/+R F3FW2YAIZsOiIiS9QgrGHAdq0+AFXwoEBPZ/iqJaUohiPGXX/dlC0UOAA3iKc54B1Lus bWXw== X-Gm-Message-State: AOJu0YxHU5F/1QmQluLdOsV405pg3u3a8DfAcbgiI1ztMsMbEWvVyXcW BXugHQpyepJbVT+hrfxCw3wUGtOYxCJQg2x/gZv1x2gWwgYvjXt9bl/R1N9PjmfILDlewb2eAPN b X-Received: by 2002:a05:6000:71b:b0:33d:c652:7c41 with SMTP id bs27-20020a056000071b00b0033dc6527c41mr5226316wrb.71.1708969104173; Mon, 26 Feb 2024 09:38:24 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id u9-20020a056000038900b0033cffd1a302sm5592272wrf.57.2024.02.26.09.38.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mitsyanko , Peter Maydell Subject: [PATCH v2 3/6] hw/arm/exynos4210: Inline sysbus_create_varargs(EXYNOS4210_FIMD) Date: Mon, 26 Feb 2024 18:38:01 +0100 Message-ID: <20240226173805.289-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 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 Mon Feb 26 17:38:02 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: 775945 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1499714lte; Mon, 26 Feb 2024 09:39:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXMyQQimEVW1sqaqC0Rjhcz1r6mYc3e8Tz5rRv8zdSLcWNPzA9rXr8smAucndbos8glaK9Pjl0DgjNzBS0UBJhs X-Google-Smtp-Source: AGHT+IG+zHYEamIpjI3xR2hHz+IxNDg3USWz5OPcPKa4kSwvS9lFFMew32PLQVNQrK21vWW6ocW5 X-Received: by 2002:ac8:59d3:0:b0:42e:60db:24ca with SMTP id f19-20020ac859d3000000b0042e60db24camr10267576qtf.26.1708969139798; Mon, 26 Feb 2024 09:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969139; cv=none; d=google.com; s=arc-20160816; b=a03bXPP9BpaSy/W1xqvP9zSLSJiLz+aZrzt1fX7OA5HkCzwLxDSmKo8LyMCH9atzEo a7LOuAizafqpWxB1Nd4hXm5ze1Sx+vdGW8sOvJH2DVfl85PCXXB13mdKqEiiFShNt0+U uUV/EofWsUzt5L4p1Nc8A4nB5Tbe8aa3u5jPXHMFMx5lryv/GuO23j66vbYqvlZimB6j EVwpDkTKrGXvgxP55WxHZod9WXvlLiaae/GFicT2lseAid3yhEb+bWnsVAqP7alqSCWB FQBjPZO6ERY5oGBffsh9EhO1j08ZJivK1uuFu3cd2ufVG1qmqlFRrza/o82RusvcNnRe wsxQ== 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=PgxgQMnqYvptEpW+MzXMom2BVnIVN63/TeZ44omQsrM=; fh=hXBz7qm8Kf5b78SvQ683p6CidcN0HSYS2W160lsNAR0=; b=RBQQ8WPAr6BWfgsFJFgE3+Soa6+5baUHKwBSwURp//5hziPRElP1B0V6fQkVbh9Tkc RBXafBsIgOFTDeD9Qa8UTk0v8CZF1DcJarcYR2l3CbkHt50WMe6Dcy4rloT8mALN+Tkb 9xN8KH23yj6i5mDfBDM4XtrEGgfVCJmYYChH6FXk1nbB+ePpG5wjphrvndDvbiXkFBHn KSEWVh64dgNaSaZaRdoO18Wdqryb0zuS3TSn8X4S2X3A+Nx0OgSNMg71jYt15ophfcpW GA7fqsSCrmtJFHhgnN186J/uuZdNVLneykkiADl++tzV1QJzhkJAj4pZUzRjV0D+X+ry T1Sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O7T4VvPJ; 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 l24-20020ac848d8000000b0042de72e6f4bsi5312957qtr.792.2024.02.26.09.38.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:38:59 -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=O7T4VvPJ; 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 1reew8-0004VS-0X; Mon, 26 Feb 2024 12:38:44 -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 1reevx-000482-N6 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:37 -0500 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 1reevv-00078U-JN for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:33 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-412a8b79b46so4768735e9.1 for ; Mon, 26 Feb 2024 09:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969109; x=1709573909; 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=PgxgQMnqYvptEpW+MzXMom2BVnIVN63/TeZ44omQsrM=; b=O7T4VvPJm7D5pdsxd+xAaXnu6CMYKatBtyMOfgwEaps97pB2eoaHlSSDEWbR7qHUIc 9q4s+8g+CJqqn3ahFSw/YWn71PaYQH1OQGfv4yz8+wAX6hVCjCzl1NwLQxxlsWKBLaQ7 T62fLpWARkx9sDqSGACqAYom+jVMHV52syJ7yp6Odqlg/T1SbymEE1G1KQlH1Xoih/EI S25+f0SZIHs4U9TKYGm4eLyvjOwAqgyb9kChXKWOR1uG4bZJ8XbUqtvZg72zlv8EUouE 37UrmiSrM19em/caAV9J72TKr1WDlQvPtsA+iS2++2KmlyT8yvgamU6wmwP1OpGRAO0Q rFPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969109; x=1709573909; 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=PgxgQMnqYvptEpW+MzXMom2BVnIVN63/TeZ44omQsrM=; b=Dm4OqmmMvauHrczX0qTs7LhmBBK1w8V6Lyn/UNW5ms+StDqJ4Do/L38c+g5zm/z2QJ 2e+Zvp0OPX/czOjnYeWajLrjG0SmmsBGMRhDcBLYVzAlUL5mHW1mNJQQ77LHYm17aZbW ujPUyn2tDqRHTtE+xyy8LtZhtvAnxCv/YbJYT5IzTvBBE7vdjkyZv7UvqoZDPiscALVa BY1sX3YV8yIJ4jrpZBPT8n3rb/K9o8Lrpt1hTjMgArma7Ls/PcGRcxlBQLp99oRTA1qM r383mkYf8CdOFB+t4jcUGxgk9JjYhYaeXiCdLpcawd84k5Qo+c/V6av8MmoGB99+D6Nv I+Pw== X-Gm-Message-State: AOJu0Yyza1+rr0YWG0xrORpOhj2TJLIbjwy+qvVsNiO5tMB61xTk5Sut 2ya88IUofIjaKcZ/28TMiSNqqcJz/5Q9PXn18YJa5FXrBCHkXZFT84ypygBb2D/nuS5wQgLNxVN H X-Received: by 2002:a05:600c:35cc:b0:412:a72c:9d9c with SMTP id r12-20020a05600c35cc00b00412a72c9d9cmr1611244wmq.17.1708969109772; Mon, 26 Feb 2024 09:38:29 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id 11-20020a05600c234b00b00412704a0e4asm12527590wmq.2.2024.02.26.09.38.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mitsyanko , Peter Maydell Subject: [PATCH v2 4/6] hw/display/exynos4210_fimd: Pass frame buffer memory region as link Date: Mon, 26 Feb 2024 18:38:02 +0100 Message-ID: <20240226173805.289-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-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, 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 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/arm/exynos4210.c | 2 ++ hw/display/exynos4210_fimd.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index ab18836943..e3f1de2631 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -770,6 +770,8 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) /*** Display controller (FIMD) ***/ dev = qdev_new("exynos4210.fimd"); + object_property_set_link(OBJECT(dev), "framebuffer-memory", + OBJECT(system_mem), &error_fatal); busdev = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, EXYNOS4210_FIMD0_BASE_ADDR); 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 Mon Feb 26 17:38:03 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: 775948 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1500164lte; Mon, 26 Feb 2024 09:39:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVqVb4Bo+bbs8vIFczgXld92H8zNxBO2wa4yrB4kwA0v6TUHaTe0DsUF8kMNIHm4mR4e9YsXhqrflYh00RAHH2l X-Google-Smtp-Source: AGHT+IEawit0d5NiCZiJsXhlXhnqHfMfzskl2c0WVBw0+/0VezylXDy98Ag1rmF/3SdSckE2ckFr X-Received: by 2002:a0c:b55a:0:b0:68f:e855:52c3 with SMTP id w26-20020a0cb55a000000b0068fe85552c3mr5870563qvd.45.1708969190103; Mon, 26 Feb 2024 09:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969190; cv=none; d=google.com; s=arc-20160816; b=YYUsK589nvsagmQTHo/KH/AfWGcipRRACD1FDZo77Dg7hEWXRL1lWQF1mfJOLIxdwk VVaQqTYNVICHQf/U/B0HjqgFInmMUuKzahxXFERo1H6tYQGVQ0GiJcQUqcR5uyfK8dhk AaE4NfRK+ON7B+XoWHmGSP7Atp1utZwyyN+KJCkTv2Qm4sCO+fYDRTOdMWL9o5jmSw+B bamLwew/QTcBgzDvbOgYw0yVTYE8ikk8sdT05zYv66xQ83JVrIWBlHshGHmX1KlHrGpY 7DBharxShiLDBoQbEn8gtjxb0bFzOLrA03v8nATNZoi5R5kfCdJ08MOF+JGGDtiND6/n O1Vg== 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=ibVcW3lwaKG1GGTyMtc1ku+JoJ+rReT+MXHBNQRHkgA=; fh=n0PTKc6cFaTUPm+4LUzQHB6y5ChB5NluvE1RUm3gstw=; b=iP14cf4W1XjRP/JUvjk5+4ugTWiLJaR+6ULC4draM8pXwnKFWvu7eR2WFriCQBYQEL 6aGUtnCwzVJ1Lio3BtAaNdSge0DUmaBbJnV5/EEviUnFWOgylLSiowKU+hDnwS+nymLO hATzZgTSOgYiOHwV2V27Ds79OjrToE0NfpabX3FTmcr6kwO6zx/IuvLTryxTDA6TeRGm DHnF79qxLIn1F593JW+ItFTBWX3dwBoHCDNwAlNKq0OByUAKAyFt2FXz/ZJFuTuW11TN BybzbnwQ4QyCVwabLWw1uVFMsxGJjv5Geg+OYAs0Qh/zjm6NT/8ScOkNegKBC+YE+akJ zLkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GWXD2Kas; 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 u15-20020a0562141c0f00b0068f731f88c7si5571945qvc.312.2024.02.26.09.39.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:39: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=GWXD2Kas; 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 1reew8-0004VT-1a; Mon, 26 Feb 2024 12:38:44 -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 1reew4-0004FQ-3D for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:41 -0500 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 1reew1-00079e-AJ for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:39 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-412a38e2adaso10228975e9.1 for ; Mon, 26 Feb 2024 09:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969115; x=1709573915; 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=ibVcW3lwaKG1GGTyMtc1ku+JoJ+rReT+MXHBNQRHkgA=; b=GWXD2Kas0o3bCKek52U4V18Gkimi3pSbE3BOSVXHsEwmeHLzb3iNw4pE82e377zHGy m6w53sX828oCFEIXDs03oYzT7Zq5cwufQkYJmgg69wfh9LV6JOYSZ5LCublk1mROaVC8 2dO0w6FlXRziCyfbstb0g10rhAF//xwYWk3jSGSWTeQS73RE3MMqI59Vf45GdqwUtR04 5+Mx/RTeg3yBB4MLKdvw+NYgRB5C6jpqGn90RzYKPeuBfpOO45rdjgHgdk6kIi4faZst YmutUHAtL+VPJQoCv5eN5cWtTk9Iw68yBj4+TMDPyxl958SoXEMWlyOFj8reuT6gdP// lB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969115; x=1709573915; 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=ibVcW3lwaKG1GGTyMtc1ku+JoJ+rReT+MXHBNQRHkgA=; b=dsod3a1FX0gJSbwI34ktiX+RjEffpfA/X10kxpa+T/FxY6s4zABluol2AWolfRyNaZ FvGaJRxZfDJ3QqEQIEPyuS/ib2v8VOZ9s5ZVgcJh57GS1S01dK2slF01flHbAT0tSR0E RLSiMOeCmvAUmI8QQ5vxRkl87KlZObz2dZQuCIY768yPsf8Ki/AHcKpVevXbtfOHMnOx 2ka+Kkg1nWXvzw+UT9KC0QwasRUjjOnQBFD+YeWdg8u1rws/QmGJAAGxhc/X7cSwFbHo /xVsfNrzMOkQ8De7lw2YIapoYeLuwGD8uXXgEdHWzuKXh56qRPTqhkEAOLMM9S823bfs //gg== X-Gm-Message-State: AOJu0YwIRQX/qd0uQHRBbt8lxx4FvWu/R4/WgwoMFS9A1+OrsjcxCBXo mmqvqp9h7QmLGy7AuOLlgZQIZaEqtcxscx2NMe676CXIr8/NnGZJ0fQrGbHBQNM3PQRdjD6nlac S X-Received: by 2002:a05:600c:5246:b0:412:8d98:78a with SMTP id fc6-20020a05600c524600b004128d98078amr7017617wmb.13.1708969115328; Mon, 26 Feb 2024 09:38:35 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id v6-20020a05600c470600b00412a2919d98sm5708711wmo.10.2024.02.26.09.38.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , kvm@vger.kernel.org Subject: [PATCH v2 5/6] hw/i386/kvmvapic: Inline sysbus_address_space() Date: Mon, 26 Feb 2024 18:38:03 +0100 Message-ID: <20240226173805.289-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-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, 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 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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 20b0300357..61a65ef2ab 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -58,6 +58,7 @@ typedef struct GuestROMState { struct VAPICROMState { SysBusDevice busdev; + MemoryRegion io; MemoryRegion rom; uint32_t state; @@ -581,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)) { @@ -614,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 Mon Feb 26 17:38:04 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: 775946 Delivered-To: patch@linaro.org Received: by 2002:ab3:621a:0:b0:258:3251:9e33 with SMTP id w26csp1499723lte; Mon, 26 Feb 2024 09:39:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX31Q9JYA2jEhetKpfwCafo5CgJWAwwV4q5FTvX9d5HWP0sBeb8nhsUR8DV2POZaXumXhyzQ6o30aU3SdJMXGAa X-Google-Smtp-Source: AGHT+IEw1QjEXjxysoNowLQXRyCSXeWx4cxlUgzWTxtbh7IH3yAvZCiAzXSmaDvqNmMXKZi7bBFX X-Received: by 2002:ac8:5a8b:0:b0:42e:81a2:919 with SMTP id c11-20020ac85a8b000000b0042e81a20919mr4524112qtc.58.1708969140244; Mon, 26 Feb 2024 09:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708969140; cv=none; d=google.com; s=arc-20160816; b=hWY4dSe0MRD7MzgnWS7rj7/j81RmoVVE6ChZ7BkFrGaE2LZ+kXpMidCe80H3QmTfed BX12jCQsMynOLDXyY3fU5AGijTXGomEQFdt4xAzVizhd5qQq0xz5JD+mXOdXjoJKgjIe oIgkgoqQufVaG7qwyKeJ5hT+vW0zvw3hNCuRJHs9DG/aLZ+tD2wUMze0CMFv7Ox2+yIH NY8oDjprEDMrp50aKSrnTa7OZCZIPTn/l9arBV62hEy1bT0CFWDLgZdu0NxwNsoRZNoM q8LJ0B4Zg0n1IkPCZcqoQYDhu1RR9DtPHVUucfNAxtY7lU0IYsNliy0hlFThmkZLaINe l2ww== 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=67Ry2a6gAfjKQBP9Yw9WSNGqndsJgD876RK2i0/zSrw=; fh=oQfXyeu5MNVyHvEzkBn+7hq0ylS5fLAj/sLY3qrixbU=; b=swzKzhIYLEutoACGkrpvpEMC3EyTjuOS8c74n6rGwNv5mnmaZW5Exy4zNs18U8A8I5 EGt18nGXvGM3IiY+7vbf52ntQutFsZrW9SrGWyLK2Vrhe2Ci1DC9o5yPtobOFrgBPjIr auJpYGrPxCQtvJ0Lhe2y5JKOTTr2N+dMFy530r3yNgYKSwVynCgC/S5ADEJhk407i74A zVjZFzrZ1RPf8kobYxD6v8B3GN+KRfWeHHpsgwxN821nWtRfHb+JaVQGIH60C749lZtg N3df1JrPv6SKeRUqhLbP0Yx+c+CT770PJI0/r/OfPOJlME8bq9L/s40HO68QlN2b1rUb MBQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpU3iXAm; 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 d22-20020ac847d6000000b0042e809d62easi3084931qtr.307.2024.02.26.09.39.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 09:39:00 -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=XpU3iXAm; 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 1reewC-0004ii-RA; Mon, 26 Feb 2024 12:38:49 -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 1reew9-0004Yu-3R for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:45 -0500 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 1reew7-0007AU-JS for qemu-devel@nongnu.org; Mon, 26 Feb 2024 12:38:44 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-412a3371133so10231845e9.2 for ; Mon, 26 Feb 2024 09:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708969121; x=1709573921; 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=67Ry2a6gAfjKQBP9Yw9WSNGqndsJgD876RK2i0/zSrw=; b=XpU3iXAmdkQdSxPVWMsr9IASBDwk2ok8jOtvQSXVffxNNURBnWoZej4effi9QX6K9L PQkw8ReTUlgMgPMmTLAy9lvF//76/DTvZDkPKaxRQiTLbtv/y5Ujb6bcyHP7UALnS5bS DhhAHfree9PgsQe3A6t8vSwpGLKDyqqp7wdsJCd8VEUODcwUl707xWTImBV2jU3Fd99r CC+r29kGY0ZtXauTtOaYasDa8DPX3Wy0Uvh3R+rQfP7DuabrtwJrKLixE6IA6AsJoENI YeFxqJz1YDGpAq7Zxj21CEmUroqqjBLp6KaaUKOXejHmdKjHwZWmsizRE1eoRn+Ek7Mt AZdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708969121; x=1709573921; 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=67Ry2a6gAfjKQBP9Yw9WSNGqndsJgD876RK2i0/zSrw=; b=qkRlLTQZey8nl17A805aAEwcGN0GpxEaV8r/Nf+QHVzNzUyTxsjOIZdNiUTgy8bLM9 fUqr1GYeN/jAmd6gvbVXAJAuYkS/G6nkIGCGqpNsHkFzqoC+XDhK4V2an3G1cXpg7DTK cLO2Bz6/Xd5TAoTj9i1toD/79sPud86RrQK3P6J5l1e50QCi4kDwMOvm3c5BMXGnWx8f wMQvl+CXU+1wF6g/inXKm3vwY++mrvBOPcYIA89Kzvgn1Y3dALclqjfvo9e9tAks0xYe +1BZU61myFxjuCD/7zlcHTZfEPO9KFI032F1gbZGmZ5gKVj7w3iOOtGUioC9GU7+/Kc8 5XfQ== X-Gm-Message-State: AOJu0Yzub4zR23dAJKbJbrHCXdKIsNkvHynAeVEo+lBUigIxsA56jdpP qrJVqJTlHw1J1FXWl9DFVUVMVH4QP9QjrlkGyUAbMzE2N2s2Dc/5t+m+EDi/SHnpK2N73SiIXt1 F X-Received: by 2002:a05:600c:4706:b0:412:a313:5a5f with SMTP id v6-20020a05600c470600b00412a3135a5fmr3562490wmo.4.1708969120904; Mon, 26 Feb 2024 09:38:40 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id g13-20020a05600c4ecd00b00412a1307106sm6258725wmq.43.2024.02.26.09.38.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 09:38:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v2 6/6] hw/sysbus: Remove now unused sysbus_address_space() Date: Mon, 26 Feb 2024 18:38:04 +0100 Message-ID: <20240226173805.289-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226173805.289-1-philmd@linaro.org> References: <20240226173805.289-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, 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 14dbc22d0c..3cb29a480e 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -83,7 +83,6 @@ void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr); void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, int priority); void sysbus_mmio_unmap(SysBusDevice *dev, int n); -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 9f1d5b2d6d..ad34fb7344 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -298,11 +298,6 @@ static char *sysbus_get_fw_dev_path(DeviceState *dev) return g_strdup(qdev_fw_name(dev)); } -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);