From patchwork Tue Jan 30 19:03: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: 768104 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1525482wro; Tue, 30 Jan 2024 11:04:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEle4m+5sU/htE1dIqHNDkzn/ozACY+6YdBeb9/RWtfF5aDoxqIurdBKDQwNN37T/UiMLZW X-Received: by 2002:a05:6870:c99b:b0:218:4ea3:f578 with SMTP id hi27-20020a056870c99b00b002184ea3f578mr8237008oab.53.1706641467951; Tue, 30 Jan 2024 11:04:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706641467; cv=none; d=google.com; s=arc-20160816; b=zm1kLIg7USOfEFKB7MB55+9n14FsfY5td2udsaJrWOgNNlTopO/Q/nnBzUy8v97ygM Me9NsH/4hg9WnsX6AoAZDk5qD6PWALSrUPDX7ZsDmWuy2GbCbPV46aV7YjYXD1C1E3mV YUx6LNAab4h6AMJdaI+kF8pqQnJkswFlM0ITiAb2oFgRBs7Jn3qr94g5BAnpnEKwnjWc Db8sQ2b7rs2o5TlyoeNOOmCA51yiJh6cnb84gSYr4TQY+p2Xyvc++zHXgAQ9Y/wY3mz9 u901KdpWpFRMr/3dPyCNuPzubTVrf2izqqcx65I7Ex8RyDt6c+9No+OBky3BQpTkUXYi cyTw== 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=8Enae3717LfHgjJzKTiqqlkaB8nPVlBbey3ho9e5HGg=; fh=SR+8DozJdQxNforhpK7RQJlJqxcnmmBQq9YEbztxGAo=; b=A7wMmC14Mo8/sR8UKiNuIqA4VdlDkfWXUXm48wbv2T3Hdq4vusk8EX5u+MyrPKJq8E ogNRvbOZajeLgbeGEvrRc5+wUjdMxvcoXR5rZjNWvGpBCp6DuCILJVm/bhM3Ez5cHaiL gCclu4RMDeWPlW8ltuHNIqfwww78SCpvmSxoZdXHjtMxbz6go/pxLZSVsQCcHKfWdOH4 Hbh8tI9upoKonDNEThujqt7mO2KBh84kyaIBn3vXWSHmDmD5nN6sGnL+iRi2VFnJvBmh HXO+LcazXDLBUUrW+9Aa5uEbIcoCwIT+VhdCvSqpGdzQUpugluOlefvLMR+IgO9tGtMO YaKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JulB6Hj3; 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 b29-20020ac5c0dd000000b004b733346620si1292303vkk.92.2024.01.30.11.04.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2024 11:04:27 -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=JulB6Hj3; 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 1rUtOz-0001Jq-Ps; Tue, 30 Jan 2024 14:04:09 -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 1rUtOn-00014U-Gj for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:04:01 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUtOd-00005J-MW for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:57 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a26fa294e56so554640666b.0 for ; Tue, 30 Jan 2024 11:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706641426; x=1707246226; 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=8Enae3717LfHgjJzKTiqqlkaB8nPVlBbey3ho9e5HGg=; b=JulB6Hj3gCGVEnrr6MwGJB0z1dUhaP8TtMFqupeL9FT5aJCARaH4BGbEDV+hpfhp/O +jjwST9QaY2arOpQti8vD5w/HJPsZP1fyORC+VEyfzUNMn9yVPFFBPNMKzrNqfFUv/bM xuf7Qb2Ym+TEkLg2uuoF03IPTwydcCzQiAVjUOjmybvGgUuX/EvYbBy93VvP1aqWTXXE esSnPGsofZCDK59jSFeXdIZxezPN+/A/3eSkmYHF2sFIl3F9sgnXUiH4g73PqiblQIy4 KUy+oRDoqVsWqs/7NbbsS4CTtghtgvWbWZBecuTNV8VZYSv4eFucRZi0cQJpjySWxvjm VwxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706641426; x=1707246226; 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=8Enae3717LfHgjJzKTiqqlkaB8nPVlBbey3ho9e5HGg=; b=N+CHvjFTXLh34+oPYMvbrbVeSwdX2p36fXKHYVeZGpatS+Sa6o+8T+Y9kohWysleVP 7kaUU6qKjJCfHYJluk7UV5JjF9oLORSwkMI5HFnT0QvvhL/GRKLkzc09f9L9JhhBtZ9c BEXVFp3T0wj4GUYsRt5gn5Nujz8HutoqvNx46E8NI1tYy4A7UIdSgDwvMPHRHbkKkcwR eAqj7MD+QMH2yIVip3mWUa6urSbzK8/ft1ltAxzVZM95jnU/eD3RWogFF+ZsbwTB1YeZ nWkezrLCSjo96gYhsFU7xyn/qsNs9ViqvFoYU4g+lYIXsCuURurA6WrhYFNmQo/7ettU elPQ== X-Gm-Message-State: AOJu0YyOfT3oUi9vx87f2MlX/bw3uL0Vbfqcr9fB2jL7pn0EcPEmiGGY PemalNvjuGjSAKCJtC2d9xZ4dS3kLZe44bLcTJE0jSa+iOgl+PlObzwTjVFU5sIJqm86LAjB/c+ 4 X-Received: by 2002:a17:906:7190:b0:a31:7e46:eac4 with SMTP id h16-20020a170906719000b00a317e46eac4mr137038ejk.45.1706641425935; Tue, 30 Jan 2024 11:03:45 -0800 (PST) Received: from m1x-phil.lan ([176.187.218.134]) by smtp.gmail.com with ESMTPSA id vu12-20020a170907a64c00b00a3006857c55sm5359923ejc.130.2024.01.30.11.03.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jan 2024 11:03:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Manos Pitsidianakis , Markus Armbruster , Gustavo Romero , qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 4/4] hw/arm/stellaris: Add missing QOM 'SoC' parent Date: Tue, 30 Jan 2024 20:03:17 +0100 Message-ID: <20240130190317.25692-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240130190317.25692-1-philmd@linaro.org> References: <20240130190317.25692-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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 QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). Since we don't model the SoC, just use a QOM container. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/stellaris.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index bb88b3ebde..e349981308 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1018,6 +1018,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) * 400fe000 system control */ + Object *soc_container; DeviceState *gpio_dev[7], *nvic; qemu_irq gpio_in[7][8]; qemu_irq gpio_out[7][8]; @@ -1038,6 +1039,9 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) flash_size = (((board->dc0 & 0xffff) + 1) << 1) * 1024; sram_size = ((board->dc0 >> 18) + 1) * 1024; + soc_container = object_new("container"); + object_property_add_child(OBJECT(ms), "soc", soc_container); + /* Flash programming is done via the SCU, so pretend it is ROM. */ memory_region_init_rom(flash, NULL, "stellaris.flash", flash_size, &error_fatal); @@ -1052,6 +1056,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) * need its sysclk output. */ ssys_dev = qdev_new(TYPE_STELLARIS_SYS); + object_property_add_child(soc_container, "sys", OBJECT(ssys_dev)); /* Most devices come preprogrammed with a MAC address in the user data. */ macaddr = nd_table[0].macaddr.a; qdev_prop_set_uint32(ssys_dev, "user0", @@ -1068,6 +1073,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) sysbus_realize_and_unref(SYS_BUS_DEVICE(ssys_dev), &error_fatal); nvic = qdev_new(TYPE_ARMV7M); + object_property_add_child(soc_container, "v7m", OBJECT(nvic)); qdev_prop_set_uint32(nvic, "num-irq", NUM_IRQ_LINES); qdev_prop_set_uint8(nvic, "num-prio-bits", NUM_PRIO_BITS); qdev_prop_set_string(nvic, "cpu-type", ms->cpu_type); @@ -1101,6 +1107,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) dev = qdev_new(TYPE_STELLARIS_GPTM); sbd = SYS_BUS_DEVICE(dev); + object_property_add_child(soc_container, "gptm[*]", OBJECT(dev)); qdev_connect_clock_in(dev, "clk", qdev_get_clock_out(ssys_dev, "SYSCLK")); sysbus_realize_and_unref(sbd, &error_fatal); @@ -1114,7 +1121,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) if (board->dc1 & (1 << 3)) { /* watchdog present */ dev = qdev_new(TYPE_LUMINARY_WATCHDOG); - + object_property_add_child(soc_container, "wdg", OBJECT(dev)); qdev_connect_clock_in(dev, "WDOGCLK", qdev_get_clock_out(ssys_dev, "SYSCLK")); @@ -1154,6 +1161,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) SysBusDevice *sbd; dev = qdev_new("pl011_luminary"); + object_property_add_child(soc_container, "uart[*]", OBJECT(dev)); sbd = SYS_BUS_DEVICE(dev); qdev_prop_set_chr(dev, "chardev", serial_hd(i)); sysbus_realize_and_unref(sbd, &error_fatal); @@ -1276,6 +1284,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) qemu_check_nic_model(&nd_table[0], "stellaris"); enet = qdev_new("stellaris_enet"); + object_property_add_child(soc_container, "enet", OBJECT(enet)); qdev_set_nic_properties(enet, &nd_table[0]); sysbus_realize_and_unref(SYS_BUS_DEVICE(enet), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(enet), 0, 0x40048000);