From patchwork Sun Jan 12 22:56:12 2025 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: 856820 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1185801wrc; Sun, 12 Jan 2025 14:57:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVvcj+T9+Jsszv/vfi8Djw4qvK+d4wkXFy8XvfFbAogMqnXuALe/wkHKUyJk+97tqqpnGNbQw==@linaro.org X-Google-Smtp-Source: AGHT+IGqzkzSGv2rtBlmzp6AeWFfLBl9R1Q5vMqdNk4Mgq7tneAU70KpU2EPPfFT4UdGHmpT+cV6 X-Received: by 2002:a05:620a:454d:b0:7b6:eb2b:b49e with SMTP id af79cd13be357-7bcd972e7a7mr2674823485a.6.1736722660165; Sun, 12 Jan 2025 14:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736722660; cv=none; d=google.com; s=arc-20240605; b=b727L1lc5Pz+vM77ClACZNONbwkhWZJemTnohq7qYmxBC8B0/bGjNZwMrQcIvycQGW uu0Yw0g6KkVCYwvrZEkeHi74lSaARpqsKHD9n0SsDyygPzBmnKzXSUQW0zbBb6C1cKMW wPCJ5AeRJOegMFY4rc0ZWYfEW3J6/kjbpgRmhHLWQ/jW2tph/HkZfzeRfZy+NTSkBfY4 59eQH74EJjshbvNJoE7E0rSGCfSTdbnVefS4yUrqJmjv1O9EJaz3DBq2CtL14UmHacW4 g/GD0LPrsC27EtLFNQN0hq/VNQyOLYBWyTbGNWf9a2NLXwAvEMuYi+P4rBctJAW5kOKB spIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=BowyydtiNf13IGVqTkq6nfH3HgTKKikK+aOyxCGRJEY=; fh=DF2NIb+N0CqV3t200NonzP1Z+7HuUkgCcwu6aInqRiw=; b=c3En2on8HBDDzSYefag3NJa9ccbeYwBTgCn80UJAwG1Vn1c16vuHackXJA68sad/pe oC3MjLHmIJ5ibOa0rjvNkIyzvE70uSh6jRiHS01yxf4ZXO5B3EEPbXcuNYW9Q/QNury7 V6zpaKjIK4JHHfpPRNbCIwdWDFOLl6Lp1s3lr3yYXjS7rWg5d+B6t7WPlP+mZPedFFZw LhWiL6YXcdqnsijwli8lv1xHS/QnYLZ7rAJjmm7/7eO8wmS/xLUQQF7TdoyV8bZ37jwz DNECS68RQHe8FdXnwj3w2mxyYwjNRfOBlXbaeTC1AgLWmc+Q1Cn3eq9FTDC6jTZ1dx10 AjUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PiIYG3XD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fdc68si914529285a.467.2025.01.12.14.57.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:57:40 -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=PiIYG3XD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6sg-00073g-Gt; Sun, 12 Jan 2025 17:56:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tX6sb-00072q-NA for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56: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 1tX6sZ-0001Z5-UQ for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56:25 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436341f575fso38282495e9.1 for ; Sun, 12 Jan 2025 14:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736722581; x=1737327381; 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=BowyydtiNf13IGVqTkq6nfH3HgTKKikK+aOyxCGRJEY=; b=PiIYG3XDPK6YCpzbuYS5sjWDMaRxgtCX3zIYlvYhmcj5/W6GbHhrNMxniDPP0rIMkG dsPcSSg4d7jUgoY/Y2Rep1IbZpkTqTqGhmvTCksVffPqW9Qie1NVaNkTJEW5rL55kHvE oziGuaMQVO/7qFA4b3YkI7OsEy3YcNU7MJlIT/RKi+U5pYY3KmvX3dFwyAzeleQ4XluP XqcXttvz4VDSjjG7jgDQB6qvQ+KiEGlAx1iZEqav7cY4C23Zt48tiUPNbwhx/YMze7Wt +TxUQ8IwH9DHhgFEcZxbcI0OarINVYPAA/a1gA3NoBTaZMvqlgfIavM6GHx4a92tr+97 cjbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736722581; x=1737327381; 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=BowyydtiNf13IGVqTkq6nfH3HgTKKikK+aOyxCGRJEY=; b=Z8OP7cafpQjBdsgA3kw3+e9UcbBcqQSjslIQnXlSs8kL/MVcg7gvURzrnQ5rG0Nb/9 KzZHatJbhy2hz5AO21mhig2KQX2G1vjMkHpaJXEgjXWRkEGppWCNGBkTtRNwFyW84YFV w4Io3S+Sl+UsJRKkzvE9tAVhGMj2FQYhdnXkNzItUmuGPLloC31312IE0ysJhO806QzR laA4+InIfGO3u7jTGN7vAFKG3iFP7/jSwJ28iY7hSl/uF7FT5vYlVEkQ5BwrX3jYp/3e zSlghP3FBQjX23BOxeoC2klkR1EvoXpIfmD3aUuhD9DIXqUVpdj34kPy5bznpZElr23D MWEw== X-Gm-Message-State: AOJu0YzS7a7mtyms9RaBPLvEGnh42GW+ySswtgp149c+G3Q0XO2G3gWu YODmjQTrMZp0xRRIys7Ghz+fFpa9jSXs/dC75+/Plva4tcVVgnx+vmT9Pan21gOwR3d2o0mD5cu bgNs= X-Gm-Gg: ASbGnctyEMTf52Oet9geH5bOSdm4WHUaFcnAWKqbu/jdQQl3CnBcBqJSqNC7Qm6gndS pTpi+xYjlpbSact1BnJu1/SJgysRkCs7asEzpkbBhpB4WrdoPf2D+EciAfatzm1E71/pJE3fpwC 0A5lvDgC/GMc7o3ChKVjBXlByb57sa68y/MuIadRlFY/kF1AtuERrJeAdQrZEboKwL4icf35lYg 4ZJ8ByT4YpUg8FiBtNbHagu4TxnddlEzocpBDWknPvtDGkEsmwkjlV4UGDCJyJOtYxK9G3QEBea T+KiHYzhRRyrgXfkMqSY29SzcJnbwLo= X-Received: by 2002:a05:600c:46d2:b0:434:a1d3:a321 with SMTP id 5b1f17b1804b1-436e2679db4mr164289725e9.3.1736722581599; Sun, 12 Jan 2025 14:56:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38325esm10604058f8f.27.2025.01.12.14.56.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:56:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Samuel Tardieu , qemu-arm@nongnu.org, Peter Maydell , Felipe Balbi , Subbaraya Sundeep , Alistair Francis , Joel Stanley , Alexandre Iooss , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] hw/arm/nrf51: Rename ARMv7MState 'cpu' -> 'armv7m' Date: Sun, 12 Jan 2025 23:56:12 +0100 Message-ID: <20250112225614.33723-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112225614.33723-1-philmd@linaro.org> References: <20250112225614.33723-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The ARMv7MState object is not simply a CPU, it also contains the NVIC, SysTick timer, and various MemoryRegions. Rename the field as 'armv7m', like other Cortex-M boards. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- include/hw/arm/nrf51_soc.h | 2 +- hw/arm/nrf51_soc.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index e52a56e75e0..f88ab1b7d3e 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -30,7 +30,7 @@ struct NRF51State { SysBusDevice parent_obj; /*< public >*/ - ARMv7MState cpu; + ARMv7MState armv7m; NRF51UARTState uart; NRF51RNGState rng; diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 37dd4cf5f40..dee06ab5654 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -76,16 +76,16 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) } /* This clock doesn't need migration because it is fixed-frequency */ clock_set_hz(s->sysclk, HCLK_FRQ); - qdev_connect_clock_in(DEVICE(&s->cpu), "cpuclk", s->sysclk); + qdev_connect_clock_in(DEVICE(&s->armv7m), "cpuclk", s->sysclk); /* * This SoC has no systick device, so don't connect refclk. * TODO: model the lack of systick (currently the armv7m object * will always provide one). */ - object_property_set_link(OBJECT(&s->cpu), "memory", OBJECT(&s->container), + object_property_set_link(OBJECT(&s->armv7m), "memory", OBJECT(&s->container), &error_abort); - if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), errp)) { + if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), errp)) { return; } @@ -104,7 +104,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0); memory_region_add_subregion_overlap(&s->container, NRF51_UART_BASE, mr, 0); sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart), 0, - qdev_get_gpio_in(DEVICE(&s->cpu), + qdev_get_gpio_in(DEVICE(&s->armv7m), BASE_TO_IRQ(NRF51_UART_BASE))); /* RNG */ @@ -115,7 +115,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->rng), 0); memory_region_add_subregion_overlap(&s->container, NRF51_RNG_BASE, mr, 0); sysbus_connect_irq(SYS_BUS_DEVICE(&s->rng), 0, - qdev_get_gpio_in(DEVICE(&s->cpu), + qdev_get_gpio_in(DEVICE(&s->armv7m), BASE_TO_IRQ(NRF51_RNG_BASE))); /* UICR, FICR, NVMC, FLASH */ @@ -161,7 +161,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->timer[i]), 0, base_addr); sysbus_connect_irq(SYS_BUS_DEVICE(&s->timer[i]), 0, - qdev_get_gpio_in(DEVICE(&s->cpu), + qdev_get_gpio_in(DEVICE(&s->armv7m), BASE_TO_IRQ(base_addr))); } @@ -185,10 +185,10 @@ static void nrf51_soc_init(Object *obj) memory_region_init(&s->container, obj, "nrf51-container", UINT64_MAX); - object_initialize_child(OBJECT(s), "armv6m", &s->cpu, TYPE_ARMV7M); - qdev_prop_set_string(DEVICE(&s->cpu), "cpu-type", + object_initialize_child(OBJECT(s), "armv6m", &s->armv7m, TYPE_ARMV7M); + qdev_prop_set_string(DEVICE(&s->armv7m), "cpu-type", ARM_CPU_TYPE_NAME("cortex-m0")); - qdev_prop_set_uint32(DEVICE(&s->cpu), "num-irq", 32); + qdev_prop_set_uint32(DEVICE(&s->armv7m), "num-irq", 32); object_initialize_child(obj, "uart", &s->uart, TYPE_NRF51_UART); object_property_add_alias(obj, "serial0", OBJECT(&s->uart), "chardev"); From patchwork Sun Jan 12 22:56:13 2025 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: 856817 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1185766wrc; Sun, 12 Jan 2025 14:57:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUWALbat24YA23m6+N8o0lOnKazXUhGS+H0wlftYjVViV7x+VBFUppJ0UtSYhECPqn0azWcVA==@linaro.org X-Google-Smtp-Source: AGHT+IHZRq2l4Xg5MnwXtkyEZP7DJFJkN9UIfmTZXp78S8utD3N2hCkIMTMRP7XCQyV3Y06m9twB X-Received: by 2002:a05:6214:409:b0:6d8:7ed4:335c with SMTP id 6a1803df08f44-6df9b2d8811mr300327906d6.45.1736722645596; Sun, 12 Jan 2025 14:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736722645; cv=none; d=google.com; s=arc-20240605; b=AaYqMYv8a4JcLQFKRTUm678fokN5JohFvcXYl+ITEjlojT2HpJSRNwt1NDgeUfnrau sYUsZvD6cUGtFT2cJ2Ggn5fKR61yXFq+dzo20dKleUIXqSWsrbcKkd0cxr+tkaOquB3N cuqQ5GtCreJdq+JP98VT3PqV1qot49u30e34knQAzThEPYwPUktDpqY16zrzcUYfgyMY SvvCG1F8kMWexbBh3SGCzWvNq7gs/xlMtjD/nEbQocV7r/nPluSj5Y5BvyAnScUCmebp SNcgYvWGID67N25u4V5uexAgUgr4olvXbUIjaQwv4EU3vy9l/vwnXvyHFWNZ73TxenzC nUSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=2P6utQTgIOG24muh2STqCnSn8EGidw/ozbeVNIgt5Qs=; fh=DF2NIb+N0CqV3t200NonzP1Z+7HuUkgCcwu6aInqRiw=; b=AOicWO4+lZCpRIbfQutctAuuBGncqh+wxCP8uXHrpb0lIM9MhTvEEMHZPwC+IpyTIx M7qnhlCc0uT2pS/z05PVX6XOsRR6Jy2TkEbBAkCz2Xdg3sel8r3DAuZ4Uv6MvEYRFCeN A4yROfkVF5VZaKQMLB5U/Kl+JV6MVJFSnEF57ZR9Cp+6w3V1KlVoY6NUmHSvf/QyTYUQ A85afwQOIfqB9LxOM6Li7TUza7u4lD+fq5ficTnfgYzMQT+/CaJ373LYWZeGakLXBazJ CFZivc+7LvCgXJirrZNRox9itO/TliR6bYYy0Ud/jYIJBsEwsvEsO9tzbNiOpvNqwC8e rE+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eqbY9VjZ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfad9cb12dsi78380566d6.106.2025.01.12.14.57.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:57:25 -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=eqbY9VjZ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6sq-0007C0-UB; Sun, 12 Jan 2025 17:56:42 -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 1tX6sg-000745-PF for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56:30 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6sf-0001ZW-7l for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56:30 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361815b96cso25753855e9.1 for ; Sun, 12 Jan 2025 14:56:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736722586; x=1737327386; 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=2P6utQTgIOG24muh2STqCnSn8EGidw/ozbeVNIgt5Qs=; b=eqbY9VjZvl82B6wKXGXxwF/YtgopRob7R+s0pY/XEBNiFVdnQKgiClrXgqGlWM4eOZ AUboeSFEDCFWVb1I57kvM/IYMYDlNLgyDuGPyunT0vxsGnTiKkR3+pwFBTRQMHMzpqfr Sz8uXzbhljJ9Dyw+E4gvUfsINvF7DkJ6s/dA/Fs1oKQCJ40w3ln5Rr16ZfFmMAgXHjtn fOp4LoDDVDTN5ogDjhS/nn+jUnboeUr16sJZGNzxxQL1EDWfmyg598dky8Gp8rbxtJ6j DW6OA8Kl6ROjnsJVCTVt8NCptMmnRDVPpGWT57cU4EbHfxvda9EqV8r/FI/eJ243hg91 r3oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736722586; x=1737327386; 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=2P6utQTgIOG24muh2STqCnSn8EGidw/ozbeVNIgt5Qs=; b=iru3dctVN14nU/c+kynLeSVUrcIyMTDao3yiNqfwghfvLroqYuGwhcIA9GGJ0I9EcR nqiTQGnE2dBS2NTisihW+C1Ztjwm12YzTV0BEF27FmUMbVXslt7EY0ZdKFvMtE3xxfiF fkPyzhP2eVhVR3voX4b+3WaozgSw/TZ1yXVg5+Fs6ZygbxAq3eC0Aik593RVRB9T1Ybz fZ7eDlwKtzFX+9j0Wdlp79eg3Z1R/HdG8e8Obute1qsGHfDupVMKQLkhwJJQ0XcHxJ5Z xEU5VNUFSmTxLjHL8xcB6N0J8SD42T9iNLof1utMvmQhrbEVO3fkviJ1GgIALCtLSB3A M8Qw== X-Gm-Message-State: AOJu0YxPTBY4W1ltNTZ7jjHuQI/8CcGd5v8Z3s8S1QQ8Y10+gV04cMnL 5jVLiGiKcC8pcTpIAZZxZ8FoFsJ0HOWs19j1qg4QQ6fMwWwgoIhX4qmgIydzzjYbva+fgRNu72v ZEpw= X-Gm-Gg: ASbGncsKNdP9hYlQT+PaHw7d+8wkyhhz0bxX3TCMRuflPuNdIzyuiHcQSUKmU2+JmsS CJ3x6XLIXoI+S/TXelhDTprgmchwOsuUTRR7NoPhgBBfLcXGzo+en8CAX5EWTkvbB8Sy7Iix2cw q4+tGyKhHCX+9lBvH0OH02g/ksn7+zOEBCXngQZJ/aLJHi9PJ97JhiMTzglDTFzfYg7f/1Kxr0B At4V1D9PJivcZX4rv581C0rGBwJHBnl5hd/QMDnhF+N9TeGJDSz1UnMvg9yLpUxKNe4OUm/u/PO sYf8+fSvqIVRWta3XfmBTuFselNRJkw= X-Received: by 2002:a05:600c:3593:b0:431:6083:cd38 with SMTP id 5b1f17b1804b1-436e2696e93mr147917025e9.6.1736722586315; Sun, 12 Jan 2025 14:56:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80besm10442329f8f.83.2025.01.12.14.56.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:56:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Samuel Tardieu , qemu-arm@nongnu.org, Peter Maydell , Felipe Balbi , Subbaraya Sundeep , Alistair Francis , Joel Stanley , Alexandre Iooss , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] hw/arm/stellaris: Add 'armv7m' local variable Date: Sun, 12 Jan 2025 23:56:13 +0100 Message-ID: <20250112225614.33723-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112225614.33723-1-philmd@linaro.org> References: <20250112225614.33723-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While the TYPE_ARMV7M object forward its NVIC interrupt lines, it is somehow misleading to name it 'nvic'. Add the 'armv7m' local variable for clarity, but also keep the 'nvic' variable behaving like before when used for wiring IRQ lines. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/arm/stellaris.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 1bba96df14e..7303e096ef7 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1031,7 +1031,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) */ Object *soc_container; - DeviceState *gpio_dev[7], *nvic; + DeviceState *gpio_dev[7], *armv7m, *nvic; qemu_irq gpio_in[7][8]; qemu_irq gpio_out[7][8]; qemu_irq adc; @@ -1095,19 +1095,20 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) qdev_prop_set_uint32(ssys_dev, "dc4", board->dc4); 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); - qdev_prop_set_bit(nvic, "enable-bitband", true); - qdev_connect_clock_in(nvic, "cpuclk", + armv7m = qdev_new(TYPE_ARMV7M); + object_property_add_child(soc_container, "v7m", OBJECT(armv7m)); + qdev_prop_set_uint32(armv7m, "num-irq", NUM_IRQ_LINES); + qdev_prop_set_uint8(armv7m, "num-prio-bits", NUM_PRIO_BITS); + qdev_prop_set_string(armv7m, "cpu-type", ms->cpu_type); + qdev_prop_set_bit(armv7m, "enable-bitband", true); + qdev_connect_clock_in(armv7m, "cpuclk", qdev_get_clock_out(ssys_dev, "SYSCLK")); /* This SoC does not connect the systick reference clock */ - object_property_set_link(OBJECT(nvic), "memory", + object_property_set_link(OBJECT(armv7m), "memory", OBJECT(get_system_memory()), &error_abort); /* This will exit with an error if the user passed us a bad cpu_type */ - sysbus_realize_and_unref(SYS_BUS_DEVICE(nvic), &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(armv7m), &error_fatal); + nvic = armv7m; /* Now we can wire up the IRQ and MMIO of the system registers */ sysbus_mmio_map(SYS_BUS_DEVICE(ssys_dev), 0, 0x400fe000); From patchwork Sun Jan 12 22:56:14 2025 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: 856819 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1185769wrc; Sun, 12 Jan 2025 14:57:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV83kEcDGcXE3SQ4ROoA5FuavDfow+e8Nl3/rOXLd1mUo+N/xESfXgJcq2UaT72Km1+CPIU1Q==@linaro.org X-Google-Smtp-Source: AGHT+IHRIJsf9lEaJi1wPfO6GKUTFu8LN+zxKt+0UmtG/RBdIvS3MInQIwYuYyPw8Ro9twW10dTL X-Received: by 2002:a05:6214:4015:b0:6d8:8f14:2f5c with SMTP id 6a1803df08f44-6df9b227e98mr333597416d6.23.1736722645763; Sun, 12 Jan 2025 14:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736722645; cv=none; d=google.com; s=arc-20240605; b=XMYMT+DPfxO8Om9XzsesSCVvqWOa9kZjtLltHHF0DzctWKdr4+77vnq5aH2M1ghddS Cw7Xr3EUwizJwhh1pXe9lUxDoQWaZ+oYJAzCwWeP2dnY4QhtC6WQwNHHBRwCmZWnQXu5 xnZonIajNMiw0ObeTFFMcN9BXKxwmsc5VcnxSg97KrPsWF8MVxw5jEOcdcKQfhWJhIZM aOFm2L6R1fSon71Jy5O3AFomUwPCTejU5EupN1gotAMN7TYEIy3EvKtGYvyOsWfXndw8 zX3quH2kNpxGcrRRb6xk41sqhD33xiVxillkY9aYFQL4v+hCdKD+b0c7gZUuefOGY8UJ n8Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Lib4OrNK5VdPwlvzVttsZjjREbL5pGt5xtvhCA9WJB4=; fh=DF2NIb+N0CqV3t200NonzP1Z+7HuUkgCcwu6aInqRiw=; b=i1noKs4v+tKVwp8uhhIV+hbo9KPl5NiZvSINw0pGB6OHJfrEA1GLqmDUORiqfU3+Wz zO206sDE3bDmi/Sau1zPRc8BkphNK8BtALbZNoJL8srgclTMzXeSb43P872BlNUViarf XFGbLl8Hm7HlpQo2pt1q/gKSB29Cika/A+Ro7MQDpW76as5C8p1oCPxidCQW9juLh2kk REfMBXI8L9YJQQBIsEY1CRq4A0xrxyEgi076HpMFPKtaNQCtAji6z7rG22tlJp+4HUWj WQk1q/9WmPaJRbVBDdbhHsjY/kM4gk9rG9X1NfCJIvdirzjBRqzkl/vwbju9aaKT9NJ+ gGwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CvOQrVWz; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e16a300239si30030046d6.36.2025.01.12.14.57.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:57:25 -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=CvOQrVWz; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6su-0007FB-6l; Sun, 12 Jan 2025 17:56:44 -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 1tX6sl-00079M-O4 for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56:36 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6sj-0001Zp-TF for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:56:35 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43621d27adeso25582185e9.2 for ; Sun, 12 Jan 2025 14:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736722591; x=1737327391; 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=Lib4OrNK5VdPwlvzVttsZjjREbL5pGt5xtvhCA9WJB4=; b=CvOQrVWzES5wzN1HzTU28ab3Q4Fsl2GBuwpVwxT3HC/4FzJQxg8R1jBkLp8uYRvRBG JrI+2DG8UbXtAyzGaiGXuHjhkwdU2gMlt/afP57jjuewjFqoUFQpq5qeL9XQDkh7F9I0 ba1glyYve0tAsiCxfxTCtLltZAortHbQIviTUjtrM5gnXjwRuW3/PixADzivrZOa/7Tr BXnBai3jMtE8d/b/TGvzmcN9xYqRUFpKjpNTjy5p3+Qg9EEMhz1EGehtze/GRt+k+B0z Aibcclf8vAaLXi9GRm5+Jat0yeSIb0UgdyT5gX+PFZknUm79M+2kb2DQHNa9XnsV3Nm5 HyZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736722591; x=1737327391; 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=Lib4OrNK5VdPwlvzVttsZjjREbL5pGt5xtvhCA9WJB4=; b=wzsdXFHz3PXLXNNYITle+K59TexueUSbVS8Oee2+frHyw2Z9qBKjcQwbfNMVXl02x0 DDmYMoo9r4vnpqJ6oMSqACJoduyWyI33faKB5iGElC215IScQBMaRquJRvfeSGfapTH+ w8StsTBGRIq7G5TPVaKCK+f347DaEo/2lmkH7PfGmuuTxK16yYDJKo3iLDndRWhiA/AM QiWNoGogDYg91CRBk3LSGcPIHfG1JmjHEExmA+i/dIE5W8it+Ufo2Oqg/qlfua5VWKBN uAmWuSHWB2gPGuXVesxZwHoGOUwDPRTJTlgGedltxDC6TLeZ+W+20bS4iCHE1PmPIQJo todQ== X-Gm-Message-State: AOJu0Yza/7aQlKZHfA0fONjX16e0j9EPzrgZPVC3rJBOq2s9mGwEmCge dlhwme2+iMpSSKznZUHvuCyyrhd9C09x0jIbnnbFoB0fvKi6rNDWE3+kRFD/I8SeGGmpJj0Ko3Y /Tsk= X-Gm-Gg: ASbGncu3JK+l7DSFiAu+tsKSIt3v4hI2Nx9HxbOTlpLfhGD9fBhscPPQ0UHUlLUq6G4 HcFYimQ1zsP0q6Gr8zpIWqlWCOrvNdhwcxSt+4BYWbK5tHWJjw0IMtJtyzL1W+K4NGjlosga1FN CKQLJpWtjdBH7/oYPBJ/6o2CPpzZ744T6a08NW7dEZc2hApJz3T+AKNgg1UxPajkaOjqN5IqWOv a3XapvpU0TvwkDDFuKpoQJSCQ8YeM+kilW8sgyfdHs1O96/x4vmmW3IxDTrAd+YcKDHSRaugEDC PjkX6Dsji3mtTiHZw/+LER6lzJ/INgI= X-Received: by 2002:a05:6000:18a7:b0:385:f220:f798 with SMTP id ffacd0b85a97d-38a872c93eemr13904757f8f.6.1736722591081; Sun, 12 Jan 2025 14:56:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1c01sm10819644f8f.97.2025.01.12.14.56.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:56:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Samuel Tardieu , qemu-arm@nongnu.org, Peter Maydell , Felipe Balbi , Subbaraya Sundeep , Alistair Francis , Joel Stanley , Alexandre Iooss , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] hw/arm/v7m: Remove use of &first_cpu in machine_init() Date: Sun, 12 Jan 2025 23:56:14 +0100 Message-ID: <20250112225614.33723-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112225614.33723-1-philmd@linaro.org> References: <20250112225614.33723-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When instanciating the machine model, the machine_init() implementations usually create the CPUs, so have access to its first CPU. Use that rather then the &first_cpu global. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/arm/b-l475e-iot01a.c | 2 +- hw/arm/microbit.c | 2 +- hw/arm/mps2-tz.c | 2 +- hw/arm/mps2.c | 2 +- hw/arm/msf2-som.c | 2 +- hw/arm/musca.c | 2 +- hw/arm/netduino2.c | 2 +- hw/arm/netduinoplus2.c | 2 +- hw/arm/olimex-stm32-h405.c | 2 +- hw/arm/stellaris.c | 2 +- hw/arm/stm32vldiscovery.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/arm/b-l475e-iot01a.c b/hw/arm/b-l475e-iot01a.c index 5002a40f06d..c9a5209216c 100644 --- a/hw/arm/b-l475e-iot01a.c +++ b/hw/arm/b-l475e-iot01a.c @@ -82,7 +82,7 @@ static void bl475e_init(MachineState *machine) sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal); sc = STM32L4X5_SOC_GET_CLASS(&s->soc); - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, 0, + armv7m_load_kernel(s->soc.armv7m.cpu, machine->kernel_filename, 0, sc->flash_size); if (object_class_by_name(TYPE_DM163)) { diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index 374fbcb3618..3f56fb45ce1 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -56,7 +56,7 @@ static void microbit_init(MachineState *machine) memory_region_add_subregion_overlap(&s->nrf51.container, NRF51_TWI_BASE, mr, -1); - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(s->nrf51.armv7m.cpu, machine->kernel_filename, 0, s->nrf51.flash_size); } diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 0136e419bfd..d3a9f1b03ac 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -1211,7 +1211,7 @@ static void mps2tz_common_init(MachineState *machine) mms->remap_irq); } - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(mms->iotkit.armv7m[0].cpu, machine->kernel_filename, 0, boot_ram_size(mms)); } diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index efb3500742f..56b2af40f1d 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -460,7 +460,7 @@ static void mps2_common_init(MachineState *machine) qdev_get_gpio_in(armv7m, mmc->fpga_type == FPGA_AN511 ? 47 : 13)); - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(mms->armv7m.cpu, machine->kernel_filename, 0, 0x400000); } diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index 5c415abe852..9b20f1e2c98 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -92,7 +92,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine) cs_line = qdev_get_gpio_in_named(spi_flash, SSI_GPIO_CS, 0); sysbus_connect_irq(SYS_BUS_DEVICE(&soc->spi[0]), 1, cs_line); - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(soc->armv7m.cpu, machine->kernel_filename, 0, soc->envm_size); } diff --git a/hw/arm/musca.c b/hw/arm/musca.c index 3c3b534cb72..e9c092abc3d 100644 --- a/hw/arm/musca.c +++ b/hw/arm/musca.c @@ -590,7 +590,7 @@ static void musca_init(MachineState *machine) "cfg_sec_resp", 0)); } - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(mms->sse.armv7m[0].cpu, machine->kernel_filename, 0, 0x2000000); } diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c index 8b1a9a24379..df793c77fe1 100644 --- a/hw/arm/netduino2.c +++ b/hw/arm/netduino2.c @@ -48,7 +48,7 @@ static void netduino2_init(MachineState *machine) qdev_connect_clock_in(dev, "sysclk", sysclk); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, + armv7m_load_kernel(STM32F205_SOC(dev)->armv7m.cpu, machine->kernel_filename, 0, FLASH_SIZE); } diff --git a/hw/arm/netduinoplus2.c b/hw/arm/netduinoplus2.c index bccd1003549..81b6334cf72 100644 --- a/hw/arm/netduinoplus2.c +++ b/hw/arm/netduinoplus2.c @@ -48,7 +48,7 @@ static void netduinoplus2_init(MachineState *machine) qdev_connect_clock_in(dev, "sysclk", sysclk); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - armv7m_load_kernel(ARM_CPU(first_cpu), + armv7m_load_kernel(STM32F405_SOC(dev)->armv7m.cpu, machine->kernel_filename, 0, FLASH_SIZE); } diff --git a/hw/arm/olimex-stm32-h405.c b/hw/arm/olimex-stm32-h405.c index 4ad7b043be0..1f15620f9fd 100644 --- a/hw/arm/olimex-stm32-h405.c +++ b/hw/arm/olimex-stm32-h405.c @@ -51,7 +51,7 @@ static void olimex_stm32_h405_init(MachineState *machine) qdev_connect_clock_in(dev, "sysclk", sysclk); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - armv7m_load_kernel(ARM_CPU(first_cpu), + armv7m_load_kernel(STM32F405_SOC(dev)->armv7m.cpu, machine->kernel_filename, 0, FLASH_SIZE); } diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 7303e096ef7..284980ad4b5 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1366,7 +1366,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) create_unimplemented_device("hibernation", 0x400fc000, 0x1000); create_unimplemented_device("flash-control", 0x400fd000, 0x1000); - armv7m_load_kernel(ARM_CPU(first_cpu), ms->kernel_filename, 0, flash_size); + armv7m_load_kernel(ARMV7M(armv7m)->cpu, ms->kernel_filename, 0, flash_size); } /* FIXME: Figure out how to generate these from stellaris_boards. */ diff --git a/hw/arm/stm32vldiscovery.c b/hw/arm/stm32vldiscovery.c index cc419351605..e6c1f5b8d7d 100644 --- a/hw/arm/stm32vldiscovery.c +++ b/hw/arm/stm32vldiscovery.c @@ -51,7 +51,7 @@ static void stm32vldiscovery_init(MachineState *machine) qdev_connect_clock_in(dev, "sysclk", sysclk); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - armv7m_load_kernel(ARM_CPU(first_cpu), + armv7m_load_kernel(STM32F100_SOC(dev)->armv7m.cpu, machine->kernel_filename, 0, FLASH_SIZE); }