From patchwork Thu Feb 15 17:35:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 772927 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp954006wre; Thu, 15 Feb 2024 09:38:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqtZ+MuVXwcm3u8pZrorQValZFUe+Z2+cVaQNQPOif7eY3jYoyKUhJZ10vSjRiq433AsUmvz7+j60/B1cWghqF X-Google-Smtp-Source: AGHT+IGcdaLrOow4bhVNjHMA0Q3PfjAPhvRIoh3f5MxTKSBAAx6PWp7+IoO3L6WdPsXIrbSTnmNp X-Received: by 2002:ac8:7f94:0:b0:42c:14b7:b617 with SMTP id z20-20020ac87f94000000b0042c14b7b617mr2913463qtj.3.1708018713154; Thu, 15 Feb 2024 09:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708018713; cv=none; d=google.com; s=arc-20160816; b=nAZO1iZNVHGXMiLfK96M/Nr6i+0nLOYm4VRxyily97iBfRHA3eiuYc1M4uoBCyROyD Ck309Gw9sHqVXJmuRXENp6Pzf22CGZQQeSZs4/N/DeJVe+aqIKcByQ8gx0Kb98i2/ey4 wdTPvqwH2NXeRrj/l5/37AhWOHLuzYab+4u2fpuPilkChf9hhw7bjTJ6tycke4fSz59l 5CacLlXTgrQh3xtOFdXyNk9LVIBmwDm6LuAtJskuJa0jtI6VqXMqdyGbDAbQ/HHAjBXy OQJFF6U+a9+nMLxG1KSTYQu96mUq0sSAVMbFM6lFukt7CXTSjMLqCpr95kPHey4PAx1w yIXA== 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=1HuGvjbyaFuNkELSJgH9k4dc4RWkJylBVt2syMO9HNA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=b13CxIfSLM81LsdbbSq4jx5Bl5ibt8ffuBbnZMNvur3I8XlD9F5fM0y60UDGDQb/DK 9OJuXak4uiMvfoumwb3zcdpNLTYgLPXGYXzGNr3A+YWtnZZ79hcmUyDfJkMJa8AR/Ef/ 9pHhPnZXwAAeGiGLmkyB/AoGxsAXQnbJwW6aGxiMfrl/ljVNjAhONKpNzU0qTzxunoDy R7x87Jzt0U46kcnqamCKOoAOIZYiUCrG84dTXhaKZnX9k8r9rUxGsWCwRlaSMCr57Xfq HZb9fHwMaEePc9lI9sqkoGvbBpsGTT7jMHz0m132uDQi6ztIy4UXy70DLqdHM2xTpSoO b9IQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PDbfHrFk; 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 i13-20020ac8764d000000b0042dabcbde13si1771521qtr.4.2024.02.15.09.38.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 09:38:33 -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=PDbfHrFk; 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 1rafen-0008T9-Qj; Thu, 15 Feb 2024 12:36:21 -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 1rafeO-00082K-1w for qemu-devel@nongnu.org; Thu, 15 Feb 2024 12:35:56 -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 1rafeI-0003z9-EZ for qemu-devel@nongnu.org; Thu, 15 Feb 2024 12:35:55 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40fb3b5893eso8871175e9.0 for ; Thu, 15 Feb 2024 09:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708018549; x=1708623349; darn=nongnu.org; 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=1HuGvjbyaFuNkELSJgH9k4dc4RWkJylBVt2syMO9HNA=; b=PDbfHrFkJ2cEGpX65nMmQCxH9kPbXlMy0hV1e7CZEfHJ9fs++4OV1aw1lJzPVbF52s XYnqA57EI5F5ZCmk9y6xa7zgftcQmCTXIPN6gkxfMsWQsdtwx1zXkBVQmdUswC1k6JBU FFRCtWPlHsgDJ4rwbDEzzEP8RpU8I1LHgtk0SEKffcB34ehE8ERntjl9ncIyz7G0cYrH FlX9J7VHKDQlmLv2e+4SkhPeLIXLldHjitth83uvZ3lVITSQVzCLU9upnlkwK+qRvqPd VxTx9Yw++bw5kPtKcGY+3vkqbFYarVO7M0QBd4CWUssRJxmJUmdt/mvxSjZwnN7D4N3N 9Ouw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708018549; x=1708623349; 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=1HuGvjbyaFuNkELSJgH9k4dc4RWkJylBVt2syMO9HNA=; b=ZLMGG43UtxtVAJ1tfuBsJdeJyqhWu9uCEDXSzWKJY8WtUf5mrWZizxTX8BUPpiylXm f/KpTnfbBac2qpeP4QB6r+23cG3u7pSGzavmUc1GeQNTBGwCKiZgW7Oi3dzbPXsnsgAR ywKI1LwbV+ZgA4WP2ZjvmY681gPv+tdDHILVEnOev+iA8V4gYX0AM+TvoQYerabcNttm LOOHT5jYrlEdFC9XLpXlgFvtgkpkoF4qH/F9+38wN0ZmNg1ltDfK9Xg/a/f/D9koWDC2 VrUMlFhMrjB+XlgLUDtA+dSWIyj4eYy5BTXrUQR/ndjLF5pRNuXDKcL/HLhEcnP65uAj 5ZLA== X-Gm-Message-State: AOJu0Yzb35MEFHPkXh3h7H7BlLXf+keYbSng78x/veybiYAfGIm+2eZQ GOqYKfIkp561MsbTaqQpzeLTYSU51Glyg+Dv7Zo2biqmuXHO3b0d3R1evBTf1pWA/JU6Xw9LBkO D X-Received: by 2002:adf:f187:0:b0:33d:82a:14af with SMTP id h7-20020adff187000000b0033d082a14afmr1302685wro.64.1708018549159; Thu, 15 Feb 2024 09:35:49 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q16-20020adfea10000000b0033cfa00e497sm2384129wrm.64.2024.02.15.09.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:35:48 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/35] hw/arm/stellaris: Add missing QOM 'SoC' parent Date: Thu, 15 Feb 2024 17:35:25 +0000 Message-Id: <20240215173538.2430599-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215173538.2430599-1-peter.maydell@linaro.org> References: <20240215173538.2430599-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@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 From: Philippe Mathieu-Daudé 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 Message-id: 20240213155214.13619-5-philmd@linaro.org Signed-off-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 d9884286b3f..a2f998bf9e2 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1031,6 +1031,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]; @@ -1052,6 +1053,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); @@ -1066,6 +1070,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. @@ -1092,6 +1097,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); @@ -1125,6 +1131,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); @@ -1138,7 +1145,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")); @@ -1178,6 +1185,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); @@ -1298,6 +1306,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) DeviceState *enet; enet = qdev_new("stellaris_enet"); + object_property_add_child(soc_container, "enet", OBJECT(enet)); if (nd) { qdev_set_nic_properties(enet, nd); } else {