From patchwork Mon Feb 27 14:01:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 657082 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2381178wrb; Mon, 27 Feb 2023 06:28:30 -0800 (PST) X-Google-Smtp-Source: AK7set9dqVe+gVEivgHVNBV/Ws6D01N+GCb0aZYJs8CQrh7Lcn2VckumYSjnWaGo1ypryr3yciHI X-Received: by 2002:a05:6214:e8d:b0:56e:a07b:f4d4 with SMTP id hf13-20020a0562140e8d00b0056ea07bf4d4mr49561410qvb.3.1677508110238; Mon, 27 Feb 2023 06:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677508110; cv=none; d=google.com; s=arc-20160816; b=XrQfgUdTdh6S3tXTDLYRaFpoNbNZRXRV2a4AhT8/C/7rqbVxhy4gLDAy/I/z7RyrZq uHLQ8cCq78VNdq30lt9D22bTUJBQF0mU7b4LlAtQij7J+z3+Gj3tboy5b+bIMvPNA/Jo fqkxDy9TrMhhO1clqQMfZ/Rgnty0Krr/8B75ycQLk7SpQDNXTY2wA2kSQFfKiGBu4MBD Cs6pAgEFqYvvlmVnI4BzfmhIECTcMVbpREkf3WJ4SwbzhHmCt8eL7uK4HCh9XnOdo8B9 s1uTOrKTC6ZP1SDxqPzlFc0ayC1wwcTu/EdQlG/dL//zABya0q6FrmcoECA6bLkgSOdp HOZw== 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:to:from :dkim-signature; bh=reFqpRaD/SRUkm/EOnn9E/Z0xVn0tzwElddaq98oV3o=; b=0RM7yYudjxmGqZHZ9ZW9H/cnX9u0+Fyt217LoXysYSJLFqONto6SCH6EWMbGWuV7fa SnrmToyLDumSflHfMyFQdNXRIVH/sORwsFgK+gvCFOsR62JX/q2CHELRrIzoxG1dQhx3 O6jF02OYE0Hq0qim2WdqwYn/iRmomcO7v++JBafEN2zcwmTe0yCgfGTQPSoKAyR4JW0l VB9Y32b6FLD51qQNPDFFQOuhGR3ZK5K8qY9UZBuG5viuH0S4EklV/ITtPRj2tvmCzhc3 L/t9ku7VbkI2ncXKSL3v9jKCx7DskhP0FyF9SKiPgcRyZtgNn2/KH+3xUgraQSCjccer Q35Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jT63GyUF; 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 r8-20020a0ce288000000b0056c23bb1597si7071447qvl.88.2023.02.27.06.28.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:28:30 -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=jT63GyUF; 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 1pWeCM-0005Kd-HC; Mon, 27 Feb 2023 09:09:50 -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 1pWeC9-0004mn-Vp for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:09:38 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWeC8-0000b3-Ad for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:09:37 -0500 Received: by mail-wm1-x335.google.com with SMTP id p26so4307189wmc.4 for ; Mon, 27 Feb 2023 06:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=reFqpRaD/SRUkm/EOnn9E/Z0xVn0tzwElddaq98oV3o=; b=jT63GyUFa7ScoWkWi8FCYh1gQGra0gFt4iTHSwSnL5umiiojJ+jARHFN6oxbxa7C1q 42fEetnCu0zI98ZXSgwhjiwpiXAN0lNWozZ3DvOWkA7KcfDdFoc1RGGrToQO5hn7WpWy r8P/2PKJvJ5RB3paCtdBE34nKrNuvaCivN71faex7UfGCT/EBcpElCp80NA94h/sfA/j V3lciG4iSDpzKgpzbUQdNUtm29HcHNFKH6I3zmDMJ9eoc/4KIvTXeHxYDomtiYqhZSiU a6zqQ2mlcuZthp9TBuN1SW3gBqRkHMMKbuawOsK1LE3F7PLK248HjzOlQSPzPiP5+X1y obMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=reFqpRaD/SRUkm/EOnn9E/Z0xVn0tzwElddaq98oV3o=; b=NKyMqQtqtOHElXmZ0Jxvubr/uJPznfqiflWkNrTJKS37/thuF819hvLD7sSOhO4Uf1 B7ITim20hFWd1XAUAyUED5uaPbjsoJHjgPYnI3+0e2n1phogQDap1ISNFYa2pMz23ACO OhTs+1xM3xzNqAP60XBYTepyt5Wzn9Muou9kGD49WiPPBz5P93L7OxcIeJ2J4msqjqr6 iFUnaBdj1asbqHXwgyLyTUntv/uSSHjiTXeeCPv/eutYcxZCZXw/3PDzHjygChTBQiRn ULy1BbuIhEBDGWuYdkk1aRoZEdiwRgiB5Jn9EwbWY2M4R2uM0Ljig1PbSHUOyXLpI/1D V0VQ== X-Gm-Message-State: AO0yUKWvc4rLQHC+MJD1exbTWcu2HuudUZ4t8BxrB+qpaGLJmxFsOrOj CkAhLzuhlAIACF3E5oXlAb0SKsoLbsHPz8oa X-Received: by 2002:a05:600c:3093:b0:3dc:5c86:12f3 with SMTP id g19-20020a05600c309300b003dc5c8612f3mr15892250wmn.1.1677506974537; Mon, 27 Feb 2023 06:09:34 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n41-20020a05600c3ba900b003e20fa01a86sm9877012wms.13.2023.02.27.06.09.33 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Feb 2023 06:09:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 090/126] hw/display/sm501: Alias 'dma-offset' QOM property in chipset object Date: Mon, 27 Feb 2023 15:01:37 +0100 Message-Id: <20230227140213.35084-81-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230227140213.35084-1-philmd@linaro.org> References: <20230227140213.35084-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Note we can rename the chipset 'base' property as 'dma-offset' since the object is a non-user-creatable sysbus type. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: BALATON Zoltan Message-Id: <20230203145536.17585-12-philmd@linaro.org> --- hw/display/sm501.c | 7 ++----- hw/sh4/r2d.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 38b8d0e16b..bb53499dff 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1944,7 +1944,6 @@ struct SM501SysBusState { /*< public >*/ SM501State state; uint32_t vram_size; - uint32_t base; SerialMM serial; OHCISysBusState ohci; }; @@ -1965,7 +1964,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp) sysbus_init_mmio(sbd, &s->state.mmio_region); /* bridge to usb host emulation module */ - qdev_prop_set_uint64(DEVICE(&s->ohci), "dma-offset", s->base); sysbus_realize_and_unref(SYS_BUS_DEVICE(&s->ohci), &error_fatal); memory_region_add_subregion(&s->state.mmio_region, SM501_USB_HOST, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ohci), 0)); @@ -1980,7 +1978,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Error **errp) static Property sm501_sysbus_properties[] = { DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0), - DEFINE_PROP_UINT32("base", SM501SysBusState, base, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -2020,6 +2017,7 @@ static void sm501_sysbus_init(Object *o) SerialMM *smm = &sm501->serial; object_initialize_child(o, "ohci", ohci, TYPE_SYSBUS_OHCI); + object_property_add_alias(o, "dma-offset", OBJECT(ohci), "dma-offset"); qdev_prop_set_uint32(DEVICE(ohci), "num-ports", 2); object_initialize_child(o, "serial", smm, TYPE_SERIAL_MM); @@ -2027,8 +2025,7 @@ static void sm501_sysbus_init(Object *o) qdev_prop_set_uint8(DEVICE(smm), "regshift", 2); qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN); - object_property_add_alias(o, "chardev", - OBJECT(smm), "chardev"); + object_property_add_alias(o, "chardev", OBJECT(smm), "chardev"); } static const TypeInfo sm501_sysbus_info = { diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..d7020d6d2b 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -274,7 +274,7 @@ static void r2d_init(MachineState *machine) dev = qdev_new("sysbus-sm501"); busdev = SYS_BUS_DEVICE(dev); qdev_prop_set_uint32(dev, "vram-size", SM501_VRAM_SIZE); - qdev_prop_set_uint32(dev, "base", 0x10000000); + qdev_prop_set_uint64(dev, "dma-offset", 0x10000000); qdev_prop_set_chr(dev, "chardev", serial_hd(2)); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, 0x10000000);