From patchwork Tue Feb 13 15:52:11 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: 772317 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp324733wre; Tue, 13 Feb 2024 07:53:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVjbhAnTTz/QRTWCgaeT5qcSLc5XRJrJPf6EozLcj/fysHy+gdvfDB5htMJdDfgAhpexN+T+mqG9lkRpqAjRreu X-Google-Smtp-Source: AGHT+IFum2178pPS+Bdtrz26Xjvd2WsLmYRBcLGCOW3DLbvAEsKXGPeLYO84ThbNEkIpQ2vQW8uI X-Received: by 2002:a05:6870:1585:b0:218:43e6:716 with SMTP id j5-20020a056870158500b0021843e60716mr9006258oab.33.1707839583112; Tue, 13 Feb 2024 07:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707839583; cv=none; d=google.com; s=arc-20160816; b=Jksh5Iuhb53uDeZzuOMKhP0sqSeLHhyDMFs6RPETc8/jnYOWMyoq3dfdmNkEpCjCAa W0DYt3LSXBm8EI0pxUcQ/n1mlXfO+n8tH8iJfChPkuA2AfFnrssuC9gbAxrkZQRPN2Ts oNeZm2aUGyQiLyrgENkFx8FfSo6Y+O0EjT4xmf7o1p3v0pTTCzrCWYI0HX4tjCdP3JBD ohPs01raWhxZaE0N57TTGiP89+SsvjT6lD34TsMvLzOox4mM1Z+kfxvrzEd4pDvUxTJK /OIten9cOsecHZktjkKHLDT1+nBGzfFBNXZXXPA8boWR8+RvUtLodQ/+QpAQ3KlTImhU ba0A== 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=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; fh=9JFGUO3HtgNHzXQWIKcz7j3umnaK9fOSBBfAN5k7TuI=; b=qDOvTpzdOBLYkF73xDNAIaI3Gxs+b34Mh1GdrXoPxeAAQerJrMLqiibXLCbpdiy64i hgQJeXE5kKSitKvizZpYGTw3f8mXx764DcHTEDWR2uye3uXvoNNdxbpC4NyLhiOqRmHj phEtqbQiekC7IFpGywDRRoSUXb4FvxmjtLoTr148OBOQwJWrX+RM8jsUufw0jgEynGxJ dq8ekS/ADM91++Ufi4y4gAjoMH/wRtTZoUQelIKR27y8kBOCHBjss6c8j+OIM1io0M8N mG90SJZebt4twm7iKud0TUNuV+2Uf5dKzLx38nu4WYJ2AREWmgoX2oO+4NEZEpQrNPtl +13g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DGvGivEO; 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 X-Forwarded-Encrypted: i=1; AJvYcCWz624OH2FfytFz8PbZPHYz25jWLjUoRXOntPgheuMTqqPWzcmKkZmnRUYQUD6fuGR0ljnV/qGAbQ1RxgoMwP/E Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id po10-20020a05620a384a00b00785767af0f3si8239572qkn.664.2024.02.13.07.53.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 07:53:03 -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=DGvGivEO; 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 1rZv5C-00016W-LK; Tue, 13 Feb 2024 10:52:30 -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 1rZv5A-00014Z-1L for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:28 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZv57-0005lg-8m for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:27 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3392b045e0aso3059563f8f.2 for ; Tue, 13 Feb 2024 07:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839543; x=1708444343; 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=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; b=DGvGivEOHnaarw4F+qcovDKo0ff/GUPOGq80idnwoVP28T5Y7gQzXudt0NWtSepMGz OmIKf5c2aO+Um2q66HRF/xc9DjWFTjFi886dYHhfTciL8IlUEFQ+2PrSC1q6ty4qwnx+ J35rOnIWaQHC5SjPFb/ZgeFvYpFK+WFyVSOza45vJYmSUxcOQ8NCr99hJ0UTLN1KOSU9 io8gxFDwFLes63mNbmPxI02SYR7E9xiDPzLxr/9t9Tn+MHXm+JxvTcBoyH0zzo8RdAfa MOudmZtZpNspUhDePwoPoRbNFHKphqaydtTaQDZbTAIsFaBD/U95zM3rqMQOYveuIx1u oK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839543; x=1708444343; 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=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; b=GiVKtBzVYYVgD3sA+wIbsDDrGsuO6WzSOkH84QTI3b/46l9on0SF6Gp8MPXf3/lsnx xz+hrF/svZA9pOv10WmLhzGxXUgf57NiBTuDA69FCvOvXeAWxMw5FF5syaxneZXWCQ1I 1k4sLl+gowqLRGNubqVf6YuLmSaYArLBn70AH/xGCuBlhNkm1zgzLMwhQEL1r49Lvf54 TR2hG/7DDrrbbkbI7kDdxpDZ83ZnPQsgmrqGP6+qzhp8bs5lz7SGBLyYrr0nbGPm9Wtp o7pEgFGYj1SxiiRWD9e6e3AH4y/oux/S6JOJd8JkyqUhRpnrTswinSfSWoPfZePbXs96 tjcQ== X-Gm-Message-State: AOJu0YwBEmo5YrkwonQM6jNYBUifMU1TFvZEhruHWOtEdAr9RyadtQgZ cwcDQ9rKPuZJssPcBVW/kR2QqQwDPgM+tAqUAIdBqUnIUs/g71TWrV/I55G/4TKAb2Fc0Ja4YD7 W X-Received: by 2002:adf:f84c:0:b0:33b:87fb:7106 with SMTP id d12-20020adff84c000000b0033b87fb7106mr3637882wrq.55.1707839543457; Tue, 13 Feb 2024 07:52:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWnaSTh5pd2/gZQHNTqQL/MOMe5XV8x67kfuVtsDxZkhKSMw/YkqmWW6rboCuiZ7dnlXqAhvVC9zeIFrQK8Lnh/T94oembmr1OxLwVtvAdOgJz4ZKC+fcJQ646eoAYshHbuvpQ0PNe/i3FRTVbMqSp8WQ== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id bu13-20020a056000078d00b0033b6d5a1244sm9873617wrb.12.2024.02.13.07.52.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 07:52:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Gustavo Romero , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/4] hw/arm/stellaris: Convert ADC controller to Resettable interface Date: Tue, 13 Feb 2024 16:52:11 +0100 Message-ID: <20240213155214.13619-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213155214.13619-1-philmd@linaro.org> References: <20240213155214.13619-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/stellaris.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 34c5a86ac2..4fa857970b 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -773,8 +773,9 @@ static void stellaris_adc_trigger(void *opaque, int irq, int level) } } -static void stellaris_adc_reset(StellarisADCState *s) +static void stellaris_adc_reset_hold(Object *obj) { + StellarisADCState *s = STELLARIS_ADC(obj); int n; for (n = 0; n < 4; n++) { @@ -946,7 +947,6 @@ static void stellaris_adc_init(Object *obj) memory_region_init_io(&s->iomem, obj, &stellaris_adc_ops, s, "adc", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - stellaris_adc_reset(s); qdev_init_gpio_in(dev, stellaris_adc_trigger, 1); } @@ -1411,7 +1411,9 @@ static const TypeInfo stellaris_i2c_info = { static void stellaris_adc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); + rc->phases.hold = stellaris_adc_reset_hold; dc->vmsd = &vmstate_stellaris_adc; } From patchwork Tue Feb 13 15:52: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: 772318 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp324746wre; Tue, 13 Feb 2024 07:53:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbJcNqp8ITPGoug5aVUA2UdMQlyVLuUhS++nLF03LqofGKczt723owDc599bihMlORlLlF8v8T/8GXZHisX+XT X-Google-Smtp-Source: AGHT+IETYD9CR5ueNPVlZtKYGD5W0yhvNQy+BD4sXlUVpbFH7TyOZtoUnwso/ye3/vikU8qiwB8y X-Received: by 2002:a05:6870:d61f:b0:210:c32b:c590 with SMTP id a31-20020a056870d61f00b00210c32bc590mr11569088oaq.27.1707839585731; Tue, 13 Feb 2024 07:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707839585; cv=none; d=google.com; s=arc-20160816; b=dQ/tzCQG0u2ttOspg428nCHCiTcpZHNuy0ONf8rRldUDCYS6yKMp3H4LnouZGuntSw xbvnVYkYJLz5RVG3KF6vYLZceT4PMmj/RoQVlyX2h/JDRSV9Y+p/UmA4M5duCeyXODNM L7quJTyggKAZX/HZ1j6abdYKL0t0h1QtbAB0d72guphQIewnLKTKp/JFMZTlM1uN9DqA QQqVajOUjCm34sab5ncn4unVpay/DszavgcZ+eYMfTIU4LQbEMVdsoMNXcfWHq7feo8z wil6HcrYWQ0EyxK5u2aWIyc49bnygTI+JGJ6xwXticfAL5t0HZEhd+cg2Ijz7A3AV38B Mkew== 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=L085CpBqbUnpyqRxr8xkRM4/gsDgBNq2ejRMwVmcLvc=; fh=hsKuLtvGC+QFsCxJwUHn5z2NfnVLtFjQENdqao6gSE0=; b=ybSIoF6jqs29jD9aEEXzJrpRY3Xiuw38HEUZSg5KyiELctKZaAFjOQ0XnrLRUgzn/n +lpgxsBjQgCWZSZhR/GV+QAtO9gAg+dUPie+rVbLQvCwL3nIoPI4RzCtm1RPVMeSMi5e De3aG2YgTII1T+9yPf2OenFdcMYSTSlN8P3wedJWuuEQt85bpxgOxqn9A6tk1vsSK1f6 xLbEXd97PiG88zB0QxKvy57L0f+5XSHYxeBS2fxrf85b2KPKTsDlxPKUQ2YlQPVFSn2w TZG9bnrv8YSbpuxWnjZcYCpg+PsYPixL/ddoGVPQUaJCPEdGodfsH1RaCmLsharF37CD NIpQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gqfUylW1; 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 X-Forwarded-Encrypted: i=1; AJvYcCVYE3c5pF0OODKMpzdfD5MRKcgbfSZkXPsFhFD4l2dAyq83cSs5k3Hue1WhThanAoGoNVuit6l2KQBY0bNkQFUO Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b4-20020a05620a126400b007871ffd03ccsi1160348qkl.235.2024.02.13.07.53.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 07:53:05 -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=gqfUylW1; 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 1rZv5H-0001EU-7d; Tue, 13 Feb 2024 10:52: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 1rZv5F-000187-IP for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:33 -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 1rZv5D-0005nG-2x for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:33 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-411bf7e5c6bso5287985e9.1 for ; Tue, 13 Feb 2024 07:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839549; x=1708444349; 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=L085CpBqbUnpyqRxr8xkRM4/gsDgBNq2ejRMwVmcLvc=; b=gqfUylW1BlOnHp7REJXELwFpkibfREbnhWI+7NDJqlUUKV442ZM19/Q9yr86+thPZG 7rqOP719Dq7wiFe6IF2LNVl+CwJAcFa6tL7beQUoBqAlLoUOWc4ted3axR17a4uaOE2A Ij9fwmZLSwuuOd0KZViEVYQowzusFSjjPYMMqg8Wv8mhWNAy5i8vCLxI99dzs+iexCn/ +vHAPORZdbdwEkUNrFF54iisIDybysL7CqL6NvbWjVgnhwE/4vH/WzqhbtPpuwWWJqNo nk+IwdNkRtCa4QC0zsL+V69wOCcFUTi3bZY/KWSoUp8x2y+GzdpVWw/xz6xqY+6FEKbj IM1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839549; x=1708444349; 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=L085CpBqbUnpyqRxr8xkRM4/gsDgBNq2ejRMwVmcLvc=; b=K1G6MRWp41FZ6Yj0J/c6A/Wg/VEl0Lcrmjh6/zAZwL/ilgJRtmzNOPzwRx5VXWHuKw LQ4Iylrn397vgmax4auCOm0qV5eGhbyZOWsUvB6RfX8F1uymTgFeqsqP4ZKluWzBUcYJ +cFSqX4ec4oIcAU/9Yasi98xDBhx4Oj8FtmnaGUwQagOpYFxPkCJ0n5mfk0/jwUHtHKN eUlnJhHJCOTY02jo/qJMAKsY8EAQpGSUr4o2fU6uXUIzN97K/COHf0+vsoAYa/lZuXbc stDxgO8QulcchqagfG+OKVyUQRQN0DEHKOdtGMWl3oEVpoHgxx9Aymn9MYhYtm8pMghj Ppow== X-Gm-Message-State: AOJu0YwL2Eh05kyi7qfaAtgvS8ScwXabnsL3mM7+OGUeq+MaBScp9J+V 3WNvSVS/eDM20WWbP5unpjH5gNnOfXNyensWRmPRCh90x87wqwcaCEiPWWZLLOFolhGpunk74W+ k X-Received: by 2002:adf:e68a:0:b0:33b:68bb:e0d4 with SMTP id r10-20020adfe68a000000b0033b68bbe0d4mr7797379wrm.56.1707839549476; Tue, 13 Feb 2024 07:52:29 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUw9y43ORycSmZRs6lqlG6429iNGLXvQA6XQLHwb0lbgnL7tN5yeWLsm0rHJkPib5f/eWu5ixgBCx4lWz05Oq3aH7JWmC+D0+w12+i8Vs4guKa5o/BXcMo1jlmK0S4zf+BNhMwYl3pPKcjkoJ/bSoHwVg== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id a15-20020adffacf000000b0033b39cba5e4sm9826619wrs.116.2024.02.13.07.52.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 07:52:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Gustavo Romero , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/4] hw/arm/stellaris: Convert I2C controller to Resettable interface Date: Tue, 13 Feb 2024 16:52:12 +0100 Message-ID: <20240213155214.13619-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213155214.13619-1-philmd@linaro.org> References: <20240213155214.13619-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 Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 4fa857970b..d3a12fe51c 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -462,7 +462,10 @@ static void stellaris_sys_instance_init(Object *obj) s->sysclk = qdev_init_clock_out(DEVICE(s), "SYSCLK"); } -/* I2C controller. */ +/* + * I2C controller. + * ??? For now we only implement the master interface. + */ #define TYPE_STELLARIS_I2C "stellaris-i2c" OBJECT_DECLARE_SIMPLE_TYPE(stellaris_i2c_state, STELLARIS_I2C) @@ -607,10 +610,17 @@ static void stellaris_i2c_write(void *opaque, hwaddr offset, stellaris_i2c_update(s); } -static void stellaris_i2c_reset(stellaris_i2c_state *s) +static void stellaris_i2c_reset_enter(Object *obj, ResetType type) { + stellaris_i2c_state *s = STELLARIS_I2C(obj); + if (s->mcs & STELLARIS_I2C_MCS_BUSBSY) i2c_end_transfer(s->bus); +} + +static void stellaris_i2c_reset_hold(Object *obj) +{ + stellaris_i2c_state *s = STELLARIS_I2C(obj); s->msa = 0; s->mcs = 0; @@ -619,6 +629,12 @@ static void stellaris_i2c_reset(stellaris_i2c_state *s) s->mimr = 0; s->mris = 0; s->mcr = 0; +} + +static void stellaris_i2c_reset_exit(Object *obj) +{ + stellaris_i2c_state *s = STELLARIS_I2C(obj); + stellaris_i2c_update(s); } @@ -658,8 +674,6 @@ static void stellaris_i2c_init(Object *obj) memory_region_init_io(&s->iomem, obj, &stellaris_i2c_ops, s, "i2c", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - /* ??? For now we only implement the master interface. */ - stellaris_i2c_reset(s); } /* Analogue to Digital Converter. This is only partially implemented, @@ -1396,7 +1410,11 @@ type_init(stellaris_machine_init) static void stellaris_i2c_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); + rc->phases.enter = stellaris_i2c_reset_enter; + rc->phases.hold = stellaris_i2c_reset_hold; + rc->phases.exit = stellaris_i2c_reset_exit; dc->vmsd = &vmstate_stellaris_i2c; } From patchwork Tue Feb 13 15:52: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: 772316 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp324600wre; Tue, 13 Feb 2024 07:52:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUcvEN1GK6kf1J5DL2Kj6oW3sSbKOv8vOBa21fRNXxSHf2shVQz3JAaQCYXwx+Ne4qtrTo8uJ6aZl3R1Ky5Z0IN X-Google-Smtp-Source: AGHT+IHVcRUZcXECJMUOz07+oe4JUr414MmwZF0HKMSqGOG5ZStGRBYOI3Wes39kOu14J8p5eenl X-Received: by 2002:a05:6808:14c5:b0:3c0:31ab:b945 with SMTP id f5-20020a05680814c500b003c031abb945mr10394803oiw.4.1707839565760; Tue, 13 Feb 2024 07:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707839565; cv=none; d=google.com; s=arc-20160816; b=bAF3tE84YceRXck8RewlB2W9ogO4yYkkgQC21YJkze3LME8HsglunMBsG0Dro2y6oF SbPbmO6kuGPuzs0KgAnqENwfbBy4b4trFtdXUlBRgJwNTEeCHWGsJv/NAYbi62/vA0v1 3Rzq/LqfKDZ/7V2Wd/42SwYSYD3CPLb9iqziM/q95A6YSkPr3FUtm01PdNATCVHQYP+1 BABDHEIwz6tw+qFpqLDsVzvCyUSIqQHMA0A4F/fjJ41J7+9brKjSkH5AQBmStt5zSUjS UWNZH8pkFHdHVStexqCLSIJ+5UM4mRbFBdyVe34YsW/5ngLMPtTJASd64+f/0E9R/9TB 9Yng== 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=5AxD+0YCMVgkroYfQziax4Z5o2Tig0RRdRnoJR3JtkY=; fh=T16U7QxuEMg1VfGTq1MyM7rjq8pSKLad7syKY1My0yI=; b=qyhs3HvkhR4jAQ6hpH8PXlmNIXDq3PhWaeAKQBmotKWoekSdJqwy3ufYta4mHxMLoE oUF9V4gIAiTsOFp/FP/8NZFt77EBixL/qUrPNlntUEEGgSGJ112Pr+QYCAFf+HVXNZUG LsTqIzKMFlVgXDsG19ZyScwTkwWsbBhQIf/YvYWLk1XWWZNQSWmZ0v/rFuH0Hi4Tywss 64N+ak4p/llEAZ0IwMJYhLD6vsRAIS97wLvAnyV8EJIIWdnm/df1Sfbq9+Rcv2XdsBPO 5iIg5ZKHML+LC0qpaMO8vROIbsfWE8Us+FLX+t/XBXWKcPITNGoiFYJZ1PipqPRx62pD HgCg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WmMbxwwo; 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 X-Forwarded-Encrypted: i=1; AJvYcCV1J78NBGOmMspVJOgv17KymSKIr3gfSwBj25jupuw/N3YpZbBp6XSujg8QBeTkglBgl5ZW517hqmb+uuSGnVeH Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jf8-20020a0562142a4800b0068ccc59df11si2945347qvb.394.2024.02.13.07.52.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 07:52:45 -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=WmMbxwwo; 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 1rZv5M-0001Za-TM; Tue, 13 Feb 2024 10:52:40 -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 1rZv5K-0001N7-L7 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:38 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZv5J-0005o9-1h for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:38 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33cda3dfa06so453920f8f.3 for ; Tue, 13 Feb 2024 07:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839555; x=1708444355; 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=5AxD+0YCMVgkroYfQziax4Z5o2Tig0RRdRnoJR3JtkY=; b=WmMbxwwonlhXPXVoekbf0Gz8IYqfGC/hytzH7JhqLkDLtZwPxxrVqDB3ZHv4Ijdb2h qL6NDcDnF7iOW0SuiVqm119vVL4YqbWbbQViZ9qOl/Y0yfn2YQWGMgTxOdGxK7IJIC+b scVJLUh3hdPFdKSnGK4G6d2BBHfeHZGCd177YB7kCpZuN1WuXGp53g4+8vQnOGKBtoyd GCjGqjvs7gQTskKAdEJemk/mCoY6lG2pf1hQSDIDi51ztBeqJfzMS9ZYBEEgb8MBZcvT rNxtqIYq+pOOCcDN6FO5fHYdKNYo/JEotXHYxBMuqmThIhR/tV8hSwyNHTppmvqeoXxi WH+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839555; x=1708444355; 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=5AxD+0YCMVgkroYfQziax4Z5o2Tig0RRdRnoJR3JtkY=; b=NCFNjUR45yL2pGiBv4HSRoJjnol5AN9ozp8kyknN22ZbKSwf4I1n2/G88VggXhUgPC +rpBk6lRXUNusgYmegM8HrFnRvtwuMgvnHA1TQJpWraFOq2UUijB5sng3ISYmTzIttMi g6qyAwQOm+rfgI8A/cs66ubmiZKQIJD5i/u4R10uZDdDfNgP5ZI4b9vCMZ2PwDrom4RN MAUpshcSdPYqdhlzUEjT3EnKZl9pJbnjbDXlcJAqzRbjwckT2WxBjAsqoWvVOIFFJOqM 91w/iudiNYd8JwbVnbW2uf74oUPWZsPaIpLtjXoUn/J2drUAEUorqksCd7Cfjr440j8F 4iDA== X-Gm-Message-State: AOJu0YwpU6KDVQDYD2KodsSq+lZFz8Mm39gcIEDMT4CPSjFPxtNy+eZZ BqWmqKESwoUyc0tSMKds3Tggzk2zNvjf2sq3SVDc/Xej0mUbN6UhJelB0SC0EtowCA79n1bF/1/ I X-Received: by 2002:adf:f890:0:b0:33a:efe0:5a37 with SMTP id u16-20020adff890000000b0033aefe05a37mr6590934wrp.6.1707839555340; Tue, 13 Feb 2024 07:52:35 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXKjmc1SZJV2956P8PE/PBTQFBMsL/I6B51CYt00/z6NkHA8dPuLoMTxxUAlxZ5JadBoGgrTkUki2f4ZOuZGU4GyguZTh8vpyqdlVFG+bhRx9jhJ79t0szDdH4CT+7QuOuwBlQTD+NaGeFMFYrDMygRMw== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id q1-20020adfb181000000b0033b68556c38sm10041274wra.70.2024.02.13.07.52.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 07:52:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Gustavo Romero , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/4] hw/arm/stellaris: Add missing QOM 'machine' parent Date: Tue, 13 Feb 2024 16:52:13 +0100 Message-ID: <20240213155214.13619-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213155214.13619-1-philmd@linaro.org> References: <20240213155214.13619-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). This commit plug the devices which aren't part of the SoC; they will be plugged into a SoC container in the next one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/arm/stellaris.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index d3a12fe51c..d9884286b3 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1271,10 +1271,13 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) &error_fatal); ssddev = qdev_new("ssd0323"); + object_property_add_child(OBJECT(ms), "oled", OBJECT(ssddev)); qdev_prop_set_uint8(ssddev, "cs", 1); qdev_realize_and_unref(ssddev, bus, &error_fatal); gpio_d_splitter = qdev_new(TYPE_SPLIT_IRQ); + object_property_add_child(OBJECT(ms), "splitter", + OBJECT(gpio_d_splitter)); qdev_prop_set_uint32(gpio_d_splitter, "num-lines", 2); qdev_realize_and_unref(gpio_d_splitter, NULL, &error_fatal); qdev_connect_gpio_out( @@ -1314,6 +1317,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) DeviceState *gpad; gpad = qdev_new(TYPE_STELLARIS_GAMEPAD); + object_property_add_child(OBJECT(ms), "gamepad", OBJECT(gpad)); for (i = 0; i < ARRAY_SIZE(gpad_keycode); i++) { qlist_append_int(gpad_keycode_list, gpad_keycode[i]); } From patchwork Tue Feb 13 15:52: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: 772319 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp324783wre; Tue, 13 Feb 2024 07:53:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsK6gSU6RB6JNs8tuO56NSHEsiVTWcWpWiAkUDX9jafEH+6r6JkvqwzG0SububB/UrqgTU X-Received: by 2002:a05:6214:27e4:b0:68d:b1:3833 with SMTP id jt4-20020a05621427e400b0068d00b13833mr9885213qvb.7.1707839589515; Tue, 13 Feb 2024 07:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707839589; cv=none; d=google.com; s=arc-20160816; b=eUOakW23ckM5dRJVSUn+N0YRtargik0xjwFiSf3b3DGQ0+9tkLASoYZCZ+up1er1Zq MiUI9JuYjRXZQEzcLfGkT0J7nlXD6E2vCzmo61+UJY3exvFbiBRXrL/N4NtOOkQA4TIg 8lWw5a79YDamg6w10p/dGrrImLLmSt3EalcC8ka9MaRr9AwX5DLpytaGXUo1S9tepLXd 3LA3am0FGjcgvfeZkSSqy/Xk5yIZtEviGaPXCtci26ENfBukI6btIyd1UeWAy8yoUdUV JFkjLxoUpgLpj6a9NyHdG6Ar7b7ML4WgMrrJ1vKD5GE/I7hMzh3Tgz3sa0fMNpR4ejLE NIuQ== 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=+WO+U/cdRoubxdgTYbsdCfwDQVIWpi3TD0ntR/eAxO0=; fh=UZUzxQrSdLNY9P3aAB5f8buOV9niqgPQsLjxQu2Ob5U=; b=Kxt2zJaJTxkgZxYHMxDh2SwsMKRdQ7K2+zM0dKRQjF9qzi3U1OKfi85UhmfOb2RRv4 oqyXMpPeG9NvVMRVEHyC55QabKSuInsuBvYPqmDfnEGAPhyUA4eDzTCpTuem6Pzhjsl6 WrsLj+6GlNjNgEoXd7TANPK+h/lShWdsw1hyN2OzBZm8M4ZrDRc9rySScENxDrgnZaSM yRoWIG3Z9XsXEJoHMEGzqBc6AlMQ/GOXBRoxSeihDdBfinu9OPzOnNh5MxoTRhoWDdkS DJW6jagIvLkZ0/crJc4/Kma8iwjHIjDRR8rZHHBI1k3O2/i2uy5gYMCWohiHIgGFAVMF dWZg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TgQv+149; 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 X-Forwarded-Encrypted: i=1; AJvYcCVmuPVoMWdPxZ+9FnP+nmb45jW2eqzyRDG5DImUfLmzuUfxT+z0fPD+7oHIACQKOyal/cpvDlr35TgRy3kcFUU4 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jp15-20020ad45f8f000000b0068ccb551887si3129750qvb.525.2024.02.13.07.53.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 07:53:09 -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=TgQv+149; 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 1rZv5S-0001mP-5U; Tue, 13 Feb 2024 10:52:46 -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 1rZv5P-0001jS-Vu for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:44 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZv5O-0005qQ-Ee for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:43 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33b86bc4bbaso1017152f8f.0 for ; Tue, 13 Feb 2024 07:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839561; x=1708444361; 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=+WO+U/cdRoubxdgTYbsdCfwDQVIWpi3TD0ntR/eAxO0=; b=TgQv+149C3sg1m9l4Xc1SGrOORe/CLY65Wo+7bhPpBkjHZtlFgwRYAIwz8fP3E8DpG s3qfhNf7/ar1kOHaKguVFJtQhXb94oAXLJ5CNiBHZBv0t64uMvVctpmN5JSofOmg5jqW VDObuReY5v17W9Pnhg66JFNgUd33bWfGtyl1YtAVNZaARjcZc7eFYUWRH56fgkt9Pnr+ VXpOVwAORwUf6iclBXzBQ4KYiHLCFud6KFkSO4ILAXbcvYEtnmjkqIuHn5RCbPZa1rOl a6Bm8srRKwEdUadEu8wFXbPnuqO2sq/OTZ/UoDYlBJN9qbgFMdKnulsFXsu1r14HCDmu YbRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839561; x=1708444361; 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=+WO+U/cdRoubxdgTYbsdCfwDQVIWpi3TD0ntR/eAxO0=; b=SCclwq7NnL3BF9jTzUtN2AIrZrPHZRq9vO+XUOpqWBhi+tDCIc6ZtuHcC3N04L3vbB fT+l5oNvVi/LhHe7fwftZAMgWqfRDE5BEhCudChy40sWfYjplJ35OT0jagwghOda/64a 90j89V7fnPobCVRoh7WzrpzeZYt6iwdPs496gz530R4gEPb/SchWtmxgsbktiyczZEjM fpDjP66bkoMr9040Xoa7wqyJ0dJWrjpVDZsk7hQFGIajXisRfykEGazA0HokQ7P+pG/L UHoOMIB1L78cf4qQu1stcJlz8kYfQKVg3+iMLdRBjOrb07eup7FmAIELEL5nJoMwcKkX JWxg== X-Gm-Message-State: AOJu0Yx+yLk6XwJMiN6vz+JU+7vJ5yoH8xQI4DS9QN/twiLyEs7RDzL6 58PQiykWT5CRWLydgCp00My0LuIZvxaLezqSgguxCgfyj1ZWdT5W6wwYPYMYr/PggSFGgNnXNB4 Q X-Received: by 2002:a5d:4041:0:b0:33c:e2ff:6c85 with SMTP id w1-20020a5d4041000000b0033ce2ff6c85mr404562wrp.49.1707839561003; Tue, 13 Feb 2024 07:52:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWuhi63JoJf7Hfb60531BHbj9k6yJtyJsKRjX8qXWSp/rOSmT/+PHCgezmXIenmTz+Jt0OZIZ+GxKZOF0aPmt1AMrvdyebU1wKovZMHvuXlbIzuFTsZQXU1dDrtew3Yv6zN3c7oeVphpBR1Z8FP+BT3Rg== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id i14-20020a5d558e000000b0033929310ae4sm9873011wrv.73.2024.02.13.07.52.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 07:52:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Gustavo Romero , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/4] hw/arm/stellaris: Add missing QOM 'SoC' parent Date: Tue, 13 Feb 2024 16:52:14 +0100 Message-ID: <20240213155214.13619-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213155214.13619-1-philmd@linaro.org> References: <20240213155214.13619-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 d9884286b3..a2f998bf9e 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 {