From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424393; cv=none; d=zohomail.com; s=zohoarc; b=FgOM4Pmgst1JCpq88eaX05URZ3QU6G4+LeWSFCBDL8lv8e2UnEYXi+w9bH4gXcbv9KsEMdEMbF5pDyGqPTX5mruohJOHSimhwAQsK3aa7qjEVL5AxCwSgxWO/SO99yh3nXs1RFjFM/3xlgIcy/+ymXaUAI6/hEfPNp4EFryr3tc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424393; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LPgOBQNVShoBt1EXepGeYQrXhiL1fUSuZyDvfJk1E40=; b=An9TiVhrmSbF28YuYC8dG4GcgHr9a50b+0Y1PN9xGw1d22UmdAj8KZo9c2aVyPuwxxWJJ9DnOmmPOE+nqMEiUZGM6GZ7duLJ5UNC+wwiPfnk5qkpSiN7/Er0EkWBrTCAvukCila71f4HYru7DEG4Cum9AJppDPiMkRWsPrIcKOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16754243932911007.8881037768998; Fri, 3 Feb 2023 03:39:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNK-0007wP-Ir; Fri, 03 Feb 2023 06:37:02 -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 1pNuNJ-0007vk-HH for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:01 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNH-0001BV-2j for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:01 -0500 Received: by mail-wr1-x42b.google.com with SMTP id bk16so4359543wrb.11 for ; Fri, 03 Feb 2023 03:36:58 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id s7-20020a5d6a87000000b00287da7ee033sm1763541wru.46.2023.02.03.03.36.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LPgOBQNVShoBt1EXepGeYQrXhiL1fUSuZyDvfJk1E40=; b=VmDCIyNwV7GEJxSl0nfE7kn8ujAuESRt4FNhb33yC/ytBz0sQ853H4qmkB32E31akS a9Iuum1DyG2LCwVRyRSazsAlCmMVzpQtxLAoA8qI6j+z7try0S7JNVw2pE+NzgzirKNx k29KWNYM3zLwCnrUXhGGXSsVzj73GE9WrJq+/kFf/gr4/yFnOSC6g5NGwpfEpxx547b0 A4y4TwtDp2eHluTTiaHlQ2gn7r9ZDX6WwwWL30EGVdrsJ1GXcfGwiDwj1sfcttcq9BMp jzaWbAr4uWF57tb3kfB+LjiX9akW2EKRWfLmp2ZVMtq2UkLrM8XGVxcb4UHT+yZUPlCZ Z4nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPgOBQNVShoBt1EXepGeYQrXhiL1fUSuZyDvfJk1E40=; b=FUQhxe2h73dJEoUoYRwKVs2Gc6YnJhNJvJnZQy1fb1/CdJXySWGsAQDbZMmBvos3t0 LZgwHXzr2mbsBonyI1jElbgtQa1ax1VbhiRGPM4UIAIfeohkayDA4I9Rw8WiH3P3w7dj GH38HuMQPq7TpoaBXH3gA3xuTNUFwi76ccfVWvf6+GAwrBJccOy33KOJknTMnKKuhUzs B35GfAj+tLDZz+dKfRFZIwwkVLpm2GztKCvtvYgTKgAHPm1CIO7NeH0DdyUBxvHC1Qe9 U0MszrLgcvEMzrpkKTJXgs8xpn30EPmRG0g7T+wJPK5XKwSbyqvjNbQjmwZX5RExSeMu SH8g== X-Gm-Message-State: AO0yUKUsFI7fjC4fOIY4ueD806WPHkuSOT3JEvy18LnKlG2L9hOOIv0j +H9c7F10R/FQaV8IWTNikffiRy7U2J06B8+W X-Google-Smtp-Source: AK7set/Pf3E/Vm6R6fejVfLxnRiMINZjt3iqKu09jt2lz8437cyovLGjtnlsb68xbIcxpqNhY2+Pew== X-Received: by 2002:adf:e192:0:b0:2b2:1db6:a6bb with SMTP id az18-20020adfe192000000b002b21db6a6bbmr9046597wrb.20.1675424217510; Fri, 03 Feb 2023 03:36:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH 1/9] hw/i386/sgx: Do not open-code qdev_realize_and_unref() Date: Fri, 3 Feb 2023 12:36:42 +0100 Message-Id: <20230203113650.78146-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424393625100002 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- hw/i386/sgx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index db004d17a6..5ddc5d7ea2 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -299,7 +299,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) &sgx_epc->mr); =20 for (list =3D x86ms->sgx_epc_list; list; list =3D list->next) { - obj =3D object_new("sgx-epc"); + obj =3D object_new(TYPE_SGX_EPC); =20 /* set the memdev link with memory backend */ object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memde= v, @@ -307,8 +307,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) /* set the numa node property for sgx epc object */ object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value-= >node, &error_fatal); - object_property_set_bool(obj, "realized", true, &error_fatal); - object_unref(obj); + qdev_realize_and_unref(DEVICE(obj), NULL, &error_fatal); } =20 if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424305; cv=none; d=zohomail.com; s=zohoarc; b=jWn+hYV9oUeJIOxyKTvQ+sI/r3Fu7vb5dwo/RuQehVd9c3kkH9fcvABThVE9+WsnavVBOc2pr6cbzW2jkqvv6arcNpX1ftMgV0lPhTi/QfI289gXQdDNh4COZPe4ljzUWjVwxl7H2DOhYeapKvsqyK+x70h1wugxxwiZR1CbLks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424305; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XruElQ/KqElMH5647D/y730I75puE5BeGIEjp7H7QEM=; b=EN2QGi7cdjRAozSV0Pk75wR+jjT4yv30WrnPGBWmoMbSH4bCYCY1UExALHoaUVr1V/hKUE9MRaoGBLhBksBQi4xF48stWOCUnEz+XgI23Mk9dWRUPHiI/Tbd4QMrIEgLTz/Xs94vaQJpUUYdFn4kuXXEHHvtA3rFpKJyXAsZTCs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424305354204.82759303366265; Fri, 3 Feb 2023 03:38:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNP-00080X-Ir; Fri, 03 Feb 2023 06:37:07 -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 1pNuNN-0007z6-V3 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:05 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNL-0001CZ-Ph for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:05 -0500 Received: by mail-wr1-x429.google.com with SMTP id a2so4102793wrd.6 for ; Fri, 03 Feb 2023 03:37:03 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y10-20020a05600015ca00b002bfd137ecddsm1885239wry.11.2023.02.03.03.37.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XruElQ/KqElMH5647D/y730I75puE5BeGIEjp7H7QEM=; b=nocjyXieTrPivHs/s+PlPk/HgSfTlvK00jERJL/goaYJOO4/wb0GOEWMwESfoxe6W+ wT6dhwZu5OCof5DZpVD8Zn/28B1BUpynSYN3GYS8ewq7sHhx+LpIib9I+MMzGKlYOkdO pQigs7ujxKmhHTKCqcRUsYG7g5SZeGUiC0fe7/H8iBv7+ElXI5M5lJ4J+YzOgyLcLXgX Z7n6EcmEytjBfySSM9L6CeEIF/zwnWfzuh0JNwmPK4HxKEBkCqm2A7Vgg2puPf/u5xVk mcgtOYS/fZXnyPXXfsUiR3B+u2UH/mt4qJVlnlNO0PZkJsHvFhj8bOGMucnHPHTViO9X 5idQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XruElQ/KqElMH5647D/y730I75puE5BeGIEjp7H7QEM=; b=WE70dRTl5TBMas+8uE7WtH2RE2XflE8bJP2C5B3yhErqBxj7Y7Ky4JcUsi5ML6qG9D QYrv4n6QrhyTOgNy09BhQXxPZE1iIEIpv5YZdOOUPskkRlZl5G7dCWRRv3aT1jpN7Qde vlk0JLcpxzWKRRdCY69AFG05r3fl4U+ecFiO6ta0Lfr1NsFPd2CRtKCIR5r4n1utVEm6 ur1MdVoitB/FxwuWCHc8UF210y9/1bqw2x7t0bxoSKWFm+iYszS3zsoRcPWXul0kHMej bhrJLjhjNlT4R4zPpzE9soPDFpwTK260il26fA0OxXwtRPN2xFGmJ6jhAQX/kP2TsGGE CD/g== X-Gm-Message-State: AO0yUKVYZbQa1UwX4b+jECZt4NoP85h4HaErfN57sfvUG+saUHrptWaN HyE0Vti7Lj/DB83kQ33fzOYsDhIjyipkAMYD X-Google-Smtp-Source: AK7set8l5xuQ3Zp70W6CsMjC0PzImHdZfl7qkpGyXWpHWe6fHylOeiPfmHxGudYFthFIExZ+fjYb6g== X-Received: by 2002:adf:ef85:0:b0:2bf:e443:ea70 with SMTP id d5-20020adfef85000000b002bfe443ea70mr8060231wro.1.1675424222405; Fri, 03 Feb 2023 03:37:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan Subject: [PATCH 2/9] hw/ppc/sam460ex: Correctly set MAL properties Date: Fri, 3 Feb 2023 12:36:43 +0100 Message-Id: <20230203113650.78146-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424307182100001 MAL properties are declared as uint8_t: static Property ppc4xx_mal_properties[] =3D { DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0), DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0), DEFINE_PROP_END_OF_LIST(), }; Set the property using qdev_prop_set_uint8(). Fixes: da116a8aab ("ppc/ppc405: QOM'ify MAL") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan --- hw/ppc/sam460ex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 4a22ce3761..cf065aae0e 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -389,8 +389,8 @@ static void sam460ex_init(MachineState *machine) =20 /* MAL */ dev =3D qdev_new(TYPE_PPC4xx_MAL); - qdev_prop_set_uint32(dev, "txc-num", 4); - qdev_prop_set_uint32(dev, "rxc-num", 16); + qdev_prop_set_uint8(dev, "txc-num", 4); + qdev_prop_set_uint8(dev, "rxc-num", 16); ppc4xx_dcr_realize(PPC4xx_DCR_DEVICE(dev), cpu, &error_fatal); object_unref(OBJECT(dev)); sbdev =3D SYS_BUS_DEVICE(dev); --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424328; cv=none; d=zohomail.com; s=zohoarc; b=diV5tEXUL4ddliEee3I1ZfkUKljrusjditf/TnYhpwflFuACIOeWJf+Xlf7R0lx7TbpT9hrXKp1XhWDNfAc8CnO+Ui1g7p8SupM4KwfaNROvdUUs9BRZJmOip70zwhuUONnIAAF6lJOs55OER6RlR0GPloeY3FCtLh6Jh3JzulQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424328; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=CjnzATvtenYQHMsjqigsBlBOWsmWrUH1G6tbEvA+MBInh66cbxJaJH57DetZ+B2wTEGpl4A+26wOlKi4smFWBkxqX3r8iZQVtQTJsHuFZaNAg1m7GV3kuRiKvssYSKw6LTn9/PEoFDDWbjGXTB7pOm5B3uOa2zjtlSClA2lifFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424328378692.4109794245643; Fri, 3 Feb 2023 03:38:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNV-000844-LT; Fri, 03 Feb 2023 06:37:13 -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 1pNuNT-00082f-P4 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:12 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNR-0001EF-3W for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:11 -0500 Received: by mail-wm1-x32e.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so5807832wmb.2 for ; Fri, 03 Feb 2023 03:37:08 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p30-20020a1c545e000000b003de2fc8214esm2531614wmi.20.2023.02.03.03.37.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=y0H+WM/0RHQyjaSUvRiTy+/3im9WNQXEoc+hyue/zdwO841cTsyjcKxBjKK+5Y9ePH PfIZoPsBaCJ/c0aYPqXSI7fHtpS+sDaYyK3hZX2myB55QRvSPs/tHQcHQYV6DxvfBIfq B4FbtEWNE12zePp+BzYqpVY9zHrpVZq5I1MdqbpoTudSAzBH93H9o4pUp756NvY4Q0IU 5JOsru0y4GpfmFI9KcZLKNT9qdZxNw3uLyNKhEQYUVc5cwVc0nAMbSaSf6XU01ylIRDu +lFRcerS3xGOguQs4bOgmKSh51fFSWWU4e8KkvRVQX6ipGU9/LAdH+Ddmrj5evFa4Pu+ K+ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=y//ugFVOatM1dlu3WF+ysMV8FJp/BqgqYJ0u92rUpV4xIK1mzvePuQAzV4t2Y28BX3 lCq0niYcWW53CgoEtuGbbJylL3fgi7TLRSi6tHLnTyWABh+V8Q8uSJ/4r3aSzCNO7U3y iVQuccPKblSobcixdx/0Z/SrF5c3GHCo3PxmZXJ3JRK+/D29WtyjWf1tDNKDDg+oCNHj BkIGOlYHogFs2U8dUWDxKtHYORzPqsTr9M6dnPqzRj8wBjr9s2viG4Zx4pQxG5Eb8/vK dLa+/470/DLf4SCCJfeHDRc3xzq4TfbVs6T5EbEZyVX5xMUr4oliXl1Z7PQdMPGIOgLy 9QZQ== X-Gm-Message-State: AO0yUKWsO9iR529qJ0JnkfsWeBxz73tCK/GV2CwKwV4O81sD0LUH+E7Y XCF4llyvnN4q/ZrHlUvNNxoiupbDnOVHBHLY X-Google-Smtp-Source: AK7set8Pz+d8AWJP1aBvlRJq0HZVK72zJNp7WX8Df/J1mtHKjTxtmsscba1fWi3E5w4L01GSg4Up6A== X-Received: by 2002:a05:600c:288:b0:3d3:513c:240b with SMTP id 8-20020a05600c028800b003d3513c240bmr8646952wmk.7.1675424227498; Fri, 03 Feb 2023 03:37:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joel Stanley , Peter Maydell Subject: [PATCH 3/9] hw/arm/nrf51: QOM-alias 'flash-size' property in SoC object Date: Fri, 3 Feb 2023 12:36:44 +0100 Message-Id: <20230203113650.78146-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424329412100001 No need to use an intermediate 'flash-size' property in the SoC object. Alias the property, so when the machine (here microbit) sets the value on the SoC, it is propagated to the flash object. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/microbit.c | 5 ++++- hw/arm/nrf51_soc.c | 10 +--------- hw/nvram/nrf51_nvm.c | 6 +++++- include/hw/arm/nrf51_soc.h | 1 - 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index 50df362088..79b5574884 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -36,6 +36,7 @@ static void microbit_init(MachineState *machine) MicrobitMachineState *s =3D MICROBIT_MACHINE(machine); MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *mr; + int64_t flash_size; =20 object_initialize_child(OBJECT(machine), "nrf51", &s->nrf51, TYPE_NRF51_SOC); @@ -43,6 +44,8 @@ static void microbit_init(MachineState *machine) object_property_set_link(OBJECT(&s->nrf51), "memory", OBJECT(system_memory), &error_fatal); sysbus_realize(SYS_BUS_DEVICE(&s->nrf51), &error_fatal); + flash_size =3D object_property_get_int(OBJECT(&s->nrf51), + "flash-size", &error_abort); =20 /* * Overlap the TWI stub device into the SoC. This is a microbit-speci= fic @@ -57,7 +60,7 @@ static void microbit_init(MachineState *machine) mr, -1); =20 armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, - 0, s->nrf51.flash_size); + 0, flash_size); } =20 static void microbit_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 34da0d62f0..cc4a636c51 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -24,9 +24,7 @@ * are supported in the future, add a sub-class of NRF51SoC for * the specific variants */ -#define NRF51822_FLASH_PAGES 256 #define NRF51822_SRAM_PAGES 16 -#define NRF51822_FLASH_SIZE (NRF51822_FLASH_PAGES * NRF51_PAGE_SIZE) #define NRF51822_SRAM_SIZE (NRF51822_SRAM_PAGES * NRF51_PAGE_SIZE) =20 #define BASE_TO_IRQ(base) ((base >> 12) & 0x1F) @@ -122,11 +120,6 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Er= ror **errp) BASE_TO_IRQ(NRF51_RNG_BASE))); =20 /* UICR, FICR, NVMC, FLASH */ - if (!object_property_set_uint(OBJECT(&s->nvm), "flash-size", - s->flash_size, errp)) { - return; - } - if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvm), errp)) { return; } @@ -199,6 +192,7 @@ static void nrf51_soc_init(Object *obj) object_initialize_child(obj, "rng", &s->rng, TYPE_NRF51_RNG); =20 object_initialize_child(obj, "nvm", &s->nvm, TYPE_NRF51_NVM); + object_property_add_alias(obj, "flash-size", OBJECT(&s->nvm), "flash-s= ize"); =20 object_initialize_child(obj, "gpio", &s->gpio, TYPE_NRF51_GPIO); =20 @@ -215,8 +209,6 @@ static Property nrf51_soc_properties[] =3D { DEFINE_PROP_LINK("memory", NRF51State, board_memory, TYPE_MEMORY_REGIO= N, MemoryRegion *), DEFINE_PROP_UINT32("sram-size", NRF51State, sram_size, NRF51822_SRAM_S= IZE), - DEFINE_PROP_UINT32("flash-size", NRF51State, flash_size, - NRF51822_FLASH_SIZE), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index 7f1db8c423..bfae028fcd 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -26,6 +26,9 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" =20 +#define NRF51822_FLASH_PAGES 256 +#define NRF51822_FLASH_SIZE (NRF51822_FLASH_PAGES * NRF51_PAGE_SIZE) + /* * FICR Registers Assignments * CODEPAGESIZE 0x010 @@ -358,7 +361,8 @@ static void nrf51_nvm_reset(DeviceState *dev) } =20 static Property nrf51_nvm_properties[] =3D { - DEFINE_PROP_UINT32("flash-size", NRF51NVMState, flash_size, 0x40000), + DEFINE_PROP_UINT32("flash-size", NRF51NVMState, + flash_size, NRF51822_FLASH_SIZE), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index e52a56e75e..8cf0c21614 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -45,7 +45,6 @@ struct NRF51State { MemoryRegion twi; =20 uint32_t sram_size; - uint32_t flash_size; =20 MemoryRegion *board_memory; =20 --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424345; cv=none; d=zohomail.com; s=zohoarc; b=LJ8QbnGangIhXvjcsNaEI2NjCQquHccUkU1h/4NDXCevDG4eOP9+2rd49b21pptUi6p5ZTn5InkYR0qcxSjIecYJ5XxOvbaN7V3JzbMqd2uo+DxnU5GXZDbMCEykj1aOOmi3nCVpupcf6qpzAG/gD9jhgzKGNgD9w0n8MuxbcS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424345; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=Xjn72SQb3dG96WJn/5HQcfveX/L5I6Wn8kqDkf4xCtWRhdMLCP/yUjbyj1+85vgupdhCqs7JY3bsdOSluzmLxNebNmxGwnWAbBiEYzaNVzdP9H9Fk5zBHinvaw3Tykcv+x8JvvNrwpqYiBoxgAWIKnS2rd1Zw0/jl0/OXwe3Jd8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424345827166.90894765142002; Fri, 3 Feb 2023 03:39:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNa-000882-7Y; Fri, 03 Feb 2023 06:37:18 -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 1pNuNY-00086G-Mu for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:16 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNW-0001F4-9g for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:16 -0500 Received: by mail-wr1-x42c.google.com with SMTP id h16so4355853wrz.12 for ; Fri, 03 Feb 2023 03:37:13 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r6-20020a5d4986000000b002bfc24e1c55sm1769986wrq.78.2023.02.03.03.37.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=B2y5MLq9wv1wRmz8W9UvNvElcqD7si5TjOQB9cGZ7fBXKiGD/2zTTlH3/RhSqB0SAk wca/XKL2/GbDxAMIPJvnFbXDEecCU42bUERIF7SlL49CtkKDVjf8iX5WHEymcpQLascx d9uQkiNNNG2gKj0oDbqBMd0uBHgSrY6attN+RP/ERXAKtuXXbYQscMJX4hKfugMXnYX8 22Z53Q2QutELp68fXjArxmRt2v9OeHUjfSmE0499VLbrxYl+ot+KElXwVpdHq4rynaSg aWoFgkp/gO/Ol0sufgOyiO4WQiX+OLE019F6JdGA9cXyNJIz7P1jKqYY8/MbQcpBlyTz rJPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=mSu8LxxHZcWIGij0rhlLbe77BE8Gp5q2isPdvnbUhCXQw2mTLV9RdX/d8YeNEdQCvd 4eB9Fnw09SlZ9ugv5eZ31xLCh0bBNHDE8TKNtS3z7wG+m+2RLIj95y5IV4VsLitnI7jB 1Er/FG4mdJ/8lOeELQz9/cdClZNqfvCJ9wr9x5wcka6OMSzMqFOlqtKNIBgXis8PvBEh softmmJ/GzqoV1MrPi10getfDfZlWrxaBwuEqfBIXitW6K3t4XS5HSYuJ+z3k/Q6HVkW r78KgViwquCsNaA6nd8HdrgV7U/QHIBxF1MNTbgtJjNauzEXlU6tNW61RM+FdYGzzsw2 i9Yg== X-Gm-Message-State: AO0yUKXGRc2r63g6E1vLy9uwry6iufYfxXjxh3Uwd5xdCPyStEM5bZQE amJaAqdCsf2YD/8joBnL3QHmjf/V50iAYLWK X-Google-Smtp-Source: AK7set+lgaHOvBmMfzMT+uObv0DypfZxm0Ybj9BNnQBOc8UsfdN4rHU9/VTmRBI9ciKXAwLUvMQ6aA== X-Received: by 2002:a05:6000:1f1c:b0:2bf:e8f7:b4fb with SMTP id bv28-20020a0560001f1c00b002bfe8f7b4fbmr10040764wrb.70.1675424232524; Fri, 03 Feb 2023 03:37:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Jean-Christophe Dubois , Andrey Smirnov Subject: [PATCH 4/9] hw/arm/fsl-imx: QOM-alias 'phy-num' property in SoC object Date: Fri, 3 Feb 2023 12:36:45 +0100 Message-Id: <20230203113650.78146-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424347360100001 No need to use intermediate 'fec-phy-num' properties in the SoC object. Alias the properties, so when the machines set the value on the SoC, it is propagated to the network device object. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/fsl-imx25.c | 3 +-- hw/arm/fsl-imx6.c | 3 +-- hw/arm/fsl-imx6ul.c | 8 ++++---- hw/arm/fsl-imx7.c | 12 ++++++------ include/hw/arm/fsl-imx25.h | 1 - include/hw/arm/fsl-imx6.h | 1 - include/hw/arm/fsl-imx6ul.h | 2 -- include/hw/arm/fsl-imx7.h | 1 - 8 files changed, 12 insertions(+), 19 deletions(-) diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 24c4374590..eff58e1f7a 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -55,6 +55,7 @@ static void fsl_imx25_init(Object *obj) } =20 object_initialize_child(obj, "fec", &s->fec, TYPE_IMX_FEC); + object_property_add_alias(obj, "fec-phy-num", OBJECT(&s->fec), "phy-nu= m"); =20 object_initialize_child(obj, "rngc", &s->rngc, TYPE_IMX_RNGC); =20 @@ -169,7 +170,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error *= *errp) epit_table[i].irq)); } =20 - object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err); qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]); =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) { @@ -315,7 +315,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error *= *errp) } =20 static Property fsl_imx25_properties[] =3D { - DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 00dafe3f62..4f870c928c 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -100,6 +100,7 @@ static void fsl_imx6_init(Object *obj) =20 =20 object_initialize_child(obj, "eth", &s->eth, TYPE_IMX_ENET); + object_property_add_alias(obj, "fec-phy-num", OBJECT(&s->eth), "phy-nu= m"); } =20 static void fsl_imx6_realize(DeviceState *dev, Error **errp) @@ -377,7 +378,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **= errp) spi_table[i].irq)); } =20 - object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err); qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]); if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) { return; @@ -451,7 +451,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **= errp) } =20 static Property fsl_imx6_properties[] =3D { - DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index d88d6cc1c5..8b3939e8c5 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -120,8 +120,12 @@ static void fsl_imx6ul_init(Object *obj) * Ethernet */ for (i =3D 0; i < FSL_IMX6UL_NUM_ETHS; i++) { + g_autofree gchar *propname =3D g_strdup_printf("fec%d-phy-num", i = + 1); snprintf(name, NAME_SIZE, "eth%d", i); object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + qdev_prop_set_uint32(DEVICE(&s->eth[i]), "phy-num", i); + object_property_add_alias(obj, propname, + OBJECT(&s->eth[i]), "phy-num"); } =20 /* USB */ @@ -424,8 +428,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error = **errp) FSL_IMX6UL_ENET2_TIMER_IRQ, }; =20 - object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", - s->phy_num[i], &error_abort); object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", FSL_IMX6UL_ETH_NUM_TX_RINGS, &error_abort= ); qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]); @@ -618,8 +620,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error = **errp) } =20 static Property fsl_imx6ul_properties[] =3D { - DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0), - DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index afc7480799..df035c9314 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -102,8 +102,12 @@ static void fsl_imx7_init(Object *obj) * Ethernet */ for (i =3D 0; i < FSL_IMX7_NUM_ETHS; i++) { - snprintf(name, NAME_SIZE, "eth%d", i); - object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + g_autofree gchar *propname =3D g_strdup_printf("fec%d-phy-num", i = + 1); + snprintf(name, NAME_SIZE, "eth%d", i); + object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + qdev_prop_set_uint32(DEVICE(&s->eth[i]), "phy-num", i); + object_property_add_alias(obj, propname, + OBJECT(&s->eth[i]), "phy-num"); } =20 /* @@ -402,8 +406,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **= errp) FSL_IMX7_ENET2_ADDR, }; =20 - object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", - s->phy_num[i], &error_abort); object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort); qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]); @@ -599,8 +601,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **= errp) } =20 static Property fsl_imx7_properties[] =3D { - DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0), - DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 1b1086e945..e377f8e79a 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -66,7 +66,6 @@ struct FslIMX25State { MemoryRegion rom[2]; MemoryRegion iram; MemoryRegion iram_alias; - uint32_t phy_num; }; =20 /** diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index 83291457cf..f7d1a94640 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -74,7 +74,6 @@ struct FslIMX6State { MemoryRegion caam; MemoryRegion ocram; MemoryRegion ocram_alias; - uint32_t phy_num; }; =20 =20 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index 7812e516a5..5217eeb8ff 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -88,8 +88,6 @@ struct FslIMX6ULState { MemoryRegion caam; MemoryRegion ocram; MemoryRegion ocram_alias; - - uint32_t phy_num[FSL_IMX6UL_NUM_ETHS]; }; =20 enum FslIMX6ULMemoryMap { diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 4e5e071864..16c68a4937 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -82,7 +82,6 @@ struct FslIMX7State { IMX7GPRState gpr; ChipideaState usb[FSL_IMX7_NUM_USBS]; DesignwarePCIEHost pcie; - uint32_t phy_num[FSL_IMX7_NUM_ETHS]; }; =20 enum FslIMX7MemoryMap { --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424330; cv=none; d=zohomail.com; s=zohoarc; b=St2CmTCckqK5N/scx0XlUMo1YTrw8PworQ4HCD7bpEDB67XRdKVPjNAlF4rFW6VWqbQNWuR0hicY6LLIerZm+wBEJwdgZbYuy8Mwrj8jCLfnP9T9j/iui0bp0pVC8vXuNJOs33jCKsGUfR1xIx0ECrEEqgulNgwcFdigGt7KsJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424330; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xiDeXbO3Wi4lEH6eghooUNVxGrmUdWjhAaUA++lBEzM=; b=JSAEb/1AXuNcmr0q804wfiNiKoRUTmMSZean6SsApQ3qv6stxHnNwjHVvwuilcxPZAZNQ2foZZS88xLf4AmnZAGdsm53b0OaB4ZKgUb+SZ9njGxxtEZg3ZpXnmASp8nxFPMPRFigEqwgR9X/a0IpttRKMndITWRmCq3ad0l3wgg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424330834132.65352248506508; Fri, 3 Feb 2023 03:38:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNe-00089j-UW; Fri, 03 Feb 2023 06:37:22 -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 1pNuNc-00088b-QT for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:20 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNb-0001Fl-2m for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:20 -0500 Received: by mail-wm1-x32d.google.com with SMTP id u10so586676wmj.3 for ; Fri, 03 Feb 2023 03:37:18 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id v16-20020a05600c471000b003dd1bd66e0dsm2772651wmo.3.2023.02.03.03.37.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xiDeXbO3Wi4lEH6eghooUNVxGrmUdWjhAaUA++lBEzM=; b=ff+VGQZQ13YwSMQ+FoXRoribBtneMRHw6VroiUCYdcwqAwNSnbwWhZV6Lmx+WDWmTy KXsqFBuN8RMKNffCIbIlYtmzAqp0DSDJ73+YZSTlnlNTzTc47a074mnEasMqqc8Uh2u7 xQHxcP49kGASgBAfeKyrKxM5WJGYC7gmy6eOXenBSWPDBui2Mq372LHf7w1wbxogwIHL 8yIRWGG3QwPeUFlmeMCFoltogKKdhFPlOUBEsxHj7a3pCk3JlQTnK16NSrwpEjT+gAQv QQtviELZxF0kI8mtv5C4Vex+kIj/WWknpn9vKF/zKLmAYcDWv1DrTeDXkkpEe3sZdZIV kKRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xiDeXbO3Wi4lEH6eghooUNVxGrmUdWjhAaUA++lBEzM=; b=B75sVcR+NFsWTdJ/6wcak7hWgEv6YPnDJ30UUXTrx/alrFQG1EVwhamJ6Jif5ca8t3 NDh0kGtnKZO2XhgkI6uA8ycAaBN3rJ/TDGKfKpskjubkyyU8+Wvo1f/xE4nUQILgB6VY UkEN6Jioc6l2ZEwUyPMiE1NXASSY28pL1EhoDKeNY/URHEmt8IDb6aaoQhL4t0Ygjk44 D++0dSSiSHeOtmgi250Jsjn/fjYD9HFKkxdab3bPZd6s6hLxcdsQc2VcXLyTRvxXgUA6 gTMlV6ZFd/ZDRIfvy15EPNuWmte9dCMcgyOEYFtAEFEhYH9F8WH3n2MCgitSF+V0x/+I j2ZA== X-Gm-Message-State: AO0yUKXSSHz2ExjK3za6YEEw3mETmcPVgY4s5RMpckUNsd9z7E9ZFoWs qHqgFr+XrMub0/eftOqL4W1IKwpM2uN1DhNN X-Google-Smtp-Source: AK7set+n9f4V7XWXqnUU8TnnNmr/xglLZ/EhOMuCL6L1YGIp663ioKmSmtRXrqAqYY29n+c9mi7wjg== X-Received: by 2002:a05:600c:4f46:b0:3dc:557f:6124 with SMTP id m6-20020a05600c4f4600b003dc557f6124mr9772875wmq.5.1675424237412; Fri, 03 Feb 2023 03:37:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 5/9] hw/usb/hcd-ohci: Include missing 'sysbus.h' header Date: Fri, 3 Feb 2023 12:36:46 +0100 Message-Id: <20230203113650.78146-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424331226100005 Avoid when including "hw/usb/hcd-ohci.h": hw/usb/hcd-ohci.h:100:5: error: unknown type name 'SysBusDevice' SysBusDevice parent_obj; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- hw/usb/hcd-ohci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 11ac57058d..e5e6b434fd 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -21,6 +21,7 @@ #ifndef HCD_OHCI_H #define HCD_OHCI_H =20 +#include "hw/sysbus.h" #include "sysemu/dma.h" #include "hw/usb.h" #include "qom/object.h" --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424305; cv=none; d=zohomail.com; s=zohoarc; b=Jk/pyj+nfyEMF7eJtiWAfTpRbE+P+lzptyyvqFDCkGlBBodJnPa40E3XSXLoVtQklw4oA6nvdDfldrqya9+OBNqycn7yqJ2yacVv0m5gyRz+Ajr8m6Cswd2QVRFGaAxxJH1DrnguJV5iDMrfMUa30phtFRLcmmF/875yY9dTjXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424305; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K+cjiRrUxf8pio68qBRhIQ1AivvB4oG5DvRMp0FNP4E=; b=Ezbl7o9lvXZKolK3NXqk+WBvKFjJix8zF6T4Tz/mN1udTgOwaUDbX4pORV/qaCoYrQ6XLT5Fi/NA8L6v/cGY+NRvUeG9fCJ2bTOgjAlnLoxtWmMPu6ENiO/HC/wUwlpvic92MEzmn9IfTSdMXXmTlVX4zr3EQl9M30y65dp9UvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424305422499.4227564821207; Fri, 3 Feb 2023 03:38:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNj-0008D6-Is; Fri, 03 Feb 2023 06:37:27 -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 1pNuNi-0008At-1x for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:26 -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 1pNuNf-0001GR-PW for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:25 -0500 Received: by mail-wm1-x333.google.com with SMTP id k8-20020a05600c1c8800b003dc57ea0dfeso5822822wms.0 for ; Fri, 03 Feb 2023 03:37:23 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i14-20020a1c540e000000b003db03725e86sm2517792wmb.8.2023.02.03.03.37.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K+cjiRrUxf8pio68qBRhIQ1AivvB4oG5DvRMp0FNP4E=; b=joz2Q7NZy4LkvmEZpfE9ThGOiVfDAdi8oJL5jrAOgFOWlgGMpFnKpAsL0pFYk5yaRr YgsXnGUPddj0LkVytcsGSr5f8pNuMcMoqvTLANfyn1y1HfRkRHCsreTsXHAxun6QkHyG kRXq2v2IOfWAsrtEE9CefhygHGCBQjk8PaZCXr5glY6q6SFOojEbTm4aT1vwhkyR7MkK Q3IV0tDKzvoJ6/5ZLJmxpPsMz7DZbitKWjr0aYjcgLsCBh32bK5jTojYeAOadBujvc96 b9mlFZaBxuRE5LJtbUC4BCBS5I7ksYXytx2DgN5UPQsjq5w0UFluEm0rFgGjQZsKgAcq BYeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K+cjiRrUxf8pio68qBRhIQ1AivvB4oG5DvRMp0FNP4E=; b=eAhP8ON7lReFaDkh7rMfI0Z1Fw0F73KUAzSU72fpN7roEOz4Nsr85KxbwaA+g3oevQ NcWZLGfhSxBqz5Jreba0xDHDcRXzOUhW3+z6sathgBZZd58pSqcU3zHg61LmdkLoOyFx y+/GYlaF4XDxtZsActu2EK4j0jhfA94BzbEym78dB64ytB4dO4v+eTXSJcUw4fJi9jW/ 0u1hdPn+m6o0BNycqtKIH/opb9W1fW1uDULue5uc+JJW+PLao1Rfw1C/pxo4e8m1mmak KD91jRDckX8vfdRoyGWFiby1qSbmlz7sEb7Zwxof/l2tR0qrAhZZSXvnnsGbRKs+TBmO akeQ== X-Gm-Message-State: AO0yUKV4FZ8LYDhOlN3VMvvdq8iyDhs/21IbmPiilHYHOoyAJ1Nx4O0O ztKHCiTBDc5GtOrKsdQcnZJDYp2Den4tgT3J X-Google-Smtp-Source: AK7set+PODevprb22UtDTgByUeA2ihJdt8lJvodnGMBHD4WlnuNgRD8uXK6pGvngkdbbZKh4RfutnA== X-Received: by 2002:a05:600c:210a:b0:3df:12db:2779 with SMTP id u10-20020a05600c210a00b003df12db2779mr8379657wml.3.1675424242406; Fri, 03 Feb 2023 03:37:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Yoshinori Sato , Magnus Damm Subject: [PATCH 6/9] hw/display/sm501: QOM-alias 'dma-offset' property in chipset object Date: Fri, 3 Feb 2023 12:36:47 +0100 Message-Id: <20230203113650.78146-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424307275100006 No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/sm501.c | 22 +++++++++++----------- hw/sh4/r2d.c | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 52e42585af..49a648e952 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "qemu/log.h" #include "qemu/module.h" +#include "hw/usb/hcd-ohci.h" #include "hw/char/serial.h" #include "ui/console.h" #include "hw/sysbus.h" @@ -1942,7 +1943,7 @@ struct SM501SysBusState { /*< public >*/ SM501State state; uint32_t vram_size; - uint32_t base; + OHCISysBusState ohci; SerialMM serial; }; =20 @@ -1950,7 +1951,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Er= ror **errp) { SM501SysBusState *s =3D SYSBUS_SM501(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - DeviceState *usb_dev; MemoryRegion *mr; =20 sm501_init(&s->state, dev, s->vram_size); @@ -1963,13 +1963,10 @@ static void sm501_realize_sysbus(DeviceState *dev, = Error **errp) sysbus_init_mmio(sbd, &s->state.mmio_region); =20 /* bridge to usb host emulation module */ - usb_dev =3D qdev_new("sysbus-ohci"); - qdev_prop_set_uint32(usb_dev, "num-ports", 2); - qdev_prop_set_uint64(usb_dev, "dma-offset", s->base); - sysbus_realize_and_unref(SYS_BUS_DEVICE(usb_dev), &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(&s->ohci), &error_fatal); memory_region_add_subregion(&s->state.mmio_region, SM501_USB_HOST, - sysbus_mmio_get_region(SYS_BUS_DEVICE(usb_dev), 0)); - sysbus_pass_irq(sbd, SYS_BUS_DEVICE(usb_dev)); + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ohci), 0)= ); + sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->ohci)); =20 /* bridge to serial emulation module */ sysbus_realize(SYS_BUS_DEVICE(&s->serial), &error_fatal); @@ -1980,7 +1977,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Er= ror **errp) =20 static Property sm501_sysbus_properties[] =3D { DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0), - DEFINE_PROP_UINT32("base", SM501SysBusState, base, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -2016,15 +2012,19 @@ static void sm501_sysbus_class_init(ObjectClass *kl= ass, void *data) static void sm501_sysbus_init(Object *o) { SM501SysBusState *sm501 =3D SYSBUS_SM501(o); + OHCISysBusState *ohci =3D &sm501->ohci; SerialMM *smm =3D &sm501->serial; =20 + object_initialize_child(o, "ohci", ohci, TYPE_SYSBUS_OHCI); + object_property_add_alias(o, "base", OBJECT(ohci), "dma-offset"); + qdev_prop_set_uint32(DEVICE(ohci), "num-ports", 2); + object_initialize_child(o, "serial", smm, TYPE_SERIAL_MM); qdev_set_legacy_instance_id(DEVICE(smm), SM501_UART0, 2); qdev_prop_set_uint8(DEVICE(smm), "regshift", 2); qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN); =20 - object_property_add_alias(o, "chardev", - OBJECT(smm), "chardev"); + object_property_add_alias(o, "chardev", OBJECT(smm), "chardev"); } =20 static const TypeInfo sm501_sysbus_info =3D { diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..279724ffbb 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -274,7 +274,7 @@ static void r2d_init(MachineState *machine) dev =3D qdev_new("sysbus-sm501"); busdev =3D SYS_BUS_DEVICE(dev); qdev_prop_set_uint32(dev, "vram-size", SM501_VRAM_SIZE); - qdev_prop_set_uint32(dev, "base", 0x10000000); + qdev_prop_set_uint64(dev, "base", 0x10000000); qdev_prop_set_chr(dev, "chardev", serial_hd(2)); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, 0x10000000); --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424379; cv=none; d=zohomail.com; s=zohoarc; b=iAMTFm9RjVfEyaPMJFgdc08YplNmuzk60vWSZ1ChszBZdBaCLMHULk7vTRTiD4/YU1pnQmC4Vh6FnK9E2r3cJc6NGHavt0ad3Abs8ZmAXhGJExAP9UTztoqGZK9b0NQRdm2mdR96Mn+6FWwn26D4HtgA8hRcOhG0IUCYS4HO3zw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424379; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=DOA3TTvkCo9chSxvdXCL9xWbY1dTg7mHhAV8toQVOxqxUGnJwp46nlHv/zoj2EJR84eO0t1JJtzUk6uqBax/B3p5FQrf8NU2itapaocQhv89FadIiucwLqkAgl7wwowdw6ujCrLi1FBFNQntEYIxokcWT9Th0jOmS4r5hdLYDCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424379318830.1269096662259; Fri, 3 Feb 2023 03:39:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNn-0008F2-TN; Fri, 03 Feb 2023 06:37:31 -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 1pNuNm-0008ED-25 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:30 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNk-0001HC-J6 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:29 -0500 Received: by mail-wr1-x432.google.com with SMTP id j25so847582wrc.4 for ; Fri, 03 Feb 2023 03:37:28 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id s7-20020adfeb07000000b002bff1de8d4bsm1791560wrn.49.2023.02.03.03.37.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=DMrWgameUQbjcd64+jNpjO/Qc9YTZNVQ3swQhJPAqBtUV/EmghCwdKjgTj5CEKwj4y fRyHuxc7qWci9UnH0yaHbzbtaMWV1iMxTikpF0EmFGbb0bOgHS6VH4pk78Fp7CX+TxzQ HBNXOo8l7OivuOBEfps/QVSKdI5YnJWQcW3r+4El74ckF3cDG35H9R6/iDjvDMS+8QlE jqpxMpgGpr12J1TufqCTxhlPT8jhMH93Sa+mL76OuBCiJ4jqkaQeIcSqA6qd/uvEtbj6 c8v3J4AOIoTuDvneYP78cFFycmOtIj7/ApTV/HoEmxPmRa6zJeR7aMWT/5/JNvjamfoz P53A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=1JlPR7o8KLw7spGd13SYTabzds/95e0fosrlgAp/OTBB56JmWXHhTN6z+EGT4GNAP+ j2JMw+yUUHbDtV+pL+Ppm7309ueKk60Zhp+TwBoo6w+0/xnhQgoMqSWJcCoqBO/k4nSj TER0DRT814phw7N7sVh+E1V4aNzzcP+G38EJCuw5g41UWGcHEmeFthg9DwcWLvEER6TB GPdu1pdJQlUyjBjiCFp/KMIoRAUHpdF49pOMK9YqURbrL+fIZ/YJW+BUfsj0Z0RzA8f6 I+/1PJl6ppxqubMWZIlMogK3qbHOXvAsaJHxshXi1/MlBdGNJoE50Pamk2Pu4xowfzzG 3oRQ== X-Gm-Message-State: AO0yUKWrJNkyYEkIATeTSbBSPht3ENTif8LNsQHKeTW+VLCbFTkKMmjU bVNtE9EIbIYVev+NlQsFLdb7g+hDoFmuTKQC X-Google-Smtp-Source: AK7set8EfbMnJIsFpFwNmUNpTxLcxndG7y7Ce3Ee2jgZidGoVyZrQybcbK1oC1K4dF5IxwkAVPcqdQ== X-Received: by 2002:adf:f68f:0:b0:2bf:ae17:bf58 with SMTP id v15-20020adff68f000000b002bfae17bf58mr9143116wrp.37.1675424247207; Fri, 03 Feb 2023 03:37:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 7/9] hw/qdev: Remove DEFINE_PROP_DMAADDR() and 'hw/qdev-dma.h' Date: Fri, 3 Feb 2023 12:36:48 +0100 Message-Id: <20230203113650.78146-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424381517100004 DEFINE_PROP_DMAADDR() is only used once. Since it doesn't add much value, simply remove it, along with the header defining it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/hcd-ohci-pci.c | 1 - hw/usb/hcd-ohci.c | 3 +-- include/hw/qdev-dma.h | 16 ---------------- 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 include/hw/qdev-dma.h diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 6b630d35a7..92cc151264 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -25,7 +25,6 @@ #include "migration/vmstate.h" #include "hw/pci/pci_device.h" #include "hw/sysbus.h" -#include "hw/qdev-dma.h" #include "hw/qdev-properties.h" #include "trace.h" #include "hcd-ohci.h" diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 9d68036d23..26c377bf1b 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -33,7 +33,6 @@ #include "hw/usb.h" #include "migration/vmstate.h" #include "hw/sysbus.h" -#include "hw/qdev-dma.h" #include "hw/qdev-properties.h" #include "trace.h" #include "hcd-ohci.h" @@ -2008,7 +2007,7 @@ static Property ohci_sysbus_properties[] =3D { DEFINE_PROP_STRING("masterbus", OHCISysBusState, masterbus), DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3), DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0), - DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 0), + DEFINE_PROP_UINT64("dma-offset", OHCISysBusState, dma_offset, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/qdev-dma.h b/include/hw/qdev-dma.h deleted file mode 100644 index b00391aa0c..0000000000 --- a/include/hw/qdev-dma.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Support for dma_addr_t typed properties - * - * Copyright (C) 2012 David Gibson, IBM Corporation. - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#ifndef HW_QDEV_DMA_H -#define HW_QDEV_DMA_H - -#define DEFINE_PROP_DMAADDR(_n, _s, _f, _d) \ - DEFINE_PROP_UINT64(_n, _s, _f, _d) - -#endif --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424413; cv=none; d=zohomail.com; s=zohoarc; b=m6L/epWgkgoSB6cI8N2fOoemujqEd4bH5ow8cQ1kqf3iWQ6LUt8XsMYp7+jxKQtHrdMvmfWkBFxXmUgzW38OfoU0jCHTR22f5u0bey7vp8VxM2AP0Y71pO3tNUZJMm3A0+2IzC9TM/3s+RTp3+9IN1hpiIrblfV5i6UbE1wqqE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424413; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=OMtuZ/puf0TG8xmUcb56C3u4OXkC148tVVzqbETAHNEyqoxZ44vOYTvkPph/Ak6BLvYFF82O0xQea8NwqcsWXgyWTlev9bDPrCKfnmcuSFtKVqvV5pmZrJEI/28s2aD+mLZ6gvvz4FAs+EuWHydJpWXHlB/g0WO0n9FwuZreH84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424413129135.58086541754358; Fri, 3 Feb 2023 03:40:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNv-0008Ju-2v; Fri, 03 Feb 2023 06:37: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 1pNuNt-0008Im-3K for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:37 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNp-0001I3-R6 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:36 -0500 Received: by mail-wm1-x32b.google.com with SMTP id n13so3635543wmr.4 for ; Fri, 03 Feb 2023 03:37:33 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p9-20020a05600c468900b003dc53217e07sm2669872wmo.16.2023.02.03.03.37.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=SkqyVkr9bl90NTh9y/mhm3U6RAht1XavxBtciVU4CHvUP22TxRNPuT7xTS9X1m7cKs 0fgb4YxVq7/5nwL/mJ+dY5suqskCB5JA5R4VDHeEbP7bpP2ZjPIIJAOJq6zr/EQQNxua Y03N5b0MYvj2f9txlChQFyjdmwGx14QZCY4LVVDk2YS9XlfGvoGe7k0YltEgt3dHlQwD LiQEYDWMyrXvmQAub4p4BN7iyRqQVaIp5t6QClR768cnyiVvlYiqexlMwPJfOmWrv3CF lqk1hCSMkNhUBzYU0wONdP+m3IQzIQkNU0dkv1wkyYW0hbfWTpRtbL2R+mjlh1wKFWIK rfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=UeouLTQnnWZyZjlaitQndQNf1PLioEwiCtjA8Wq4MC/2OTO5bhoFtkuQEacn62navQ iJ8L4187Os3MD7XpTVoZpU6MR5zHudpuSprW2D7MJo9AxB4lfg883tBkbuR9+Fd6ryV0 RCUbt4P4IL73HmdId/VLl6ItGHm5xvBTZQgVBdFRdxiPjKv0u99pmp3UjAFzMSJyNkin jZ9U0hCb/s1dXe3uXSNp9Jn290fBQF85BeLZvT+/dLQTtc8DSM8FIFKE/nFOymJfT5dY lJkZQLQVRRLBenGyU9/t7eDiNQkudaH85KebqdaeIM5511VVZQdmkqUn6+lhnBQyT1d+ VouA== X-Gm-Message-State: AO0yUKVhQGNvk7FTJJT4rmG5fZEqEXaKmhocRtOyUGQHXQx7BQxoFNPp 7XsnQaoFTUxi2vHNHBEtvp4UXMJmlNFgYl7f X-Google-Smtp-Source: AK7set/hAnhrrIQ9lM6Lm/WYlBxlcv1nSgxubjh452c7f3AT2l/RKhGwSH0fcNA4/ME268s6ac8zGw== X-Received: by 2002:a05:600c:601b:b0:3dc:557f:6129 with SMTP id az27-20020a05600c601b00b003dc557f6129mr9062609wmb.2.1675424252209; Fri, 03 Feb 2023 03:37:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paul Burton , Aleksandar Rikalo , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 8/9] hw/mips: Declare all length properties as unsigned Date: Fri, 3 Feb 2023 12:36:49 +0100 Message-Id: <20230203113650.78146-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424413913100002 Some length properties are signed, other unsigned: hw/mips/cps.c:183: DEFINE_PROP_UINT32("num-vp", MIPSCPSState, num_vp, = 1), hw/mips/cps.c:184: DEFINE_PROP_UINT32("num-irq", MIPSCPSState, num_irq= , 256), hw/misc/mips_cmgcr.c:215: DEFINE_PROP_INT32("num-vp", MIPSGCRState, nu= m_vps, 1), hw/misc/mips_cpc.c:167: DEFINE_PROP_UINT32("num-vp", MIPSCPCState, num= _vp, 0x1), hw/misc/mips_itu.c:552: DEFINE_PROP_INT32("num-fifo", MIPSITUState, nu= m_fifo, hw/misc/mips_itu.c:554: DEFINE_PROP_INT32("num-semaphores", MIPSITUSta= te, Since negative values are not used (the minimum is '0'), unify by declaring all properties as unsigned. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/mips_gic.c | 4 ++-- hw/mips/boston.c | 2 +- hw/mips/cps.c | 12 ++++++------ hw/mips/malta.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_itu.c | 4 ++-- include/hw/intc/mips_gic.h | 4 ++-- include/hw/misc/mips_cmgcr.h | 2 +- include/hw/misc/mips_itu.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/intc/mips_gic.c b/hw/intc/mips_gic.c index bda4549925..4bdc3b1bd1 100644 --- a/hw/intc/mips_gic.c +++ b/hw/intc/mips_gic.c @@ -439,8 +439,8 @@ static void mips_gic_realize(DeviceState *dev, Error **= errp) } =20 static Property mips_gic_properties[] =3D { - DEFINE_PROP_INT32("num-vp", MIPSGICState, num_vps, 1), - DEFINE_PROP_INT32("num-irq", MIPSGICState, num_irq, 256), + DEFINE_PROP_UINT32("num-vp", MIPSGICState, num_vps, 1), + DEFINE_PROP_UINT32("num-irq", MIPSGICState, num_irq, 256), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/mips/boston.c b/hw/mips/boston.c index a9d87f3437..21ad844519 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -702,7 +702,7 @@ static void boston_mach_init(MachineState *machine) object_initialize_child(OBJECT(machine), "cps", &s->cps, TYPE_MIPS_CPS= ); object_property_set_str(OBJECT(&s->cps), "cpu-type", machine->cpu_type, &error_fatal); - object_property_set_int(OBJECT(&s->cps), "num-vp", machine->smp.cpus, + object_property_set_uint(OBJECT(&s->cps), "num-vp", machine->smp.cpus, &error_fatal); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", qdev_get_clock_out(dev, "cpu-refclk")); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 2b436700ce..38acc57468 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -114,9 +114,9 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) /* Inter-Thread Communication Unit */ if (itu_present) { object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU= ); - object_property_set_int(OBJECT(&s->itu), "num-fifo", 16, + object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16, &error_abort); - object_property_set_int(OBJECT(&s->itu), "num-semaphores", 16, + object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16, &error_abort); object_property_set_bool(OBJECT(&s->itu), "saar-present", saar_pre= sent, &error_abort); @@ -133,7 +133,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) =20 /* Cluster Power Controller */ object_initialize_child(OBJECT(dev), "cpc", &s->cpc, TYPE_MIPS_CPC); - object_property_set_int(OBJECT(&s->cpc), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->cpc), "num-vp", s->num_vp, &error_abort); object_property_set_int(OBJECT(&s->cpc), "vp-start-running", 1, &error_abort); @@ -146,9 +146,9 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) =20 /* Global Interrupt Controller */ object_initialize_child(OBJECT(dev), "gic", &s->gic, TYPE_MIPS_GIC); - object_property_set_int(OBJECT(&s->gic), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->gic), "num-vp", s->num_vp, &error_abort); - object_property_set_int(OBJECT(&s->gic), "num-irq", 128, + object_property_set_uint(OBJECT(&s->gic), "num-irq", 128, &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { return; @@ -161,7 +161,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) gcr_base =3D env->CP0_CMGCRBase << 4; =20 object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR); - object_property_set_int(OBJECT(&s->gcr), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->gcr), "num-vp", s->num_vp, &error_abort); object_property_set_int(OBJECT(&s->gcr), "gcr-rev", 0x800, &error_abort); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ec172b111a..af9021316d 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1066,7 +1066,7 @@ static void create_cps(MachineState *ms, MaltaState *= s, object_initialize_child(OBJECT(s), "cps", &s->cps, TYPE_MIPS_CPS); object_property_set_str(OBJECT(&s->cps), "cpu-type", ms->cpu_type, &error_fatal); - object_property_set_int(OBJECT(&s->cps), "num-vp", ms->smp.cpus, + object_property_set_uint(OBJECT(&s->cps), "num-vp", ms->smp.cpus, &error_fatal); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", s->cpuclk); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); diff --git a/hw/misc/mips_cmgcr.c b/hw/misc/mips_cmgcr.c index 3c8b37f700..66eb11662c 100644 --- a/hw/misc/mips_cmgcr.c +++ b/hw/misc/mips_cmgcr.c @@ -212,7 +212,7 @@ static const VMStateDescription vmstate_mips_gcr =3D { }; =20 static Property mips_gcr_properties[] =3D { - DEFINE_PROP_INT32("num-vp", MIPSGCRState, num_vps, 1), + DEFINE_PROP_UINT32("num-vp", MIPSGCRState, num_vps, 1), DEFINE_PROP_INT32("gcr-rev", MIPSGCRState, gcr_rev, 0x800), DEFINE_PROP_UINT64("gcr-base", MIPSGCRState, gcr_base, GCR_BASE_ADDR), DEFINE_PROP_LINK("gic", MIPSGCRState, gic_mr, TYPE_MEMORY_REGION, diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index badef5c214..a06cdd10ea 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -549,9 +549,9 @@ static void mips_itu_reset(DeviceState *dev) } =20 static Property mips_itu_properties[] =3D { - DEFINE_PROP_INT32("num-fifo", MIPSITUState, num_fifo, + DEFINE_PROP_UINT32("num-fifo", MIPSITUState, num_fifo, ITC_FIFO_NUM_MAX), - DEFINE_PROP_INT32("num-semaphores", MIPSITUState, num_semaphores, + DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores, ITC_SEMAPH_NUM_MAX), DEFINE_PROP_BOOL("saar-present", MIPSITUState, saar_present, false), DEFINE_PROP_END_OF_LIST(), diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index eeb136e261..5e4c71edd4 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -211,8 +211,8 @@ struct MIPSGICState { /* GIC VP Timer */ MIPSGICTimerState *gic_timer; =20 - int32_t num_vps; - int32_t num_irq; + uint32_t num_vps; + uint32_t num_irq; }; =20 #endif /* MIPS_GIC_H */ diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h index 9fa58942d7..db4bf5f449 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -75,7 +75,7 @@ struct MIPSGCRState { SysBusDevice parent_obj; =20 int32_t gcr_rev; - int32_t num_vps; + uint32_t num_vps; hwaddr gcr_base; MemoryRegion iomem; MemoryRegion *cpc_mr; diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index 50d961106d..ab6d286c38 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -57,8 +57,8 @@ struct MIPSITUState { SysBusDevice parent_obj; /*< public >*/ =20 - int32_t num_fifo; - int32_t num_semaphores; + uint32_t num_fifo; + uint32_t num_semaphores; =20 /* ITC Storage */ ITCStorageCell *cell; --=20 2.38.1 From nobody Fri May 17 09:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675424403; cv=none; d=zohomail.com; s=zohoarc; b=gGn9AJQ/IbcEQHpIRJeMEK+FPGWSCNVz7xjsQYq+ReHo3R+VSPsJDDrmOFyMPddSutIv0YA7/UZp8OKzon1h0D2Bg5vFmBWT25jAds6GKjTi8tSOv/bmfGMd0x2jExNnBYgCOCWbCBK4yMeiiZ19twGrMqfbK8NGVCDRiPmhw3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675424403; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=gOCZ/hyI6QuuE9sNDmKXEoNBP1BJFE+8YtBbiGtWJzyuZuL3h7hedErrmYp+X/kDEJhHg1fZ45ea55r4HVfvT+XG4E2c2sp4jSdAZgh5BEv8Ue4dbnRdefMVnKq6zDyF1YwdiXb7XCBWqAqqWJDnaVo6ZjYVM8uOuh/Uz1Tn0AM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675424403864351.43575827488564; Fri, 3 Feb 2023 03:40:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNuNx-0008RV-Px; Fri, 03 Feb 2023 06:37:41 -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 1pNuNw-0008KI-1C for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:40 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNuNu-0001I3-27 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 06:37:39 -0500 Received: by mail-wm1-x32b.google.com with SMTP id n13so3635688wmr.4 for ; Fri, 03 Feb 2023 03:37:37 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c459100b003dee8c5d814sm7787235wmo.24.2023.02.03.03.37.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 03:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=JYjl0/VvlntLjVc4egYlP9yaTbI6aNzp2WME3CIytntZwWgGd+xrGd5PVCRdGjsy5k M1mbrxcNWnZbVMZT1yIHGm9QSgHTxQqpVs6My7sR3ubc3IC2EjEfj2ZnKYUDwsbAEsMB q8X3TRFxYEByofp2rUMK5gBbU2jbwBsvO+agXXh+ouGSbkrdgMMnBwdWp6cWEelRHJ8k Q8PtkCTA3Lo9RhygpZwcnTOLcCrGzyima6/l+NQXRif0JvZjg2DuJ6QHngk0gDFTWs1o BM7g7WtjcZu0Lx9sClGipBXENLGYWY+jjwENgJpRaqYWluzOmlDMBqfvuk+8ObYlFW7c dWbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=w/iMr5VPVcMbW65Hqm31DPaKU+L6TZ4F5aylPejZRnnrUq2JGbzzKVUewSpCs0k56k 0Gln1pbLZwSIVxkxJ/u1NPqYyepsyEnkmvZip8OYTHiZqD9MBX89MVXPJpxwiHo+HU/U s3i1jBsPj+fUp/+ZiBoOWXXUH7iBCgpAaj2OZwyVumGEKqvrn8btugXRUdrh0dYfBYb+ qPO1GBK1q1k9MSApyK2/SJCOpuyfvL9R0fX6MXx+/TltDTbfDEhtz3v+sfE67BAmr4Jq sfbgr7r7E2yfbiFUq/VE16tD0i1YWqJOr4L60xxdA2oWkm+oOu4x1apoWmYWqqoneu8V wOmg== X-Gm-Message-State: AO0yUKWesKlMUynlxNP5eUimmvF2dTnpH4LvnLoLxTXfTD1mykzMeSbI 8HBiyPTsJaxxMWWZXpflFi0j95G4I6tPrmcc X-Google-Smtp-Source: AK7set/B8GaFBQ4jc5CuGHJNoFOENPkZM7O9PARoHiNknpqA2pe+jGnD5Ra3LzcMb+9dlm5PCixnyQ== X-Received: by 2002:a05:600c:3795:b0:3dc:561a:79e7 with SMTP id o21-20020a05600c379500b003dc561a79e7mr9012581wmr.2.1675424257110; Fri, 03 Feb 2023 03:37:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Markus Armbruster , Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang Subject: [RFC PATCH 9/9] hw/mips/itu: Pass SAAR using QOM link property Date: Fri, 3 Feb 2023 12:36:50 +0100 Message-Id: <20230203113650.78146-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203113650.78146-1-philmd@linaro.org> References: <20230203113650.78146-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675424405771100002 QOM objects shouldn't access each other internals fields except using the QOM API. mips_cps_realize() instantiates a TYPE_MIPS_ITU object, and directly sets the 'saar' pointer: if (saar_present) { s->itu.saar =3D &env->CP0_SAAR; } In order to avoid that, pass the MIPS_CPU object via a QOM link property, and set the 'saar' pointer in mips_itu_realize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang --- RFC because not tested. --- hw/mips/cps.c | 23 ++++++----------------- hw/misc/mips_itu.c | 26 ++++++++++++++++++-------- include/hw/misc/mips_itu.h | 5 ++--- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 38acc57468..2b5269ebf1 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -66,20 +66,17 @@ static bool cpu_mips_itu_supported(CPUMIPSState *env) static void mips_cps_realize(DeviceState *dev, Error **errp) { MIPSCPSState *s =3D MIPS_CPS(dev); - CPUMIPSState *env; - MIPSCPU *cpu; - int i; target_ulong gcr_base; bool itu_present =3D false; - bool saar_present =3D false; =20 if (!clock_get(s->clock)) { error_setg(errp, "CPS input clock is not connected to an output cl= ock"); return; } =20 - for (i =3D 0; i < s->num_vp; i++) { - cpu =3D MIPS_CPU(object_new(s->cpu_type)); + for (int i =3D 0; i < s->num_vp; i++) { + MIPSCPU *cpu =3D MIPS_CPU(object_new(s->cpu_type)); + CPUMIPSState *env =3D &cpu->env; =20 /* All VPs are halted on reset. Leave powering up to CPC. */ if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", tr= ue, @@ -97,7 +94,6 @@ static void mips_cps_realize(DeviceState *dev, Error **er= rp) cpu_mips_irq_init_cpu(cpu); cpu_mips_clock_init(cpu); =20 - env =3D &cpu->env; if (cpu_mips_itu_supported(env)) { itu_present =3D true; /* Attach ITC Tag to the VP */ @@ -107,22 +103,15 @@ static void mips_cps_realize(DeviceState *dev, Error = **errp) qemu_register_reset(main_cpu_reset, cpu); } =20 - cpu =3D MIPS_CPU(first_cpu); - env =3D &cpu->env; - saar_present =3D (bool)env->saarp; - /* Inter-Thread Communication Unit */ if (itu_present) { object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU= ); + object_property_set_link(OBJECT(&s->itu), "cpu[0]", + OBJECT(first_cpu), &error_abort); object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16, &error_abort); object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16, &error_abort); - object_property_set_bool(OBJECT(&s->itu), "saar-present", saar_pre= sent, - &error_abort); - if (saar_present) { - s->itu.saar =3D &env->CP0_SAAR; - } if (!sysbus_realize(SYS_BUS_DEVICE(&s->itu), errp)) { return; } @@ -158,7 +147,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gic)= , 0)); =20 /* Global Configuration Registers */ - gcr_base =3D env->CP0_CMGCRBase << 4; + gcr_base =3D MIPS_CPU(first_cpu)->env.CP0_CMGCRBase << 4; =20 object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR); object_property_set_uint(OBJECT(&s->gcr), "num-vp", s->num_vp, diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index a06cdd10ea..0eda302db4 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -93,10 +93,10 @@ void itc_reconfigure(MIPSITUState *tag) uint64_t size =3D (1 * KiB) + (am[1] & ITC_AM1_ADDR_MASK_MASK); bool is_enabled =3D (am[0] & ITC_AM0_EN_MASK) !=3D 0; =20 - if (tag->saar_present) { - address =3D ((*(uint64_t *) tag->saar) & 0xFFFFFFFFE000ULL) << 4; - size =3D 1ULL << ((*(uint64_t *) tag->saar >> 1) & 0x1f); - is_enabled =3D *(uint64_t *) tag->saar & 1; + if (tag->saar) { + address =3D (tag->saar[0] & 0xFFFFFFFFE000ULL) << 4; + size =3D 1ULL << ((tag->saar[0] >> 1) & 0x1f); + is_enabled =3D tag->saar[0] & 1; } =20 memory_region_transaction_begin(); @@ -157,7 +157,7 @@ static inline ITCView get_itc_view(hwaddr addr) static inline int get_cell_stride_shift(const MIPSITUState *s) { /* Minimum interval (for EntryGain =3D 0) is 128 B */ - if (s->saar_present) { + if (s->saar) { return 7 + ((s->icr0 >> ITC_ICR0_BLK_GRAIN) & ITC_ICR0_BLK_GRAIN_MASK); } else { @@ -515,6 +515,7 @@ static void mips_itu_init(Object *obj) static void mips_itu_realize(DeviceState *dev, Error **errp) { MIPSITUState *s =3D MIPS_ITU(dev); + CPUMIPSState *env; =20 if (s->num_fifo > ITC_FIFO_NUM_MAX) { error_setg(errp, "Exceed maximum number of FIFO cells: %d", @@ -526,6 +527,15 @@ static void mips_itu_realize(DeviceState *dev, Error *= *errp) s->num_semaphores); return; } + if (!s->cpu0) { + error_setg(errp, "Missing 'cpu[0]' property"); + return; + } + + env =3D &s->cpu0->env; + if (env->saarp) { + s->saar =3D env->CP0_SAAR; + } =20 s->cell =3D g_new(ITCStorageCell, get_num_cells(s)); } @@ -534,8 +544,8 @@ static void mips_itu_reset(DeviceState *dev) { MIPSITUState *s =3D MIPS_ITU(dev); =20 - if (s->saar_present) { - *(uint64_t *) s->saar =3D 0x11 << 1; + if (s->saar) { + s->saar[0] =3D 0x11 << 1; s->icr0 =3D get_num_cells(s) << ITC_ICR0_CELL_NUM; } else { s->ITCAddressMap[0] =3D 0; @@ -553,7 +563,7 @@ static Property mips_itu_properties[] =3D { ITC_FIFO_NUM_MAX), DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores, ITC_SEMAPH_NUM_MAX), - DEFINE_PROP_BOOL("saar-present", MIPSITUState, saar_present, false), + DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, MIPSCPU = *), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index ab6d286c38..35218b2d14 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -72,9 +72,8 @@ struct MIPSITUState { uint64_t icr0; =20 /* SAAR */ - bool saar_present; - void *saar; - + uint64_t *saar; + MIPSCPU *cpu0; }; =20 /* Get ITC Configuration Tag memory region. */ --=20 2.38.1