From patchwork Tue Jan 30 19:03: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: 768106 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1525866wro; Tue, 30 Jan 2024 11:05:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAp1XyKA+h0GsU+sdjCVn4kmrLY7XRS/CNvmwhl7NEcurdQep72Af1Zy5cdr/yFgHn2Wzf X-Received: by 2002:ac8:4e54:0:b0:42a:59a3:c1ef with SMTP id e20-20020ac84e54000000b0042a59a3c1efmr2360486qtw.19.1706641509500; Tue, 30 Jan 2024 11:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706641509; cv=none; d=google.com; s=arc-20160816; b=IBWAP6GNG9ICKk3HFa6A47Gp6pCBvOc+W6kwXg6c0oYpwBjHhunagPZrJAAsKLsvta WY0Qlv++AJtgrHKO7mXrhGgBvNPh0JmjZ7ucWwcAhRBmgg1S6uB0fpqrDVgdoUpZ6Yfh CErJmTHBUd9uXTF8fML8dt3siYZ/g6hIrMPw9hEK+YJOzWnSL/lf+cC7NBnWjpjd4NFX zMv9fabdyk5PTsn/AGxY7L1s9FpegqYMhd1gqED2krpRxYuUlDklMjHQNpOCvE+bxS6y fTJq9q0QphV/9lT5pfsuXomzofL04Z4G9OaROpLDzWr2DsIpwsi4HBb7IL4ssQi6/VGe 26TA== 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; fh=SR+8DozJdQxNforhpK7RQJlJqxcnmmBQq9YEbztxGAo=; b=S95N2GV5X6Zi2yGv+FFe1uXUZYTXWn2Ghreaia8zTBsCqyI9I7A6uo7/Fl2/FjOVbc iMAEiR/53au/e86TH9Wy7nX/CdCfoTvZZr3UQvMxfhKoh/DfWO6iH3bu3H9aX3aYYOB2 mpvSAOTRAW++r8DYcu6Q1KVP8hgYe5kB8eji6gY5DvNbszkKKaTywbpxxw8j0SMxqcNW sSGh2KRvCm5+P1FZ1rIDzxuuOFVOknK54OlJdf3dSBf7regGKrhDtOh8hoFpLIZwOerp LbWfI18HjZ+LKgQsN0t8GiwD93OKVb6eRzYijgL9arK5NhInXPV9WBzQYgFaF0Y73jbN yTRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSSwV83e; 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 p15-20020a05622a13cf00b0042a86d14547si9744076qtk.691.2024.01.30.11.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2024 11:05: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=MSSwV83e; 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 1rUtOO-0000ws-M4; Tue, 30 Jan 2024 14:03:32 -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 1rUtOM-0000w1-J0 for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:30 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUtOK-0008UV-Gm for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:30 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-55f0b2c79cdso3656404a12.3 for ; Tue, 30 Jan 2024 11:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706641406; x=1707246206; 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; b=MSSwV83eNR9FGLpmJSssxUslPb6W8kIccTFl5XC672cIbn6RhLZOHKd2oN80hEXwkU nJJ2Ovd6rUPHIkWxzcaR64AFnh33WPKAOReWeyAbYQx51QEX5912SOZpqS71fhstQOKx SWlkqFm44H9nnjX4IarKtpio9aADYSYs2xKiZ6My2CAekgAsbs6osR6AoHboXTApTsQs 3eFvzHIP7COPqMHwuzYX67cavcFC/e5/cfvgr3ey5wxnPla3hpJiKqviK0MvWtIrhFRf +lcBdsh4oheTrDH3KPFsj3l+yNhvr+hEAt1Y0rkhI2jKud6Wdjf7tIJy6tiUnlctFu77 H5bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706641406; x=1707246206; 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; b=wBkRVKEKrJ10AhTEojF0rKkIJSkFXSnOsyMJRED3OROPgU4/BGyaUS8ORy17YsFPcP 8pnUtVuHM/Kg4zUflFa7v3usk3OE5scScYzFrHYabeFS+oLS31EVMrfFgeok2RX6xGkx o8CXsBGXZnxwcZStFSysMD5pvb4nBMx3nH7oFoYfyaaqBgzERF+rEGxu6kQrnurNrx1F 6LY12kodLUxPSgpyJW6k1yiDKHRHMAMGLeOvWakGGidvr0oG2wmlumTXjQ0Vl7hGOpO8 IRUCFPQqxt/VHJF6jqkeEv3ucsXDSOuhkBhgz2TdRfM7WvuP8Lg5etgWfb9Ca26FyqYT a6xg== X-Gm-Message-State: AOJu0YxNeqI99ETrI53clkEH+arRsO/0wgYBwFU2OOD12b9XnCqQ7H/G FW0MvDv+AlcTMK9oH7wRVet7o5Ww1RTknLmz9WuIrYNd95c68TjzOFd2JMHlS29nsRin14vPA3z O X-Received: by 2002:a17:906:489:b0:a35:ad04:dcb7 with SMTP id f9-20020a170906048900b00a35ad04dcb7mr5066014eja.17.1706641406542; Tue, 30 Jan 2024 11:03:26 -0800 (PST) Received: from m1x-phil.lan ([176.187.218.134]) by smtp.gmail.com with ESMTPSA id rg9-20020a1709076b8900b00a35464aab52sm4190773ejc.96.2024.01.30.11.03.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jan 2024 11:03:26 -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 1/4] hw/arm/stellaris: Convert ADC controller to Resettable interface Date: Tue, 30 Jan 2024 20:03:14 +0100 Message-ID: <20240130190317.25692-2-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::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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 d18b1144af..afbc83f1e6 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); } @@ -1397,7 +1397,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 Jan 30 19:03:15 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: 768103 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1525472wro; Tue, 30 Jan 2024 11:04:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjIa86Pt7sDyQ0igPrtMPHtvI2j80xyHKjcHYO2JTt0BRg8kEBOZG2t8lmKM2hV2zxE+mj X-Received: by 2002:a05:622a:134b:b0:42a:814c:ca3d with SMTP id w11-20020a05622a134b00b0042a814cca3dmr2371133qtk.15.1706641466517; Tue, 30 Jan 2024 11:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706641466; cv=none; d=google.com; s=arc-20160816; b=R/+2j5E2GxYZAaejp12E6YXpLXvFzo80g5yD3MRY4YCnb2eLJxKrLcqt2QpC9Rs1QD 5LoKQ9rQR+3CZLYJ1AkH/1v06TWcvMt/qpuGqI05TACgaec1Sq8Tbl7W8je/pbUyiqqs jnA88HqGOA/WBW/RZqAisopqhC/UUOlLBwkkHu6V7oND1SEdsHnDpFSNnF1iaoclCC05 w4M45U08323GqkD9EvVTvkKrCwClxnwqhvD674l6E9QkL3/3246qOlbHTIANyqCMgLtP 0La0ecqykA0cDmvufKDbYfrH/xuFWLYq+TmOky+/KMCvEQeeseqPIb/eBxoywjHmrM7q QW4w== 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=UWlZLNkviQ6+EOhMX+hVeP6Y5TmUtDE6y8FSkM9wd24=; fh=SR+8DozJdQxNforhpK7RQJlJqxcnmmBQq9YEbztxGAo=; b=P2Y2koQnbpBoqJoEp9MkgYYk4ZowMUlfscfD9IWbZyHTJDNgJUvJoRkQ3o4Ce1dY5G 2VGnxwCa1T3B9PpGpB1zNm+J3dyfx5nHXE2vVxDo1iPkaybLTccjdF1cu9KqEnJgFsA8 MDnsazaxCC6Z4zVkePaH7F0B/fP+ORJpCtk0Heh8hfZc2Ax66/vNGWZKKbR0P0puh1n7 JQKBZNqX3gifTOC2zURn/dkFqQwDwW70/VxGtscpnfvMuIAMz8TP6QLV9HrFyPrp08du UjRgtZKnH5AJNnSUthHE4A6k/CHYl7krTZYtuMO0NkyGXIuXEdFGe8CuRfLitIuWjdL8 mEVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwsZiYGS; 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 v18-20020ac85792000000b0042be329564csi469569qta.515.2024.01.30.11.04.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2024 11:04:26 -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=XwsZiYGS; 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 1rUtOV-00010p-9O; Tue, 30 Jan 2024 14:03:39 -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 1rUtOS-0000zK-MN for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:36 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUtOR-0008VY-31 for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:36 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-55f15762840so2382353a12.0 for ; Tue, 30 Jan 2024 11:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706641412; x=1707246212; 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=UWlZLNkviQ6+EOhMX+hVeP6Y5TmUtDE6y8FSkM9wd24=; b=XwsZiYGSpdGQn9pUfD+zXgF9ymC2HRfxDUPXrvPdqFEXNbeuDoMqmR7zkw132UCT8T KMbAFvt8EFNbC3Ab2oxc6TwHsnGkwwwvVp13TbFR3Sxl74TbTN79K1rZQZycJUjS8gfv /HWe5lnn4jMriSx11ePe5QZCoSvATpdIpOEzWl1IwIAT25/HLkkWIdLl5Z7bSR8YxTPo mkBmtjYxmK8elLWKErTDUSxpwnceRo5msABV7101+FmGBcW4zPNaESFb8PYIc7n1rFxK bjL7HYHSxpcCyx0SoWKjE1SYXW7n1lPhkkIKCkBBe23JnODniCKGAFBwKi5V83K1fvds kJQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706641412; x=1707246212; 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=UWlZLNkviQ6+EOhMX+hVeP6Y5TmUtDE6y8FSkM9wd24=; b=o9kdJtXTItJiR321Zj1fmmzIB4P3S2/d0p8q86toVx+4jQS9gsroXxpr8ZZRUdx+xA GrHgKiecptSUxTIVlo4AwKHrQXQmC8IN0wsKW6RbXQJCA2vxOxT1jZX3bEn8ep3crJ2Y UeJV4GIBXMfvvBfAO0ZIgyqseD3/+LoDle5UWf+MHWjvGDoNkYg5kFcCGkQxOk5dJegR irPElaGuUsMMOyunk32Nc1lhYclrscS5zwOso3ZM2w3fRUjpVIcia/vW6w/rH+bUd8Kz Ob4MB2Qc0IirRsTjhrBzTITv8otFikfKaCiFTfV24H5bxnsJ8fPv+d1Xm0dsWCgZlwRM 2TKg== X-Gm-Message-State: AOJu0YzV8WK1+cUShC6kpnvUVj1x/6OPxloEam6AEEcXLw+Z5cZUP+Ah gfO1VLgl7qrta0uM2R7ADwgiSqySBujjyRDi541QqmhcCShG5zQ27W3JhmrTgaRKseCq7dkJWyz i X-Received: by 2002:a05:6402:348c:b0:55e:f37f:7fc5 with SMTP id v12-20020a056402348c00b0055ef37f7fc5mr5533517edc.14.1706641412509; Tue, 30 Jan 2024 11:03:32 -0800 (PST) Received: from m1x-phil.lan ([176.187.218.134]) by smtp.gmail.com with ESMTPSA id g9-20020a056402428900b0055d333a0584sm5111597edc.72.2024.01.30.11.03.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jan 2024 11:03:31 -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 2/4] hw/arm/stellaris: Convert I2C controller to Resettable interface Date: Tue, 30 Jan 2024 20:03:15 +0100 Message-ID: <20240130190317.25692-3-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::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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é --- hw/arm/stellaris.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index afbc83f1e6..284b95005f 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -607,8 +607,11 @@ 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_exit(Object *obj) { + stellaris_i2c_state *s = STELLARIS_I2C(obj); + + /* ??? For now we only implement the master interface. */ if (s->mcs & STELLARIS_I2C_MCS_BUSBSY) i2c_end_transfer(s->bus); @@ -658,8 +661,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, @@ -1382,7 +1383,9 @@ 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.exit = stellaris_i2c_reset_exit; dc->vmsd = &vmstate_stellaris_i2c; } From patchwork Tue Jan 30 19:03:16 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: 768105 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1525660wro; Tue, 30 Jan 2024 11:04:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnZK4fo7RhvOQN0ZGrLXnK8k8/AqhYwWaEYhJliWilyv8NjWmw3Fely4LDLWyElF4i8kb3 X-Received: by 2002:ae9:e647:0:b0:783:df7a:a7c4 with SMTP id x7-20020ae9e647000000b00783df7aa7c4mr8926141qkl.51.1706641487401; Tue, 30 Jan 2024 11:04:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706641487; cv=none; d=google.com; s=arc-20160816; b=dIR+TmwcNJFajRsq7kxPx1oZmP/3pGT675GwV5D8kpoQT/TAxGNqdPi/QXwKBOSLHC 6DAsaHexrFnUH8Y6DR5nqeUJZf0+KxMEKtG6Dk8ZOiJQ1nj00pHXKyKppcAYUZEezYRw XAF/t7THdZdKvY9/0OhajGLM8xNenE6vpXIqUFlSDNiEB9fx7naJeprsiUIBLtmq8vsn QFDa2wL40R6jfrP2T4gho+i5ZT7TccqkhslYlNLSCfo32+nTXaeI7qsX3FYnnGunOBA5 eYaB9lBpO8UQyAhDlcxEzQ+70KWZlNyY9q6BeSi/iwnDdAsdBrxMx7wUVlOsUxyiA9u+ lwvg== 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=ONQQAhlWUJUIL1ohHT6vUP5FJscZaLW2vVSHJwIJiGk=; fh=SR+8DozJdQxNforhpK7RQJlJqxcnmmBQq9YEbztxGAo=; b=fRSjT/6bfpmAMu57sf7SAVpL0mKdNKVvkr4B9u08ihp4iepZi0ieud/73eVEUX1GUH FVCjYSlcb5cqf6BhhDwrThMamK69G3wF3lxWJYquAfpYd41bYfkSHNb7VcIaOE5sldV5 d/F5xPnk7wyLLnuevlBtif32R/ZHLNa3xBvwcZpa2WL7hKykaM4c5VL75lm6c2td7DPo s4VKy/9uwXzNpOFPGkX4OwXTutfpc5ahQ1KnCuAQMyyeDc9Om3AeleKK1t3Ila6gI9uq DoGKHnGsHDfaVRSvU+/5KR24Q80bhryCuBma7qoOxRSOeKGTHgS/FjX3e5Ldzmjm62Ob IH4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x8DGc7Qp; 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 pe1-20020a05620a850100b0078438018b61si1602685qkn.136.2024.01.30.11.04.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2024 11:04:47 -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=x8DGc7Qp; 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 1rUtOs-000140-OG; Tue, 30 Jan 2024 14:04:04 -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 1rUtOX-00011A-Bs for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:42 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUtOV-0008WB-R8 for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:41 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a35b32bd055so309767866b.2 for ; Tue, 30 Jan 2024 11:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706641418; x=1707246218; 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=ONQQAhlWUJUIL1ohHT6vUP5FJscZaLW2vVSHJwIJiGk=; b=x8DGc7Qp6PVEjevdLESY+q5E2kZnQA3pON2QZ/YpLftR2FU0fmNUzlOXS+YCxfO9Uw yor3vj8avrEDdl/0F2lXwAxzGGjZEBjf6Sq5H2qBJwvWo4nFv3vQzg+wKJ0V3xSTU+/K FgmD6tSwpu6nBwYqjB63FqXaCAy7uzZ5DkIwTaqMOvPzeBEBf/NJOlSzzEpge/bIrhVo OzYq30c4+f2kwlHnap3sn2RR4QivwXGPYAlslHxFPxgBWXfF2IiXuTlEkYmhpwsnbpTM rHNGD/G4rgPUE1jR7svaVAR1tmtuM7E9K6afsNW1N/GZuYLED62PBbmNoM+7bCQY88Uq ekOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706641418; x=1707246218; 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=ONQQAhlWUJUIL1ohHT6vUP5FJscZaLW2vVSHJwIJiGk=; b=m0ogKN2iSW+L6oIEpe9zpQw05yYB2kZbN9+Dfp5H1F8K9K4KzAH6OMaKUBwQ0B/usK Sc0Ijs8r1nwwhA4QhADXLwwUfOAP4eIEfphAEPDEXrKNMAgxZsDivcD8V3HG0CJSqrhr 5K0002nFxfsrcSJ2TNRvtRQkrY3HQ1t3Ato3o7bCG/NwsrZiNh52KHfPj+7DE8bx3Tol gU6j808589o3fQ+XayUWebVP0rQjvcxgGaMVDQyCiO2HIUDS6w2MBnpo78KlDxfKLRgp cgrQOatL6CChymNANUvs1BCGibM5HbEt1vlyr/7zSjisZGZ/DpgwRNXhYFpEiXa+TXWQ YAiQ== X-Gm-Message-State: AOJu0Yzwu7NKT9qNY6uiyHvsgBtSWCQXwDZOWyKNsuIUsv6uufzVk/+p rCSH2MaOa4zO0RMvPVxxDlLRzX8S35sP3XBr/9UKep4AOtlX3+ukpx/nDKMHolEP/gY65ymJeac u X-Received: by 2002:a17:906:f152:b0:a36:5d54:64b1 with SMTP id gw18-20020a170906f15200b00a365d5464b1mr212381ejb.73.1706641418290; Tue, 30 Jan 2024 11:03:38 -0800 (PST) Received: from m1x-phil.lan ([176.187.218.134]) by smtp.gmail.com with ESMTPSA id l13-20020a1709066b8d00b00a32429e455asm5441536ejr.175.2024.01.30.11.03.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jan 2024 11:03:37 -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 3/4] hw/arm/stellaris: Add missing QOM 'machine' parent Date: Tue, 30 Jan 2024 20:03:16 +0100 Message-ID: <20240130190317.25692-4-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::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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(). 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 284b95005f..bb88b3ebde 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1247,10 +1247,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( @@ -1287,6 +1290,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 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);