From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619296; cv=none; d=zohomail.com; s=zohoarc; b=SKPqZAwUK/RQnhzscIQNdfuljboIxA5aCFqlH6zSZyc/JU7bEyt/tsAm8CGIWcmwWEWSTXq5RNOARNyOfJSeAG41aL8dAQs2oWmFfi9/yXwm7aUVrMsPLnbsB+mhumKDfmJ6hQf3eWjkpOa4RGnqp9qwxok5vOxjSVJG+yPF4CI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619296; h=Content-Type:Content-Transfer-Encoding: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=0UjFAgB+hRTqOaCSG06n/BoGBnVJMNwagk4kbsnn0CU=; b=bhQ/uwFwnAk1v+V+Y1ik+7Ys6bIJldPcrBhmtzgK9iBeazNn2zWI45zwGR20hrmIcyZCFhGoMcAnRPE1B0wpCD8VT2HBN41bUO5oIIg5L04841fXNBO76uUpDFbblTkERZSSkmlGhjeVKBREr5C6o9f5/FGANLRAFUU152opI+g= 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+importer2=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 1673619296832876.239441867419; Fri, 13 Jan 2023 06:14:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmS-0000qa-1b; Fri, 13 Jan 2023 09:11:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKmM-0000pL-Ep for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:34 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmI-0003dl-HN for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:31 -0500 Received: by mail-wm1-x332.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so14040999wma.1 for ; Fri, 13 Jan 2023 06:11:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:28 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0UjFAgB+hRTqOaCSG06n/BoGBnVJMNwagk4kbsnn0CU=; b=ULiYO3fl1uV9msj9tdAMEhO+h4oC2pikmw+C6APLZmhvD0TkPRijyN1slGRQtHKYQ9 nvP1zkZDItRSRzzf8Rg5KfaBMWleDadY8DutT8aObJYFvDwaMGGIemDTclAag6yZPysD dvTPc5OgkirCSW1BV39QnV858eGrkYe85tdb8KTELY4fHQ1sVgrF27lgZuWZU2eWUEup 2QAxCDqOq3qv7qaDEda/rCXotcw/ANHhx8NXUPSq6dt4psPhGlIy0gPENX51S3JvktCa qeueNz3mUN4g9q3Kolysb8h9MOqiowrQwegHojOXvcxV/v7tQ2h6arz2zzeKqqakabfJ uvKw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0UjFAgB+hRTqOaCSG06n/BoGBnVJMNwagk4kbsnn0CU=; b=mTIIjJRDCXJdrcNUgEGFfJIDrgzvcRKGf3iZYcejZJ8aCeIzZm7dHad+Sy5KX/0XVS Gp3uMVuQoufHW2eUMvKGaOLmtOtty9zm3f8mLyqpQV1pt3Ro5e/nhMY1dlpxdWjPJAd5 P69H/eR858v8sylucz0fjRVxllavNv2BeDD8cOczV5x1iXcliNFYIcieM/LpXPcKRIrK HGEuBbPP1w49hzjts/EijCOZ4CI0rjdxfQ2MoluS/j0V7NW6hprKIxY+lGpG7fvEUpWm WegI2+uEwxfk2rlz+3QTIDJlZ0chM5LPEK1+Fdy/LMFqi6B1ZBvTnRfJY560TDwTx3Aj izCw== X-Gm-Message-State: AFqh2koK5sCPskMByVWaafKdLYBaJoOUqghUn9juxoHngegMgipKVwMN sRPpxoEiNNm7ovYUQLqnNDszxSQyzb1izscp X-Google-Smtp-Source: AMrXdXsBheE39RwSHb8VGHFe+VOXTJlR+yhK6vtbvi5hZdSjFcPzi10afF5Bpsw0bJjjeBbZO+I2IQ== X-Received: by 2002:a05:600c:3493:b0:3d2:370b:97f4 with SMTP id a19-20020a05600c349300b003d2370b97f4mr63294552wmq.16.1673619088908; Fri, 13 Jan 2023 06:11:28 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/38] hw/arm/stm32f405: correctly describe the memory layout Date: Fri, 13 Jan 2023 14:10:49 +0000 Message-Id: <20230113141126.535646-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619298991100001 From: Felipe Balbi STM32F405 has 128K of SRAM and another 64K of CCM (Core-coupled Memory) at a different base address. Correctly describe the memory layout to give existing FW images a chance to run unmodified. Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Felipe Balbi Message-id: 20221230145733.200496-2-balbi@kernel.org Signed-off-by: Peter Maydell --- include/hw/arm/stm32f405_soc.h | 5 ++++- hw/arm/stm32f405_soc.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/arm/stm32f405_soc.h b/include/hw/arm/stm32f405_soc.h index 5bb0c8d5697..249ab5434ec 100644 --- a/include/hw/arm/stm32f405_soc.h +++ b/include/hw/arm/stm32f405_soc.h @@ -46,7 +46,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(STM32F405State, STM32F405_SOC) #define FLASH_BASE_ADDRESS 0x08000000 #define FLASH_SIZE (1024 * 1024) #define SRAM_BASE_ADDRESS 0x20000000 -#define SRAM_SIZE (192 * 1024) +#define SRAM_SIZE (128 * 1024) +#define CCM_BASE_ADDRESS 0x10000000 +#define CCM_SIZE (64 * 1024) =20 struct STM32F405State { /*< private >*/ @@ -65,6 +67,7 @@ struct STM32F405State { STM32F2XXADCState adc[STM_NUM_ADCS]; STM32F2XXSPIState spi[STM_NUM_SPIS]; =20 + MemoryRegion ccm; MemoryRegion sram; MemoryRegion flash; MemoryRegion flash_alias; diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c index c07947d9f8b..cef23d7ee41 100644 --- a/hw/arm/stm32f405_soc.c +++ b/hw/arm/stm32f405_soc.c @@ -139,6 +139,14 @@ static void stm32f405_soc_realize(DeviceState *dev_soc= , Error **errp) } memory_region_add_subregion(system_memory, SRAM_BASE_ADDRESS, &s->sram= ); =20 + memory_region_init_ram(&s->ccm, NULL, "STM32F405.ccm", CCM_SIZE, + &err); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } + memory_region_add_subregion(system_memory, CCM_BASE_ADDRESS, &s->ccm); + armv7m =3D DEVICE(&s->armv7m); qdev_prop_set_uint32(armv7m, "num-irq", 96); qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620694; cv=none; d=zohomail.com; s=zohoarc; b=JT39eYgjD2tBWmhtd4tj1qQiGwFzlw44uY+yKL0j3Nb0+BSOVeda/XHbUKpB4Lxb6U7l431SsUQTUrD1c6YWtkFhO/RLR38rCMrR/t/pFCq0Aoda6DeRTKW2evG2lZ7oqHwBUHCDfDA/6ED+gWHakdzLh0U7dHZ+NR8nt86lPtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620694; h=Content-Type:Content-Transfer-Encoding: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=oZXMhkSlmXqoV9sDK+w4eUOj9W1bzDySktwjVzGpPRM=; b=LjALdjEi2HOi8K0hYfsJRhywbIX6NPl/llcgE6SsegeJXxGK8VAQBG3TIn1zt6kNfuXt9BO6R2mvpd+xtvI3pEc9PTBVXccBz3Gvgzf0PB4U4fnQ5qVKCMQ4ku22yAjQLDj0JkI0p0yLy7/pIUT58PtMX65ksTylSd0u4yyAO1k= 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+importer2=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 167362069467999.25980794982502; Fri, 13 Jan 2023 06:38:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmW-0000sp-BQ; Fri, 13 Jan 2023 09:11: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 1pGKmO-0000py-GM for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11: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 1pGKmL-0003du-1X for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:35 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso12369697wms.4 for ; Fri, 13 Jan 2023 06:11:30 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:29 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oZXMhkSlmXqoV9sDK+w4eUOj9W1bzDySktwjVzGpPRM=; b=cnetN40p8k2qRyMG7EjqIpucDAsw+ZPJYeElgwK6X43nL1oVOdwRUcEtR2X+bktXVc tdHepFXTFzbrL/jpKPrnQQ7l21Nsadns+xb08KvdL5HNEvp6Is7RpUHYBtjA15cKnzGH WNDzUT+gYXRMnWKPSkFEglIsrWUrhWgxPh4RQXuEcnSnDZUx/FgapjOy+heIJjPEzvny br2+m+9teZywGuGPTN5L/Fml5ik3bI9nkWLpzKPaBaI34X0XlPj8DfhXNifliKxV7eG1 HVpCc0s11C9j8HMF1czFhR9rkWFp+VNoF9SN4sSmFSLkkWk8RHSb5km3JCwaGuiSr/OG fH3A== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZXMhkSlmXqoV9sDK+w4eUOj9W1bzDySktwjVzGpPRM=; b=ekC5RjJFc6J+1IFNMXDKLFkAIN2qDFRz9prz1wf5Uo0ZZyh++NztmNLiN3RTADLWic gzv5dZvwRgXvbd2YEaXFrBoMT4V4kcxNfePUO1XF3BJGKkEd8/h5xBvG+gpfXjIOMgrh 8ZGZPt9x7xh+4A5/pNuzkO0hr0A92A/OpPEuXzdUOuUqWmX5J1F3Q3XkYm0r9NzeD2yo f3Qp4zXY2Yo1KMQG+xaEisIOQTo1M3ScVjmtkGMJfDLoOEgvvaZr99O7z2pVwml87+ES v1wslzuKK4TcUGq0TaD5PyJmTESjpnCuC5Jl3aniul8X23kUnrMImZOSnwCOI/0Z70tK FbtA== X-Gm-Message-State: AFqh2kp3vBcPKU5QDQ802ASbti2qw3aF7cnfTo0Ea7NSQZ6j6A4t0E7S ZBCFuIKwndWsM1qISbI8EcIv3siWyEi6SBK7 X-Google-Smtp-Source: AMrXdXuvP2JPXpbP0qB3iCfwVe4gxaXJOz499dgj9ShznpId/R9HBAaPkdwJrESInvHIEIFsu44JxA== X-Received: by 2002:a05:600c:4f07:b0:3da:1bb0:4d78 with SMTP id l7-20020a05600c4f0700b003da1bb04d78mr4304113wmq.14.1673619089866; Fri, 13 Jan 2023 06:11:29 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/38] hw/arm: Add Olimex H405 Date: Fri, 13 Jan 2023 14:10:50 +0000 Message-Id: <20230113141126.535646-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620696149100001 From: Felipe Balbi Olimex makes a series of low-cost STM32 boards. This commit introduces the minimum setup to support SMT32-H405. See [1] for details [1] https://www.olimex.com/Products/ARM/ST/STM32-H405/ Signed-off-by: Felipe Balbi Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20221230145733.200496-3-balbi@kernel.org Signed-off-by: Peter Maydell --- docs/system/arm/stm32.rst | 1 + configs/devices/arm-softmmu/default.mak | 1 + hw/arm/olimex-stm32-h405.c | 69 +++++++++++++++++++++++++ MAINTAINERS | 6 +++ hw/arm/Kconfig | 4 ++ hw/arm/meson.build | 1 + 6 files changed, 82 insertions(+) create mode 100644 hw/arm/olimex-stm32-h405.c diff --git a/docs/system/arm/stm32.rst b/docs/system/arm/stm32.rst index 508b92cf862..d7265b763d4 100644 --- a/docs/system/arm/stm32.rst +++ b/docs/system/arm/stm32.rst @@ -20,6 +20,7 @@ The STM32F4 series is based on ARM Cortex-M4F core. This = series is pin-to-pin compatible with STM32F2 series. The following machines are based on this c= hip : =20 - ``netduinoplus2`` Netduino Plus 2 board with STM32F405RGT6 microcont= roller +- ``olimex-stm32-h405`` Olimex STM32 H405 board with STM32F405RGT6 microco= ntroller =20 There are many other STM32 series that are currently not supported by QEMU. =20 diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-= softmmu/default.mak index 6985a25377a..1b49a7830c7 100644 --- a/configs/devices/arm-softmmu/default.mak +++ b/configs/devices/arm-softmmu/default.mak @@ -30,6 +30,7 @@ CONFIG_COLLIE=3Dy CONFIG_ASPEED_SOC=3Dy CONFIG_NETDUINO2=3Dy CONFIG_NETDUINOPLUS2=3Dy +CONFIG_OLIMEX_STM32_H405=3Dy CONFIG_MPS2=3Dy CONFIG_RASPI=3Dy CONFIG_DIGIC=3Dy diff --git a/hw/arm/olimex-stm32-h405.c b/hw/arm/olimex-stm32-h405.c new file mode 100644 index 00000000000..3aa61c91b75 --- /dev/null +++ b/hw/arm/olimex-stm32-h405.c @@ -0,0 +1,69 @@ +/* + * ST STM32VLDISCOVERY machine + * Olimex STM32-H405 machine + * + * Copyright (c) 2022 Felipe Balbi + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/boards.h" +#include "hw/qdev-properties.h" +#include "hw/qdev-clock.h" +#include "qemu/error-report.h" +#include "hw/arm/stm32f405_soc.h" +#include "hw/arm/boot.h" + +/* olimex-stm32-h405 implementation is derived from netduinoplus2 */ + +/* Main SYSCLK frequency in Hz (168MHz) */ +#define SYSCLK_FRQ 168000000ULL + +static void olimex_stm32_h405_init(MachineState *machine) +{ + DeviceState *dev; + Clock *sysclk; + + /* This clock doesn't need migration because it is fixed-frequency */ + sysclk =3D clock_new(OBJECT(machine), "SYSCLK"); + clock_set_hz(sysclk, SYSCLK_FRQ); + + dev =3D qdev_new(TYPE_STM32F405_SOC); + qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m4")); + 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, + 0, FLASH_SIZE); +} + +static void olimex_stm32_h405_machine_init(MachineClass *mc) +{ + mc->desc =3D "Olimex STM32-H405 (Cortex-M4)"; + mc->init =3D olimex_stm32_h405_init; + mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-m4"); + + /* SRAM pre-allocated as part of the SoC instantiation */ + mc->default_ram_size =3D 0; +} + +DEFINE_MACHINE("olimex-stm32-h405", olimex_stm32_h405_machine_init) diff --git a/MAINTAINERS b/MAINTAINERS index 5606e5dbd25..904b524896d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1036,6 +1036,12 @@ L: qemu-arm@nongnu.org S: Maintained F: hw/arm/netduinoplus2.c =20 +Olimex STM32 H405 +M: Felipe Balbi +L: qemu-arm@nongnu.org +S: Maintained +F: hw/arm/olimex-stm32-h405.c + SmartFusion2 M: Subbaraya Sundeep M: Peter Maydell diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 17fcde8e1cc..9143533ef79 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -119,6 +119,10 @@ config NETDUINOPLUS2 bool select STM32F405_SOC =20 +config OLIMEX_STM32_H405 + bool + select STM32F405_SOC + config NSERIES bool select OMAP diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 92f9f6e000e..76d4d650e42 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -12,6 +12,7 @@ arm_ss.add(when: 'CONFIG_MICROBIT', if_true: files('micro= bit.c')) arm_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('musicpal.c')) arm_ss.add(when: 'CONFIG_NETDUINO2', if_true: files('netduino2.c')) arm_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinoplus2.c')) +arm_ss.add(when: 'CONFIG_OLIMEX_STM32_H405', if_true: files('olimex-stm32-= h405.c')) arm_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx.c', 'npcm7xx_bo= ards.c')) arm_ss.add(when: 'CONFIG_NSERIES', if_true: files('nseries.c')) arm_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c')) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673625952; cv=none; d=zohomail.com; s=zohoarc; b=dKokzGEjlbAEwk9TS/OYHpFV7eIMv/aZ1c90RbnFdhcSNjxQE6Ebsq8tzqv3YZ4q5jYT621OkuW0Q1cAKmDlaUGkEDtjzxMZb2cqj+hhFewWRid26Ntpqwjt4NGdU0gWgvzi51eA7nD/BufdP0ASNWBVs83zwYyOX/vKemjwh9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673625952; h=Content-Transfer-Encoding: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=YSysLujAR8dL5PxqCP3BR2lPoOWPsZT0HVubvNDLyVc=; b=loAITV8N1i1LM7L7WBzvzzxPoBr8y6AGgMbMbOV4ggZkJBtWsdXMX8+UcqJ2jUB0K/hmsrcc9lMCjBqZQZjIoC2OnsnrgWAxu5yJmKNCqfJc0ERB9TyUhNYgbaeDf5M7T3a3qcGT0m4T9RMhsBoCY0I1TauqWrQeTg8dZ7rUsx8= 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+importer2=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 1673625952799888.3433898073656; Fri, 13 Jan 2023 08:05:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmc-0000ug-FD; Fri, 13 Jan 2023 09:11:50 -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 1pGKmQ-0000qQ-88 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:39 -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 1pGKmM-0003eE-74 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:37 -0500 Received: by mail-wm1-x333.google.com with SMTP id m3so15371044wmq.0 for ; Fri, 13 Jan 2023 06:11:31 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:30 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YSysLujAR8dL5PxqCP3BR2lPoOWPsZT0HVubvNDLyVc=; b=v+bJtWKXDVdqcalhFeHeBmgngUO/31HSs39xewjSSjl3lth9xWzw2UCKzh/BsmK0Z3 HAIdIdZNOAP8LOSMyhdBUF8k+erEF1VYncSR4zl8sDm3WQHRKCQkdTX2p8ilhaP1ApQl vchj8sn54gTDZIhSNG/vcRTyHgn8RDUbg1GerC21bdcxvd36KDWoEwzimfaWSUpBLdAe ygX1HZvPEv0+I8J6Q5VsCqZe9XG7lyU2Ho9igN4HSrANFWiKf/TN9URMZTiCX5Qnes/e utRVgPjMG6xqIYxxBkxdWqlnKTatHtb+eY1W3UYex3XcYYJHMt5lISHkIYaWD+Vkw3kV onYg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YSysLujAR8dL5PxqCP3BR2lPoOWPsZT0HVubvNDLyVc=; b=DfibJ2qy7hFljAERaQgzPr5pNhtMt4zDdBEJRA34ugJgEj91oHMCuKgWuA86iw/Nj9 OP9KcDIuR/wBK1Vl9F+FBdIy3wkKpivERjG0pozrpvc8m5eEQ5MO2Y4V6jSGfTQE8OfZ T6EhCKyTtHEhrFIiEQEpA352XO0IRoNdPZ10f3aW/oUjy7gKQIbbqbMpQadrm7F8ey8Z SvzBWnt+h9NwWl8uEYXvFtwJiU4TiGQHQVbqLePbwsqJ6kQaTCbP/QfLpVCWFRXl8Z3W VK8NfC1GdkT91b/oIqsrDD0R/5hGx+lBuavthisot7EixLpx+UhWowWGIU04yT3gI8oa Iw0w== X-Gm-Message-State: AFqh2kq2l+DRAvQjEXLt17mxIf3RexGMbI1O87uzvfy4F9Wy8FBwhxJD sQvL9IVlJJWHnQrb6bxm8Nb9p8Vqp04PhaDz X-Google-Smtp-Source: AMrXdXsKZsIRA1wl3S1d8nuS0X4KcZ9E67KhF6GQ/orasAythhh6jb7LDkKXitHLV2Yv5ug3T6/fmA== X-Received: by 2002:a05:600c:1d8e:b0:3d6:e23:76a2 with SMTP id p14-20020a05600c1d8e00b003d60e2376a2mr57013933wms.34.1673619090714; Fri, 13 Jan 2023 06:11:30 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/38] hw/misc: Allwinner-A10 Clock Controller Module Emulation Date: Fri, 13 Jan 2023 14:10:51 +0000 Message-Id: <20230113141126.535646-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673625954649100002 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic During SPL boot several Clock Controller Module (CCM) registers are read, most important are PLL and Tuning, as well as divisor registers. This patch adds these registers and initializes reset values from user's guide. Signed-off-by: Strahinja Jankovic Reviewed-by: Niek Linnenbank Message-id: 20221226220303.14420-2-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/allwinner-a10.h | 2 + include/hw/misc/allwinner-a10-ccm.h | 67 +++++++++ hw/arm/allwinner-a10.c | 7 + hw/misc/allwinner-a10-ccm.c | 224 ++++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + hw/misc/Kconfig | 3 + hw/misc/meson.build | 1 + 7 files changed, 305 insertions(+) create mode 100644 include/hw/misc/allwinner-a10-ccm.h create mode 100644 hw/misc/allwinner-a10-ccm.c diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index f9240ffa64a..11bf1ca415a 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -13,6 +13,7 @@ #include "hw/usb/hcd-ohci.h" #include "hw/usb/hcd-ehci.h" #include "hw/rtc/allwinner-rtc.h" +#include "hw/misc/allwinner-a10-ccm.h" =20 #include "target/arm/cpu.h" #include "qom/object.h" @@ -31,6 +32,7 @@ struct AwA10State { /*< public >*/ =20 ARMCPU cpu; + AwA10ClockCtlState ccm; AwA10PITState timer; AwA10PICState intc; AwEmacState emac; diff --git a/include/hw/misc/allwinner-a10-ccm.h b/include/hw/misc/allwinne= r-a10-ccm.h new file mode 100644 index 00000000000..7f22532efaa --- /dev/null +++ b/include/hw/misc/allwinner-a10-ccm.h @@ -0,0 +1,67 @@ +/* + * Allwinner A10 Clock Control Module emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * This file is derived from Allwinner H3 CCU, + * by Niek Linnenbank. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef HW_MISC_ALLWINNER_A10_CCM_H +#define HW_MISC_ALLWINNER_A10_CCM_H + +#include "qom/object.h" +#include "hw/sysbus.h" + +/** + * @name Constants + * @{ + */ + +/** Size of register I/O address space used by CCM device */ +#define AW_A10_CCM_IOSIZE (0x400) + +/** Total number of known registers */ +#define AW_A10_CCM_REGS_NUM (AW_A10_CCM_IOSIZE / sizeof(uint32_t)) + +/** @} */ + +/** + * @name Object model + * @{ + */ + +#define TYPE_AW_A10_CCM "allwinner-a10-ccm" +OBJECT_DECLARE_SIMPLE_TYPE(AwA10ClockCtlState, AW_A10_CCM) + +/** @} */ + +/** + * Allwinner A10 CCM object instance state. + */ +struct AwA10ClockCtlState { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + + /** Maps I/O registers in physical memory */ + MemoryRegion iomem; + + /** Array of hardware registers */ + uint32_t regs[AW_A10_CCM_REGS_NUM]; +}; + +#endif /* HW_MISC_ALLWINNER_H3_CCU_H */ diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 79082289ea5..86baeeeca2c 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -26,6 +26,7 @@ #include "hw/usb/hcd-ohci.h" =20 #define AW_A10_MMC0_BASE 0x01c0f000 +#define AW_A10_CCM_BASE 0x01c20000 #define AW_A10_PIC_REG_BASE 0x01c20400 #define AW_A10_PIT_REG_BASE 0x01c20c00 #define AW_A10_UART0_REG_BASE 0x01c28000 @@ -46,6 +47,8 @@ static void aw_a10_init(Object *obj) =20 object_initialize_child(obj, "timer", &s->timer, TYPE_AW_A10_PIT); =20 + object_initialize_child(obj, "ccm", &s->ccm, TYPE_AW_A10_CCM); + object_initialize_child(obj, "emac", &s->emac, TYPE_AW_EMAC); =20 object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); @@ -103,6 +106,10 @@ static void aw_a10_realize(DeviceState *dev, Error **e= rrp) memory_region_add_subregion(get_system_memory(), 0x00000000, &s->sram_= a); create_unimplemented_device("a10-sram-ctrl", 0x01c00000, 4 * KiB); =20 + /* Clock Control Module */ + sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, AW_A10_CCM_BASE); + /* FIXME use qdev NIC properties instead of nd_table[] */ if (nd_table[0].used) { qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); diff --git a/hw/misc/allwinner-a10-ccm.c b/hw/misc/allwinner-a10-ccm.c new file mode 100644 index 00000000000..68146ee3401 --- /dev/null +++ b/hw/misc/allwinner-a10-ccm.c @@ -0,0 +1,224 @@ +/* + * Allwinner A10 Clock Control Module emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * This file is derived from Allwinner H3 CCU, + * by Niek Linnenbank. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "qemu/osdep.h" +#include "qemu/units.h" +#include "hw/sysbus.h" +#include "migration/vmstate.h" +#include "qemu/log.h" +#include "qemu/module.h" +#include "hw/misc/allwinner-a10-ccm.h" + +/* CCM register offsets */ +enum { + REG_PLL1_CFG =3D 0x0000, /* PLL1 Control */ + REG_PLL1_TUN =3D 0x0004, /* PLL1 Tuning */ + REG_PLL2_CFG =3D 0x0008, /* PLL2 Control */ + REG_PLL2_TUN =3D 0x000C, /* PLL2 Tuning */ + REG_PLL3_CFG =3D 0x0010, /* PLL3 Control */ + REG_PLL4_CFG =3D 0x0018, /* PLL4 Control */ + REG_PLL5_CFG =3D 0x0020, /* PLL5 Control */ + REG_PLL5_TUN =3D 0x0024, /* PLL5 Tuning */ + REG_PLL6_CFG =3D 0x0028, /* PLL6 Control */ + REG_PLL6_TUN =3D 0x002C, /* PLL6 Tuning */ + REG_PLL7_CFG =3D 0x0030, /* PLL7 Control */ + REG_PLL1_TUN2 =3D 0x0038, /* PLL1 Tuning2 */ + REG_PLL5_TUN2 =3D 0x003C, /* PLL5 Tuning2 */ + REG_PLL8_CFG =3D 0x0040, /* PLL8 Control */ + REG_OSC24M_CFG =3D 0x0050, /* OSC24M Control */ + REG_CPU_AHB_APB0_CFG =3D 0x0054, /* CPU, AHB and APB0 Divide Ratio= */ +}; + +#define REG_INDEX(offset) (offset / sizeof(uint32_t)) + +/* CCM register reset values */ +enum { + REG_PLL1_CFG_RST =3D 0x21005000, + REG_PLL1_TUN_RST =3D 0x0A101000, + REG_PLL2_CFG_RST =3D 0x08100010, + REG_PLL2_TUN_RST =3D 0x00000000, + REG_PLL3_CFG_RST =3D 0x0010D063, + REG_PLL4_CFG_RST =3D 0x21009911, + REG_PLL5_CFG_RST =3D 0x11049280, + REG_PLL5_TUN_RST =3D 0x14888000, + REG_PLL6_CFG_RST =3D 0x21009911, + REG_PLL6_TUN_RST =3D 0x00000000, + REG_PLL7_CFG_RST =3D 0x0010D063, + REG_PLL1_TUN2_RST =3D 0x00000000, + REG_PLL5_TUN2_RST =3D 0x00000000, + REG_PLL8_CFG_RST =3D 0x21009911, + REG_OSC24M_CFG_RST =3D 0x00138013, + REG_CPU_AHB_APB0_CFG_RST =3D 0x00010010, +}; + +static uint64_t allwinner_a10_ccm_read(void *opaque, hwaddr offset, + unsigned size) +{ + const AwA10ClockCtlState *s =3D AW_A10_CCM(opaque); + const uint32_t idx =3D REG_INDEX(offset); + + switch (offset) { + case REG_PLL1_CFG: + case REG_PLL1_TUN: + case REG_PLL2_CFG: + case REG_PLL2_TUN: + case REG_PLL3_CFG: + case REG_PLL4_CFG: + case REG_PLL5_CFG: + case REG_PLL5_TUN: + case REG_PLL6_CFG: + case REG_PLL6_TUN: + case REG_PLL7_CFG: + case REG_PLL1_TUN2: + case REG_PLL5_TUN2: + case REG_PLL8_CFG: + case REG_OSC24M_CFG: + case REG_CPU_AHB_APB0_CFG: + break; + case 0x158 ... AW_A10_CCM_IOSIZE: + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", + __func__, (uint32_t)offset); + return 0; + default: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented read offset 0x%04x\n", + __func__, (uint32_t)offset); + return 0; + } + + return s->regs[idx]; +} + +static void allwinner_a10_ccm_write(void *opaque, hwaddr offset, + uint64_t val, unsigned size) +{ + AwA10ClockCtlState *s =3D AW_A10_CCM(opaque); + const uint32_t idx =3D REG_INDEX(offset); + + switch (offset) { + case REG_PLL1_CFG: + case REG_PLL1_TUN: + case REG_PLL2_CFG: + case REG_PLL2_TUN: + case REG_PLL3_CFG: + case REG_PLL4_CFG: + case REG_PLL5_CFG: + case REG_PLL5_TUN: + case REG_PLL6_CFG: + case REG_PLL6_TUN: + case REG_PLL7_CFG: + case REG_PLL1_TUN2: + case REG_PLL5_TUN2: + case REG_PLL8_CFG: + case REG_OSC24M_CFG: + case REG_CPU_AHB_APB0_CFG: + break; + case 0x158 ... AW_A10_CCM_IOSIZE: + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", + __func__, (uint32_t)offset); + break; + default: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented write offset 0x%04x\n", + __func__, (uint32_t)offset); + break; + } + + s->regs[idx] =3D (uint32_t) val; +} + +static const MemoryRegionOps allwinner_a10_ccm_ops =3D { + .read =3D allwinner_a10_ccm_read, + .write =3D allwinner_a10_ccm_write, + .endianness =3D DEVICE_NATIVE_ENDIAN, + .valid =3D { + .min_access_size =3D 4, + .max_access_size =3D 4, + }, + .impl.min_access_size =3D 4, +}; + +static void allwinner_a10_ccm_reset_enter(Object *obj, ResetType type) +{ + AwA10ClockCtlState *s =3D AW_A10_CCM(obj); + + /* Set default values for registers */ + s->regs[REG_INDEX(REG_PLL1_CFG)] =3D REG_PLL1_CFG_RST; + s->regs[REG_INDEX(REG_PLL1_TUN)] =3D REG_PLL1_TUN_RST; + s->regs[REG_INDEX(REG_PLL2_CFG)] =3D REG_PLL2_CFG_RST; + s->regs[REG_INDEX(REG_PLL2_TUN)] =3D REG_PLL2_TUN_RST; + s->regs[REG_INDEX(REG_PLL3_CFG)] =3D REG_PLL3_CFG_RST; + s->regs[REG_INDEX(REG_PLL4_CFG)] =3D REG_PLL4_CFG_RST; + s->regs[REG_INDEX(REG_PLL5_CFG)] =3D REG_PLL5_CFG_RST; + s->regs[REG_INDEX(REG_PLL5_TUN)] =3D REG_PLL5_TUN_RST; + s->regs[REG_INDEX(REG_PLL6_CFG)] =3D REG_PLL6_CFG_RST; + s->regs[REG_INDEX(REG_PLL6_TUN)] =3D REG_PLL6_TUN_RST; + s->regs[REG_INDEX(REG_PLL7_CFG)] =3D REG_PLL7_CFG_RST; + s->regs[REG_INDEX(REG_PLL1_TUN2)] =3D REG_PLL1_TUN2_RST; + s->regs[REG_INDEX(REG_PLL5_TUN2)] =3D REG_PLL5_TUN2_RST; + s->regs[REG_INDEX(REG_PLL8_CFG)] =3D REG_PLL8_CFG_RST; + s->regs[REG_INDEX(REG_OSC24M_CFG)] =3D REG_OSC24M_CFG_RST; + s->regs[REG_INDEX(REG_CPU_AHB_APB0_CFG)] =3D REG_CPU_AHB_APB0_CFG_RST; +} + +static void allwinner_a10_ccm_init(Object *obj) +{ + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + AwA10ClockCtlState *s =3D AW_A10_CCM(obj); + + /* Memory mapping */ + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_a10_ccm_ops, s, + TYPE_AW_A10_CCM, AW_A10_CCM_IOSIZE); + sysbus_init_mmio(sbd, &s->iomem); +} + +static const VMStateDescription allwinner_a10_ccm_vmstate =3D { + .name =3D "allwinner-a10-ccm", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT32_ARRAY(regs, AwA10ClockCtlState, AW_A10_CCM_REGS_NUM= ), + VMSTATE_END_OF_LIST() + } +}; + +static void allwinner_a10_ccm_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); + + rc->phases.enter =3D allwinner_a10_ccm_reset_enter; + dc->vmsd =3D &allwinner_a10_ccm_vmstate; +} + +static const TypeInfo allwinner_a10_ccm_info =3D { + .name =3D TYPE_AW_A10_CCM, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D allwinner_a10_ccm_init, + .instance_size =3D sizeof(AwA10ClockCtlState), + .class_init =3D allwinner_a10_ccm_class_init, +}; + +static void allwinner_a10_ccm_register(void) +{ + type_register_static(&allwinner_a10_ccm_info); +} + +type_init(allwinner_a10_ccm_register) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 9143533ef79..2be618fe8fd 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -323,6 +323,7 @@ config ALLWINNER_A10 select AHCI select ALLWINNER_A10_PIT select ALLWINNER_A10_PIC + select ALLWINNER_A10_CCM select ALLWINNER_EMAC select SERIAL select UNIMP diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index cbabe9f78c3..ed07bf41339 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -174,4 +174,7 @@ config VIRT_CTRL config LASI bool =20 +config ALLWINNER_A10_CCM + bool + source macio/Kconfig diff --git a/hw/misc/meson.build b/hw/misc/meson.build index ed0598dc9eb..c828dbeb267 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -38,6 +38,7 @@ subdir('macio') =20 softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c')) =20 +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_CCM', if_true: files('allwinner= -a10-ccm.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-c= cu.c')) specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpu= cfg.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-d= ramc.c')) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673624379; cv=none; d=zohomail.com; s=zohoarc; b=g//Q/DPFTehbd9gqxVc/we8Y9Ivm2uT/l8vjGT9Klb/L3OK/5jPbUgsS+dcY0VPRPNE0zKh2ECB/AkG/xeuro1F41z1gJpSof68l1PQMH05b33IK7tZqrv/p1vfLyG2MVSr1YzqDszn5b0Tm5gJ31t//Ou14RTakh26Wf2v8akY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673624379; h=Content-Transfer-Encoding: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=mAvr2md1ZrxgLhDIA+lsU2uRrQ3or0Magy0T0exxhSo=; b=ET+usbKjaSJ7sVsOUdwRHFC0XOHvdqy7DrsYCPNJ2qvGI2k6kacqT7jz0hyHdvNsOz1ZUI9/uBQFQiXzlFv/sXxJEYKhe+SQteI8afx297XRtbE5h0nk0RuV3UQZDrIYrVUzxdJKU1bTfuZbBpSM1XkTDRcUZyXSHCSoTv0BJAQ= 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+importer2=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 SMTP id 1673624379878327.57412431151204; Fri, 13 Jan 2023 07: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 1pGKmX-0000sy-IG; Fri, 13 Jan 2023 09:11:45 -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 1pGKmQ-0000qR-7l for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:39 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmM-0003eP-6x for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:37 -0500 Received: by mail-wm1-x32a.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so1022363wml.0 for ; Fri, 13 Jan 2023 06:11:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11: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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mAvr2md1ZrxgLhDIA+lsU2uRrQ3or0Magy0T0exxhSo=; b=j+8n2L9KermDMHreNq/47BUQzuAxKLoDyXmXzx/60Z9kxJuo0Rzct867Kh1ZaDJ4jO cvwJ3aYOZ+fKHZTsv2yxUWSFx2mNFrWE7xVwgQXzcyTzODDLF1dZjTWfACFHBBg33Oet raCawlrUcXbVHZcwmuvt91/y2a1ZkDGMQhO/oEPGMeOS8QzmOpE9fSEdT5qMHK895MAv XCMPNclwQUq7UALxXPxlRGRYqNG7x/1pyccWArj6b3FPhfbaEg7qv9Y4vk4hqI/5wtXk eWaBa5IOuW0mMD38+Q11yO9jHBVq+dydBj4MwJL+/bRnh4mnprONzowa7DjezFGkH66a 4QWA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mAvr2md1ZrxgLhDIA+lsU2uRrQ3or0Magy0T0exxhSo=; b=sMqaqLErK68304fUm3PpeOrxTCX2+Q2KBI3p652lYh1kGlm3ucmWeoXJt0+VqN5HKw 6KhpM7gMQIeJK6e5ZEvbhlEfGSgfB6I33ko5YF9SBsFg3BFpB0rHCKO4AQqrfgaiAKym HR4h3IfqwVw2x7wp48925i7X7kY4ZxwlJ7C0YuyXi+79NCWeG1LzU49f02ul0tzxCmSQ HabtlHyhZS0I91RiQDPzt6XGMNdPiL2Skn+1JTWGApVQa5i/XYYNf4MCLueW1xV1cm7t Y9pWDs9u8sEdxtuumMSPXOxpp1mJZ/NIp0l6JyqXdFjszTgwZcdhqIy3N7nQ+pddKCRF LojA== X-Gm-Message-State: AFqh2kono1H7ELd5vjHI3Gh7iGBoh9ByyXAV7POnVgYcNl+QcSMLVbcH SWUq5kpY1lU6inwrb51TgBkhbuMv9yEKz+fE X-Google-Smtp-Source: AMrXdXujEIAMFQfU9K/H+FXxeCYJcR65pl9bdTRVl/mUk/mwswzTPv3F/2oBYIuQgVOyNdQu/34DFA== X-Received: by 2002:a05:600c:34d1:b0:3d7:72e3:f437 with SMTP id d17-20020a05600c34d100b003d772e3f437mr59247440wmq.21.1673619091587; Fri, 13 Jan 2023 06:11:31 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/38] hw/misc: Allwinner A10 DRAM Controller Emulation Date: Fri, 13 Jan 2023 14:10:52 +0000 Message-Id: <20230113141126.535646-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673624381412100001 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic During SPL boot several DRAM Controller registers are used. Most important registers are those related to DRAM initialization and calibration, where SPL initiates process and waits until certain bit is set/cleared. This patch adds these registers, initializes reset values from user's guide and updates state of registers as SPL expects it. Signed-off-by: Strahinja Jankovic Reviewed-by: Niek Linnenbank Message-id: 20221226220303.14420-3-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/allwinner-a10.h | 2 + include/hw/misc/allwinner-a10-dramc.h | 68 ++++++++++ hw/arm/allwinner-a10.c | 7 + hw/misc/allwinner-a10-dramc.c | 179 ++++++++++++++++++++++++++ hw/arm/Kconfig | 1 + hw/misc/Kconfig | 3 + hw/misc/meson.build | 1 + 7 files changed, 261 insertions(+) create mode 100644 include/hw/misc/allwinner-a10-dramc.h create mode 100644 hw/misc/allwinner-a10-dramc.c diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index 11bf1ca415a..ad959d6395f 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -14,6 +14,7 @@ #include "hw/usb/hcd-ehci.h" #include "hw/rtc/allwinner-rtc.h" #include "hw/misc/allwinner-a10-ccm.h" +#include "hw/misc/allwinner-a10-dramc.h" =20 #include "target/arm/cpu.h" #include "qom/object.h" @@ -33,6 +34,7 @@ struct AwA10State { =20 ARMCPU cpu; AwA10ClockCtlState ccm; + AwA10DramControllerState dramc; AwA10PITState timer; AwA10PICState intc; AwEmacState emac; diff --git a/include/hw/misc/allwinner-a10-dramc.h b/include/hw/misc/allwin= ner-a10-dramc.h new file mode 100644 index 00000000000..b61fbecbe74 --- /dev/null +++ b/include/hw/misc/allwinner-a10-dramc.h @@ -0,0 +1,68 @@ +/* + * Allwinner A10 DRAM Controller emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * This file is derived from Allwinner H3 DRAMC, + * by Niek Linnenbank. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef HW_MISC_ALLWINNER_A10_DRAMC_H +#define HW_MISC_ALLWINNER_A10_DRAMC_H + +#include "qom/object.h" +#include "hw/sysbus.h" +#include "hw/register.h" + +/** + * @name Constants + * @{ + */ + +/** Size of register I/O address space used by DRAMC device */ +#define AW_A10_DRAMC_IOSIZE (0x1000) + +/** Total number of known registers */ +#define AW_A10_DRAMC_REGS_NUM (AW_A10_DRAMC_IOSIZE / sizeof(uint32_t)) + +/** @} */ + +/** + * @name Object model + * @{ + */ + +#define TYPE_AW_A10_DRAMC "allwinner-a10-dramc" +OBJECT_DECLARE_SIMPLE_TYPE(AwA10DramControllerState, AW_A10_DRAMC) + +/** @} */ + +/** + * Allwinner A10 DRAMC object instance state. + */ +struct AwA10DramControllerState { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + + /** Maps I/O registers in physical memory */ + MemoryRegion iomem; + + /** Array of hardware registers */ + uint32_t regs[AW_A10_DRAMC_REGS_NUM]; +}; + +#endif /* HW_MISC_ALLWINNER_A10_DRAMC_H */ diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 86baeeeca2c..a5f7a36ac9b 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -25,6 +25,7 @@ #include "hw/boards.h" #include "hw/usb/hcd-ohci.h" =20 +#define AW_A10_DRAMC_BASE 0x01c01000 #define AW_A10_MMC0_BASE 0x01c0f000 #define AW_A10_CCM_BASE 0x01c20000 #define AW_A10_PIC_REG_BASE 0x01c20400 @@ -49,6 +50,8 @@ static void aw_a10_init(Object *obj) =20 object_initialize_child(obj, "ccm", &s->ccm, TYPE_AW_A10_CCM); =20 + object_initialize_child(obj, "dramc", &s->dramc, TYPE_AW_A10_DRAMC); + object_initialize_child(obj, "emac", &s->emac, TYPE_AW_EMAC); =20 object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); @@ -110,6 +113,10 @@ static void aw_a10_realize(DeviceState *dev, Error **e= rrp) sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, AW_A10_CCM_BASE); =20 + /* DRAM Control Module */ + sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, AW_A10_DRAMC_BASE); + /* FIXME use qdev NIC properties instead of nd_table[] */ if (nd_table[0].used) { qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); diff --git a/hw/misc/allwinner-a10-dramc.c b/hw/misc/allwinner-a10-dramc.c new file mode 100644 index 00000000000..e118b0c2fd4 --- /dev/null +++ b/hw/misc/allwinner-a10-dramc.c @@ -0,0 +1,179 @@ +/* + * Allwinner A10 DRAM Controller emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * This file is derived from Allwinner H3 DRAMC, + * by Niek Linnenbank. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "qemu/osdep.h" +#include "qemu/units.h" +#include "hw/sysbus.h" +#include "migration/vmstate.h" +#include "qemu/log.h" +#include "qemu/module.h" +#include "hw/misc/allwinner-a10-dramc.h" + +/* DRAMC register offsets */ +enum { + REG_SDR_CCR =3D 0x0000, + REG_SDR_ZQCR0 =3D 0x00a8, + REG_SDR_ZQSR =3D 0x00b0 +}; + +#define REG_INDEX(offset) (offset / sizeof(uint32_t)) + +/* DRAMC register flags */ +enum { + REG_SDR_CCR_DATA_TRAINING =3D (1 << 30), + REG_SDR_CCR_DRAM_INIT =3D (1 << 31), +}; +enum { + REG_SDR_ZQSR_ZCAL =3D (1 << 31), +}; + +/* DRAMC register reset values */ +enum { + REG_SDR_CCR_RESET =3D 0x80020000, + REG_SDR_ZQCR0_RESET =3D 0x07b00000, + REG_SDR_ZQSR_RESET =3D 0x80000000 +}; + +static uint64_t allwinner_a10_dramc_read(void *opaque, hwaddr offset, + unsigned size) +{ + const AwA10DramControllerState *s =3D AW_A10_DRAMC(opaque); + const uint32_t idx =3D REG_INDEX(offset); + + switch (offset) { + case REG_SDR_CCR: + case REG_SDR_ZQCR0: + case REG_SDR_ZQSR: + break; + case 0x2e4 ... AW_A10_DRAMC_IOSIZE: + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", + __func__, (uint32_t)offset); + return 0; + default: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented read offset 0x%04x\n", + __func__, (uint32_t)offset); + return 0; + } + + return s->regs[idx]; +} + +static void allwinner_a10_dramc_write(void *opaque, hwaddr offset, + uint64_t val, unsigned size) +{ + AwA10DramControllerState *s =3D AW_A10_DRAMC(opaque); + const uint32_t idx =3D REG_INDEX(offset); + + switch (offset) { + case REG_SDR_CCR: + if (val & REG_SDR_CCR_DRAM_INIT) { + /* Clear DRAM_INIT to indicate process is done. */ + val &=3D ~REG_SDR_CCR_DRAM_INIT; + } + if (val & REG_SDR_CCR_DATA_TRAINING) { + /* Clear DATA_TRAINING to indicate process is done. */ + val &=3D ~REG_SDR_CCR_DATA_TRAINING; + } + break; + case REG_SDR_ZQCR0: + /* Set ZCAL in ZQSR to indicate calibration is done. */ + s->regs[REG_INDEX(REG_SDR_ZQSR)] |=3D REG_SDR_ZQSR_ZCAL; + break; + case 0x2e4 ... AW_A10_DRAMC_IOSIZE: + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", + __func__, (uint32_t)offset); + break; + default: + qemu_log_mask(LOG_UNIMP, "%s: unimplemented write offset 0x%04x\n", + __func__, (uint32_t)offset); + break; + } + + s->regs[idx] =3D (uint32_t) val; +} + +static const MemoryRegionOps allwinner_a10_dramc_ops =3D { + .read =3D allwinner_a10_dramc_read, + .write =3D allwinner_a10_dramc_write, + .endianness =3D DEVICE_NATIVE_ENDIAN, + .valid =3D { + .min_access_size =3D 4, + .max_access_size =3D 4, + }, + .impl.min_access_size =3D 4, +}; + +static void allwinner_a10_dramc_reset_enter(Object *obj, ResetType type) +{ + AwA10DramControllerState *s =3D AW_A10_DRAMC(obj); + + /* Set default values for registers */ + s->regs[REG_INDEX(REG_SDR_CCR)] =3D REG_SDR_CCR_RESET; + s->regs[REG_INDEX(REG_SDR_ZQCR0)] =3D REG_SDR_ZQCR0_RESET; + s->regs[REG_INDEX(REG_SDR_ZQSR)] =3D REG_SDR_ZQSR_RESET; +} + +static void allwinner_a10_dramc_init(Object *obj) +{ + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + AwA10DramControllerState *s =3D AW_A10_DRAMC(obj); + + /* Memory mapping */ + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_a10_dramc_ops, = s, + TYPE_AW_A10_DRAMC, AW_A10_DRAMC_IOSIZE); + sysbus_init_mmio(sbd, &s->iomem); +} + +static const VMStateDescription allwinner_a10_dramc_vmstate =3D { + .name =3D "allwinner-a10-dramc", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT32_ARRAY(regs, AwA10DramControllerState, + AW_A10_DRAMC_REGS_NUM), + VMSTATE_END_OF_LIST() + } +}; + +static void allwinner_a10_dramc_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); + + rc->phases.enter =3D allwinner_a10_dramc_reset_enter; + dc->vmsd =3D &allwinner_a10_dramc_vmstate; +} + +static const TypeInfo allwinner_a10_dramc_info =3D { + .name =3D TYPE_AW_A10_DRAMC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D allwinner_a10_dramc_init, + .instance_size =3D sizeof(AwA10DramControllerState), + .class_init =3D allwinner_a10_dramc_class_init, +}; + +static void allwinner_a10_dramc_register(void) +{ + type_register_static(&allwinner_a10_dramc_info); +} + +type_init(allwinner_a10_dramc_register) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 2be618fe8fd..9ce756fca77 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -324,6 +324,7 @@ config ALLWINNER_A10 select ALLWINNER_A10_PIT select ALLWINNER_A10_PIC select ALLWINNER_A10_CCM + select ALLWINNER_A10_DRAMC select ALLWINNER_EMAC select SERIAL select UNIMP diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index ed07bf41339..052fb543103 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -177,4 +177,7 @@ config LASI config ALLWINNER_A10_CCM bool =20 +config ALLWINNER_A10_DRAMC + bool + source macio/Kconfig diff --git a/hw/misc/meson.build b/hw/misc/meson.build index c828dbeb267..9eaa0750b50 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -39,6 +39,7 @@ subdir('macio') softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c')) =20 softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_CCM', if_true: files('allwinner= -a10-ccm.c')) +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_DRAMC', if_true: files('allwinn= er-a10-dramc.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-c= cu.c')) specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpu= cfg.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-d= ramc.c')) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620382; cv=none; d=zohomail.com; s=zohoarc; b=ecvYEbJlZsoB/4EmZ2tIYXrdMlILHuXIUexQ/+XP/ku1ht0NIAmW7XDUmBv5u+NfbUV7hd/pxrrY1xLnsD9n6+/UUsUoGVwa6jtdnatty9hp06CM0eCzjwW6AgJUs0mcKgsglo0D3+bVJ6T7O3p7XqE70MUp21BnZFXxSAydfYY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620382; h=Content-Transfer-Encoding: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=a/R4jyoAfb0YQWGVRlN2GeE3T3fJjXtZYrTLqZefdTs=; b=RwJA+zXP9EVykJm/tLc0K/+XWuAO7sHKrdMThJlgkyB2eASEt9DkI/eL/1tm/aFq2iqoFwmwnrL8ZdN3GW3vRDm5zSK/WKYC8MDfka48q6XMls8+Ze6bHVHqQP1lymcUuBbfiVQOxBer5pD/M8EZlE30sH+7ig5bpTiF8vnbqQE= 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+importer2=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 1673620382404566.936216926515; Fri, 13 Jan 2023 06:33:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmj-000101-Qk; Fri, 13 Jan 2023 09:11:57 -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 1pGKmS-0000r3-5s for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:40 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmM-0003eW-7G for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:38 -0500 Received: by mail-wm1-x32f.google.com with SMTP id j16-20020a05600c1c1000b003d9ef8c274bso13089788wms.0 for ; Fri, 13 Jan 2023 06:11:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11: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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=a/R4jyoAfb0YQWGVRlN2GeE3T3fJjXtZYrTLqZefdTs=; b=cGsomRBm9+hLJoKsUMZgLA5RFHlZzqRDvb/80NDuMP0Fvu8WlTOzk+lju+6C5NRJ8C nzQKeBftZHCPM4c8tA8zETfDHlq1LHxCOWXNuBOCNprOLtO680OOUJgeBH1otohsU2tR kdprmfOGCSAH0Pv/wMiGkKbUz+Ad41BvyyIYYzae6M1jrUeDvtsmmIvfVREYmGBdRflp mLMRe4E7Z+sNpSdpNABIa1xhbUSP+lPOHXzv7xFGwA9gU3wfXtl8e54PjBopOLwK1bYA sT1MI0hvpj96fhwIRP7RoIjN63P2qzbjvJZvsQnwqG+tbtIwq+H1Yd8xA5zazQwE+UOz txAA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a/R4jyoAfb0YQWGVRlN2GeE3T3fJjXtZYrTLqZefdTs=; b=jV0jlIV2AUpmCPjV29sPWLmkVQMOkBM1PfZfD178TIkbEV6Pp95NSoa/+KMeGEdh+f /+hz15gy/qwnsjbkMr+wmndq6Zp56OxNn03l8N0p7NA0ZhbZsjCmhV96p1GTd+DEyKjJ s8+5jSll5tNFw3h2v+VMpBiJvNCDJABCmll3YO+DJIXSoN7avaHNL1wSIR+AVJDRlxrp XCPQS3T2eihN9TJ5iVQJaDrl7WQFUsovU3O+QMCDzsKw63xd91kGKFQLq6q68uytYRNg JsNt7W9vVbDqA8iWOTEn4EOg0WcVQ75kWqcHVestZpVwSrW4BD/M+JZldORWm4EgOxX8 fhHg== X-Gm-Message-State: AFqh2krEN8HvNWYASIiLnL1FMynujwH9D/dOINOfyEs9CIh0GWr9umbM yuuSiYIyFBMS/UnoV9nWv+6R+wDGtGqwK9Kb X-Google-Smtp-Source: AMrXdXtGpH3gY84UUUWnt74BN7pxcnDD0cm437gCyLLESHy4trFNUIhD48fOuuQXYJBlUSTLeLK/zA== X-Received: by 2002:a05:600c:4f8a:b0:3d9:f559:1f7e with SMTP id n10-20020a05600c4f8a00b003d9f5591f7emr13596464wmq.20.1673619092559; Fri, 13 Jan 2023 06:11:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/38] {hw/i2c,docs/system/arm}: Allwinner TWI/I2C Emulation Date: Fri, 13 Jan 2023 14:10:53 +0000 Message-Id: <20230113141126.535646-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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, WEIRD_QUOTING=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620384170100003 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic This patch implements Allwinner TWI/I2C controller emulation. Only master-mode functionality is implemented. The SPL boot for Cubieboard expects AXP209 PMIC on TWI0/I2C0 bus, so this is first part enabling the TWI/I2C bus operation. Since both Allwinner A10 and H3 use the same module, it is added for both boards. Docs are also updated for Cubieboard and Orangepi-PC board to indicate I2C availability. Signed-off-by: Strahinja Jankovic Reviewed-by: Niek Linnenbank Message-id: 20221226220303.14420-4-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- docs/system/arm/cubieboard.rst | 1 + docs/system/arm/orangepi.rst | 1 + include/hw/arm/allwinner-a10.h | 2 + include/hw/arm/allwinner-h3.h | 3 + include/hw/i2c/allwinner-i2c.h | 55 ++++ hw/arm/allwinner-a10.c | 8 + hw/arm/allwinner-h3.c | 11 +- hw/i2c/allwinner-i2c.c | 459 +++++++++++++++++++++++++++++++++ hw/arm/Kconfig | 2 + hw/i2c/Kconfig | 4 + hw/i2c/meson.build | 1 + hw/i2c/trace-events | 5 + 12 files changed, 551 insertions(+), 1 deletion(-) create mode 100644 include/hw/i2c/allwinner-i2c.h create mode 100644 hw/i2c/allwinner-i2c.c diff --git a/docs/system/arm/cubieboard.rst b/docs/system/arm/cubieboard.rst index 344ff8cef99..8d485f5435a 100644 --- a/docs/system/arm/cubieboard.rst +++ b/docs/system/arm/cubieboard.rst @@ -14,3 +14,4 @@ Emulated devices: - SDHCI - USB controller - SATA controller +- TWI (I2C) controller diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst index 83c7445197b..e5973600a15 100644 --- a/docs/system/arm/orangepi.rst +++ b/docs/system/arm/orangepi.rst @@ -25,6 +25,7 @@ The Orange Pi PC machine supports the following devices: * Clock Control Unit * System Control module * Security Identifier device + * TWI (I2C) =20 Limitations """"""""""" diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index ad959d6395f..e569e661095 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -15,6 +15,7 @@ #include "hw/rtc/allwinner-rtc.h" #include "hw/misc/allwinner-a10-ccm.h" #include "hw/misc/allwinner-a10-dramc.h" +#include "hw/i2c/allwinner-i2c.h" =20 #include "target/arm/cpu.h" #include "qom/object.h" @@ -40,6 +41,7 @@ struct AwA10State { AwEmacState emac; AllwinnerAHCIState sata; AwSdHostState mmc0; + AWI2CState i2c0; AwRtcState rtc; MemoryRegion sram_a; EHCISysBusState ehci[AW_A10_NUM_USB]; diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h index 63025fb27c8..1d7ce205890 100644 --- a/include/hw/arm/allwinner-h3.h +++ b/include/hw/arm/allwinner-h3.h @@ -47,6 +47,7 @@ #include "hw/sd/allwinner-sdhost.h" #include "hw/net/allwinner-sun8i-emac.h" #include "hw/rtc/allwinner-rtc.h" +#include "hw/i2c/allwinner-i2c.h" #include "target/arm/cpu.h" #include "sysemu/block-backend.h" =20 @@ -82,6 +83,7 @@ enum { AW_H3_DEV_UART2, AW_H3_DEV_UART3, AW_H3_DEV_EMAC, + AW_H3_DEV_TWI0, AW_H3_DEV_DRAMCOM, AW_H3_DEV_DRAMCTL, AW_H3_DEV_DRAMPHY, @@ -130,6 +132,7 @@ struct AwH3State { AwH3SysCtrlState sysctrl; AwSidState sid; AwSdHostState mmc0; + AWI2CState i2c0; AwSun8iEmacState emac; AwRtcState rtc; GICState gic; diff --git a/include/hw/i2c/allwinner-i2c.h b/include/hw/i2c/allwinner-i2c.h new file mode 100644 index 00000000000..4f378b86ba1 --- /dev/null +++ b/include/hw/i2c/allwinner-i2c.h @@ -0,0 +1,55 @@ +/* + * Allwinner I2C Bus Serial Interface registers definition + * + * Copyright (C) 2022 Strahinja Jankovic. + * + * This file is derived from IMX I2C controller, + * by Jean-Christophe DUBOIS . + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WI= THOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + * + */ + +#ifndef ALLWINNER_I2C_H +#define ALLWINNER_I2C_H + +#include "hw/sysbus.h" +#include "qom/object.h" + +#define TYPE_AW_I2C "allwinner.i2c" +OBJECT_DECLARE_SIMPLE_TYPE(AWI2CState, AW_I2C) + +#define AW_I2C_MEM_SIZE 0x24 + +struct AWI2CState { + /*< private >*/ + SysBusDevice parent_obj; + + /*< public >*/ + MemoryRegion iomem; + I2CBus *bus; + qemu_irq irq; + + uint8_t addr; + uint8_t xaddr; + uint8_t data; + uint8_t cntr; + uint8_t stat; + uint8_t ccr; + uint8_t srst; + uint8_t efr; + uint8_t lcr; +}; + +#endif /* ALLWINNER_I2C_H */ diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index a5f7a36ac9b..17e439777e4 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -36,6 +36,7 @@ #define AW_A10_OHCI_BASE 0x01c14400 #define AW_A10_SATA_BASE 0x01c18000 #define AW_A10_RTC_BASE 0x01c20d00 +#define AW_A10_I2C0_BASE 0x01c2ac00 =20 static void aw_a10_init(Object *obj) { @@ -56,6 +57,8 @@ static void aw_a10_init(Object *obj) =20 object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); =20 + object_initialize_child(obj, "i2c0", &s->i2c0, TYPE_AW_I2C); + if (machine_usb(current_machine)) { int i; =20 @@ -176,6 +179,11 @@ static void aw_a10_realize(DeviceState *dev, Error **e= rrp) /* RTC */ sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal); sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->rtc), 0, AW_A10_RTC_BASE, 1= 0); + + /* I2C */ + sysbus_realize(SYS_BUS_DEVICE(&s->i2c0), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c0), 0, AW_A10_I2C0_BASE); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c0), 0, qdev_get_gpio_in(dev, = 7)); } =20 static void aw_a10_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c index 308ed155525..bfce3c8d92a 100644 --- a/hw/arm/allwinner-h3.c +++ b/hw/arm/allwinner-h3.c @@ -53,6 +53,7 @@ const hwaddr allwinner_h3_memmap[] =3D { [AW_H3_DEV_UART1] =3D 0x01c28400, [AW_H3_DEV_UART2] =3D 0x01c28800, [AW_H3_DEV_UART3] =3D 0x01c28c00, + [AW_H3_DEV_TWI0] =3D 0x01c2ac00, [AW_H3_DEV_EMAC] =3D 0x01c30000, [AW_H3_DEV_DRAMCOM] =3D 0x01c62000, [AW_H3_DEV_DRAMCTL] =3D 0x01c63000, @@ -106,7 +107,6 @@ struct AwH3Unimplemented { { "uart1", 0x01c28400, 1 * KiB }, { "uart2", 0x01c28800, 1 * KiB }, { "uart3", 0x01c28c00, 1 * KiB }, - { "twi0", 0x01c2ac00, 1 * KiB }, { "twi1", 0x01c2b000, 1 * KiB }, { "twi2", 0x01c2b400, 1 * KiB }, { "scr", 0x01c2c400, 1 * KiB }, @@ -150,6 +150,7 @@ enum { AW_H3_GIC_SPI_UART1 =3D 1, AW_H3_GIC_SPI_UART2 =3D 2, AW_H3_GIC_SPI_UART3 =3D 3, + AW_H3_GIC_SPI_TWI0 =3D 6, AW_H3_GIC_SPI_TIMER0 =3D 18, AW_H3_GIC_SPI_TIMER1 =3D 19, AW_H3_GIC_SPI_MMC0 =3D 60, @@ -225,6 +226,8 @@ static void allwinner_h3_init(Object *obj) "ram-size"); =20 object_initialize_child(obj, "rtc", &s->rtc, TYPE_AW_RTC_SUN6I); + + object_initialize_child(obj, "twi0", &s->i2c0, TYPE_AW_I2C); } =20 static void allwinner_h3_realize(DeviceState *dev, Error **errp) @@ -423,6 +426,12 @@ static void allwinner_h3_realize(DeviceState *dev, Err= or **errp) sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, s->memmap[AW_H3_DEV_RTC]); =20 + /* I2C */ + sysbus_realize(SYS_BUS_DEVICE(&s->i2c0), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c0), 0, s->memmap[AW_H3_DEV_TWI0]= ); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c0), 0, + qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_TWI= 0)); + /* Unimplemented devices */ for (i =3D 0; i < ARRAY_SIZE(unimplemented); i++) { create_unimplemented_device(unimplemented[i].device_name, diff --git a/hw/i2c/allwinner-i2c.c b/hw/i2c/allwinner-i2c.c new file mode 100644 index 00000000000..a4359658362 --- /dev/null +++ b/hw/i2c/allwinner-i2c.c @@ -0,0 +1,459 @@ +/* + * Allwinner I2C Bus Serial Interface Emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * This file is derived from IMX I2C controller, + * by Jean-Christophe DUBOIS . + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WI= THOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "hw/i2c/allwinner-i2c.h" +#include "hw/irq.h" +#include "migration/vmstate.h" +#include "hw/i2c/i2c.h" +#include "qemu/log.h" +#include "trace.h" +#include "qemu/module.h" + +/* Allwinner I2C memory map */ +#define TWI_ADDR_REG 0x00 /* slave address register */ +#define TWI_XADDR_REG 0x04 /* extended slave address register */ +#define TWI_DATA_REG 0x08 /* data register */ +#define TWI_CNTR_REG 0x0c /* control register */ +#define TWI_STAT_REG 0x10 /* status register */ +#define TWI_CCR_REG 0x14 /* clock control register */ +#define TWI_SRST_REG 0x18 /* software reset register */ +#define TWI_EFR_REG 0x1c /* enhance feature register */ +#define TWI_LCR_REG 0x20 /* line control register */ + +/* Used only in slave mode, do not set */ +#define TWI_ADDR_RESET 0 +#define TWI_XADDR_RESET 0 + +/* Data register */ +#define TWI_DATA_MASK 0xFF +#define TWI_DATA_RESET 0 + +/* Control register */ +#define TWI_CNTR_INT_EN (1 << 7) +#define TWI_CNTR_BUS_EN (1 << 6) +#define TWI_CNTR_M_STA (1 << 5) +#define TWI_CNTR_M_STP (1 << 4) +#define TWI_CNTR_INT_FLAG (1 << 3) +#define TWI_CNTR_A_ACK (1 << 2) +#define TWI_CNTR_MASK 0xFC +#define TWI_CNTR_RESET 0 + +/* Status register */ +#define TWI_STAT_MASK 0xF8 +#define TWI_STAT_RESET 0xF8 + +/* Clock register */ +#define TWI_CCR_CLK_M_MASK 0x78 +#define TWI_CCR_CLK_N_MASK 0x07 +#define TWI_CCR_MASK 0x7F +#define TWI_CCR_RESET 0 + +/* Soft reset */ +#define TWI_SRST_MASK 0x01 +#define TWI_SRST_RESET 0 + +/* Enhance feature */ +#define TWI_EFR_MASK 0x03 +#define TWI_EFR_RESET 0 + +/* Line control */ +#define TWI_LCR_SCL_STATE (1 << 5) +#define TWI_LCR_SDA_STATE (1 << 4) +#define TWI_LCR_SCL_CTL (1 << 3) +#define TWI_LCR_SCL_CTL_EN (1 << 2) +#define TWI_LCR_SDA_CTL (1 << 1) +#define TWI_LCR_SDA_CTL_EN (1 << 0) +#define TWI_LCR_MASK 0x3F +#define TWI_LCR_RESET 0x3A + +/* Status value in STAT register is shifted by 3 bits */ +#define TWI_STAT_SHIFT 3 +#define STAT_FROM_STA(x) ((x) << TWI_STAT_SHIFT) +#define STAT_TO_STA(x) ((x) >> TWI_STAT_SHIFT) + +enum { + STAT_BUS_ERROR =3D 0, + /* Master mode */ + STAT_M_STA_TX, + STAT_M_RSTA_TX, + STAT_M_ADDR_WR_ACK, + STAT_M_ADDR_WR_NACK, + STAT_M_DATA_TX_ACK, + STAT_M_DATA_TX_NACK, + STAT_M_ARB_LOST, + STAT_M_ADDR_RD_ACK, + STAT_M_ADDR_RD_NACK, + STAT_M_DATA_RX_ACK, + STAT_M_DATA_RX_NACK, + /* Slave mode */ + STAT_S_ADDR_WR_ACK, + STAT_S_ARB_LOST_AW_ACK, + STAT_S_GCA_ACK, + STAT_S_ARB_LOST_GCA_ACK, + STAT_S_DATA_RX_SA_ACK, + STAT_S_DATA_RX_SA_NACK, + STAT_S_DATA_RX_GCA_ACK, + STAT_S_DATA_RX_GCA_NACK, + STAT_S_STP_RSTA, + STAT_S_ADDR_RD_ACK, + STAT_S_ARB_LOST_AR_ACK, + STAT_S_DATA_TX_ACK, + STAT_S_DATA_TX_NACK, + STAT_S_LB_TX_ACK, + /* Master mode, 10-bit */ + STAT_M_2ND_ADDR_WR_ACK, + STAT_M_2ND_ADDR_WR_NACK, + /* Idle */ + STAT_IDLE =3D 0x1f +} TWI_STAT_STA; + +static const char *allwinner_i2c_get_regname(unsigned offset) +{ + switch (offset) { + case TWI_ADDR_REG: + return "ADDR"; + case TWI_XADDR_REG: + return "XADDR"; + case TWI_DATA_REG: + return "DATA"; + case TWI_CNTR_REG: + return "CNTR"; + case TWI_STAT_REG: + return "STAT"; + case TWI_CCR_REG: + return "CCR"; + case TWI_SRST_REG: + return "SRST"; + case TWI_EFR_REG: + return "EFR"; + case TWI_LCR_REG: + return "LCR"; + default: + return "[?]"; + } +} + +static inline bool allwinner_i2c_is_reset(AWI2CState *s) +{ + return s->srst & TWI_SRST_MASK; +} + +static inline bool allwinner_i2c_bus_is_enabled(AWI2CState *s) +{ + return s->cntr & TWI_CNTR_BUS_EN; +} + +static inline bool allwinner_i2c_interrupt_is_enabled(AWI2CState *s) +{ + return s->cntr & TWI_CNTR_INT_EN; +} + +static void allwinner_i2c_reset_hold(Object *obj) +{ + AWI2CState *s =3D AW_I2C(obj); + + if (STAT_TO_STA(s->stat) !=3D STAT_IDLE) { + i2c_end_transfer(s->bus); + } + + s->addr =3D TWI_ADDR_RESET; + s->xaddr =3D TWI_XADDR_RESET; + s->data =3D TWI_DATA_RESET; + s->cntr =3D TWI_CNTR_RESET; + s->stat =3D TWI_STAT_RESET; + s->ccr =3D TWI_CCR_RESET; + s->srst =3D TWI_SRST_RESET; + s->efr =3D TWI_EFR_RESET; + s->lcr =3D TWI_LCR_RESET; +} + +static inline void allwinner_i2c_raise_interrupt(AWI2CState *s) +{ + /* + * Raise an interrupt if the device is not reset and it is configured + * to generate some interrupts. + */ + if (!allwinner_i2c_is_reset(s) && allwinner_i2c_bus_is_enabled(s)) { + if (STAT_TO_STA(s->stat) !=3D STAT_IDLE) { + s->cntr |=3D TWI_CNTR_INT_FLAG; + if (allwinner_i2c_interrupt_is_enabled(s)) { + qemu_irq_raise(s->irq); + } + } + } +} + +static uint64_t allwinner_i2c_read(void *opaque, hwaddr offset, + unsigned size) +{ + uint16_t value; + AWI2CState *s =3D AW_I2C(opaque); + + switch (offset) { + case TWI_ADDR_REG: + value =3D s->addr; + break; + case TWI_XADDR_REG: + value =3D s->xaddr; + break; + case TWI_DATA_REG: + if ((STAT_TO_STA(s->stat) =3D=3D STAT_M_ADDR_RD_ACK) || + (STAT_TO_STA(s->stat) =3D=3D STAT_M_DATA_RX_ACK) || + (STAT_TO_STA(s->stat) =3D=3D STAT_M_DATA_RX_NACK)) { + /* Get the next byte */ + s->data =3D i2c_recv(s->bus); + + if (s->cntr & TWI_CNTR_A_ACK) { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_ACK); + } else { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_NACK); + } + allwinner_i2c_raise_interrupt(s); + } + value =3D s->data; + break; + case TWI_CNTR_REG: + value =3D s->cntr; + break; + case TWI_STAT_REG: + value =3D s->stat; + /* + * If polling when reading then change state to indicate data + * is available + */ + if (STAT_TO_STA(s->stat) =3D=3D STAT_M_ADDR_RD_ACK) { + if (s->cntr & TWI_CNTR_A_ACK) { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_ACK); + } else { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_NACK); + } + allwinner_i2c_raise_interrupt(s); + } + break; + case TWI_CCR_REG: + value =3D s->ccr; + break; + case TWI_SRST_REG: + value =3D s->srst; + break; + case TWI_EFR_REG: + value =3D s->efr; + break; + case TWI_LCR_REG: + value =3D s->lcr; + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" + HWADDR_PRIx "\n", TYPE_AW_I2C, __func__, offset); + value =3D 0; + break; + } + + trace_allwinner_i2c_read(allwinner_i2c_get_regname(offset), offset, va= lue); + + return (uint64_t)value; +} + +static void allwinner_i2c_write(void *opaque, hwaddr offset, + uint64_t value, unsigned size) +{ + AWI2CState *s =3D AW_I2C(opaque); + + value &=3D 0xff; + + trace_allwinner_i2c_write(allwinner_i2c_get_regname(offset), offset, v= alue); + + switch (offset) { + case TWI_ADDR_REG: + s->addr =3D (uint8_t)value; + break; + case TWI_XADDR_REG: + s->xaddr =3D (uint8_t)value; + break; + case TWI_DATA_REG: + /* If the device is in reset or not enabled, nothing to do */ + if (allwinner_i2c_is_reset(s) || (!allwinner_i2c_bus_is_enabled(s)= )) { + break; + } + + s->data =3D value & TWI_DATA_MASK; + + switch (STAT_TO_STA(s->stat)) { + case STAT_M_STA_TX: + case STAT_M_RSTA_TX: + /* Send address */ + if (i2c_start_transfer(s->bus, extract32(s->data, 1, 7), + extract32(s->data, 0, 1))) { + /* If non zero is returned, the address is not valid */ + s->stat =3D STAT_FROM_STA(STAT_M_ADDR_WR_NACK); + } else { + /* Determine if read of write */ + if (extract32(s->data, 0, 1)) { + s->stat =3D STAT_FROM_STA(STAT_M_ADDR_RD_ACK); + } else { + s->stat =3D STAT_FROM_STA(STAT_M_ADDR_WR_ACK); + } + allwinner_i2c_raise_interrupt(s); + } + break; + case STAT_M_ADDR_WR_ACK: + case STAT_M_DATA_TX_ACK: + if (i2c_send(s->bus, s->data)) { + /* If the target return non zero then end the transfer */ + s->stat =3D STAT_FROM_STA(STAT_M_DATA_TX_NACK); + i2c_end_transfer(s->bus); + } else { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_TX_ACK); + allwinner_i2c_raise_interrupt(s); + } + break; + default: + break; + } + break; + case TWI_CNTR_REG: + if (!allwinner_i2c_is_reset(s)) { + /* Do something only if not in software reset */ + s->cntr =3D value & TWI_CNTR_MASK; + + /* Check if start condition should be sent */ + if (s->cntr & TWI_CNTR_M_STA) { + /* Update status */ + if (STAT_TO_STA(s->stat) =3D=3D STAT_IDLE) { + /* Send start condition */ + s->stat =3D STAT_FROM_STA(STAT_M_STA_TX); + } else { + /* Send repeated start condition */ + s->stat =3D STAT_FROM_STA(STAT_M_RSTA_TX); + } + /* Clear start condition */ + s->cntr &=3D ~TWI_CNTR_M_STA; + } + if (s->cntr & TWI_CNTR_M_STP) { + /* Update status */ + i2c_end_transfer(s->bus); + s->stat =3D STAT_FROM_STA(STAT_IDLE); + s->cntr &=3D ~TWI_CNTR_M_STP; + } + if ((s->cntr & TWI_CNTR_INT_FLAG) =3D=3D 0) { + /* Interrupt flag cleared */ + qemu_irq_lower(s->irq); + } + if ((s->cntr & TWI_CNTR_A_ACK) =3D=3D 0) { + if (STAT_TO_STA(s->stat) =3D=3D STAT_M_DATA_RX_ACK) { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_NACK); + } + } else { + if (STAT_TO_STA(s->stat) =3D=3D STAT_M_DATA_RX_NACK) { + s->stat =3D STAT_FROM_STA(STAT_M_DATA_RX_ACK); + } + } + allwinner_i2c_raise_interrupt(s); + + } + break; + case TWI_CCR_REG: + s->ccr =3D value & TWI_CCR_MASK; + break; + case TWI_SRST_REG: + if (((value & TWI_SRST_MASK) =3D=3D 0) && (s->srst & TWI_SRST_MASK= )) { + /* Perform reset */ + allwinner_i2c_reset_hold(OBJECT(s)); + } + s->srst =3D value & TWI_SRST_MASK; + break; + case TWI_EFR_REG: + s->efr =3D value & TWI_EFR_MASK; + break; + case TWI_LCR_REG: + s->lcr =3D value & TWI_LCR_MASK; + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" + HWADDR_PRIx "\n", TYPE_AW_I2C, __func__, offset); + break; + } +} + +static const MemoryRegionOps allwinner_i2c_ops =3D { + .read =3D allwinner_i2c_read, + .write =3D allwinner_i2c_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +static const VMStateDescription allwinner_i2c_vmstate =3D { + .name =3D TYPE_AW_I2C, + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(addr, AWI2CState), + VMSTATE_UINT8(xaddr, AWI2CState), + VMSTATE_UINT8(data, AWI2CState), + VMSTATE_UINT8(cntr, AWI2CState), + VMSTATE_UINT8(ccr, AWI2CState), + VMSTATE_UINT8(srst, AWI2CState), + VMSTATE_UINT8(efr, AWI2CState), + VMSTATE_UINT8(lcr, AWI2CState), + VMSTATE_END_OF_LIST() + } +}; + +static void allwinner_i2c_realize(DeviceState *dev, Error **errp) +{ + AWI2CState *s =3D AW_I2C(dev); + + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_i2c_ops, s, + TYPE_AW_I2C, AW_I2C_MEM_SIZE); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); + s->bus =3D i2c_init_bus(dev, "i2c"); +} + +static void allwinner_i2c_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); + + rc->phases.hold =3D allwinner_i2c_reset_hold; + dc->vmsd =3D &allwinner_i2c_vmstate; + dc->realize =3D allwinner_i2c_realize; + dc->desc =3D "Allwinner I2C Controller"; +} + +static const TypeInfo allwinner_i2c_type_info =3D { + .name =3D TYPE_AW_I2C, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(AWI2CState), + .class_init =3D allwinner_i2c_class_init, +}; + +static void allwinner_i2c_register_types(void) +{ + type_register_static(&allwinner_i2c_type_info); +} + +type_init(allwinner_i2c_register_types) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 9ce756fca77..3e9b2a23fd5 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -326,6 +326,7 @@ config ALLWINNER_A10 select ALLWINNER_A10_CCM select ALLWINNER_A10_DRAMC select ALLWINNER_EMAC + select ALLWINNER_I2C select SERIAL select UNIMP =20 @@ -333,6 +334,7 @@ config ALLWINNER_H3 bool select ALLWINNER_A10_PIT select ALLWINNER_SUN8I_EMAC + select ALLWINNER_I2C select SERIAL select ARM_TIMER select ARM_GIC diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig index 9bb8870517f..f8ec461be3d 100644 --- a/hw/i2c/Kconfig +++ b/hw/i2c/Kconfig @@ -34,6 +34,10 @@ config MPC_I2C bool select I2C =20 +config ALLWINNER_I2C + bool + select I2C + config PCA954X bool select I2C diff --git a/hw/i2c/meson.build b/hw/i2c/meson.build index 6e7340aaacc..e4c8e14a527 100644 --- a/hw/i2c/meson.build +++ b/hw/i2c/meson.build @@ -8,6 +8,7 @@ i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitb= ang_i2c.c')) i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c')) i2c_ss.add(when: 'CONFIG_IMX_I2C', if_true: files('imx_i2c.c')) i2c_ss.add(when: 'CONFIG_MPC_I2C', if_true: files('mpc_i2c.c')) +i2c_ss.add(when: 'CONFIG_ALLWINNER_I2C', if_true: files('allwinner-i2c.c')) i2c_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('microbit_i2c.c')) i2c_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_smbus.c')) i2c_ss.add(when: 'CONFIG_SMBUS_EEPROM', if_true: files('smbus_eeprom.c')) diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index af181d43ee6..52dbd53a234 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -8,6 +8,11 @@ i2c_send_async(uint8_t address, uint8_t data) "send_async(= addr:0x%02x) data:0x%0 i2c_recv(uint8_t address, uint8_t data) "recv(addr:0x%02x) data:0x%02x" i2c_ack(void) "" =20 +# allwinner_i2c.c + +allwinner_i2c_read(const char* reg_name, uint64_t offset, uint64_t value) = "read %s [0x%" PRIx64 "]: -> 0x%" PRIx64 +allwinner_i2c_write(const char* reg_name, uint64_t offset, uint64_t value)= "write %s [0x%" PRIx64 "]: <- 0x%" PRIx64 + # aspeed_i2c.c =20 aspeed_i2c_bus_cmd(uint32_t cmd, const char *cmd_flags, uint32_t count, ui= nt32_t intr_status) "handling cmd=3D0x%x %s count=3D%d intr=3D0x%x" --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619521; cv=none; d=zohomail.com; s=zohoarc; b=SfjD23TO/owr684rxquobzOcAMUkpMVJCsEW5rLe5jhyuIjdb8CY13ablVB/F91lPiYmp2RB2ufTPgIwmC6Ck6IOP2ocOcgw64uruyiJD4VY7TUa/l/udJQXXR7r+IUUY5II+MlmGac8cWzToRI4AHhxfG9Ad+24jGrpK0V/fbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619521; h=Content-Transfer-Encoding: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=ju7tJewwCKiHfoKv7bAtINSmE5J7OZzCxsQjQ4DFswU=; b=AQG1TJwQXY93e5vbPAodzINEe51hR9JePkRiPLSaqd2MgdupL4Z5qlWljRFF+G/iyGr3MDSeaQ39LLCQg6kQNYO29jYsfirkRUwm3zc9PXnkLjpYVt1JQBRTJ3gpUeAGkImJyqHlTqaltXJKpmJVP2BZyWyTqQtrzJWkgL1OLZQ= 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+importer2=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 SMTP id 1673619521375808.0815920331673; Fri, 13 Jan 2023 06:18:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnJ-0001Wt-QF; Fri, 13 Jan 2023 09:12:33 -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 1pGKmQ-0000qS-85 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:39 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmN-0003ef-JE for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:37 -0500 Received: by mail-wm1-x334.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so17449156wms.4 for ; Fri, 13 Jan 2023 06:11:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:32 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ju7tJewwCKiHfoKv7bAtINSmE5J7OZzCxsQjQ4DFswU=; b=NwebsL12GYv9joIQsm3QDYiwnEygzy3pGf6VBajdyvaXxfeWOR17VPSEpSz1qEdWXd JQlgftld4ugJ8KpXyIYxCZz/F5enPX2+Wb09fFkWh1jAhUdtp3AW62GSTzJZBRHDsLkN tpfJLACQiPJ/xNtHIGHEA4Tuqpk7drEKFWYIZRKWHU2vvKMtw36rd0qiXqA4x4fhvrDJ jVc9108ex5rbAuKObDW9GMUvQBZlcqHnjRAPLnOiK00ZZQZvz0rPi59UdgGmBzJQT/Ga kr793tSL4J9YLY2+83+dgUs4x6ADtxfENSyH/CZ1VG99jOrwwY654mcz9umnD4bq9AJN MepQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ju7tJewwCKiHfoKv7bAtINSmE5J7OZzCxsQjQ4DFswU=; b=lKboNPRBpTUvGFsL9OeI66IGaG6VmKFFL5R2CaOuYGDxOn9dO++OO3BDF+PxFzGIUT Plvb765JMDCDhU8+wNVGY7/9Z1UZR9uPkZ7J+WHgOEtSbmO4Nhqao6DQneVaLQLf+WoR AvryjwhtDALJMp4J1U4/1MNhwcK3aCSJ8oMym1A4OkS9l1i45v38jTu7aPoFAINgZaDE bgZq8i998BVxILMb/yE+GUT38iH1Nx7HVEnJPBDIgLVNp7j/FdYZxYrtW3ju7+pU2/HV WAsQTiO4d0+G8COyKr7cEKYqd42pf0OYjABquY8lwXjPAPhyvT0061wtWspkar59sziB oUAg== X-Gm-Message-State: AFqh2krFwuLybj6Hvu/GombcWy67/bX1U6dEPFE2aLQDblK48F8gFtkR H5uOa12W3zrp/LxjIv71czEEN8si1N/itmwI X-Google-Smtp-Source: AMrXdXt83Eir09s8ytrEl6IAdgFg2XWCf8CaLziwURh8klSqIVd4qV6vZDgfst54ms0OjR4EAZ070w== X-Received: by 2002:a05:600c:3509:b0:3c6:e60f:3f6f with SMTP id h9-20020a05600c350900b003c6e60f3f6fmr57674329wmq.38.1673619093456; Fri, 13 Jan 2023 06:11:33 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/38] hw/misc: AXP209 PMU Emulation Date: Fri, 13 Jan 2023 14:10:54 +0000 Message-Id: <20230113141126.535646-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619522336100001 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic This patch adds minimal support for AXP-209 PMU. Most important is chip ID since U-Boot SPL expects version 0x1. Besides the chip ID register, reset values for two more registers used by A10 U-Boot SPL are covered. Signed-off-by: Strahinja Jankovic Message-id: 20221226220303.14420-5-strahinja.p.jankovic@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/misc/axp209.c | 238 +++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 2 + hw/misc/Kconfig | 4 + hw/misc/meson.build | 1 + hw/misc/trace-events | 5 + 5 files changed, 250 insertions(+) create mode 100644 hw/misc/axp209.c diff --git a/hw/misc/axp209.c b/hw/misc/axp209.c new file mode 100644 index 00000000000..2908ed99a6f --- /dev/null +++ b/hw/misc/axp209.c @@ -0,0 +1,238 @@ +/* + * AXP-209 PMU Emulation + * + * Copyright (C) 2022 Strahinja Jankovic + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software= "), + * to deal in the Software without restriction, including without limitati= on + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "trace.h" +#include "hw/i2c/i2c.h" +#include "migration/vmstate.h" + +#define TYPE_AXP209_PMU "axp209_pmu" + +#define AXP209(obj) \ + OBJECT_CHECK(AXP209I2CState, (obj), TYPE_AXP209_PMU) + +/* registers */ +enum { + REG_POWER_STATUS =3D 0x0u, + REG_OPERATING_MODE, + REG_OTG_VBUS_STATUS, + REG_CHIP_VERSION, + REG_DATA_CACHE_0, + REG_DATA_CACHE_1, + REG_DATA_CACHE_2, + REG_DATA_CACHE_3, + REG_DATA_CACHE_4, + REG_DATA_CACHE_5, + REG_DATA_CACHE_6, + REG_DATA_CACHE_7, + REG_DATA_CACHE_8, + REG_DATA_CACHE_9, + REG_DATA_CACHE_A, + REG_DATA_CACHE_B, + REG_POWER_OUTPUT_CTRL =3D 0x12u, + REG_DC_DC2_OUT_V_CTRL =3D 0x23u, + REG_DC_DC2_DVS_CTRL =3D 0x25u, + REG_DC_DC3_OUT_V_CTRL =3D 0x27u, + REG_LDO2_4_OUT_V_CTRL, + REG_LDO3_OUT_V_CTRL, + REG_VBUS_CH_MGMT =3D 0x30u, + REG_SHUTDOWN_V_CTRL, + REG_SHUTDOWN_CTRL, + REG_CHARGE_CTRL_1, + REG_CHARGE_CTRL_2, + REG_SPARE_CHARGE_CTRL, + REG_PEK_KEY_CTRL, + REG_DC_DC_FREQ_SET, + REG_CHR_TEMP_TH_SET, + REG_CHR_HIGH_TEMP_TH_CTRL, + REG_IPSOUT_WARN_L1, + REG_IPSOUT_WARN_L2, + REG_DISCHR_TEMP_TH_SET, + REG_DISCHR_HIGH_TEMP_TH_CTRL, + REG_IRQ_BANK_1_CTRL =3D 0x40u, + REG_IRQ_BANK_2_CTRL, + REG_IRQ_BANK_3_CTRL, + REG_IRQ_BANK_4_CTRL, + REG_IRQ_BANK_5_CTRL, + REG_IRQ_BANK_1_STAT =3D 0x48u, + REG_IRQ_BANK_2_STAT, + REG_IRQ_BANK_3_STAT, + REG_IRQ_BANK_4_STAT, + REG_IRQ_BANK_5_STAT, + REG_ADC_ACIN_V_H =3D 0x56u, + REG_ADC_ACIN_V_L, + REG_ADC_ACIN_CURR_H, + REG_ADC_ACIN_CURR_L, + REG_ADC_VBUS_V_H, + REG_ADC_VBUS_V_L, + REG_ADC_VBUS_CURR_H, + REG_ADC_VBUS_CURR_L, + REG_ADC_INT_TEMP_H, + REG_ADC_INT_TEMP_L, + REG_ADC_TEMP_SENS_V_H =3D 0x62u, + REG_ADC_TEMP_SENS_V_L, + REG_ADC_BAT_V_H =3D 0x78u, + REG_ADC_BAT_V_L, + REG_ADC_BAT_DISCHR_CURR_H, + REG_ADC_BAT_DISCHR_CURR_L, + REG_ADC_BAT_CHR_CURR_H, + REG_ADC_BAT_CHR_CURR_L, + REG_ADC_IPSOUT_V_H, + REG_ADC_IPSOUT_V_L, + REG_DC_DC_MOD_SEL =3D 0x80u, + REG_ADC_EN_1, + REG_ADC_EN_2, + REG_ADC_SR_CTRL, + REG_ADC_IN_RANGE, + REG_GPIO1_ADC_IRQ_RISING_TH, + REG_GPIO1_ADC_IRQ_FALLING_TH, + REG_TIMER_CTRL =3D 0x8au, + REG_VBUS_CTRL_MON_SRP, + REG_OVER_TEMP_SHUTDOWN =3D 0x8fu, + REG_GPIO0_FEAT_SET, + REG_GPIO_OUT_HIGH_SET, + REG_GPIO1_FEAT_SET, + REG_GPIO2_FEAT_SET, + REG_GPIO_SIG_STATE_SET_MON, + REG_GPIO3_SET, + REG_COULOMB_CNTR_CTRL =3D 0xb8u, + REG_POWER_MEAS_RES, + NR_REGS +}; + +#define AXP209_CHIP_VERSION_ID (0x01) +#define AXP209_DC_DC2_OUT_V_CTRL_RESET (0x16) +#define AXP209_IRQ_BANK_1_CTRL_RESET (0xd8) + +/* A simple I2C slave which returns values of ID or CNT register. */ +typedef struct AXP209I2CState { + /*< private >*/ + I2CSlave i2c; + /*< public >*/ + uint8_t regs[NR_REGS]; /* peripheral registers */ + uint8_t ptr; /* current register index */ + uint8_t count; /* counter used for tx/rx */ +} AXP209I2CState; + +/* Reset all counters and load ID register */ +static void axp209_reset_enter(Object *obj, ResetType type) +{ + AXP209I2CState *s =3D AXP209(obj); + + memset(s->regs, 0, NR_REGS); + s->ptr =3D 0; + s->count =3D 0; + s->regs[REG_CHIP_VERSION] =3D AXP209_CHIP_VERSION_ID; + s->regs[REG_DC_DC2_OUT_V_CTRL] =3D AXP209_DC_DC2_OUT_V_CTRL_RESET; + s->regs[REG_IRQ_BANK_1_CTRL] =3D AXP209_IRQ_BANK_1_CTRL_RESET; +} + +/* Handle events from master. */ +static int axp209_event(I2CSlave *i2c, enum i2c_event event) +{ + AXP209I2CState *s =3D AXP209(i2c); + + s->count =3D 0; + + return 0; +} + +/* Called when master requests read */ +static uint8_t axp209_rx(I2CSlave *i2c) +{ + AXP209I2CState *s =3D AXP209(i2c); + uint8_t ret =3D 0xff; + + if (s->ptr < NR_REGS) { + ret =3D s->regs[s->ptr++]; + } + + trace_axp209_rx(s->ptr - 1, ret); + + return ret; +} + +/* + * Called when master sends write. + * Update ptr with byte 0, then perform write with second byte. + */ +static int axp209_tx(I2CSlave *i2c, uint8_t data) +{ + AXP209I2CState *s =3D AXP209(i2c); + + if (s->count =3D=3D 0) { + /* Store register address */ + s->ptr =3D data; + s->count++; + trace_axp209_select(data); + } else { + trace_axp209_tx(s->ptr, data); + if (s->ptr =3D=3D REG_DC_DC2_OUT_V_CTRL) { + s->regs[s->ptr++] =3D data; + } + } + + return 0; +} + +static const VMStateDescription vmstate_axp209 =3D { + .name =3D TYPE_AXP209_PMU, + .version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8_ARRAY(regs, AXP209I2CState, NR_REGS), + VMSTATE_UINT8(count, AXP209I2CState), + VMSTATE_UINT8(ptr, AXP209I2CState), + VMSTATE_END_OF_LIST() + } +}; + +static void axp209_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + I2CSlaveClass *isc =3D I2C_SLAVE_CLASS(oc); + ResettableClass *rc =3D RESETTABLE_CLASS(oc); + + rc->phases.enter =3D axp209_reset_enter; + dc->vmsd =3D &vmstate_axp209; + isc->event =3D axp209_event; + isc->recv =3D axp209_rx; + isc->send =3D axp209_tx; +} + +static const TypeInfo axp209_info =3D { + .name =3D TYPE_AXP209_PMU, + .parent =3D TYPE_I2C_SLAVE, + .instance_size =3D sizeof(AXP209I2CState), + .class_init =3D axp209_class_init +}; + +static void axp209_register_devices(void) +{ + type_register_static(&axp209_info); +} + +type_init(axp209_register_devices); diff --git a/MAINTAINERS b/MAINTAINERS index 904b524896d..6982be48c63 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -577,12 +577,14 @@ ARM Machines Allwinner-a10 M: Beniamino Galvani M: Peter Maydell +R: Strahinja Jankovic L: qemu-arm@nongnu.org S: Odd Fixes F: hw/*/allwinner* F: include/hw/*/allwinner* F: hw/arm/cubieboard.c F: docs/system/arm/cubieboard.rst +F: hw/misc/axp209.c =20 Allwinner-h3 M: Niek Linnenbank diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index 052fb543103..eaeddca277b 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -180,4 +180,8 @@ config ALLWINNER_A10_CCM config ALLWINNER_A10_DRAMC bool =20 +config AXP209_PMU + bool + depends on I2C + source macio/Kconfig diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 9eaa0750b50..448e14b531a 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -45,6 +45,7 @@ specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: fil= es('allwinner-cpucfg.c' softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-d= ramc.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-s= ysctrl.c')) softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-sid.= c')) +softmmu_ss.add(when: 'CONFIG_AXP209_PMU', if_true: files('axp209.c')) softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('arm_sysctl.c')) softmmu_ss.add(when: 'CONFIG_NSERIES', if_true: files('cbus.c')) softmmu_ss.add(when: 'CONFIG_ECCMEMCTL', if_true: files('eccmemctl.c')) diff --git a/hw/misc/trace-events b/hw/misc/trace-events index c18bc0605e8..c47876a9026 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -23,6 +23,11 @@ allwinner_sid_write(uint64_t offset, uint64_t data, unsi= gned size) "offset 0x%" avr_power_read(uint8_t value) "power_reduc read value:%u" avr_power_write(uint8_t value) "power_reduc write value:%u" =20 +# axp209.c +axp209_rx(uint8_t reg, uint8_t data) "Read reg 0x%" PRIx8 " : 0x%" PRIx8 +axp209_select(uint8_t reg) "Accessing reg 0x%" PRIx8 +axp209_tx(uint8_t reg, uint8_t data) "Write reg 0x%" PRIx8 " : 0x%" PRIx8 + # eccmemctl.c ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x" ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x" --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673627981; cv=none; d=zohomail.com; s=zohoarc; b=YEy2IxtqZaP7EDXjHzJTiQQ8yqHJAC2Mk7A+kQC3sGkEcEh3J9obLdxonAbIuYjOa45VLKmWubZtlrwOCETh+ztIQHEHTaTnEPGFKvNszoXuR4MS3SdsY1dPP0t1ggpANs3lZxT7wsFzB8D1yxqL7TCAZc+q7USN6GU5AaW2xEU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673627981; h=Content-Type:Content-Transfer-Encoding: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=XgUpRbLEF+TsYOwo2xS2TZOAlQ8tINZlq3JwSHfJySY=; b=LKJJ4P5w/dnbQNHehnB+QpWKNsjEXcLa2OWnI1m6FTL1y6t3hpa39+U537s+pxk6NtWS3OXPJ3+AdmH3BGvFNu+s8z7bgfsv0pXa74OZFNUV0gTqPchhFgU14z5g69pe3nA1GxGDtMKWBh98Oyva8psyTiJqUsBPoc54FukkgfA= 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+importer2=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 SMTP id 16736279812611004.4334736751932; Fri, 13 Jan 2023 08:39:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmd-0000vx-0q; Fri, 13 Jan 2023 09:11:51 -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 1pGKmS-0000r4-6V for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11: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 1pGKmO-0003ev-2F for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:38 -0500 Received: by mail-wm1-x32b.google.com with SMTP id o15so15343177wmr.4 for ; Fri, 13 Jan 2023 06:11:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:33 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XgUpRbLEF+TsYOwo2xS2TZOAlQ8tINZlq3JwSHfJySY=; b=zsQJIt8nDE4bsd6HP0z+LJLPSCid8M1PsLIbtzL7Ta98r//HB9MXfIOAMuG5lT/DIi RvHCl4a1SR+fohZelqoBR2kchAamJOnkUx9t28iKBZWthy5n6pYFb1NZePi6YUHcVLVb zg56V+n8cKmsVNEhPd/lT/gRSytODbOVaDzk3Ar8GbrJkXI49FbVF1GotQMiHlAkf1x6 vMxwsLMP06TkF8ciwYl8lyCKp/NDy/LfFqXnxoVsXNCDloBoPt7iexqn9jsP1s3OoyUl KEedr2CaN2yGRCM5WG0yhrD+u+ul6GcxWPM4K2U03AAt1o3HeKp9+AP0Yd9lyvLUABU2 gWgw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XgUpRbLEF+TsYOwo2xS2TZOAlQ8tINZlq3JwSHfJySY=; b=nJZzmjhENP1PQI6AoEtzW57p34ZREiORT1JxlTvTt44EIMTqFgn3EqglnfeOBzBh/9 MdBE02WzSciouAxf0T4pQqRKPdYwShbbJI+8GSNyax78FXHuniKgqEJnvdmG7qMEwaNZ vuwS43ADfvBqfEJ4dqXRFmW1Lw4PmSTMV/wtDVMctBraizZM51YHMRCSbGRbwzbOEOA3 4A2BNGXVhqZyFV9XI4CuuSG7mKi9nxsnLR9zbJgcqfZDQSal+Z8OUPHBgILB6tnDzhrN YtmRj3JWpI6V0o32NdoZYE5WMfvO1kfC0fDLlk5ht4I69h0UPWF6oIeG0673TvZiXFLG LWWQ== X-Gm-Message-State: AFqh2kp2GVQFtmoTl/AE4KTlytVOQxHJCkqhLehit2T9pDczVZohIvi1 bL4rwdyLGT7kBRsWVbvo7Z5n9QqDllvLE4gY X-Google-Smtp-Source: AMrXdXsa8wXCBueeDW0LHOvPSvPMWQTuxIk81gngdtqq9L1q4LmdTqPx1KDmKnJVhZj/tFmSQtB61A== X-Received: by 2002:a7b:cb89:0:b0:3d2:2101:1f54 with SMTP id m9-20020a7bcb89000000b003d221011f54mr58122689wmi.4.1673619094258; Fri, 13 Jan 2023 06:11:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/38] hw/arm: Add AXP209 to Cubieboard Date: Fri, 13 Jan 2023 14:10:55 +0000 Message-Id: <20230113141126.535646-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673627982498100001 From: Strahinja Jankovic SPL Boot for Cubieboard expects AXP209 connected to I2C0 bus. Signed-off-by: Strahinja Jankovic Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20221226220303.14420-6-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- hw/arm/cubieboard.c | 6 ++++++ hw/arm/Kconfig | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 5e3372a3c7b..dca257620d0 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -20,6 +20,7 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "hw/arm/allwinner-a10.h" +#include "hw/i2c/i2c.h" =20 static struct arm_boot_info cubieboard_binfo =3D { .loader_start =3D AW_A10_SDRAM_BASE, @@ -34,6 +35,7 @@ static void cubieboard_init(MachineState *machine) BlockBackend *blk; BusState *bus; DeviceState *carddev; + I2CBus *i2c; =20 /* BIOS is not supported by this board */ if (machine->firmware) { @@ -80,6 +82,10 @@ static void cubieboard_init(MachineState *machine) exit(1); } =20 + /* Connect AXP 209 */ + i2c =3D I2C_BUS(qdev_get_child_bus(DEVICE(&a10->i2c0), "i2c")); + i2c_slave_create_simple(i2c, "axp209_pmu", 0x34); + /* Retrieve SD bus */ di =3D drive_get(IF_SD, 0, 0); blk =3D di ? blk_by_legacy_dinfo(di) : NULL; diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 3e9b2a23fd5..19d6b9d95f5 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -327,6 +327,7 @@ config ALLWINNER_A10 select ALLWINNER_A10_DRAMC select ALLWINNER_EMAC select ALLWINNER_I2C + select AXP209_PMU select SERIAL select UNIMP =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673624656; cv=none; d=zohomail.com; s=zohoarc; b=JiYUlNS5ogb6a70epz9G70ZWpO4TdUQX7ucFu6leMD637wKAAc8r0Xc9ZNt5035B/IyYWF6SMGWV5LcnQ7xB3NuAlAEtBXDJvlHhgcQWu69JnkUANV1Fh6j/OSonDKhuAFz1HOST+lh7uZqCdcPfFla/NitaNdziS3kBOuR/rY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673624656; h=Content-Transfer-Encoding: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=wzuNZCXupgu//7V2i08nAuAgXUWawm0tfvprgDr6yp0=; b=Me3PxrCbfJkZ74f+3nBraZaPTlzGzpdG5froGzGgk/lI3ZH2qDzofH4NVncev5NCWnfKZP/rb9kMeMUJZ/GJYMbsjkOvsNZ7paCPMFclU3IR/yyNok2ZYAA/wj+YCogIv4/Wo5AH5wI30R95UPqW9DQcXn2yGNYLGYPRkochNNc= 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+importer2=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 1673624656661566.6541483953673; Fri, 13 Jan 2023 07:44:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnK-0001Ya-Ft; Fri, 13 Jan 2023 09:12:34 -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 1pGKmS-0000r5-6U for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11: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 1pGKmO-0003f4-Oa for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:38 -0500 Received: by mail-wm1-x32b.google.com with SMTP id m8-20020a05600c3b0800b003d96f801c48so18857413wms.0 for ; Fri, 13 Jan 2023 06:11:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:34 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wzuNZCXupgu//7V2i08nAuAgXUWawm0tfvprgDr6yp0=; b=OlHmUjPQBFqAsgF43cARB5xBAlPIbwDSVy8iJ2J8bdorXmF16InjnNWbKw0ffe+k/5 Eoy1MV7hKnFAdhLaC3iBdXzBaOu3PDfycwvaMss2qKekunQPs5kX7MFeQbxdoSqGv5aP sJgjgcmO684xNmRqBo+kOq7AqnHbhDff+yTULLWBlRlXBPU8p/mDsdwOfivsvsnB+y+y +2hNl6T/Q9JMBextlstckMoEZAxnBW+p28a1EaRNvy8AgZZr1F6EDZrxYBEyyuUhZsoh UvT4OqcRhtdMp4JP+kGX4STMlTswprJ7Tmk3DaegmRbhej41+dBHBvCBCRCcQy+zseSh eUyw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wzuNZCXupgu//7V2i08nAuAgXUWawm0tfvprgDr6yp0=; b=aelF9ZLbxVY3c0PDIIrKsIzFc2FP4caGrn9PaVN7QEgifKbXYabkHuHweAPV2uVmpT 6DExcqfQzDD/WGHF6GIQxe82/eF1rNNx298hSv3Ajtt0bT6sKKGr2XT3BlLPhBH3qSKi OJSgyuXWYUSrGKZYP5+Y+AG8flsgAqpfkoJ3LMABHZ7JSm7D6P940YjpuuYv2iGcy8jw hMnhCLD+ww6xXA0hgsmaAsxinCie+Al/I8ZePHYiEpgIpXLisEMhB/wHrtvNcXb5Y8WQ ENjhUmXbDPnEWfSqdKHNcq+yaIjxbONQq1LIuAVEyIxgqsWd5FLwP6Lp7GWWRI9BNJS+ 8v/A== X-Gm-Message-State: AFqh2kpCxK6jewcp32vwzv8DH5nVeOO3195oyx+z4z/tnpsOozCOTqTC 3zpmZmuJCnufNXkEBzrZ/Pls4DxTehiBaQ2D X-Google-Smtp-Source: AMrXdXt/RJN1BXd4hx8OWvHeqXztD7pR7z3RDf2/9MSuVA82LLAge9/lHR+bcr6ckNx0aPlDNL68vA== X-Received: by 2002:a05:600c:4fc9:b0:3da:8f9:4f62 with SMTP id o9-20020a05600c4fc900b003da08f94f62mr8009244wmq.7.1673619095140; Fri, 13 Jan 2023 06:11:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/38] hw/arm: Allwinner A10 enable SPL load from MMC Date: Fri, 13 Jan 2023 14:10:56 +0000 Message-Id: <20230113141126.535646-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673624657669100001 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic This patch enables copying of SPL from MMC if `-kernel` parameter is not passed when starting QEMU. SPL is copied to SRAM_A. The approach is reused from Allwinner H3 implementation. Tested with Armbian and custom Yocto image. Signed-off-by: Strahinja Jankovic Reviewed-by: Niek Linnenbank Message-id: 20221226220303.14420-7-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- include/hw/arm/allwinner-a10.h | 21 +++++++++++++++++++++ hw/arm/allwinner-a10.c | 18 ++++++++++++++++++ hw/arm/cubieboard.c | 5 +++++ 3 files changed, 44 insertions(+) diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h index e569e661095..e0f2f7ab198 100644 --- a/include/hw/arm/allwinner-a10.h +++ b/include/hw/arm/allwinner-a10.h @@ -16,6 +16,7 @@ #include "hw/misc/allwinner-a10-ccm.h" #include "hw/misc/allwinner-a10-dramc.h" #include "hw/i2c/allwinner-i2c.h" +#include "sysemu/block-backend.h" =20 #include "target/arm/cpu.h" #include "qom/object.h" @@ -48,4 +49,24 @@ struct AwA10State { OHCISysBusState ohci[AW_A10_NUM_USB]; }; =20 +/** + * Emulate Boot ROM firmware setup functionality. + * + * A real Allwinner A10 SoC contains a Boot ROM + * which is the first code that runs right after + * the SoC is powered on. The Boot ROM is responsible + * for loading user code (e.g. a bootloader) from any + * of the supported external devices and writing the + * downloaded code to internal SRAM. After loading the SoC + * begins executing the code written to SRAM. + * + * This function emulates the Boot ROM by copying 32 KiB + * of data at offset 8 KiB from the given block device and writes it to + * the start of the first internal SRAM memory. + * + * @s: Allwinner A10 state object pointer + * @blk: Block backend device object pointer + */ +void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk); + #endif diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 17e439777e4..dc1966ff7a2 100644 --- a/hw/arm/allwinner-a10.c +++ b/hw/arm/allwinner-a10.c @@ -24,7 +24,9 @@ #include "sysemu/sysemu.h" #include "hw/boards.h" #include "hw/usb/hcd-ohci.h" +#include "hw/loader.h" =20 +#define AW_A10_SRAM_A_BASE 0x00000000 #define AW_A10_DRAMC_BASE 0x01c01000 #define AW_A10_MMC0_BASE 0x01c0f000 #define AW_A10_CCM_BASE 0x01c20000 @@ -38,6 +40,22 @@ #define AW_A10_RTC_BASE 0x01c20d00 #define AW_A10_I2C0_BASE 0x01c2ac00 =20 +void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk) +{ + const int64_t rom_size =3D 32 * KiB; + g_autofree uint8_t *buffer =3D g_new0(uint8_t, rom_size); + + if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) { + error_setg(&error_fatal, "%s: failed to read BlockBackend data", + __func__); + return; + } + + rom_add_blob("allwinner-a10.bootrom", buffer, rom_size, + rom_size, AW_A10_SRAM_A_BASE, + NULL, NULL, NULL, NULL, false); +} + static void aw_a10_init(Object *obj) { AwA10State *s =3D AW_A10(obj); diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index dca257620d0..71a7df15083 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -99,6 +99,11 @@ static void cubieboard_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE, machine->ram); =20 + /* Load target kernel or start using BootROM */ + if (!machine->kernel_filename && blk && blk_is_available(blk)) { + /* Use Boot ROM to copy data from SD card to SRAM */ + allwinner_a10_bootrom_setup(a10, blk); + } /* TODO create and connect IDE devices for ide_drive_get() */ =20 cubieboard_binfo.ram_size =3D machine->ram_size; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622239; cv=none; d=zohomail.com; s=zohoarc; b=ZR/q1ICYKRLG6ivZk8BCWkec0GdRyUrdle9h4nOz09Z70JMM3ndllSSOau68jix+ssWB5hUi2SgYE5FgfPuwYIdEQrGGonlSsFSGq67nRORYLlZ+hh8fjFaHQXjlyFHraD0DPWAXqAr8ea6WoU1KI5UAKMbX2H7pLKixVb2imRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622239; h=Content-Transfer-Encoding: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=iMMN6nvJLFr/G4zXkqeXauiYOdLOH+OhtPL6bqIWzyk=; b=HvgjE0k38aJSPbZhArCEDvTcan444rGZCXHoWsOAn9Qw4XuVyh4nia6mvAeAo60RajXs9P0ya5LgrvMcQhAIJRmp+Zz2X1q5MV7zLSiCCVbx6NC9Idof8nMnnbiJN7fgvO8yhj8IAVnyI7wET/bh+ufBI7NKQ10rwbgVATqVUpU= 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+importer2=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 1673622239597954.3725653939882; Fri, 13 Jan 2023 07:03:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmZ-0000tC-84; Fri, 13 Jan 2023 09:11:47 -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 1pGKmU-0000s2-7V for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:43 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmP-0003fQ-VT for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:40 -0500 Received: by mail-wm1-x334.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso862982wmb.1 for ; Fri, 13 Jan 2023 06:11:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:35 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=iMMN6nvJLFr/G4zXkqeXauiYOdLOH+OhtPL6bqIWzyk=; b=nLQihLgIvsLLVp6YpGPAOHUMDytEsusHCcymmpHOxtmGUyrgj95ajPeyc8jm+lLJBt LEU3rIFfPcxledjLzg4md4uHJHEpULr9it9heuPQP/irx/CwUMBVU0yGL80BeSHBkoaP PtXsrm8gtE0avv7jfr7XQnSkre5PXYNiP7MjXkFeyDG0boMt/f6U1gjMt1oEkXaEqYLu GzKIt3VZEX3/uGtpccjoANvzJT22RgbXu2NzOCmWHY88Mp/uH1+8LmWmZNFAJn05xaOd 7kuW2X+QIr3Qw/QDiaJUYwlMjUGBkFpKHzi5onFGnK/g3HMDqrGak9+/w9uzhek7YPl3 P5vw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iMMN6nvJLFr/G4zXkqeXauiYOdLOH+OhtPL6bqIWzyk=; b=SON/pqvQUuw+bvo5FPW60VkI2H/X9IUQKkoa4YAb1etil3Z+DA/G8G7TUckWByzfKv mJjw1h6BjPFjWAQlnKOVJPxaohW9zHSZA3FoZkFevAtclUIHs4s/r1ogb1Lo3MAknRal VtG+eiTeK3kNUI2oSRrmSCtH/ybnO8EVbNfQ3AImsh4r81DVx/lO9WHR5VJ6+VKVdX6o DoXIIp2QqfK7xefNDhB7Fe6Od7W/c2Q2g7wW0R0Zmz1VHmZD1n/P0lrgqwTEZY9JmhsX 1gASygUzh6OPM5qj8s42tIOqcRnMm9dcCQj88zf9KZsol3Mn4PD4MPVqe48MIYsoQyHI bkyg== X-Gm-Message-State: AFqh2kqyumB1MnWWpOhzWfysZyveRSqeFjML9N3hLcCTw+bFhZjz16La rnnlZ9RdLDoNYonmJfy+AzuEErYHGrxpCqkn X-Google-Smtp-Source: AMrXdXuMg5+CcgDCckxA9jS4futtgfeBftmd2bmgzAud47iET7ouUVMGAaxzZjXA5wFwrt6SHU8P/Q== X-Received: by 2002:a05:600c:1c9d:b0:3d1:f3eb:c718 with SMTP id k29-20020a05600c1c9d00b003d1f3ebc718mr69726435wms.19.1673619095951; Fri, 13 Jan 2023 06:11:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/38] tests/avocado: Add SD boot test to Cubieboard Date: Fri, 13 Jan 2023 14:10:57 +0000 Message-Id: <20230113141126.535646-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622240056100001 Content-Type: text/plain; charset="utf-8" From: Strahinja Jankovic Cubieboard now can boot directly from SD card, without the need to pass `-kernel` parameter. Update Avocado tests to cover this functionality. Signed-off-by: Strahinja Jankovic Reviewed-by: Niek Linnenbank Tested-by: Niek Linnenbank Message-id: 20221226220303.14420-8-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell --- tests/avocado/boot_linux_console.py | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux= _console.py index ec07c64291d..8c1d9815861 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -620,6 +620,53 @@ def test_arm_cubieboard_sata(self): 'sda') # cubieboard's reboot is not functioning; omit reboot test. =20 + @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited= ') + def test_arm_cubieboard_openwrt_22_03_2(self): + """ + :avocado: tags=3Darch:arm + :avocado: tags=3Dmachine:cubieboard + :avocado: tags=3Ddevice:sd + """ + + # This test download a 7.5 MiB compressed image and expand it + # to 126 MiB. + image_url =3D ('https://downloads.openwrt.org/releases/22.03.2/tar= gets/' + 'sunxi/cortexa8/openwrt-22.03.2-sunxi-cortexa8-' + 'cubietech_a10-cubieboard-ext4-sdcard.img.gz') + image_hash =3D ('94b5ecbfbc0b3b56276e5146b899eafa' + '2ac5dc2d08733d6705af9f144f39f554') + image_path_gz =3D self.fetch_asset(image_url, asset_hash=3Dimage_h= ash, + algorithm=3D'sha256') + image_path =3D archive.extract(image_path_gz, self.workdir) + image_pow2ceil_expand(image_path) + + self.vm.set_console() + self.vm.add_args('-drive', 'file=3D' + image_path + ',if=3Dsd,form= at=3Draw', + '-nic', 'user', + '-no-reboot') + self.vm.launch() + + kernel_command_line =3D (self.KERNEL_COMMON_COMMAND_LINE + + 'usbcore.nousb ' + 'noreboot') + + self.wait_for_console_pattern('U-Boot SPL') + + interrupt_interactive_console_until_pattern( + self, 'Hit any key to stop autoboot:', '=3D>') + exec_command_and_wait_for_pattern(self, "setenv extraargs '" + + kernel_command_line + "'",= '=3D>') + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel .= ..'); + + self.wait_for_console_pattern( + 'Please press Enter to activate this console.') + + exec_command_and_wait_for_pattern(self, ' ', 'root@') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'Allwinner sun4i/sun5i') + # cubieboard's reboot is not functioning; omit reboot test. + @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout= ') def test_arm_quanta_gsj(self): """ --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673621009; cv=none; d=zohomail.com; s=zohoarc; b=aeFzKZMkHiQlCOs0oLd83GT9hvoNAOaVVBYnO6KgI+TUjMJVMiwGt45/93HfHdmUnvLR/kfpqsdc9tdkAnD+4oTo8svdXMbzccZssmdSrBcgshIn+Mu8ttd4tGK6XF1aK0O4f/uRK+RRIXIpJcsubM4AA1A4OHFy13JHIOJcrR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673621009; h=Content-Type:Content-Transfer-Encoding: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=yQOKxbWfNbJ6ZYIkx8c2YswZ3peqlz+Y7JAPsZrSkN8=; b=SZIEMprDWAk2y+iRJlUhZGXFY08q3PmQrC8elyycRfaAewnaRFTyP/GsnNKw97eefM2aVZKF/iOjWiVAEUhhNDtMGsO33unVhbFaZjS0HuWeXaoulDQP50T5nZixVl+6aXFKHE7SuvmxQ2uflbWmHX0Ea3HOqe3HXjVMRuJtYv8= 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+importer2=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 SMTP id 1673621009899137.19324372588687; Fri, 13 Jan 2023 06:43:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmc-0000um-F8; Fri, 13 Jan 2023 09:11:50 -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 1pGKmS-0000r6-7c for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:42 -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 1pGKmP-0003dg-Fb for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:39 -0500 Received: by mail-wm1-x329.google.com with SMTP id g10so15354457wmo.1 for ; Fri, 13 Jan 2023 06:11:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11: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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yQOKxbWfNbJ6ZYIkx8c2YswZ3peqlz+Y7JAPsZrSkN8=; b=tKzEpYk+p9BEmTWInUrHBV/qTXtw8YrhAhpGAzcth47EPNsj0cJTSgPjLqePTtmRWr ZYdL/UqVZFCMreHQiW4jnexSJHZGHOhFFE13/gswzmbFsnqIurFQ1xdF7fam5P8OfGiC 0BSj/8R8SBIhK0FWrxyTK7dfV8tPJ4YD+nykfjcRp+AzhfDjbu9wDzGg4fLBXPVvuCjn vlv511DlMvt9dL9UkIAxGEKvIpwKxspDGEtokbt0dRg7j73fsAeENWihwwpVN1GRAEXD rf9yZrRyNemmenSPvrAjYFR9jjMJ6rfGs4PwtdRsIA81XXyqaZIseIlce4g1yfKN/jxO 815A== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yQOKxbWfNbJ6ZYIkx8c2YswZ3peqlz+Y7JAPsZrSkN8=; b=QdpI8PfKuAhaDdAEDPG2TTOAjTcxAgnJbh4qd2vGt3BXHy6plGE7PeiEq5ZbXBvtJX urJQi3RIPFJ0vfSV6zxGGe8ND7S9RoB1LBBz9qKUZk+L8NYvWmS/J1U2WyZcYw5NPmLP xTX49wY3hqwjm25D7wc/2dJ2TJGmmzehY263vfF1U7OOb4ydVc+GFXhh1r/Vfe7JZaty GYTK2UrpTTMEHgqhfH/3FQrbpkHc2qKF4Gx3lPcXRbe3Yxaw5zU05XKYphiRsmq5rI7i joMIK0+tI39HXv6q1CsycXfaom4OWonadPdCUUerjkwW70CCuPNqgH8bd33aBqKv5X/C RcHw== X-Gm-Message-State: AFqh2krUWmsUqfvMar2hFyEPJZhhe+ioZ5IeF5q47SxR4dvCpS4W7nEq mmcw+gt9qvi59BMwmR7PDLQLFKH0vkknQTIu X-Google-Smtp-Source: AMrXdXv7sSXUuqi7g4FQ51IzSrNbaND14WyTCD2BNvSwJ7Vr3tVkhTZLQrR1RnTHSjjYpY1O6BWmMg== X-Received: by 2002:a7b:ce87:0:b0:3d9:f37e:2acb with SMTP id q7-20020a7bce87000000b003d9f37e2acbmr13911484wmj.20.1673619096788; Fri, 13 Jan 2023 06:11:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/38] target/arm: Fix sve_probe_page Date: Fri, 13 Jan 2023 14:10:58 +0000 Message-Id: <20230113141126.535646-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673621011132100001 From: Richard Henderson Don't dereference CPUTLBEntryFull until we verify that the page is valid. Move the other user-only info field updates after the valid check to match. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1412 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20230104190056.305143-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/sve_helper.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 1afeadf9c85..521fc9b9697 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -5354,15 +5354,10 @@ bool sve_probe_page(SVEHostPage *info, bool nofault= , CPUARMState *env, #ifdef CONFIG_USER_ONLY flags =3D probe_access_flags(env, addr, access_type, mmu_idx, nofault, &info->host, retaddr); - memset(&info->attrs, 0, sizeof(info->attrs)); - /* Require both ANON and MTE; see allocation_tag_mem(). */ - info->tagged =3D (flags & PAGE_ANON) && (flags & PAGE_MTE); #else CPUTLBEntryFull *full; flags =3D probe_access_full(env, addr, access_type, mmu_idx, nofault, &info->host, &full, retaddr); - info->attrs =3D full->attrs; - info->tagged =3D full->pte_attrs =3D=3D 0xf0; #endif info->flags =3D flags; =20 @@ -5371,6 +5366,15 @@ bool sve_probe_page(SVEHostPage *info, bool nofault,= CPUARMState *env, return false; } =20 +#ifdef CONFIG_USER_ONLY + memset(&info->attrs, 0, sizeof(info->attrs)); + /* Require both ANON and MTE; see allocation_tag_mem(). */ + info->tagged =3D (flags & PAGE_ANON) && (flags & PAGE_MTE); +#else + info->attrs =3D full->attrs; + info->tagged =3D full->pte_attrs =3D=3D 0xf0; +#endif + /* Ensure that info->host[] is relative to addr, not addr + mem_off. */ info->host -=3D mem_off; return true; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620209; cv=none; d=zohomail.com; s=zohoarc; b=CraoW3U6vuJuOqnZJKwbPTdNjokc9H/z6PGUIH+/y+Qb56oam5uDuuJ/ESM8JUuORFb1zSkCSdCIwzl3LijYO1nDQnDi+lt0k1MXnzoU1NTfr8hmkxik5QKLNZVdvozBQ7Gf5RKhZJnWQl+W0K+r5WIsyCSqFNDQleSTidaJUvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620209; h=Content-Type:Content-Transfer-Encoding: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=Qqq5jSaGqD+6ajO8SNo3n4GhKgld5h1XD9p1VGEHQsg=; b=PFmU+MMi3kpR44s390ST4VIKLO67YParVQP1JPGEsY5DQ/W0FkO6FHVvIl6siDmVvl09E990e0QbWa7689ZGGaL5BPVmOh9PQegxPwBC9GZzvH4yQ8hs21WU2M8tlxG1YWQPSWY85lcD2JF+oKDltu5vz4l9Fpn61csXTud83jM= 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+importer2=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 SMTP id 1673620209927534.6335796177706; Fri, 13 Jan 2023 06:30:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmj-000103-SE; Fri, 13 Jan 2023 09:11:57 -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 1pGKmW-0000sf-2f for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:44 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmR-0003fm-T2 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:41 -0500 Received: by mail-wm1-x332.google.com with SMTP id j34-20020a05600c1c2200b003da1b054057so3149247wms.5 for ; Fri, 13 Jan 2023 06:11:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:37 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Qqq5jSaGqD+6ajO8SNo3n4GhKgld5h1XD9p1VGEHQsg=; b=dhSLX1WjzHn0KrSbEK9O4msp7LXloy/aEk0tmBNcWoB55inp4PL0KtRmr/WFtC37Zk OesxvdtvHpZgKg1ysaeB4yFPSqo/5wlf3t8SDzDqyqikf+tVhZUKfferkAjLXh/uUkB4 4KWtZueZ/EF0zvLGWKo6iqTYVDryuz9A50FIoRRrFQuy6aIXTpO6iIJ8+zyScxY9EGO2 NU4+I34nB27RT2KrNBx+3Np3GoSYlZXP+fjZzNL3/4iauyPc2+pEvMbGJa9U1YszV92B oOr+G3Ri0MiN/Amzo5e8bpcQG4X5FfLCld92JGxYGvXWJ1Asc70Gi6+etqC9/S4Lhu7z Qz+A== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qqq5jSaGqD+6ajO8SNo3n4GhKgld5h1XD9p1VGEHQsg=; b=llag/36CAIXaPOGK4yMqGmXdZ87Ng4GCslISmcHcrlZgvw1qWN2087PFKRgiajAej4 nYNFPcosBulSqbLp6xYByDzGne6q3CVkyi9ITxOszeER82mdNpEvPBKjj2kQO0mtCk0v 0eRiq4fLcJJ7C/FDNzTH73oEGQIGGF6HOLGlskHQbl3vuqyTzyBHSQRq6Q5wNJ1zF7NR RwtoETM5yIZrShZUAHK2XRnOnKaxyWyGlCrs9VXvQnR/B11z0BUTh/6EbAv6GdgeX1cy m6DmKy1wkMjjU46AXgOv5/Suv0n+Js1V6aIrqpfUkbnVVU3nqsaR+9VZx2uObqcMlnDq CrIg== X-Gm-Message-State: AFqh2kqfnv2AH2m0V9e5J9bmAsKjfOzZI9epURg4h2SggbQ9P3XbJ0w1 lwe1CiyRELYRtohftRz6wpMphfECy65KHDX7 X-Google-Smtp-Source: AMrXdXtvYKoj4H0xFmeWkRtrLlaJBy1mumQzJQJJfXbuHMFCNb+GI6a0T4AGz0Gy4GY4k5ujFl4FwQ== X-Received: by 2002:a05:600c:4e4f:b0:3cf:9d32:db67 with SMTP id e15-20020a05600c4e4f00b003cf9d32db67mr58189503wmq.3.1673619097613; Fri, 13 Jan 2023 06:11:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/38] hw/arm/pxa2xx: Simplify pxa255_init() Date: Fri, 13 Jan 2023 14:10:59 +0000 Message-Id: <20230113141126.535646-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620212020100001 From: Philippe Mathieu-Daud=C3=A9 Since pxa255_init() must map the device in the system memory, there is no point in passing get_system_memory() by argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-2-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/pxa.h | 2 +- hw/arm/gumstix.c | 3 +-- hw/arm/pxa2xx.c | 4 +++- hw/arm/tosa.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 1095504b86f..c26007e57f9 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -195,6 +195,6 @@ struct PXA2xxI2SState { =20 PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_s= ize, const char *revision); -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_s= ize); +PXA2xxState *pxa255_init(unsigned int sdram_size); =20 #endif /* PXA_H */ diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 3a4bc332c42..c167518a46e 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -51,12 +51,11 @@ static void connex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; - MemoryRegion *address_space_mem =3D get_system_memory(); =20 uint32_t connex_rom =3D 0x01000000; uint32_t connex_ram =3D 0x04000000; =20 - cpu =3D pxa255_init(address_space_mem, connex_ram); + cpu =3D pxa255_init(connex_ram); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 93dda83d7aa..8b8845fc630 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -11,6 +11,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qapi/error.h" +#include "exec/address-spaces.h" #include "cpu.h" #include "hw/sysbus.h" #include "migration/vmstate.h" @@ -2230,8 +2231,9 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, } =20 /* Initialise a PXA255 integrated chip (ARM based core). */ -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_s= ize) +PXA2xxState *pxa255_init(unsigned int sdram_size) { + MemoryRegion *address_space =3D get_system_memory(); PXA2xxState *s; int i; DriveInfo *dinfo; diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index d5a6763cf9a..3ca2e4459ca 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -242,7 +242,7 @@ static void tosa_init(MachineState *machine) TC6393xbState *tmio; DeviceState *scp0, *scp1; =20 - mpu =3D pxa255_init(address_space_mem, tosa_binfo.ram_size); + mpu =3D pxa255_init(tosa_binfo.ram_size); =20 memory_region_init_rom(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal); memory_region_add_subregion(address_space_mem, 0, rom); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620472; cv=none; d=zohomail.com; s=zohoarc; b=mnnh+aF400HbzhwIZa3dW2lcClmPiQuwb3hz6JXBWjDI5ckvA9OVNc/CNXrY9KyiBUYlsJeb18kwkJE1ov6XAiNapLc+pWtQubs+nU6Q1WxgTxJw6w2ki/H5i+Yie1ybro1o079EBSWi+Zx6c85eqOnrYmlIrz5R7sh+tVbf604= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620472; h=Content-Type:Content-Transfer-Encoding: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=Px7luTWW+dLtq2BVhk30rePDxrVTBf/HIgoT3jUar+A=; b=gHq9E9qXjyiy+OehTCKfdmyZQj7V4Wfk34dl8DN2HOO8AVMuWrJs3lmeRj8ncZfjg1qhtwKkaGQDrppqB9U+3qQAuhYqDLXQZvoyTkM7r/hV7ExlWPn9PasnSEG3FH+rNx+oZjur2Dvzxm+JwT1ysJQ/oEmwSBAahLMFpgb8mb8= 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+importer2=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 SMTP id 1673620472102958.9533014632367; Fri, 13 Jan 2023 06:34:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnF-0001TY-VO; Fri, 13 Jan 2023 09:12: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 1pGKmg-0000zy-PC for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:54 -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 1pGKmR-0003eE-Ti for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id m3so15371340wmq.0 for ; Fri, 13 Jan 2023 06:11:39 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:38 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Px7luTWW+dLtq2BVhk30rePDxrVTBf/HIgoT3jUar+A=; b=uBi18eYxI6eAVlojMPqx2zuMPgd+Lj2S4pBEY/cT4EyYVLJX+jMPWbuNDQlCdCIvD1 XbDjJzIXxSaE9O8xMTWrYlZ5RnTAAVq96nAFegj5FR0iX1McSKKENum7BBPCxD2FCIFL sBHI+rvTnhf3z/zbF0T8+GEz3Tg7phy2N52tO1ToOWGmslt1GujfwWglKwvHpOuQyz46 V45uazmsEOsawXHrN0d+EIObYVERleEs9jGsgvFZY9k+SQ4siwX2lEyKkY3d0cSK6U2G kGw9q0yaaCUvenuTRtF4ifBp7gtQ5spqtEl2DaxwhKLYcCM9wXGG4hbb6x+CU5A5Pkk3 Qp5g== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Px7luTWW+dLtq2BVhk30rePDxrVTBf/HIgoT3jUar+A=; b=04M2dkf4XYuTVlpHuDld396l1beh0AyrEixIps37BlX2n+Ldpu7SvHdR4SEeHQhnmy zU19wH/HsWlIGv0I756LSQAbVTr0vSP0V5cogTvwNeMnk/ffFjmQV0VbXF34BgZ/sKHG qr2ZVcR63nTo4wylAoA01B/920/mghVoz/rOp15vRZDkKZ4mUWzuyxtXAQZIylXmRyrR qloANvbvKf8lijTmjaAU0MkJi/qWiRCDz89WHuU6QlY75lxoXpeAeGwmyoDYGmc62cJV /cSb7FhD0zVPgM/spgnQU2HVQc4GaNmqt+xiLGOBxxD4cHgYJ5H/NzJpbYFMusfhC/qs PP7w== X-Gm-Message-State: AFqh2kppovB1N9DU/tAdU8oLuPe91WRQceGpj52N7AFxNP61jM6LrGJA wdbViNgJSmUIHrJbPIhDQCgFtIPZl87lsi73 X-Google-Smtp-Source: AMrXdXvYWBy7OUXMTsznyn4WARfnOwQV8vLsuKOwxtlxsEUk0M51N4V/HetFBRj+7+zalsSZMOZeOw== X-Received: by 2002:a05:600c:204c:b0:3d6:6a17:7015 with SMTP id p12-20020a05600c204c00b003d66a177015mr57262201wmg.15.1673619098686; Fri, 13 Jan 2023 06:11:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/38] hw/arm/pxa2xx: Simplify pxa270_init() Date: Fri, 13 Jan 2023 14:11:00 +0000 Message-Id: <20230113141126.535646-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620472773100003 From: Philippe Mathieu-Daud=C3=A9 Since pxa270_init() must map the device in the system memory, there is no point in passing get_system_memory() by argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-3-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/pxa.h | 3 +-- hw/arm/gumstix.c | 3 +-- hw/arm/mainstone.c | 10 ++++------ hw/arm/pxa2xx.c | 4 ++-- hw/arm/spitz.c | 6 ++---- hw/arm/z2.c | 3 +-- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index c26007e57f9..ba8f49e48ed 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -193,8 +193,7 @@ struct PXA2xxI2SState { =20 # define PA_FMT "0x%08lx" =20 -PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_s= ize, - const char *revision); +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision); PXA2xxState *pxa255_init(unsigned int sdram_size); =20 #endif /* PXA_H */ diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index c167518a46e..ab9b0182f6f 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -80,12 +80,11 @@ static void verdex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; - MemoryRegion *address_space_mem =3D get_system_memory(); =20 uint32_t verdex_rom =3D 0x02000000; uint32_t verdex_ram =3D 0x10000000; =20 - cpu =3D pxa270_init(address_space_mem, verdex_ram, machine->cpu_type); + cpu =3D pxa270_init(verdex_ram, machine->cpu_type); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index 8454b654585..f6293c6c13a 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -108,8 +108,7 @@ static struct arm_boot_info mainstone_binfo =3D { .ram_size =3D 0x04000000, }; =20 -static void mainstone_common_init(MemoryRegion *address_space_mem, - MachineState *machine, +static void mainstone_common_init(MachineState *machine, enum mainstone_model_e model, int arm_id) { uint32_t sector_len =3D 256 * 1024; @@ -121,11 +120,10 @@ static void mainstone_common_init(MemoryRegion *addre= ss_space_mem, MemoryRegion *rom =3D g_new(MemoryRegion, 1); =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, mainstone_binfo.ram_size, - machine->cpu_type); + mpu =3D pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, &error_fatal); - memory_region_add_subregion(address_space_mem, 0, rom); + memory_region_add_subregion(get_system_memory(), 0x00000000, rom); =20 /* There are two 32MiB flash devices on the board */ for (i =3D 0; i < 2; i ++) { @@ -165,7 +163,7 @@ static void mainstone_common_init(MemoryRegion *address= _space_mem, =20 static void mainstone_init(MachineState *machine) { - mainstone_common_init(get_system_memory(), machine, mainstone, 0x196); + mainstone_common_init(machine, mainstone, 0x196); } =20 static void mainstone2_machine_init(MachineClass *mc) diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index 8b8845fc630..07d5dd8691f 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -2092,9 +2092,9 @@ static void pxa2xx_reset(void *opaque, int line, int = level) } =20 /* Initialise a PXA270 integrated chip (ARM based core). */ -PXA2xxState *pxa270_init(MemoryRegion *address_space, - unsigned int sdram_size, const char *cpu_type) +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *cpu_type) { + MemoryRegion *address_space =3D get_system_memory(); PXA2xxState *s; int i; DriveInfo *dinfo; diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 5aab0b85657..f732fe0acf9 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -986,18 +986,16 @@ static void spitz_common_init(MachineState *machine) SpitzMachineState *sms =3D SPITZ_MACHINE(machine); enum spitz_model_e model =3D smc->model; PXA2xxState *mpu; - MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *rom =3D g_new(MemoryRegion, 1); =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, spitz_binfo.ram_size, - machine->cpu_type); + mpu =3D pxa270_init(spitz_binfo.ram_size, machine->cpu_type); sms->mpu =3D mpu; =20 sl_flash_register(mpu, (model =3D=3D spitz) ? FLASH_128M : FLASH_1024M= ); =20 memory_region_init_rom(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal= ); - memory_region_add_subregion(address_space_mem, 0, rom); + memory_region_add_subregion(get_system_memory(), 0, rom); =20 /* Setup peripherals */ spitz_keyboard_register(mpu); diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9c1e876207b..8eb6f495bc9 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -299,7 +299,6 @@ static const TypeInfo aer915_info =3D { =20 static void z2_init(MachineState *machine) { - MemoryRegion *address_space_mem =3D get_system_memory(); uint32_t sector_len =3D 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; @@ -308,7 +307,7 @@ static void z2_init(MachineState *machine) DeviceState *wm; =20 /* Setup CPU & memory */ - mpu =3D pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu= _type); + mpu =3D pxa270_init(z2_binfo.ram_size, machine->cpu_type); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619663; cv=none; d=zohomail.com; s=zohoarc; b=ed2tiLPACo/YAOHuGAkjkfwtKXqCIW3hVhN0XTFT7L01lvZcqgCr+gqnMOAfrQb4iH0tbz+G9eX8dc4KEi2d8gl8sYYHdmBMJCXwKK2YHX+xKp72/RE3DXLKoa+nxdc5EdKyKI8gbxjPMbU4Ea471qAZDA1BvMM+sQXMUkgDwBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619663; h=Content-Type:Content-Transfer-Encoding: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=M+xwFgGZEh0D/hoAK84xuNGNVlgbA1ZKtrhZxue+uNk=; b=BM1U/l5RhKmz/GbYWmNW+5nhYzYGfgb3lhK07y0zrsGAVaWeGxVUq/fvDymqWINKdDvbGzUraXiip8IAzsqycPxmz9XI3+cl9ErjoXGLyRJ7qqvNt/GRtW1U4DoGu5HxsaJ9lif5VYw9R7tP4QOPgtaxUSguQz1oZlgbz49Icv4= 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+importer2=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 SMTP id 1673619663511633.8628288815058; Fri, 13 Jan 2023 06:21:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmo-00014h-1k; Fri, 13 Jan 2023 09:12: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 1pGKmh-00010X-Lk for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:56 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmS-0003gJ-UV for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:43 -0500 Received: by mail-wm1-x334.google.com with SMTP id m26-20020a05600c3b1a00b003d9811fcaafso17439186wms.5 for ; Fri, 13 Jan 2023 06:11:40 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:38 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=M+xwFgGZEh0D/hoAK84xuNGNVlgbA1ZKtrhZxue+uNk=; b=I3aOgn6j6cR6tKag441/6+uB0GKnt4NtE1VjFc8fTlFSg6Hp3MLKujDi2O3+F/cTHc nc8BujmM7evveVJOjvYnOx+jHH0ukHW/0hv+zNHYijsOMjN/UGTDDDDw2IGKNwDVQEF+ HFfynHGzYgm94LgjXdi4RHfJT0wVA6ajCE7jSpp9Gzt00Eq7Le9mVIVviHE72gvVmrZ8 RLFBeHdxD4XXAUn33JI1acu6TAfSbTCH4nVFW2qLJer6FM96omzD8qQhumOLH5zLfkkF mZN+ifh+VABC7je0U3jrnx93bLkzM4JvvMpFMNgRDVeugZ1zH/l4l1Eluh/7Of/5LVBQ K3sw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M+xwFgGZEh0D/hoAK84xuNGNVlgbA1ZKtrhZxue+uNk=; b=hBLHJy4AOWmTvkg/MPnojc/P9f+o7Gmk3Bul+R5efxxNGhRdX24HPDB9L3aKKGK8+E ETjf2nxw2hziDuxDsULwrw8qxt9jI1zSQe50y/NawI2R3F21WD0ZpOBmLc2FMUJOcJKO cxB7aP33a7DBpZKhGGohwp/u7yp31xfY6tKJcSHbrP+k3ApEfNLVIEB+TFaQdKRZkFEO dMS5LmR/2GdJls6aXw9Qy05unqtdu5F3LIkS/CI4j4lYwO+EoGtbL0vINPUTiB7ApYWW Lv1ZgibhumIP43baWugwOkeVWQmWqfdkpc6uXziy30yagMmUN722Q1fXYpXMvOXO35Pk cMwA== X-Gm-Message-State: AFqh2krawN2j+uhCuOIAGYvGX3BEDkLuvysNHK/198islLTQPxJaLdCx vQIfmBuSrmAJuE3L3ENi9ji75ooaLUP8mjyk X-Google-Smtp-Source: AMrXdXs3O4xXrFXlu3akFqW8EoYiRKZa9O5tL8PoqJ8MSxcTt62r3gGFGh/0H6v26YYSHdvC2T+piA== X-Received: by 2002:a05:600c:539a:b0:3d9:efe8:a42d with SMTP id hg26-20020a05600c539a00b003d9efe8a42dmr14764050wmb.21.1673619099451; Fri, 13 Jan 2023 06:11:39 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/38] hw/arm/collie: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:01 +0000 Message-Id: <20230113141126.535646-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619665199100001 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-4-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/collie.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index 8df31e27932..d59c376e601 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -20,6 +20,10 @@ #include "cpu.h" #include "qom/object.h" =20 +#define RAM_SIZE (512 * MiB) +#define FLASH_SIZE (32 * MiB) +#define FLASH_SECTOR_SIZE (64 * KiB) + struct CollieMachineState { MachineState parent; =20 @@ -31,7 +35,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, COLLIE_MAC= HINE) =20 static struct arm_boot_info collie_binfo =3D { .loader_start =3D SA_SDCS0, - .ram_size =3D 0x20000000, + .ram_size =3D RAM_SIZE, }; =20 static void collie_init(MachineState *machine) @@ -52,14 +56,14 @@ static void collie_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ra= m); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000, + pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); =20 dinfo =3D drive_get(IF_PFLASH, 0, 1); - pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000, + pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); =20 sysbus_create_simple("scoop", 0x40800000, NULL); =20 @@ -75,7 +79,7 @@ static void collie_machine_class_init(ObjectClass *oc, vo= id *data) mc->init =3D collie_init; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("sa1110"); - mc->default_ram_size =3D 0x20000000; + mc->default_ram_size =3D RAM_SIZE; mc->default_ram_id =3D "strongarm.sdram"; } =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673627561; cv=none; d=zohomail.com; s=zohoarc; b=mCNmFYffgITGe9DJNKbXs9AYeiP1a3jNDnMBAuKI/GhrDcpwo2w1rLRhod7u8tROvt6J7N2u6k1nAgaSBsfo4lE4puP63UBvd1luUYm8D/ljGZagyxW1q302m48uT7IO31zYR7C9z/HWeK3La+rv1+ZepfyJZSyL91alCq+8jI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673627561; h=Content-Type:Content-Transfer-Encoding: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=p5wUjZHNEX4wvPYtRpYJpyJdLoIbuRacZePj/0c5n/s=; b=JS9m2881mkS1KzqQCqcbL6tbGguEEZr61udHG7TnU37uAGyV579J7VVlJ/a/b/42tEgI0riHJX1iGi0VkWGsYOuTdlwkG09H9snzUZuToMYwPe9aA1JM3yW7+XlIHqEFUzsEgjEUDiPIYPx4ZjbABltoTOS316bbaCI+0+pbkqU= 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+importer2=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 SMTP id 1673627561144233.59920445038995; Fri, 13 Jan 2023 08:32:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnG-0001Tf-6y; Fri, 13 Jan 2023 09:12: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 1pGKmh-00010W-MC for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:56 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmT-0003ef-UU for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:45 -0500 Received: by mail-wm1-x334.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so17449441wms.4 for ; Fri, 13 Jan 2023 06:11:40 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:39 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=p5wUjZHNEX4wvPYtRpYJpyJdLoIbuRacZePj/0c5n/s=; b=skDG2nMakcCjDePVX6rNJFWF6KgeLqZgGWDYIvI+b9sWdottF6GUl21KOJ7kC/9ASJ pO4UNcKjffqrlVu4hWKEAhHc9yLLQaQ649CH/oyb9NnTP8fv08H0soZ20QsUA8sECjyD 5rlzp8ZvPsU4dw9nuY7QIKlMe9sO0yo+6oUxjAn81Bjlb6Ift3GSoaqLFo2jOZqEQBYL UVIhUWunYlqhpbIvdFr2cv0z1d7ZetlobmrTvf2DBb0amQ28miv+OJYL3eJvwiLmyLwG 29c8eDcOgQ1qzDGcDskIkYoHc4uvKSc8DqMZdWvBMKkaoY7CPYj2qeDHK3u31XQ1mQA3 cLEw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p5wUjZHNEX4wvPYtRpYJpyJdLoIbuRacZePj/0c5n/s=; b=fIDE7wQlmNcaSaU0pOc+HjNKAcg2giMPNxw6WKEmtrvnStjb3HctadTGuLGFLoKpZO JnTE/qKRe+bXPUeFSLzKxFBeH+TKch3S43TPmRpNdWeOg3s0em8fqW0chvtblP77vRJ3 GFRdKHXo8YthAicpX4lL3VITutLcJFClFAbzLt8flqfnHQD4Hf1LpU+N2hjqEEL5DDFq kDWEtoMBn+XMR3NNbALB9ukx3DovAY8z0gHJP4piFKkSnZA/fRUd7zHgf+W1orCaI2Sa Unm9py44n20Dca1CcBTJvCLNwbTiOBfXUExSO0riSMvboKqTQY/uIL50iXMlTCmj8Pz0 d/9A== X-Gm-Message-State: AFqh2koGi0WMjy1Zu+yDw6lWs2Akpg7yoI8AxBknPzgW1ioIrC7jaDA3 ucbgZhFqTREi9K+VerAtKZcZcQmKzo3BFMBb X-Google-Smtp-Source: AMrXdXtGeJEi7WYbfi3CXTX66BARSUciGQnBHR2ZyLQzWbzTecnDb9HyB94nAsgpl70q3gnPHhQBvw== X-Received: by 2002:a05:600c:3d0e:b0:3d3:4aa6:4fd0 with SMTP id bh14-20020a05600c3d0e00b003d34aa64fd0mr58858177wmb.6.1673619100253; Fri, 13 Jan 2023 06:11:40 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/38] hw/arm/collie: Simplify flash creation using for() loop Date: Fri, 13 Jan 2023 14:11:02 +0000 Message-Id: <20230113141126.535646-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673627577107100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-5-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/collie.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index d59c376e601..9edff593708 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -40,7 +40,6 @@ static struct arm_boot_info collie_binfo =3D { =20 static void collie_init(MachineState *machine) { - DriveInfo *dinfo; MachineClass *mc =3D MACHINE_GET_CLASS(machine); CollieMachineState *cms =3D COLLIE_MACHINE(machine); =20 @@ -55,15 +54,13 @@ static void collie_init(MachineState *machine) =20 memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ra= m); =20 - dinfo =3D drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); - - dinfo =3D drive_get(IF_PFLASH, 0, 1); - pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); + for (unsigned i =3D 0; i < 2; i++) { + DriveInfo *dinfo =3D drive_get(IF_PFLASH, 0, i); + pflash_cfi01_register(i ? SA_CS1 : SA_CS0, + i ? "collie.fl2" : "collie.fl1", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00= , 0); + } =20 sysbus_create_simple("scoop", 0x40800000, NULL); =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673625866; cv=none; d=zohomail.com; s=zohoarc; b=mqKfM8IFr6ZfJ9C73CH8dSwpFF/eprn7Clo4dAJfEejdu8Sxvdc2Vmwc4ESPxusL+U1stgle/DFnwPgcZMIAdyHSRjsCRTlFKskKlQvAl2Sf5OA+jXvUX+E8WFmXtgfSgdG0km/0foUboJoKImxrfvYCDwpkiMFCUyFFGVW9wjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673625866; h=Content-Type:Content-Transfer-Encoding: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=dTsmvOY3TJk1Idee7Z8gcWnQgpKzbt50K3xWFkX5qoA=; b=dOJNQI0khYtF0EOHg4Dlquw76DpWlnhh+vxHg2QjGSakPrnqb0b2J8eicjt/FAKKnPkkC4MYi+LOlxVBXbYP0M/mOKUmZW0A1tj/wRHC3JCPMwWlw6mr0PzpOsmq3cxdiDJyt5iL0lptpgmIMMABInBapd5qxnzV9Qp/73widiU= 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+importer2=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 1673625866453625.6763872746345; Fri, 13 Jan 2023 08:04:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmn-00014G-VO; Fri, 13 Jan 2023 09:12: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 1pGKmj-000115-0S for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:57 -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 1pGKmV-0003gt-QF for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:56 -0500 Received: by mail-wm1-x32b.google.com with SMTP id ja17so15355174wmb.3 for ; Fri, 13 Jan 2023 06:11:41 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:40 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dTsmvOY3TJk1Idee7Z8gcWnQgpKzbt50K3xWFkX5qoA=; b=qj4fRPLUhv9HE5xv6phJ8ztNKazHmw4ttH1RdjH+I3raDcaXLEwVU1M9/I7TLNbErf n6KAoXxOhQK/qYgqTN61v6b6abrn8XP8AXVW4jGN+iGIrnS8PPgkZvN+H/d7JQvkKGqw EeZ+OdfqiNwT7DcopEO9sNEgVbGENYot1YkogXWkR2g0opX0Kc1LQSCaDcJXL0h6mVfY 6K2pGjwcx1Bcv5iFXeXEFRkZaS6QaHsoWt7NNlsFxjtJX6HBBkDPnTUTSx2IsazmDEpQ zLOq3Nw9sBjUIJ4kC5cIIAvmTkDYtOare/phCOQCg+ccg/agXuwVzyhEBDfsO/sYgoRS 2eKw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dTsmvOY3TJk1Idee7Z8gcWnQgpKzbt50K3xWFkX5qoA=; b=0n2Lcs06IOLcoWRw5RXSQGISOnQxhnemVw7Li9LKNh0yw2C3mzybi+Wnb8+b1GinM8 5faJ2us1J/x+/FsQXT30e8DPlF222v4Ohl3Gbj6BMeikeiT/uMJRJjz8gUsTdXGGBe/Z HlzcJdSVGD5oiKVlEggOrk3jhbzDJgJ6/fXs/+dAsnyb6U78ywArHe8Fd3JOxUCBtphP PLIEM4WMtQMAcAXfMTE9kdd7MvzSnSYqrRfn6rD2NO2e1faXs5yyedKN8oCMSVblAdXR KiRqs+ZHg5GibWACBKsDRgPumCyCmJKmBWBGyYwlbOmByWtnENBsNNKpiBoHvXi1p3cm NCag== X-Gm-Message-State: AFqh2krKqbv1fIFumFWMb7NgNfZv1fKRqjU1vQgWDXCMF74deCv2W27w rYqLCTi/O0Aj2x88NOyl4NFebmbinqdzZyau X-Google-Smtp-Source: AMrXdXtTa/EteHhwoDGuLRZjigZOlX1WR9KuUHafbLCO94AUh03pFSVd+0VSHOk9BemQwwNVyBxwlA== X-Received: by 2002:a05:600c:3caa:b0:3d9:cb4c:af5a with SMTP id bg42-20020a05600c3caa00b003d9cb4caf5amr29909714wmb.33.1673619101034; Fri, 13 Jan 2023 06:11:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/38] hw/arm/gumstix: Improve documentation Date: Fri, 13 Jan 2023 14:11:03 +0000 Message-Id: <20230113141126.535646-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673625867934100001 From: Philippe Mathieu-Daud=C3=A9 Add a comment describing the Connex uses a Numonyx RC28F128J3F75 flash, and the Verdex uses a Micron RC28F256P30TFA. Correct the Verdex machine description (we model the 'Pro' board). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-6-philmd@linaro.org Message-Id: <20200223231044.8003-3-philmd@redhat.com> Signed-off-by: Peter Maydell --- hw/arm/gumstix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index ab9b0182f6f..89c15bee759 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -10,7 +10,7 @@ * Contributions after 2012-01-13 are licensed under the terms of the * GNU GPL, version 2 or (at your option) any later version. */ -=20 + /*=20 * Example usage: *=20 @@ -64,6 +64,7 @@ static void connex_init(MachineState *machine) exit(1); } =20 + /* Numonyx RC28F128J3F75 */ if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, 2, 0, 0, 0, 0, 0)) { @@ -93,6 +94,7 @@ static void verdex_init(MachineState *machine) exit(1); } =20 + /* Micron RC28F256P30TFA */ if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, 2, 0, 0, 0, 0, 0)) { @@ -124,7 +126,7 @@ static void verdex_class_init(ObjectClass *oc, void *da= ta) { MachineClass *mc =3D MACHINE_CLASS(oc); =20 - mc->desc =3D "Gumstix Verdex (PXA270)"; + mc->desc =3D "Gumstix Verdex Pro XL6P COMs (PXA270)"; mc->init =3D verdex_init; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("pxa270-c0"); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622283; cv=none; d=zohomail.com; s=zohoarc; b=kTQbV2qO33oDh3WUWE27VWIjvL8eMCEgTepxoFUifEqbTGU8sKCmbad75L8tOnGu6Mup7NEej+Bngg9jL/SpslQgvmcZvc50rGeOL4m4Hx/BHoWsYjFh+HJmICmtsaQE5SWQjYeJYcgORwyechL1pmV3z9+SiB2bDjdPRZIN6qY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622283; h=Content-Type:Content-Transfer-Encoding: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=rDLpEGhfKq8E9A3i8kqw2MyfOYvNsDJPdKlzQIMXq8g=; b=J350oirUB7CQa5ERQ63xAtMHyY34RO2bCG49MadGgHRxv6yYKEANN8VT41d0gcIhc0qKXGb88/KdhfKGXecfQYscHiHhL7MUhERR8MZ5LJqmf1tT6drb947MycfZVFZjCPsPzRRIrTcWhT1Zpl9MIi/lKyrjiETCZymaCn9vgZc= 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+importer2=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 1673622283775607.6253354222623; Fri, 13 Jan 2023 07:04:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmx-0001AL-1N; Fri, 13 Jan 2023 09:12:14 -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 1pGKmk-00012I-8q for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003dg-8t for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:57 -0500 Received: by mail-wm1-x329.google.com with SMTP id g10so15354652wmo.1 for ; Fri, 13 Jan 2023 06:11:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:41 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rDLpEGhfKq8E9A3i8kqw2MyfOYvNsDJPdKlzQIMXq8g=; b=Ky1clYYG9atFMCfcK2czOPvVNRML5E/i4QPoWlmYiRW0xtSz3zdZNGOfgSvJmROFPQ fRZRxmgbwqMHWmMXeWM+m+JrxuMtnUWG7PT87blgjZFUYWfDhxQfwfGCCNf0r7zaXWty nZOBwOmPG504EieXPjkj01FO74J2MBKntwkv9IkA8CU8Kw2ihmkJteiPOcxdna4YRqxj 9N/swmo62HDPvLUixNrWORuMpgSNtJqpjyMfJR6jQQxYolWHNS4uDEpnzI4x+cN6Ez6X XUO3oj/PVUsEGtfskCQK8z828zaVKzWG9IMydcooWwZ6EWgcZc9BMAMfsvHh/XS3biqh 7HeA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rDLpEGhfKq8E9A3i8kqw2MyfOYvNsDJPdKlzQIMXq8g=; b=0Q65V2GtpuOKnTOKCMawq1IZyXe+kud1DVkAiFUzZ+7QzS0fF2eb7yj/ltU0K8Ejr0 ZUpwlDggVgJsqrb6icZULdW/57qIv2WeyQUp4DlX4+ZUR0c+2nHuJ+hgxBUyCGwbxLQM bZ6pqjKwlCOM3Pa7YB05Jg+hcBdMipg2gUYRIVbRL+JGkH1BQbsTYSiq8VJs414+nnpO l4E+9yoPVxkMKkhZfG+IqX2YJd5sk0iHT2a1hVsfLJvuokVEz5bZYMYMrVyq7lcq1Lni /hAzub3NwdaNXS5FLZgjaglHJ+OpLA8V0w1M8+lPJg79w5NZkyix4WSlX24tsAS2ynWw 1s2A== X-Gm-Message-State: AFqh2kpurEz99ZlWMx3BYfEfVH/DwXWRNnO1yTk0TbRM4PyCBZhjYGl9 Rn94zG2h8e992/J8bgNRUedkCR08EsaRL/NV X-Google-Smtp-Source: AMrXdXs1SSoHM+rCHzhYX17aldjEA69aKHZYFbmqA7rHD0aXwIK7mwKHx1fMrif72SyuNdHy78TxRQ== X-Received: by 2002:a05:600c:3495:b0:3c6:e62e:2e74 with SMTP id a21-20020a05600c349500b003c6e62e2e74mr59266484wmq.15.1673619101855; Fri, 13 Jan 2023 06:11:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/38] hw/arm/gumstix: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:04 +0000 Message-Id: <20230113141126.535646-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622284994100001 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add definitions for RAM / Flash / Flash blocksize. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-7-philmd@linaro.org Message-Id: <20200223231044.8003-3-philmd@redhat.com> Signed-off-by: Peter Maydell --- hw/arm/gumstix.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 89c15bee759..579d3635774 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -35,6 +35,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "hw/arm/pxa.h" #include "net/net.h" @@ -45,17 +46,20 @@ #include "sysemu/qtest.h" #include "cpu.h" =20 -static const int sector_len =3D 128 * 1024; +#define CONNEX_FLASH_SIZE (16 * MiB) +#define CONNEX_RAM_SIZE (64 * MiB) + +#define VERDEX_FLASH_SIZE (32 * MiB) +#define VERDEX_RAM_SIZE (256 * MiB) + +#define FLASH_SECTOR_SIZE (128 * KiB) =20 static void connex_init(MachineState *machine) { PXA2xxState *cpu; DriveInfo *dinfo; =20 - uint32_t connex_rom =3D 0x01000000; - uint32_t connex_ram =3D 0x04000000; - - cpu =3D pxa255_init(connex_ram); + cpu =3D pxa255_init(CONNEX_RAM_SIZE); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -65,9 +69,9 @@ static void connex_init(MachineState *machine) } =20 /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, + if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZ= E, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 2, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } @@ -82,10 +86,7 @@ static void verdex_init(MachineState *machine) PXA2xxState *cpu; DriveInfo *dinfo; =20 - uint32_t verdex_rom =3D 0x02000000; - uint32_t verdex_ram =3D 0x10000000; - - cpu =3D pxa270_init(verdex_ram, machine->cpu_type); + cpu =3D pxa270_init(VERDEX_RAM_SIZE, machine->cpu_type); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { @@ -95,9 +96,9 @@ static void verdex_init(MachineState *machine) } =20 /* Micron RC28F256P30TFA */ - if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, + if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 2, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673625458; cv=none; d=zohomail.com; s=zohoarc; b=DkvnUpDXoxXKjfvg+pQ/71CEt0WR+Wwb3Yh6rAPxqxU0JELsCMmqkDxhabj3TablSrMjloheZwWW/Pm/jWZYO7cLcJKUZbe6Tfz/Ss4DS/NuGsuHv9A8ic6Eg/CWEWImIjuE9Rf9LV7DHDXQ4wVT/6L514K3MjV60mKBof7IcGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673625458; h=Content-Type:Content-Transfer-Encoding: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=4zdHeiITJEFYFvL/oVldM7ClF1Ud0kfLQubpqfkMy+k=; b=NgSz6t195tDnzTSZg5Yv2ciSl75dmTObfomFDsUxjbEx+V/iPvwEV2cqHIQ3LFiDQJdLCm+ZVf3nJIhOW8DWPBV4Fj/ZVOU50WsIzn6IMTWln06uFvOel33e7p6AUZe5KLgufV3cs9nAccvyDr6qh5c6AJ8XjbotWvQjYz3CE2g= 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+importer2=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 1673625458814707.1594616138607; Fri, 13 Jan 2023 07:57:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnJ-0001Wq-Qi; Fri, 13 Jan 2023 09:12:33 -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 1pGKml-00012q-L4 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmh-0003hx-8s for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: by mail-wm1-x32a.google.com with SMTP id f25-20020a1c6a19000000b003da221fbf48so1129085wmc.1 for ; Fri, 13 Jan 2023 06:11:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:42 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=4zdHeiITJEFYFvL/oVldM7ClF1Ud0kfLQubpqfkMy+k=; b=WXsVH5NuKAPkxdD0Lf8OUmIiiIW0tjTki/wm2mSN76e3ksW1zHuzCJEiANoIvnMRhO yqewPgqZQHwC60utBEObCgQJZ69IFWky5pSailAjTo7xJUUcde11rS8YUJO1Dit2Hmog HU+jrg5dVHcPz5Jo5RmLZ8VBbwumvMAfDbpuZOW1hb549hAwP3j3TBsM8K4h59AVohvF 5eKCyF56pr705MW8t23RZd1DFivsZqQda28ILoS78cm6ar/Jm1dRPk2g8Of/rPRGJime I8gGRwvoPpJt8e7ha00an67OOgAH+Y0P92DrkJARYtGQMPMTI+WlbXaPluhtSGnB45UJ An4A== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4zdHeiITJEFYFvL/oVldM7ClF1Ud0kfLQubpqfkMy+k=; b=CBy3RUAEsLYkh+BFg5zVX4FqbGRCnP84RQuq6rCfMmHCZ4nXW8+PGni+rfeDeHZBSn HB+cl1y3GBX5e4Z+hjbynAahNbgPybpmM3f3pVX+gnrx9XeDpLDjDPjhTh/yzQ02kwM8 wtr6s5aluNm2aw4gXx1NtZFUxEZRjK46zDXlze3tGTLmLJs+saTBU9xonysBBopYVpVr ywsfPrvFaW6y+sg8LvU34/WBdKL7wigszErJifcWmDOPT1ZI71YpI4uUvzBmv7s9fS3G cJEtWIlcyEzCkcV+n/gPcmFwc8uRrI3MkZLv9WGZ6kDAc6+7GxcO2oKX8rINxOPlPWgn dtew== X-Gm-Message-State: AFqh2kqCium1duXfXCRI+g51CWKuwLyEnaZ4lfdCcU5JnozVaQl6S2PW oXemN50M30G53nThHjuS4Kg0l4PrLOwGu08G X-Google-Smtp-Source: AMrXdXtpjTqsVgmDbd9wpcXzNRulsVI847yEtPPE6cYPNRSh7uZU0VDJ2XEFnhVMj7Gd40uemp7oZA== X-Received: by 2002:a05:600c:c0d:b0:3d9:7667:c0e4 with SMTP id fm13-20020a05600c0c0d00b003d97667c0e4mr50204939wmb.31.1673619102720; Fri, 13 Jan 2023 06:11:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/38] hw/arm/mainstone: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:05 +0000 Message-Id: <20230113141126.535646-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673625460869100003 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-8-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/mainstone.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index f6293c6c13a..eebaed6e3ea 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -12,6 +12,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "hw/arm/pxa.h" @@ -99,19 +100,20 @@ static const struct keymap map[0xE0] =3D { =20 enum mainstone_model_e { mainstone }; =20 -#define MAINSTONE_RAM 0x04000000 -#define MAINSTONE_ROM 0x00800000 -#define MAINSTONE_FLASH 0x02000000 +#define MAINSTONE_RAM_SIZE (64 * MiB) +#define MAINSTONE_ROM_SIZE (8 * MiB) +#define MAINSTONE_FLASH_SIZE (32 * MiB) =20 static struct arm_boot_info mainstone_binfo =3D { .loader_start =3D PXA2XX_SDRAM_BASE, - .ram_size =3D 0x04000000, + .ram_size =3D MAINSTONE_RAM_SIZE, }; =20 +#define FLASH_SECTOR_SIZE (256 * KiB) + static void mainstone_common_init(MachineState *machine, enum mainstone_model_e model, int arm_id) { - uint32_t sector_len =3D 256 * 1024; hwaddr mainstone_flash_base[] =3D { MST_FLASH_0, MST_FLASH_1 }; PXA2xxState *mpu; DeviceState *mst_irq; @@ -121,7 +123,7 @@ static void mainstone_common_init(MachineState *machine, =20 /* Setup CPU & memory */ mpu =3D pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); - memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, + memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM_SIZE, &error_fatal); memory_region_add_subregion(get_system_memory(), 0x00000000, rom); =20 @@ -130,9 +132,9 @@ static void mainstone_common_init(MachineState *machine, dinfo =3D drive_get(IF_PFLASH, 0, i); if (!pflash_cfi01_register(mainstone_flash_base[i], i ? "mainstone.flash1" : "mainstone.fla= sh0", - MAINSTONE_FLASH, + MAINSTONE_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NU= LL, - sector_len, 4, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619713; cv=none; d=zohomail.com; s=zohoarc; b=esO2jmKohux7hsidv37jNBfyCa/ecTDenUkrknEE+wNgNJCP0I6YxcVE2QyzwmJJqoOpf1qddH0hhMjKo9D98carZk6ngybLFRlWyCDv/gig1z1mQOygaKKeNpMauIeE4+wAtnMjzxxyzxZ9khJywiuVUDsC9/MvKqCZ67nTgzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619713; h=Content-Type:Content-Transfer-Encoding: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=8kvFw5OaxUrQIg+Lm57FxJPCYrHar5GDxptYQDtd90o=; b=acQoUtQKYl42xGwmqsNFPcCuqEHsaIDd6dpml7TZd0AQo4AQm+SoNKSOnA9AMWMjR1xWamSJsYFBc44CrWzxjJ5vNuTZ2eyzggINBgBHKpY12MBeGKIe3EoB0G8BSBHhj7dJhsgJLdBkW2j2zh+OaiHxeuANH88RkGC9pfWj1EY= 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+importer2=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 1673619713692202.7171958667118; Fri, 13 Jan 2023 06:21:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnF-0001TW-GO; Fri, 13 Jan 2023 09:12:29 -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 1pGKmk-00012R-BS for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003iJ-8x for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:57 -0500 Received: by mail-wm1-x32e.google.com with SMTP id ja17so15355266wmb.3 for ; Fri, 13 Jan 2023 06:11:44 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:43 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8kvFw5OaxUrQIg+Lm57FxJPCYrHar5GDxptYQDtd90o=; b=fLRZ51g+/LZcdByPJa1+EMN7RrBni5M3j3VCSCvBKpyClpmSFkacPNMhWYe/5yT833 jJzsKk0lnx0t3Gf673814ZZN4KuYnY8HeL6rsv96N7Ovf6G6lPm2UX9j5N7UYLeGcbUH C5+nJOERhrASxgc9Mr5oSv88G9m5CqUKHq8QqugJ3vrvneDc0yJewMMp2yjKEqgzXS46 Xn3A+501OsTWLA8QfapWZNxZk0Ne0uMaBSMP6Xj+aS+5ZSnTmqb3uiPNkKzhCQtkJPJG L2MCeuDUMSXrgjPiJNtBYUdn22zZLH8mloUhinxumlvkgLOLSZTSHU7QGUI96PzvBbiB ZmgA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8kvFw5OaxUrQIg+Lm57FxJPCYrHar5GDxptYQDtd90o=; b=MLz7Ac7d4tL4ELC/7vyPCLxmljfWSiQWdm57qJTiXomPlkZzm2yD0oZn7w3agY0vKq QlL3fgkG6mki6i9QNb+/f/Iojk3liNOQu+/RaW1w+MUZcqSBVucc9sEA4yoG/2kTMdyu C8CNLI1/8uIQv/JCYKuQtS3PyjZoAXkhyaesFMlPpq0RCd4DpFU7D/Nldlmiz1d9GND4 /97fEcTfi6iZaXKTPO7m5wzgLICy69d3ZNZvt2ueVpFXDS2Ng6P0HJwX9m+VzFDl/ADO 7F9YsWdq9AKbAlP0GgVjSguata7JQSGUNsYQuGzPvpa+ROs6tTgsZaoxDGyvIkmOTtWH TFSQ== X-Gm-Message-State: AFqh2kqBP7jYVQY1dckApQbPmGREkieEpCnocn2Oj5rU5Sx9ZeGghah/ g2d7pfaP1+suLZSnieQcsSdxL2zSw8DjiKul X-Google-Smtp-Source: AMrXdXuCCdY/1NCQXQD0Pq8vUzzmcWyH2FcXwzStSa/AWjairpQVHstHoIbLg5HzpjHtmYLT+Ij34Q== X-Received: by 2002:a05:600c:2046:b0:3da:1357:4ca2 with SMTP id p6-20020a05600c204600b003da13574ca2mr5372565wmg.11.1673619103541; Fri, 13 Jan 2023 06:11:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/38] hw/arm/musicpal: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:06 +0000 Message-Id: <20230113141126.535646-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619715430100001 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-9-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/musicpal.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index b65c020115a..73e2b7e4cef 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -10,6 +10,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -1196,6 +1197,8 @@ static const TypeInfo musicpal_key_info =3D { .class_init =3D musicpal_key_class_init, }; =20 +#define FLASH_SECTOR_SIZE (64 * KiB) + static struct arm_boot_info musicpal_binfo =3D { .loader_start =3D 0x0, .board_id =3D 0x20e, @@ -1264,8 +1267,8 @@ static void musicpal_init(MachineState *machine) BlockBackend *blk =3D blk_by_legacy_dinfo(dinfo); =20 flash_size =3D blk_getlength(blk); - if (flash_size !=3D 8*1024*1024 && flash_size !=3D 16*1024*1024 && - flash_size !=3D 32*1024*1024) { + if (flash_size !=3D 8 * MiB && flash_size !=3D 16 * MiB && + flash_size !=3D 32 * MiB) { error_report("Invalid flash image size"); exit(1); } @@ -1277,7 +1280,7 @@ static void musicpal_init(MachineState *machine) */ pflash_cfi02_register(0x100000000ULL - MP_FLASH_SIZE_MAX, "musicpal.flash", flash_size, - blk, 0x10000, + blk, FLASH_SECTOR_SIZE, MP_FLASH_SIZE_MAX / flash_size, 2, 0x00BF, 0x236D, 0x0000, 0x0000, 0x5555, 0x2AAA, 0); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620340; cv=none; d=zohomail.com; s=zohoarc; b=aawh9OzAUtAQ8EESDZuNWGghiSOKGBounXjRVv/tEmUD9MnLpw2Kc4WmOw3gXEHDJrC1OdsTDnb1WkpeDVOCnKxjqa7Quehl8pVmHaGzfdh62Iu4nRuzQjV6U9etFKX+shRje6Qta43ErJMIZ+VbddTPszqsDqhbDPPSwISIOoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620340; h=Content-Type:Content-Transfer-Encoding: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=qagczbKQoz2kyzFacEZPcoKe04O1uSO7YS9E6eFyDqU=; b=kEum4ICEk/k8xTXq8spPtH8w1V93xxDLxsPafIbxsMU74kgFwHd9a8Eq0BYfmUIymTfqaUse0bH+rdsRa/mHD75Um9DFdkFt3HNo0e9vwQ1anZdmQWJApc57/kk4oJa4juGPTNUhdVCv9zrTGtEvUF22FVyKCjVKhfScThVyrkA= 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+importer2=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 1673620340690782.461832472482; Fri, 13 Jan 2023 06:32:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnH-0001UQ-7h; Fri, 13 Jan 2023 09:12: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 1pGKmo-00014p-19 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:02 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003iZ-9P for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:01 -0500 Received: by mail-wm1-x32f.google.com with SMTP id ja17so15355290wmb.3 for ; Fri, 13 Jan 2023 06:11:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:43 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qagczbKQoz2kyzFacEZPcoKe04O1uSO7YS9E6eFyDqU=; b=lGcAbTiyhaDcqrZCChpWZdNsWNMdNT+RfZ4/Fu0GyB4xxZUeqI30dODYc2UsJGRWHF DGPB30CS/rofny2TS5+BNK2pha81Qt1K9+MP2lbYIXcKP7WK9QWBkPLDT/gFTIQCnNZ1 AjbL6mujOjlGHGjCBTtSHTgfeFYhfnnSgI6gwDxWdtAzk97pXRlYsuLWvxIDuywJ1Qee ghK8+Oamj75R3Wo4vf3RshdSSroG82gGunt50TVu342pGgkreSAoIKOAerr82if+Jgtm sNv1Msn8+7mmy1I5wbVqVYM9iE4dzMCpBdy5kkD+keqGTtF9uSYEUxPvDCVH4qdzGBP3 p8GQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qagczbKQoz2kyzFacEZPcoKe04O1uSO7YS9E6eFyDqU=; b=7BCnZz5guj5+0px6d1l9Z4BQU5j76SvOONAiEuZFZ6jfnNhgM4LKWq2U3iiJ/bfAVi fATNFyd9VMHlTH9f/UHSPABxLV+T4Cc2HAogl99MgEiI3eXJq/j/0OWqRNACbndSeHPV f7sMhgjAl/F8ZUzLySc9flG4jxj7HxdMMqRvObQNN1AyqmfOE1/rKoWIAxpcl8es41HD MZp3F1OQr5XKGeWMbXjNZ/mLXd0Xgmrzp+rF3BzfYOoFpbo9BfFJ4fYxFqg68nVFXxAW k+ah4PKJ+AD6QAO2D5c/zWeMG8OuJy4RVDvRr5/VvM3UjNl2wMxq/Ppp8M6HelN/QYoq O6VA== X-Gm-Message-State: AFqh2kqcOqS0CGzo/jyZfGCK85duMMLJZz/hZirZF8jt8s2HtnwLPMEH d934bP35t0AuAemK3i0NBuSXVRK0p5jJaaE4 X-Google-Smtp-Source: AMrXdXuQADKajZ2MtxQlc6Hr9EPPwbFLwGSycMd9u4PZEDwRjwP8F+M8AOVcCfuRBXo+Sx8YnT2TWQ== X-Received: by 2002:a05:600c:a4f:b0:3d2:196c:270c with SMTP id c15-20020a05600c0a4f00b003d2196c270cmr61209899wmq.31.1673619104503; Fri, 13 Jan 2023 06:11:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/38] hw/arm/omap_sx1: Remove unused 'total_ram' definitions Date: Fri, 13 Jan 2023 14:11:07 +0000 Message-Id: <20230113141126.535646-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620341928100003 From: Philippe Mathieu-Daud=C3=A9 The total_ram_v1/total_ram_v2 definitions were never used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-10-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/omap_sx1.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 57829b37441..84b7059f7c7 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -91,8 +91,6 @@ static const MemoryRegionOps static_ops =3D { #define flash0_size (16 * 1024 * 1024) #define flash1_size ( 8 * 1024 * 1024) #define flash2_size (32 * 1024 * 1024) -#define total_ram_v1 (sdram_size + flash0_size + flash1_size + OMAP15XX_SR= AM_SIZE) -#define total_ram_v2 (sdram_size + flash2_size + OMAP15XX_SRAM_SIZE) =20 static struct arm_boot_info sx1_binfo =3D { .loader_start =3D OMAP_EMIFF_BASE, --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673625908; cv=none; d=zohomail.com; s=zohoarc; b=DUXbur248/D7T50UChjpCEVOStPp+ch1tIwm8UPpJyMKqbQE9YbKFSRTPTwjUoO8OpuJlep9bAYpequnmPBJF6GKnWK7nnswOlTup6X4X2G76ksLIRdWTGDM34aVqwfaFCAIY5rDKg+QUcFaIkRs+5/Qvv7Pp5LSNINfhtMl9Kg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673625908; h=Content-Type:Content-Transfer-Encoding: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=rCt8gM/FZTQl9skse/4Zewww4A5PzU/1oOkoyZpsiGs=; b=NcJXrigRIW3jEdO1MlmU+CI6hfx93xaa0uPDq5ocXXC/TuF6FT273qPY9fXUQQ0NpcCUTMlkyAhe8rxg4XCJgOzec3o4KwJhfrCbf+MuPRzh59yolvh9iSStd/izEauxZa7cq84el1qogNJDx7cyLQZ+S1GjdBp5pldubXyDvMI= 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+importer2=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 1673625908192935.3171844107737; Fri, 13 Jan 2023 08:05:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnK-0001Yw-IK; Fri, 13 Jan 2023 09:12:34 -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 1pGKmn-00014P-CX for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:01 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003jU-3R for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:01 -0500 Received: by mail-wm1-x332.google.com with SMTP id m26-20020a05600c3b1a00b003d9811fcaafso17439409wms.5 for ; Fri, 13 Jan 2023 06:11:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:44 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rCt8gM/FZTQl9skse/4Zewww4A5PzU/1oOkoyZpsiGs=; b=dG47+urY37gTtaWGWAT3Trg2HAE/1c84/I1iKg0uUM4YtB4ksXfov/4b8vzMfr7IEg +4m1vzLH4VyiOIhu/GkvMTm8cBrjdeqrtL22LNVphIKgYwkIuYP7FlBt0Do5b5j+jLsV zLtExJWqR6qpb5xzpyjBvUMeoNBs5xkmJKewMOiqIjgqywM0LntSSa5PcfwUq0oeDkI3 q/r7dSLrxYKLlzHX/zhvy1U5w/p5WLah7HB4ZCl7UhfNz+u8s38HSsiYSER9L6pUcxzC eo2JW/GhUWlZZjUeNQ1AibqlzrKXlFYntorh3wzo12oJ0Ox00kIIaEuZosGFxcWEEavN I7GA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rCt8gM/FZTQl9skse/4Zewww4A5PzU/1oOkoyZpsiGs=; b=gv4WxamOvAG9MZ4NfRbbLaF/L2mfXA25TXmYkZCMydRD9pODLq6qBEBqrWXM49UlME rRUOE/ikklQ5bFX35gRCbOErCONgePKncS+ag15yaY2JghYUkaiv3wb390ryvn63IhiQ YO/opPZAyVu6pvg9oF2PDBpDEkLNoF9XSLIDYFQjAXR2rQ4KUDDFQgLmWRnfTxq7UtyG +b374tA76O9inqXv+hmhp7xH3alTD/i6x8Lma6NW2ndMFgEplJu1Zq7bSaQ0OI3O3odN JI/1iJUnL/1kF2iF1bmFjqyHbJwg/VEtjmTZG70qSFV5r3Qz/xUvAfaJm34n4iSwMHwS uQzA== X-Gm-Message-State: AFqh2krerZj2GB3xxEYZs5e1JnINHOytvODezJXACiiCAwznTNrnhzYV rz0uZ0sW49HrB6PTNz+ZMhCVqP3ye7ac2dP9 X-Google-Smtp-Source: AMrXdXulu5DjVxsU4GECU9/BhraqTKGlWN3a0hUUFWR81rvzna+hJFAAjrSCCg/Pa1WLFX9FnM2+Zg== X-Received: by 2002:a05:600c:42d5:b0:3d6:e790:c9a0 with SMTP id j21-20020a05600c42d500b003d6e790c9a0mr69157868wme.10.1673619105289; Fri, 13 Jan 2023 06:11:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/38] hw/arm/omap_sx1: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:08 +0000 Message-Id: <20230113141126.535646-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673625909872100001 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-11-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/omap_sx1.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 84b7059f7c7..d1b0ec3264e 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -26,6 +26,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "ui/console.h" #include "hw/arm/omap.h" @@ -86,15 +87,15 @@ static const MemoryRegionOps static_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -#define sdram_size 0x02000000 -#define sector_size (128 * 1024) -#define flash0_size (16 * 1024 * 1024) -#define flash1_size ( 8 * 1024 * 1024) -#define flash2_size (32 * 1024 * 1024) +#define SDRAM_SIZE (32 * MiB) +#define SECTOR_SIZE (128 * KiB) +#define FLASH0_SIZE (16 * MiB) +#define FLASH1_SIZE (8 * MiB) +#define FLASH2_SIZE (32 * MiB) =20 static struct arm_boot_info sx1_binfo =3D { .loader_start =3D OMAP_EMIFF_BASE, - .ram_size =3D sdram_size, + .ram_size =3D SDRAM_SIZE, .board_id =3D 0x265, }; =20 @@ -111,7 +112,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) static uint32_t cs3val =3D 0x00001139; DriveInfo *dinfo; int fl_idx; - uint32_t flash_size =3D flash0_size; + uint32_t flash_size =3D FLASH0_SIZE; =20 if (machine->ram_size !=3D mc->default_ram_size) { char *sz =3D size_to_str(mc->default_ram_size); @@ -121,7 +122,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) } =20 if (version =3D=3D 2) { - flash_size =3D flash2_size; + flash_size =3D FLASH2_SIZE; } =20 memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, machine->r= am); @@ -154,7 +155,7 @@ static void sx1_init(MachineState *machine, const int v= ersion) if (!pflash_cfi01_register(OMAP_CS0_BASE, "omap_sx1.flash0-1", flash_size, blk_by_legacy_dinfo(dinfo), - sector_size, 4, 0, 0, 0, 0, 0)) { + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { fprintf(stderr, "qemu: Error registering flash memory %d.\n", fl_idx); } @@ -165,18 +166,18 @@ static void sx1_init(MachineState *machine, const int= version) (dinfo =3D drive_get(IF_PFLASH, 0, fl_idx)) !=3D NULL) { MemoryRegion *flash_1 =3D g_new(MemoryRegion, 1); memory_region_init_rom(flash_1, NULL, "omap_sx1.flash1-0", - flash1_size, &error_fatal); + FLASH1_SIZE, &error_fatal); memory_region_add_subregion(address_space, OMAP_CS1_BASE, flash_1); =20 memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, - "sx1.cs1", OMAP_CS1_SIZE - flash1_size); + "sx1.cs1", OMAP_CS1_SIZE - FLASH1_SIZE); memory_region_add_subregion(address_space, - OMAP_CS1_BASE + flash1_size, &cs[1]); + OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); =20 if (!pflash_cfi01_register(OMAP_CS1_BASE, - "omap_sx1.flash1-1", flash1_size, + "omap_sx1.flash1-1", FLASH1_SIZE, blk_by_legacy_dinfo(dinfo), - sector_size, 4, 0, 0, 0, 0, 0)) { + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { fprintf(stderr, "qemu: Error registering flash memory %d.\n", fl_idx); } @@ -218,7 +219,7 @@ static void sx1_machine_v2_class_init(ObjectClass *oc, = void *data) mc->init =3D sx1_init_v2; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size =3D sdram_size; + mc->default_ram_size =3D SDRAM_SIZE; mc->default_ram_id =3D "omap1.dram"; } =20 @@ -236,7 +237,7 @@ static void sx1_machine_v1_class_init(ObjectClass *oc, = void *data) mc->init =3D sx1_init_v1; mc->ignore_memory_transaction_failures =3D true; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("ti925t"); - mc->default_ram_size =3D sdram_size; + mc->default_ram_size =3D SDRAM_SIZE; mc->default_ram_id =3D "omap1.dram"; } =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673630345; cv=none; d=zohomail.com; s=zohoarc; b=myaUNDHlEyC/eLvSKsfPzE8nreTPJ8zMzWgGDUVWInkQFT4VEsTXy4QxmRcGJeIfvjBTwzJUQORW3tEtVNIo+EM0TLJa/K1EsWmg+S1f9Z7e3z5eo0ZdpQl4M2FiSd7Ej+9SREm4XyLbLLYHYvbhriO9kEsv462MpQlxyVJTpko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673630345; h=Content-Type:Content-Transfer-Encoding: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=Dxp2wfE0pKqPXsVGcWtOJq7QnhlLWskLKJj95GnQE+8=; b=GZjCd611EIXRNqbPFl/wL6WZYEdXV/oCucdxMux1tOs8NTePNwRAnip1IwX2FNN6VtcOpt4c3s8VLxR2k/MW1xL/cFrPIeIkFl9nSuX51IyYEJz+WX7IyR0GsQWaINqUYofCH7YttKKTJZP6cf9rgSOWugUvQB3M6buR7oUrw60= 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+importer2=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 SMTP id 1673630345163722.0287808254027; Fri, 13 Jan 2023 09:19:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmp-000153-RB; Fri, 13 Jan 2023 09:12:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKmk-00012S-Bt for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003f4-8k for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:57 -0500 Received: by mail-wm1-x32b.google.com with SMTP id m8-20020a05600c3b0800b003d96f801c48so18857810wms.0 for ; Fri, 13 Jan 2023 06:11:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:45 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Dxp2wfE0pKqPXsVGcWtOJq7QnhlLWskLKJj95GnQE+8=; b=diKGLz8vmUGTJtNRDLua+u96cWJZN1B05xT9S1CJMdJsm1HjNeA5gUKQcIfN7TsvLs hfQfQpG2KfOD2mc4uAevCk5iOReEk+2m/y5XfhmNvbxvbpfxTCE9xWM4CZRjGe9JIP69 GfA/NX+3Cy+4FGAiYfikngFqXpq22ceZlipM2Yv4fbc4+xKS1Vm2h3FHE8BqLBg411mp Ooq+W3oTwxJonTo9DYz3BvITaZsqRZT5XW6kbvSUivnCNMpvveduUiY4ApJEBJgnEhlm zhDW7lS4MDIXNDQD6D8zn/h51MtVy7hK+POqTPm353l6DBLS03FYgeRysHtqW89cGoNV F1uA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dxp2wfE0pKqPXsVGcWtOJq7QnhlLWskLKJj95GnQE+8=; b=NS1WHTXXwhzUnd6h5C/jSwbNX59c6o7G8bmP9M2gofgNBWDg/XFThy2acYHno0Sh3B AIg8amqSJmX1H7lZnAIA9pKwALofML86+Ex8VtS0Q2ptcWifLpXxpbPQK70YALCToF46 nD5UaNYWnffNTr1fhmflNsVvK3sowLpmz0jtOkgGJ5ROaoZ/sIYaSBzrG3KPGBYXxXk1 IU7j29cMmtSKnL5P8b6Q1/5MxHIw/5x8j75bE8OquMZiYD1Gn5V2+EcEjiRToogF8FU1 2ZffJJJViiSU8GV1YNv4l0+L9jAGALWVPdtaqLsOX8d/JNNrjLzsLF3IIbPI0WC9Zpr1 tO2g== X-Gm-Message-State: AFqh2koxmkG+wLqd1tc+9KF6/aJYf5Jd/3w34e+RlWEGLqthvfL63ynE RcH1DLwqCIgVMwBQdneNE4BSRQDWyj5ML0ZL X-Google-Smtp-Source: AMrXdXuK6Q56YYn0uP+Zuik4J3q9gSaY7rg5i2rg10Oq56S+YK535FGmPYLCJ2Uc4rV7COemoJO0hw== X-Received: by 2002:a05:600c:4f93:b0:3d9:e5f9:984c with SMTP id n19-20020a05600c4f9300b003d9e5f9984cmr17120423wmq.2.1673619106170; Fri, 13 Jan 2023 06:11:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/38] hw/arm/z2: Use the IEC binary prefix definitions Date: Fri, 13 Jan 2023 14:11:09 +0000 Message-Id: <20230113141126.535646-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673630346504100001 From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Add the FLASH_SECTOR_SIZE definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-12-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/z2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 8eb6f495bc9..839be3ca169 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -12,6 +12,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "hw/arm/pxa.h" #include "hw/arm/boot.h" #include "hw/i2c/i2c.h" @@ -297,9 +298,10 @@ static const TypeInfo aer915_info =3D { .class_init =3D aer915_class_init, }; =20 +#define FLASH_SECTOR_SIZE (64 * KiB) + static void z2_init(MachineState *machine) { - uint32_t sector_len =3D 0x10000; PXA2xxState *mpu; DriveInfo *dinfo; void *z2_lcd; @@ -312,7 +314,7 @@ static void z2_init(MachineState *machine) dinfo =3D drive_get(IF_PFLASH, 0, 0); if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 4, 0, 0, 0, 0, 0)) { + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { error_report("Error registering flash memory"); exit(1); } --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620752; cv=none; d=zohomail.com; s=zohoarc; b=l+1Z3lDZESDWXHan7q202vgI2/4Z0xer2lvWPgp/0F0TKjxZiPvwMRvsSWcXRZ5/UhpK/ecUTqS3qlYDYvN6hJwmDJ01Q9L7FNzvdsr4VopWyuo9vZ1/BaZ/k1ePXNHtKIeja2MPh1XV6Kfg+JVNJX6LIByaPj/1qlGNTnl0txk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620752; h=Content-Type:Content-Transfer-Encoding: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=EM2/m4aIPwCcmm0UYVNBr9Hej5isozR7WVzOBPfC9wI=; b=exOCO8q8/4tiXTam/XrK5gHRudPVwxXIUTAr2QAkDJwWFiYEfP+yw49FOhUGpUlDC1aLorl+zM2KHCKtZAW1uSGGMmnC759jKkwUHDhn9d0sXBsMpuqUxtoO9KsUZ5gyXxpGBoqNl1ZMGVNNWOCY9jSy5kTIiUauoJ6xAo7sraU= 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+importer2=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 1673620752809649.0385293655506; Fri, 13 Jan 2023 06:39:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnM-0001ag-6j; Fri, 13 Jan 2023 09:12:36 -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 1pGKmo-00015F-PA for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:03 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003eW-PO for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id j16-20020a05600c1c1000b003d9ef8c274bso13090319wms.0 for ; Fri, 13 Jan 2023 06:11:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:46 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EM2/m4aIPwCcmm0UYVNBr9Hej5isozR7WVzOBPfC9wI=; b=LBg6gZn55+EvOJL1EoQ3EsACxPVjYiJHBCTPiSYNnpQHlxes+yoDle+bAuFbCEHPmo xKhDsvO5xyvBUVf95eigAOsy60eszPyh3fRab8GCkNlzXHjuS7+lqVBd9xdQ4GEZVRkY OJheL76CWXsYmfEa+95u8X3ApvYTitZJ5tqvOvYFLFDPyf5QIdxm7/P0kfEBcVut9pNm 4hve5HEHiIDfvYFfyXmbvNd71K0SogmBKTNlwUsRcYfJikt/C4XsLsexBwh+KpLsBelN KCyuuStoe3taoTpVXah7cPlnhdyLYvWJvnmvjnuPFLp3Y+HGgEDp5eVY3DAJjvu7gNvC NuFw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EM2/m4aIPwCcmm0UYVNBr9Hej5isozR7WVzOBPfC9wI=; b=B2byQ25JocSEi0zgs4Jn67MPMVPPYzc4c5Eyy+a1jtyfTiMze8HdwfEnLMPgznTCm9 vNXhHo/iTJgPprDdj+tFbvMfBtD1joWwPvBpK9+I0rI3TO8PwUhTbUYMwh49kaucJLPK Go03y6fUZsB3XlT9x54TMl/vkQkiORm2C5TAU1zYbPMDoGbXZTw4XqWCQ514SAQd0ICa dEsKZufyAeE00pqC0cpFIketKZpmKzR5wG+6Ky3Fv/OXH951jV/VhIXxRx97sakDH2t9 RQeBH9xpysRpZUda7notNC1t6WcafFNh5MNwPIzlHx2rkOY9m1tWwD/dEpTE/WzKlZPC 4xnw== X-Gm-Message-State: AFqh2koPgdrdh6WVUvMKOFPTv1LyOs2HINEONAwLmZqqk+FItwTysc3u Skj7Jgj/t8RLHm5icknjuVZpoBCVCS+/COuM X-Google-Smtp-Source: AMrXdXsbl8t/YX4i3hSQkAVeWhvgK5bc8WsEzq6kvNDkOFGtUCYXxu+euAlJDrnY43J4k70g0K+YdQ== X-Received: by 2002:a1c:4b04:0:b0:3c6:f0b8:74e6 with SMTP id y4-20020a1c4b04000000b003c6f0b874e6mr59734125wma.4.1673619106968; Fri, 13 Jan 2023 06:11:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/38] hw/arm/vexpress: Remove dead code in vexpress_common_init() Date: Fri, 13 Jan 2023 14:11:10 +0000 Message-Id: <20230113141126.535646-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620754352100001 From: Philippe Mathieu-Daud=C3=A9 Upon introduction in commit b8433303fb ("Set proper device-width for vexpress flash"), ve_pflash_cfi01_register() was calling qdev_init_nofail() which can not fail. This call was later converted with a script to use &error_fatal, still unable to fail. Remove the unreachable code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-13-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/vexpress.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e1d1983ae65..757236767b0 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -659,10 +659,6 @@ static void vexpress_common_init(MachineState *machine) dinfo =3D drive_get(IF_PFLASH, 0, 0); pflash0 =3D ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flas= h0", dinfo); - if (!pflash0) { - error_report("vexpress: error registering flash 0"); - exit(1); - } =20 if (map[VE_NORFLASHALIAS] !=3D -1) { /* Map flash 0 as an alias into low memory */ @@ -673,11 +669,7 @@ static void vexpress_common_init(MachineState *machine) } =20 dinfo =3D drive_get(IF_PFLASH, 0, 1); - if (!ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", - dinfo)) { - error_report("vexpress: error registering flash 1"); - exit(1); - } + ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", dinfo); =20 sram_size =3D 0x2000000; memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size, --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622180; cv=none; d=zohomail.com; s=zohoarc; b=YkRPCgTvd/yjRISi/2l/gU4sUQhiNbiGc4IoMNhmpCP4nT9BK5rTYlwf1C+pfAQeWyGJ8cLt0+7ZfBpkZkEDNK/u7CX/RADI/grvLe3p3FzatKsYBK87Fn6o1g1PcT8DjgzBorXQT0rcSKtrmYY3JdlWDjAoFWWnVjpW9mrQLok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622180; h=Content-Type:Content-Transfer-Encoding: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=JHSt7/WOQwiLTuQ6eeYq7HrmU1hC/3lzuHdwebI3rPk=; b=NVB0fNV5FgFBm8S/7dJNeyll79/EKec91hdKBKU22mDvcIgN5XP8lqbhnCw/gpa6DDh7EfuZg20qdWXH6u1U7zjcb/EMEr0X1XtKAJ8xSTJPTIVnXF4t3v5nC7HYPj1V1iggWxAnSLWLzwjwi3JQ/9IjDUnUDnKXPxeZl5nSQYY= 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+importer2=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 167362218041250.04971715083161; Fri, 13 Jan 2023 07:03:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnH-0001Ub-Ng; Fri, 13 Jan 2023 09:12: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 1pGKmk-000124-5o for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmh-0003lK-8V for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:57 -0500 Received: by mail-wm1-x331.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so17449676wms.4 for ; Fri, 13 Jan 2023 06:11:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:47 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JHSt7/WOQwiLTuQ6eeYq7HrmU1hC/3lzuHdwebI3rPk=; b=YvTfNM7eh8lMuzV66tOmUoBV0bppearxC3SVdvgBt7YrWo0V7HRca5tEmwfKSQW09o IT57J7jONLzbSGXAB8IGJtBxpRcLRs20gFPdN14MdapY2llghKmxYB4FGbp+iqHCqTZb GjASl6r3l3wol+xhr3X2+hr+6R4wgdYCumttgGcrHRsxVrzbH5mOjazUSFPTSzhP2B/V l3kzmKJAN8npHaD6Og+V/ZiYCOd8wAhjK7eWtQV8jf8tSmMegXvs2WNn83xDzAp7gaz7 m/46us4u3BtmVliigh2hEQqNCXmfTyHQVpgqbUi6edPp9uV0gBSOP1nBwp1nS7TVmRoE 1Y5w== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JHSt7/WOQwiLTuQ6eeYq7HrmU1hC/3lzuHdwebI3rPk=; b=7+BiTPHifPgOFXATPgsvrMMbbF+EaejrzB3noquNv3d69+9M3h4TqZ5Vd9Gq17gFCS +cYI6+HXFgC84sqpsCG3pghNe4elt6pPp7A4L3ukG8MbteCi3QPiWxK9AnooBYbLhjUn ftvTAhz8cG256REOYQpaWI372wDI6MY/8c1huZ9UA+wRSWgQ3Fprsy+Finzp6gXPz5+x M0A91Mm4EmbZggC1k7/HEEIrlqqzhGYhONOat8CaDQQf/EeeXbNT8pPNz5vf73uGmOFW zUTOEYuGSrZjyFlIgw0Tz0Y2Lj/58ml2vWypHiIjY1KhfjWiGVekthupKSk4AYshhPOs gQIg== X-Gm-Message-State: AFqh2kp45GkFxiaHQEc/TgS9/VXOaZE++rOUZhdaR7Vo2xGuSosLVTdD bZ2CGseQdXQOR7OlyfRovuzwm3XZvKCpki8+ X-Google-Smtp-Source: AMrXdXu0EBycHv+efBeiHFUSdAsocjUB6ZxzxlRDQa2Jx1QQAE6m6H/ZRUHlZ0iM08pNpxc7YwEECg== X-Received: by 2002:a05:600c:250:b0:3d2:2043:9cbf with SMTP id 16-20020a05600c025000b003d220439cbfmr57230338wmj.10.1673619107714; Fri, 13 Jan 2023 06:11:47 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/38] hw/arm: Remove unreachable code calling pflash_cfi01_register() Date: Fri, 13 Jan 2023 14:11:11 +0000 Message-Id: <20230113141126.535646-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622181463100001 From: Philippe Mathieu-Daud=C3=A9 Since its QOM'ification in commit 368a354f02 ("pflash_cfi0x: QOMified") the pflash_cfi01_register() function does not fail. This call was later converted with a script to use &error_fatal, still unable to fail. Remove the unreachable code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109115316.2235-14-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/gumstix.c | 18 ++++++------------ hw/arm/mainstone.c | 13 +++++-------- hw/arm/omap_sx1.c | 22 ++++++++-------------- hw/arm/versatilepb.c | 6 ++---- hw/arm/z2.c | 9 +++------ 5 files changed, 24 insertions(+), 44 deletions(-) diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index 579d3635774..2ca4140c9fc 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -69,12 +69,9 @@ static void connex_init(MachineState *machine) } =20 /* Numonyx RC28F128J3F75 */ - if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZ= E, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); =20 /* Interrupt line of NIC is connected to GPIO line 36 */ smc91c111_init(&nd_table[0], 0x04000300, @@ -96,12 +93,9 @@ static void verdex_init(MachineState *machine) } =20 /* Micron RC28F256P30TFA */ - if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); =20 /* Interrupt line of NIC is connected to GPIO line 99 */ smc91c111_init(&nd_table[0], 0x04000300, diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index eebaed6e3ea..68329c46178 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -130,14 +130,11 @@ static void mainstone_common_init(MachineState *machi= ne, /* There are two 32MiB flash devices on the board */ for (i =3D 0; i < 2; i ++) { dinfo =3D drive_get(IF_PFLASH, 0, i); - if (!pflash_cfi01_register(mainstone_flash_base[i], - i ? "mainstone.flash1" : "mainstone.fla= sh0", - MAINSTONE_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NU= LL, - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(mainstone_flash_base[i], + i ? "mainstone.flash1" : "mainstone.flash0", + MAINSTONE_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); } =20 mst_irq =3D sysbus_create_simple("mainstone-fpga", MST_FPGA_PHYS, diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index d1b0ec3264e..1d156bc3441 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -152,13 +152,10 @@ static void sx1_init(MachineState *machine, const int= version) =20 fl_idx =3D 0; if ((dinfo =3D drive_get(IF_PFLASH, 0, fl_idx)) !=3D NULL) { - if (!pflash_cfi01_register(OMAP_CS0_BASE, - "omap_sx1.flash0-1", flash_size, - blk_by_legacy_dinfo(dinfo), - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", - fl_idx); - } + pflash_cfi01_register(OMAP_CS0_BASE, + "omap_sx1.flash0-1", flash_size, + blk_by_legacy_dinfo(dinfo), + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); fl_idx++; } =20 @@ -174,13 +171,10 @@ static void sx1_init(MachineState *machine, const int= version) memory_region_add_subregion(address_space, OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); =20 - if (!pflash_cfi01_register(OMAP_CS1_BASE, - "omap_sx1.flash1-1", FLASH1_SIZE, - blk_by_legacy_dinfo(dinfo), - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", - fl_idx); - } + pflash_cfi01_register(OMAP_CS1_BASE, + "omap_sx1.flash1-1", FLASH1_SIZE, + blk_by_legacy_dinfo(dinfo), + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); fl_idx++; } else { memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index ecc1f6cf74f..43172d72ea4 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -385,13 +385,11 @@ static void versatile_init(MachineState *machine, int= board_id) /* 0x34000000 NOR Flash */ =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", + pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", VERSATILE_FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, VERSATILE_FLASH_SECT_SIZE, - 4, 0x0089, 0x0018, 0x0000, 0x0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); - } + 4, 0x0089, 0x0018, 0x0000, 0x0, 0); =20 versatile_binfo.ram_size =3D machine->ram_size; versatile_binfo.board_id =3D board_id; diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 839be3ca169..dc25304290a 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -312,12 +312,9 @@ static void z2_init(MachineState *machine) mpu =3D pxa270_init(z2_binfo.ram_size, machine->cpu_type); =20 dinfo =3D drive_get(IF_PFLASH, 0, 0); - if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { - error_report("Error registering flash memory"); - exit(1); - } + pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); =20 /* setup keypad */ pxa27x_register_keypad(mpu->kp, map, 0x100); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673623434; cv=none; d=zohomail.com; s=zohoarc; b=i2CRhJAdnF+ntWwCKvDiiDw3A0pYXAJ2kP2v4KE0zxkh0CU3sSYIiQCcLllAPqcDMkht0sfy+wN3PiskunBGdbUFjEQxU3R8JP9KeyMj7JXssfVTN/KDm/ZNVCbRZStnjjd6T2k8eulYo5j59A+qKwr+DH974r+VijfRTV59usE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673623434; h=Content-Type:Content-Transfer-Encoding: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=q7Emin5LoBOaXo/950Rc6TydbfuLbLjEQel5QAMzT6A=; b=JxhRPgXdfQfXxuRFDBOOK1vAkGIyKxRSTLhQK259aXg7hoQJiWX1YoBKvPxI9YdGjb2qn8GH6xmN9+co0/roqIDZQSe9lvg/EDwHH96Wp5Cr0QfNhkEtDY3MsahGomqulySOByFk9m6Lmlalxo6jtmmS6UpAFgwnul5+umkLfKs= 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+importer2=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 SMTP id 1673623434580436.17264367405437; Fri, 13 Jan 2023 07:23:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnI-0001VP-HU; Fri, 13 Jan 2023 09:12:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKml-00012r-LR for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003ev-90 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: by mail-wm1-x32b.google.com with SMTP id o15so15343644wmr.4 for ; Fri, 13 Jan 2023 06:11:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:48 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=q7Emin5LoBOaXo/950Rc6TydbfuLbLjEQel5QAMzT6A=; b=mEuXM2hct2dEW5utDYoRtPTqEuWsT9sH9phsJtBzs8FLdQPs8kzWwMw5jF2SmZBydW M86ZBxCMUW/KaJjAsXL0wNe7WiasEqfGnOMsJjXlU42/n9THAFhfjVi4nJntWXfFXUMD 6h0Tmwq78oneu4elrTu1atiQQ8qhOOGgjzIhAefXLL2fC/NnI2JyjWHi/tC33UrNPQy1 hDOErl6BzHJ1TUBm7IhQJMnZdRsg+ihd0fIZBAG/CiKS3w4TG+NtbEiO2CoeFdYoKOSz rhLC/2CH6aI6rUs/IlHjR3MDz1fQhHS/nT2hfnFxP00SXId260NmW1Vcl6rkd1pOMTs0 EeiA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q7Emin5LoBOaXo/950Rc6TydbfuLbLjEQel5QAMzT6A=; b=tSAH3WgqpJTXUwh5EimMUEXpa68FbdHZCMMXYf2i2qDiMsZ1yMy65zbZS6hnWAm/dr 6HlCAznmzvouD8z6PO9DBpE3zfcDbU51KkGilW7FiC5mCZDt4ucaw3+Kotroas8bwCul jtHpW9JNYtxg4oj0Sa6gPxMHFVw1JyPV+S6mCvk3/mbEexOpXptB7kHdcXqrtQScO5x2 aGZUHs+oDhtwmKm/0Av+IDYe/ik2dvFIa1TJ4UoJAHTdE/odBW3y3tkhul2YDD2HUyYu CUdiOqlPENVhUtshObZ16GnsM2qIhdQe0r2U+eCC0+erNp3JoWP4htyxEhzDPC7+ib04 dv/w== X-Gm-Message-State: AFqh2kql9fBAFQRcb8++y5zr64VwNA2J5nFKg7c9854aFCbt776LEtZZ U2oC4IMaxIebaN7S3b54EPd/BRnjgxvL41dy X-Google-Smtp-Source: AMrXdXvVsa63hYOMfyDyHTafy/qickl3yWGdGJ7cJ3J36mOH2P8B4kARThNDkp6ky6qQSn1g7+aLRg== X-Received: by 2002:a1c:6a16:0:b0:3c6:f732:bf6f with SMTP id f22-20020a1c6a16000000b003c6f732bf6fmr58470016wmc.13.1673619108534; Fri, 13 Jan 2023 06:11:48 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/38] hw/arm/pxa: Avoid forward-declaring PXA2xxI2CState Date: Fri, 13 Jan 2023 14:11:12 +0000 Message-Id: <20230113141126.535646-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673623434970100001 From: Philippe Mathieu-Daud=C3=A9 To avoid forward-declaring PXA2xxI2CState, declare PXA2XX_I2C before its use in pxa2xx_i2c_init() prototype. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-2-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/pxa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index ba8f49e48ed..54eb895e42a 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -119,14 +119,14 @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, const struct keymap *map, int size); =20 /* pxa2xx.c */ -typedef struct PXA2xxI2CState PXA2xxI2CState; +#define TYPE_PXA2XX_I2C "pxa2xx_i2c" +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) + PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, qemu_irq irq, uint32_t page_size); I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s); =20 -#define TYPE_PXA2XX_I2C "pxa2xx_i2c" typedef struct PXA2xxI2SState PXA2xxI2SState; -OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) =20 #define TYPE_PXA2XX_FIR "pxa2xx-fir" OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxFIrState, PXA2XX_FIR) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620272; cv=none; d=zohomail.com; s=zohoarc; b=N6dv2fchhquHv9aEfVY3ArhZkFPpoG3S6Bjr+/OslFIYZ9sCFX3YtGoAfkjMnVL3+1boKWWJ7kMc6krSXN/cUy0PPAU/Pb4Dn+r4Q54lXltUSDkoAfBTBU/KKa3VfYrJzy/Zy6JOwHlF2RklEYopkcUqkMqopLBRUF8jjGkNLyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620272; h=Content-Type:Content-Transfer-Encoding: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=FAbaJSh5m/RbxwmToLtNlRWjUwZqE/zfDC3TWOgg/dY=; b=RpdF8yM3YVMNp7pIuerMog5VJKt60adWIbzHXC15JbN+QuHHOIsdgcl6BGSW0bJBbKuFoaMlo4PQu6lkb7C0BLV4Iw7cMrk3FDDOyIjKQZjlQtMxlXtDuwIx3HxhFHWn9UaMyQv/embtdTlg3qia+nhBIPFgh0Hx1REB6q/gdbg= 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+importer2=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 1673620272397578.6369928687793; Fri, 13 Jan 2023 06:31:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmv-00017B-Ew; Fri, 13 Jan 2023 09:12:10 -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 1pGKmn-00014F-13 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:01 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003nJ-3j for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:00 -0500 Received: by mail-wm1-x332.google.com with SMTP id o15so15343667wmr.4 for ; Fri, 13 Jan 2023 06:11:50 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:48 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FAbaJSh5m/RbxwmToLtNlRWjUwZqE/zfDC3TWOgg/dY=; b=E257E4N3zMA+WxrVYov8eeagXgISqCYUc7ceotZ/E3vTyufpY6f7iEJ9Izn6of/XSy CnZWx7+PcGKmnVvYKHntX/7Cp+b73sDWXFWxySkW1DcSUipgngsYwXBGU/P0aQfVY5/G 3gvbTH0R6bxYSBXBbjK1Yb8z9rIbyR3pIrj1nhtMMfBQHYRZk1lcB1kqj92Yf3mz2+wD QLn264SOlaQFVLBIZNOdie14FvPD3BL+JtWQRRGaEtimotrqRlbX7X3o6ZAQkCdPaJ5c oT+xsGy/fcfGMI1jLu7RxznnYwl4q2rVWt8lO9cxg4nwR+J9nUWLV3SEQconGCauwmxx CIQg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FAbaJSh5m/RbxwmToLtNlRWjUwZqE/zfDC3TWOgg/dY=; b=686kDSrAGSfi7bpmFnbAsCjRCogkonuX1A0I5SJmZpr+2rfxMg/r/VmDyazW8vqe6u GO+g/JzaE8gYUMa8W53zEt8H59ZtgUHvC/Ywq98Yidh14R/czenUAmmpM1M9TQtlY+hR vTot6lqfreCtXRMv2ZTvxq2dmqKueJ21VPOZF/FwKteCkJ690JCU3nmTFw58zLEWWCKe cEIpirM7Rptd+patXExyzBwLIEX5Thxd7aSKm9sNMZ82QaAYzHtWm/0xfVRHoLnCdXDG IvUiabUInzQk3IjK+Kpg8dejHowk/nqUfD9i/Xkow3rCdGbTN4I6wx5V0dKNbOTHHDQq J+Wg== X-Gm-Message-State: AFqh2kq/XtuFMWbygwNQKvy9LapA36PlGOuczDbXwc0KachU+0queBal MXkKBm6PeXQLHYEPcJDWl6VtORuhX9iX2gJ0 X-Google-Smtp-Source: AMrXdXuMe4ub9xA6neJYIvpo6p0hZC3en6gbW3tFb4YVluE24mSLriSVtO1tQbpFNjrGxUqxyW7XmA== X-Received: by 2002:a05:600c:3509:b0:3c6:e60f:3f6f with SMTP id h9-20020a05600c350900b003c6e60f3f6fmr57675299wmq.38.1673619109403; Fri, 13 Jan 2023 06:11:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/38] hw/gpio/omap_gpio: Add local variable to avoid embedded cast Date: Fri, 13 Jan 2023 14:11:13 +0000 Message-Id: <20230113141126.535646-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620274374100001 From: Philippe Mathieu-Daud=C3=A9 Add a local 'struct omap_gpif_s *' variable to improve readability. (This also eases next commit conversion). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-3-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/gpio/omap_gpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index bd0841d57fe..12ec16d1b03 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -53,7 +53,8 @@ struct omap_gpif_s { /* General-Purpose I/O of OMAP1 */ static void omap_gpio_set(void *opaque, int line, int level) { - struct omap_gpio_s *s =3D &((struct omap_gpif_s *) opaque)->omap1; + struct omap_gpif_s *p =3D opaque; + struct omap_gpio_s *s =3D &p->omap1; uint16_t prev =3D s->inputs; =20 if (level) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622200; cv=none; d=zohomail.com; s=zohoarc; b=kw2yROPSzV/0I7xtRn0LQjUi/HeSIgIOGLtVoXH0znkxPjmT6Z+dtqdArVgMtBa4mDqO7QUWNNocOj6uBUcaLkcFqWXQe1s8pnuRdJ30juTzPVI9LFgbuwHjNIozatSnzFtyAwss2Mc0EJB7MUpuVVJTRqxvipuoTL6aS64ckBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622200; h=Content-Type:Content-Transfer-Encoding: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=c7XGJQLnyfKX1vBajpS8zvsUCj272U0606U4cygYrzo=; b=ExMLiKrnr4YcxFDY9EwKdcerENB21T3eNjPGCmdDWdnVQsXoSiOxe1zqwU048OumxgOTUZnxOeUjFenUvOXYJm87NXLebh8ArvpulkRJxPjfQqnQY3OLcuq8uuV6e7UvVjyDjI/TYpIf5ORC5nj65q5If7vIMO028g9R9dcoFpE= 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+importer2=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 167362220034550.25943772223434; Fri, 13 Jan 2023 07:03:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnR-0001lj-Ua; Fri, 13 Jan 2023 09:12: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 1pGKmp-00015S-QA for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:04 -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 1pGKmh-0003oi-8b for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:03 -0500 Received: by mail-wm1-x336.google.com with SMTP id p1-20020a05600c1d8100b003d8c9b191e0so17449822wms.4 for ; Fri, 13 Jan 2023 06:11:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:49 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=c7XGJQLnyfKX1vBajpS8zvsUCj272U0606U4cygYrzo=; b=zGVO1oweDDPiYavOyAa3kTQxvI6grJoMoFKhSuJulY8nj7WvZp3asYPlb+p/HTCDwX QLJ6rTaeawd2fHaiScoIuQY3LFUXAqyqkcmknugC82jtRYjc8TRvkS+kZM4vbA1+Tvqz QC5zAzI5x/4mIP24ljbiyTTA5F7Gy61iAaO83/b1tIyB56BOJ5RHEd9jewidYHidm82j ZsZj8xe5aEFiyIydtDXUPQDm7OqR6cHQpFxN2+bA09cuuu+okLgl4BLUzjdVdR6efn6R vwkZrK7/pACKT4Zp93iDMXa5obEyPdL/emNKzlhB34+DIGwqRZLuxTt8H6cNPIBQmyPS bO7A== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c7XGJQLnyfKX1vBajpS8zvsUCj272U0606U4cygYrzo=; b=plPb+1Tmbj+lebYBBK8yno2QaH6bfIBZPN75d8a4veU5bRs9BKlmJybhryoYVAURWR hiGsBhunwlyFsxMkEFt+EY/07La8Tk6t+29sirDRHhPyjr5j9AoAjXnLINLynsDzfOyR khEQxg4O2UNsIzfxKgImq+0irbGXXXv+6FoOv3aDOseusw7vLkz65MjsU9JKAkdXKkZE B8gb38d95WCWW+1WFTor6lgyuSm19dq2VRwx0A8xvZlotfpit/9m1NtG4r1+MqmqlLes s0KRkrzvHVXk+soTatcF9VqQFKWOACN3fbg3MyieaATSjPimgD7SLdT1/IfsDMU7nOj1 KOrw== X-Gm-Message-State: AFqh2krQQ2m1LkIxVPJHAHm/HhYwB9l+EX819yZ6RMwW+2894x+5bs3x BTxtr0RDbz2ndXhPB8DumWrmPj+wc5XtB6Ni X-Google-Smtp-Source: AMrXdXtmbqSb9Ga5+cwEuYOBdVDydwyEIeLjHIBbLDCiOn5fJMlcd79vN1T1klfr4sB1bZaL5A3/1g== X-Received: by 2002:a05:600c:8505:b0:3da:f89:bc46 with SMTP id gw5-20020a05600c850500b003da0f89bc46mr6598738wmb.17.1673619110337; Fri, 13 Jan 2023 06:11:50 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/38] hw/arm/omap: Drop useless casts from void * to pointer Date: Fri, 13 Jan 2023 14:11:14 +0000 Message-Id: <20230113141126.535646-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622201616100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-4-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/omap1.c | 115 ++++++++++++++++++-------------------- hw/arm/omap2.c | 40 ++++++------- hw/arm/omap_sx1.c | 2 +- hw/arm/palm.c | 2 +- hw/char/omap_uart.c | 7 +-- hw/display/omap_dss.c | 15 +++-- hw/display/omap_lcdc.c | 9 ++- hw/dma/omap_dma.c | 15 +++-- hw/gpio/omap_gpio.c | 15 +++-- hw/intc/omap_intc.c | 12 ++-- hw/misc/omap_gpmc.c | 12 ++-- hw/misc/omap_l4.c | 7 +-- hw/misc/omap_sdrc.c | 7 +-- hw/misc/omap_tap.c | 5 +- hw/sd/omap_mmc.c | 9 ++- hw/ssi/omap_spi.c | 7 +-- hw/timer/omap_gptimer.c | 22 ++++---- hw/timer/omap_synctimer.c | 4 +- 18 files changed, 142 insertions(+), 163 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index f693faa43e0..559c066ce90 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -176,7 +176,7 @@ static void omap_timer_fire(void *opaque) =20 static void omap_timer_tick(void *opaque) { - struct omap_mpu_timer_s *timer =3D (struct omap_mpu_timer_s *) opaque; + struct omap_mpu_timer_s *timer =3D opaque; =20 omap_timer_sync(timer); omap_timer_fire(timer); @@ -185,7 +185,7 @@ static void omap_timer_tick(void *opaque) =20 static void omap_timer_clk_update(void *opaque, int line, int on) { - struct omap_mpu_timer_s *timer =3D (struct omap_mpu_timer_s *) opaque; + struct omap_mpu_timer_s *timer =3D opaque; =20 omap_timer_sync(timer); timer->rate =3D on ? omap_clk_getrate(timer->clk) : 0; @@ -202,7 +202,7 @@ static void omap_timer_clk_setup(struct omap_mpu_timer_= s *timer) static uint64_t omap_mpu_timer_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_timer_s *s =3D (struct omap_mpu_timer_s *) opaque; + struct omap_mpu_timer_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -226,7 +226,7 @@ static uint64_t omap_mpu_timer_read(void *opaque, hwadd= r addr, static void omap_mpu_timer_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_timer_s *s =3D (struct omap_mpu_timer_s *) opaque; + struct omap_mpu_timer_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -308,7 +308,7 @@ struct omap_watchdog_timer_s { static uint64_t omap_wd_timer_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_watchdog_timer_s *s =3D (struct omap_watchdog_timer_s *) o= paque; + struct omap_watchdog_timer_s *s =3D opaque; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, addr); @@ -333,7 +333,7 @@ static uint64_t omap_wd_timer_read(void *opaque, hwaddr= addr, static void omap_wd_timer_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_watchdog_timer_s *s =3D (struct omap_watchdog_timer_s *) o= paque; + struct omap_watchdog_timer_s *s =3D opaque; =20 if (size !=3D 2) { omap_badwidth_write16(opaque, addr, value); @@ -431,7 +431,7 @@ struct omap_32khz_timer_s { static uint64_t omap_os_timer_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_32khz_timer_s *s =3D (struct omap_32khz_timer_s *) opaque; + struct omap_32khz_timer_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 4) { @@ -458,7 +458,7 @@ static uint64_t omap_os_timer_read(void *opaque, hwaddr= addr, static void omap_os_timer_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_32khz_timer_s *s =3D (struct omap_32khz_timer_s *) opaque; + struct omap_32khz_timer_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 4) { @@ -532,7 +532,7 @@ static struct omap_32khz_timer_s *omap_os_timer_init(Me= moryRegion *memory, static uint64_t omap_ulpd_pm_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; uint16_t ret; =20 if (size !=3D 2) { @@ -600,7 +600,7 @@ static inline void omap_ulpd_req_update(struct omap_mpu= _state_s *s, static void omap_ulpd_pm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; int64_t now, ticks; int div, mult; static const int bypass_div[4] =3D { 1, 2, 4, 4 }; @@ -765,7 +765,7 @@ static void omap_ulpd_pm_init(MemoryRegion *system_memo= ry, static uint64_t omap_pin_cfg_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -876,7 +876,7 @@ static inline void omap_pin_modconf1_update(struct omap= _mpu_state_s *s, static void omap_pin_cfg_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; uint32_t diff; =20 if (size !=3D 4) { @@ -988,7 +988,7 @@ static void omap_pin_cfg_init(MemoryRegion *system_memo= ry, static uint64_t omap_id_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -1070,7 +1070,7 @@ static void omap_id_init(MemoryRegion *memory, struct= omap_mpu_state_s *mpu) static uint64_t omap_mpui_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -1103,7 +1103,7 @@ static uint64_t omap_mpui_read(void *opaque, hwaddr a= ddr, static void omap_mpui_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -1168,7 +1168,7 @@ struct omap_tipb_bridge_s { static uint64_t omap_tipb_bridge_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_tipb_bridge_s *s =3D (struct omap_tipb_bridge_s *) opaque; + struct omap_tipb_bridge_s *s =3D opaque; =20 if (size < 2) { return omap_badwidth_read16(opaque, addr); @@ -1198,7 +1198,7 @@ static uint64_t omap_tipb_bridge_read(void *opaque, h= waddr addr, static void omap_tipb_bridge_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_tipb_bridge_s *s =3D (struct omap_tipb_bridge_s *) opaque; + struct omap_tipb_bridge_s *s =3D opaque; =20 if (size < 2) { omap_badwidth_write16(opaque, addr, value); @@ -1269,7 +1269,7 @@ static struct omap_tipb_bridge_s *omap_tipb_bridge_in= it( static uint64_t omap_tcmi_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; uint32_t ret; =20 if (size !=3D 4) { @@ -1307,7 +1307,7 @@ static uint64_t omap_tcmi_read(void *opaque, hwaddr a= ddr, static void omap_tcmi_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -1384,7 +1384,7 @@ struct dpll_ctl_s { static uint64_t omap_dpll_read(void *opaque, hwaddr addr, unsigned size) { - struct dpll_ctl_s *s =3D (struct dpll_ctl_s *) opaque; + struct dpll_ctl_s *s =3D opaque; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, addr); @@ -1400,7 +1400,7 @@ static uint64_t omap_dpll_read(void *opaque, hwaddr a= ddr, static void omap_dpll_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct dpll_ctl_s *s =3D (struct dpll_ctl_s *) opaque; + struct dpll_ctl_s *s =3D opaque; uint16_t diff; static const int bypass_div[4] =3D { 1, 2, 4, 4 }; int div, mult; @@ -1464,7 +1464,7 @@ static struct dpll_ctl_s *omap_dpll_init(MemoryRegio= n *memory, static uint64_t omap_clkm_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, addr); @@ -1668,7 +1668,7 @@ static inline void omap_clkm_ckout1_update(struct oma= p_mpu_state_s *s, static void omap_clkm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; uint16_t diff; omap_clk clk; static const char *clkschemename[8] =3D { @@ -1756,7 +1756,7 @@ static const MemoryRegionOps omap_clkm_ops =3D { static uint64_t omap_clkdsp_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; CPUState *cpu =3D CPU(s->cpu); =20 if (size !=3D 2) { @@ -1801,7 +1801,7 @@ static inline void omap_clkdsp_idlect2_update(struct = omap_mpu_state_s *s, static void omap_clkdsp_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; uint16_t diff; =20 if (size !=3D 2) { @@ -1911,7 +1911,7 @@ struct omap_mpuio_s { =20 static void omap_mpuio_set(void *opaque, int line, int level) { - struct omap_mpuio_s *s =3D (struct omap_mpuio_s *) opaque; + struct omap_mpuio_s *s =3D opaque; uint16_t prev =3D s->inputs; =20 if (level) @@ -1947,7 +1947,7 @@ static void omap_mpuio_kbd_update(struct omap_mpuio_s= *s) static uint64_t omap_mpuio_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpuio_s *s =3D (struct omap_mpuio_s *) opaque; + struct omap_mpuio_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; uint16_t ret; =20 @@ -2007,7 +2007,7 @@ static uint64_t omap_mpuio_read(void *opaque, hwaddr = addr, static void omap_mpuio_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mpuio_s *s =3D (struct omap_mpuio_s *) opaque; + struct omap_mpuio_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; uint16_t diff; int ln; @@ -2104,7 +2104,7 @@ static void omap_mpuio_reset(struct omap_mpuio_s *s) =20 static void omap_mpuio_onoff(void *opaque, int line, int on) { - struct omap_mpuio_s *s =3D (struct omap_mpuio_s *) opaque; + struct omap_mpuio_s *s =3D opaque; =20 s->clk =3D on; if (on) @@ -2198,10 +2198,9 @@ static void omap_uwire_transfer_start(struct omap_uw= ire_s *s) } } =20 -static uint64_t omap_uwire_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_uwire_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_uwire_s *s =3D (struct omap_uwire_s *) opaque; + struct omap_uwire_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { @@ -2235,7 +2234,7 @@ static uint64_t omap_uwire_read(void *opaque, hwaddr = addr, static void omap_uwire_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_uwire_s *s =3D (struct omap_uwire_s *) opaque; + struct omap_uwire_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { @@ -2351,10 +2350,9 @@ static void omap_pwl_update(struct omap_pwl_s *s) } } =20 -static uint64_t omap_pwl_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_pwl_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_pwl_s *s =3D (struct omap_pwl_s *) opaque; + struct omap_pwl_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -2374,7 +2372,7 @@ static uint64_t omap_pwl_read(void *opaque, hwaddr ad= dr, static void omap_pwl_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_pwl_s *s =3D (struct omap_pwl_s *) opaque; + struct omap_pwl_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -2414,7 +2412,7 @@ static void omap_pwl_reset(struct omap_pwl_s *s) =20 static void omap_pwl_clk_update(void *opaque, int line, int on) { - struct omap_pwl_s *s =3D (struct omap_pwl_s *) opaque; + struct omap_pwl_s *s =3D opaque; =20 s->clk =3D on; omap_pwl_update(s); @@ -2445,10 +2443,9 @@ struct omap_pwt_s { omap_clk clk; }; =20 -static uint64_t omap_pwt_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_pwt_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_pwt_s *s =3D (struct omap_pwt_s *) opaque; + struct omap_pwt_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -2470,7 +2467,7 @@ static uint64_t omap_pwt_read(void *opaque, hwaddr ad= dr, static void omap_pwt_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_pwt_s *s =3D (struct omap_pwt_s *) opaque; + struct omap_pwt_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -2577,10 +2574,9 @@ static void omap_rtc_alarm_update(struct omap_rtc_s = *s) printf("%s: conversion failed\n", __func__); } =20 -static uint64_t omap_rtc_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_rtc_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_rtc_s *s =3D (struct omap_rtc_s *) opaque; + struct omap_rtc_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; uint8_t i; =20 @@ -2662,7 +2658,7 @@ static uint64_t omap_rtc_read(void *opaque, hwaddr ad= dr, static void omap_rtc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_rtc_s *s =3D (struct omap_rtc_s *) opaque; + struct omap_rtc_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; struct tm new_tm; time_t ti[2]; @@ -3034,7 +3030,7 @@ static void omap_mcbsp_rx_newdata(struct omap_mcbsp_s= *s) =20 static void omap_mcbsp_source_tick(void *opaque) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; static const int bps[8] =3D { 0, 1, 1, 2, 2, 2, -255, -255 }; =20 if (!s->rx_rate) @@ -3080,7 +3076,7 @@ static void omap_mcbsp_tx_newdata(struct omap_mcbsp_s= *s) =20 static void omap_mcbsp_sink_tick(void *opaque) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; static const int bps[8] =3D { 0, 1, 1, 2, 2, 2, -255, -255 }; =20 if (!s->tx_rate) @@ -3173,7 +3169,7 @@ static void omap_mcbsp_req_update(struct omap_mcbsp_s= *s) static uint64_t omap_mcbsp_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; uint16_t ret; =20 @@ -3271,7 +3267,7 @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr = addr, static void omap_mcbsp_writeh(void *opaque, hwaddr addr, uint32_t value) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 switch (offset) { @@ -3407,7 +3403,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr ad= dr, static void omap_mcbsp_writew(void *opaque, hwaddr addr, uint32_t value) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (offset =3D=3D 0x04) { /* DXR */ @@ -3498,7 +3494,7 @@ static struct omap_mcbsp_s *omap_mcbsp_init(MemoryReg= ion *system_memory, =20 static void omap_mcbsp_i2s_swallow(void *opaque, int line, int level) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; =20 if (s->rx_rate) { s->rx_req =3D s->codec->in.len; @@ -3508,7 +3504,7 @@ static void omap_mcbsp_i2s_swallow(void *opaque, int = line, int level) =20 static void omap_mcbsp_i2s_start(void *opaque, int line, int level) { - struct omap_mcbsp_s *s =3D (struct omap_mcbsp_s *) opaque; + struct omap_mcbsp_s *s =3D opaque; =20 if (s->tx_rate) { s->tx_req =3D s->codec->out.size; @@ -3590,10 +3586,9 @@ static void omap_lpg_reset(struct omap_lpg_s *s) omap_lpg_update(s); } =20 -static uint64_t omap_lpg_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_lpg_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_lpg_s *s =3D (struct omap_lpg_s *) opaque; + struct omap_lpg_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -3615,7 +3610,7 @@ static uint64_t omap_lpg_read(void *opaque, hwaddr ad= dr, static void omap_lpg_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_lpg_s *s =3D (struct omap_lpg_s *) opaque; + struct omap_lpg_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { @@ -3650,7 +3645,7 @@ static const MemoryRegionOps omap_lpg_ops =3D { =20 static void omap_lpg_clk_update(void *opaque, int line, int on) { - struct omap_lpg_s *s =3D (struct omap_lpg_s *) opaque; + struct omap_lpg_s *s =3D opaque; =20 s->clk =3D on; omap_lpg_update(s); @@ -3713,7 +3708,7 @@ static void omap_setup_mpui_io(MemoryRegion *system_m= emory, /* General chip reset */ static void omap1_mpu_reset(void *opaque) { - struct omap_mpu_state_s *mpu =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *mpu =3D opaque; =20 omap_dma_reset(mpu->dma); omap_mpu_timer_reset(mpu->timer[0]); @@ -3793,7 +3788,7 @@ static void omap_setup_dsp_mapping(MemoryRegion *syst= em_memory, =20 void omap_mpu_wakeup(void *opaque, int irq, int req) { - struct omap_mpu_state_s *mpu =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *mpu =3D opaque; CPUState *cpu =3D CPU(mpu->cpu); =20 if (cpu->halted) { diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 8571eedd736..366d6af1b66 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -167,7 +167,7 @@ static inline void omap_eac_out_empty(struct omap_eac_s= *s) =20 static void omap_eac_in_cb(void *opaque, int avail_b) { - struct omap_eac_s *s =3D (struct omap_eac_s *) opaque; + struct omap_eac_s *s =3D opaque; =20 s->codec.rxavail =3D avail_b >> 2; omap_eac_in_refill(s); @@ -177,7 +177,7 @@ static void omap_eac_in_cb(void *opaque, int avail_b) =20 static void omap_eac_out_cb(void *opaque, int free_b) { - struct omap_eac_s *s =3D (struct omap_eac_s *) opaque; + struct omap_eac_s *s =3D opaque; =20 s->codec.txavail =3D free_b >> 2; if (s->codec.txlen) @@ -333,10 +333,9 @@ static void omap_eac_reset(struct omap_eac_s *s) omap_eac_interrupt_update(s); } =20 -static uint64_t omap_eac_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_eac_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_eac_s *s =3D (struct omap_eac_s *) opaque; + struct omap_eac_s *s =3D opaque; uint32_t ret; =20 if (size !=3D 2) { @@ -452,7 +451,7 @@ static uint64_t omap_eac_read(void *opaque, hwaddr addr, static void omap_eac_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_eac_s *s =3D (struct omap_eac_s *) opaque; + struct omap_eac_s *s =3D opaque; =20 if (size !=3D 2) { omap_badwidth_write16(opaque, addr, value); @@ -656,7 +655,7 @@ static void omap_sti_reset(struct omap_sti_s *s) static uint64_t omap_sti_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_sti_s *s =3D (struct omap_sti_s *) opaque; + struct omap_sti_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -697,7 +696,7 @@ static uint64_t omap_sti_read(void *opaque, hwaddr addr, static void omap_sti_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_sti_s *s =3D (struct omap_sti_s *) opaque; + struct omap_sti_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -751,8 +750,7 @@ static const MemoryRegionOps omap_sti_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static uint64_t omap_sti_fifo_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_sti_fifo_read(void *opaque, hwaddr addr, unsigned siz= e) { OMAP_BAD_REG(addr); return 0; @@ -761,7 +759,7 @@ static uint64_t omap_sti_fifo_read(void *opaque, hwaddr= addr, static void omap_sti_fifo_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_sti_s *s =3D (struct omap_sti_s *) opaque; + struct omap_sti_s *s =3D opaque; int ch =3D addr >> 6; uint8_t byte =3D value; =20 @@ -1057,7 +1055,7 @@ static void omap_prcm_int_update(struct omap_prcm_s *= s, int dom) static uint64_t omap_prcm_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_prcm_s *s =3D (struct omap_prcm_s *) opaque; + struct omap_prcm_s *s =3D opaque; uint32_t ret; =20 if (size !=3D 4) { @@ -1369,7 +1367,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s = *s) static void omap_prcm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_prcm_s *s =3D (struct omap_prcm_s *) opaque; + struct omap_prcm_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -1849,7 +1847,7 @@ struct omap_sysctl_s { static uint32_t omap_sysctl_read8(void *opaque, hwaddr addr) { =20 - struct omap_sysctl_s *s =3D (struct omap_sysctl_s *) opaque; + struct omap_sysctl_s *s =3D opaque; int pad_offset, byte_offset; int value; =20 @@ -1873,7 +1871,7 @@ static uint32_t omap_sysctl_read8(void *opaque, hwadd= r addr) =20 static uint32_t omap_sysctl_read(void *opaque, hwaddr addr) { - struct omap_sysctl_s *s =3D (struct omap_sysctl_s *) opaque; + struct omap_sysctl_s *s =3D opaque; =20 switch (addr) { case 0x000: /* CONTROL_REVISION */ @@ -1971,10 +1969,9 @@ static uint32_t omap_sysctl_read(void *opaque, hwadd= r addr) return 0; } =20 -static void omap_sysctl_write8(void *opaque, hwaddr addr, - uint32_t value) +static void omap_sysctl_write8(void *opaque, hwaddr addr, uint32_t value) { - struct omap_sysctl_s *s =3D (struct omap_sysctl_s *) opaque; + struct omap_sysctl_s *s =3D opaque; int pad_offset, byte_offset; int prev_value; =20 @@ -1995,10 +1992,9 @@ static void omap_sysctl_write8(void *opaque, hwaddr = addr, } } =20 -static void omap_sysctl_write(void *opaque, hwaddr addr, - uint32_t value) +static void omap_sysctl_write(void *opaque, hwaddr addr, uint32_t value) { - struct omap_sysctl_s *s =3D (struct omap_sysctl_s *) opaque; + struct omap_sysctl_s *s =3D opaque; =20 switch (addr) { case 0x000: /* CONTROL_REVISION */ @@ -2233,7 +2229,7 @@ static struct omap_sysctl_s *omap_sysctl_init(struct = omap_target_agent_s *ta, /* General chip reset */ static void omap2_mpu_reset(void *opaque) { - struct omap_mpu_state_s *mpu =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *mpu =3D opaque; =20 omap_dma_reset(mpu->dma); omap_prcm_reset(mpu->prcm); diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 1d156bc3441..e7212920797 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -66,7 +66,7 @@ static uint64_t static_read(void *opaque, hwaddr offset, unsigned size) { - uint32_t *val =3D (uint32_t *) opaque; + uint32_t *val =3D opaque; uint32_t mask =3D (4 / size) - 1; =20 return *val >> ((offset & mask) << 3); diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 68e11dd1ecc..1457f10c83a 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -115,7 +115,7 @@ static struct { =20 static void palmte_button_event(void *opaque, int keycode) { - struct omap_mpu_state_s *cpu =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *cpu =3D opaque; =20 if (palmte_keymap[keycode & 0x7f].row !=3D -1) omap_mpuio_key(cpu->mpuio, diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c index e8da9333782..1c890b92018 100644 --- a/hw/char/omap_uart.c +++ b/hw/char/omap_uart.c @@ -67,10 +67,9 @@ struct omap_uart_s *omap_uart_init(hwaddr base, return s; } =20 -static uint64_t omap_uart_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_uart_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_uart_s *s =3D (struct omap_uart_s *) opaque; + struct omap_uart_s *s =3D opaque; =20 if (size =3D=3D 4) { return omap_badwidth_read8(opaque, addr); @@ -108,7 +107,7 @@ static uint64_t omap_uart_read(void *opaque, hwaddr add= r, static void omap_uart_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_uart_s *s =3D (struct omap_uart_s *) opaque; + struct omap_uart_s *s =3D opaque; =20 if (size =3D=3D 4) { omap_badwidth_write8(opaque, addr, value); diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c index 09e18407b46..f33fc7606d3 100644 --- a/hw/display/omap_dss.c +++ b/hw/display/omap_dss.c @@ -175,7 +175,7 @@ void omap_dss_reset(struct omap_dss_s *s) static uint64_t omap_diss_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -213,7 +213,7 @@ static uint64_t omap_diss_read(void *opaque, hwaddr add= r, static void omap_diss_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -254,7 +254,7 @@ static const MemoryRegionOps omap_diss_ops =3D { static uint64_t omap_disc_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -379,7 +379,7 @@ static uint64_t omap_disc_read(void *opaque, hwaddr add= r, static void omap_disc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); @@ -669,10 +669,9 @@ static void omap_rfbi_transfer_start(struct omap_dss_s= *s) omap_dispc_interrupt_update(s); } =20 -static uint64_t omap_rfbi_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_rfbi_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -739,7 +738,7 @@ static uint64_t omap_rfbi_read(void *opaque, hwaddr add= r, static void omap_rfbi_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_dss_s *s =3D (struct omap_dss_s *) opaque; + struct omap_dss_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c index 0ba42ef637c..3532a801be2 100644 --- a/hw/display/omap_lcdc.c +++ b/hw/display/omap_lcdc.c @@ -198,7 +198,7 @@ static void draw_line16_32(void *opaque, uint8_t *d, co= nst uint8_t *s, =20 static void omap_update_display(void *opaque) { - struct omap_lcd_panel_s *omap_lcd =3D (struct omap_lcd_panel_s *) opaq= ue; + struct omap_lcd_panel_s *omap_lcd =3D opaque; DisplaySurface *surface; drawfn draw_line; int size, height, first, last; @@ -376,10 +376,9 @@ static void omap_lcd_update(struct omap_lcd_panel_s *s= ) { } } =20 -static uint64_t omap_lcdc_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_lcdc_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_lcd_panel_s *s =3D (struct omap_lcd_panel_s *) opaque; + struct omap_lcd_panel_s *s =3D opaque; =20 switch (addr) { case 0x00: /* LCD_CONTROL */ @@ -412,7 +411,7 @@ static uint64_t omap_lcdc_read(void *opaque, hwaddr add= r, static void omap_lcdc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_lcd_panel_s *s =3D (struct omap_lcd_panel_s *) opaque; + struct omap_lcd_panel_s *s =3D opaque; =20 switch (addr) { case 0x00: /* LCD_CONTROL */ diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 6677237d42a..c6e35ba4b80 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -1454,10 +1454,9 @@ static int omap_dma_sys_read(struct omap_dma_s *s, i= nt offset, return 0; } =20 -static uint64_t omap_dma_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_dma_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; int reg, ch; uint16_t ret; =20 @@ -1505,7 +1504,7 @@ static uint64_t omap_dma_read(void *opaque, hwaddr ad= dr, static void omap_dma_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; int reg, ch; =20 if (size !=3D 2) { @@ -1557,7 +1556,7 @@ static const MemoryRegionOps omap_dma_ops =3D { =20 static void omap_dma_request(void *opaque, int drq, int req) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; /* The request pins are level triggered in QEMU. */ if (req) { if (~s->dma->drqbmp & (1ULL << drq)) { @@ -1571,7 +1570,7 @@ static void omap_dma_request(void *opaque, int drq, i= nt req) /* XXX: this won't be needed once soc_dma knows about clocks. */ static void omap_dma_clk_update(void *opaque, int line, int on) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; int i; =20 s->dma->freq =3D omap_clk_getrate(s->clk); @@ -1703,7 +1702,7 @@ static void omap_dma_interrupts_4_update(struct omap_= dma_s *s) static uint64_t omap_dma4_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; int irqn =3D 0, chnum; struct omap_dma_channel_s *ch; =20 @@ -1859,7 +1858,7 @@ static uint64_t omap_dma4_read(void *opaque, hwaddr a= ddr, static void omap_dma4_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_dma_s *s =3D (struct omap_dma_s *) opaque; + struct omap_dma_s *s =3D opaque; int chnum, irqn =3D 0; struct omap_dma_channel_s *ch; =20 diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 12ec16d1b03..b3cb3499bd1 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -72,7 +72,7 @@ static void omap_gpio_set(void *opaque, int line, int lev= el) static uint64_t omap_gpio_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_gpio_s *s =3D (struct omap_gpio_s *) opaque; + struct omap_gpio_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { @@ -110,7 +110,7 @@ static uint64_t omap_gpio_read(void *opaque, hwaddr add= r, static void omap_gpio_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_gpio_s *s =3D (struct omap_gpio_s *) opaque; + struct omap_gpio_s *s =3D opaque; int offset =3D addr & OMAP_MPUI_REG_MASK; uint16_t diff; int ln; @@ -309,7 +309,7 @@ static void omap2_gpio_module_reset(struct omap2_gpio_s= *s) =20 static uint32_t omap2_gpio_module_read(void *opaque, hwaddr addr) { - struct omap2_gpio_s *s =3D (struct omap2_gpio_s *) opaque; + struct omap2_gpio_s *s =3D opaque; =20 switch (addr) { case 0x00: /* GPIO_REVISION */ @@ -382,7 +382,7 @@ static uint32_t omap2_gpio_module_read(void *opaque, hw= addr addr) static void omap2_gpio_module_write(void *opaque, hwaddr addr, uint32_t value) { - struct omap2_gpio_s *s =3D (struct omap2_gpio_s *) opaque; + struct omap2_gpio_s *s =3D opaque; uint32_t diff; int ln; =20 @@ -611,10 +611,9 @@ static void omap2_gpif_reset(DeviceState *dev) s->gpo =3D 0; } =20 -static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, unsigned si= ze) { - struct omap2_gpif_s *s =3D (struct omap2_gpif_s *) opaque; + struct omap2_gpif_s *s =3D opaque; =20 switch (addr) { case 0x00: /* IPGENERICOCPSPL_REVISION */ @@ -643,7 +642,7 @@ static uint64_t omap2_gpif_top_read(void *opaque, hwadd= r addr, static void omap2_gpif_top_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap2_gpif_s *s =3D (struct omap2_gpif_s *) opaque; + struct omap2_gpif_s *s =3D opaque; =20 switch (addr) { case 0x00: /* IPGENERICOCPSPL_REVISION */ diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index d7183d035e9..9f6a71ce305 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -109,7 +109,7 @@ static inline void omap_inth_update(struct omap_intr_ha= ndler_s *s, int is_fiq) =20 static void omap_set_intr(void *opaque, int irq, int req) { - struct omap_intr_handler_s *ih =3D (struct omap_intr_handler_s *) opaq= ue; + struct omap_intr_handler_s *ih =3D opaque; uint32_t rise; =20 struct omap_intr_handler_bank_s *bank =3D &ih->bank[irq >> 5]; @@ -136,7 +136,7 @@ static void omap_set_intr(void *opaque, int irq, int re= q) /* Simplified version with no edge detection */ static void omap_set_intr_noedge(void *opaque, int irq, int req) { - struct omap_intr_handler_s *ih =3D (struct omap_intr_handler_s *) opaq= ue; + struct omap_intr_handler_s *ih =3D opaque; uint32_t rise; =20 struct omap_intr_handler_bank_s *bank =3D &ih->bank[irq >> 5]; @@ -156,7 +156,7 @@ static void omap_set_intr_noedge(void *opaque, int irq,= int req) static uint64_t omap_inth_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_intr_handler_s *s =3D (struct omap_intr_handler_s *) opaqu= e; + struct omap_intr_handler_s *s =3D opaque; int i, offset =3D addr; int bank_no =3D offset >> 8; int line_no; @@ -234,7 +234,7 @@ static uint64_t omap_inth_read(void *opaque, hwaddr add= r, static void omap_inth_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_intr_handler_s *s =3D (struct omap_intr_handler_s *) opaqu= e; + struct omap_intr_handler_s *s =3D opaque; int i, offset =3D addr; int bank_no =3D offset >> 8; struct omap_intr_handler_bank_s *bank =3D &s->bank[bank_no]; @@ -423,7 +423,7 @@ static const TypeInfo omap_intc_info =3D { static uint64_t omap2_inth_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_intr_handler_s *s =3D (struct omap_intr_handler_s *) opaqu= e; + struct omap_intr_handler_s *s =3D opaque; int offset =3D addr; int bank_no, line_no; struct omap_intr_handler_bank_s *bank =3D NULL; @@ -504,7 +504,7 @@ static uint64_t omap2_inth_read(void *opaque, hwaddr ad= dr, static void omap2_inth_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_intr_handler_s *s =3D (struct omap_intr_handler_s *) opaqu= e; + struct omap_intr_handler_s *s =3D opaque; int offset =3D addr; int bank_no, line_no; struct omap_intr_handler_bank_s *bank =3D NULL; diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c index 10de7a55236..67158eb1649 100644 --- a/hw/misc/omap_gpmc.c +++ b/hw/misc/omap_gpmc.c @@ -126,7 +126,7 @@ static void omap_gpmc_dma_update(struct omap_gpmc_s *s,= int value) static uint64_t omap_nand_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_gpmc_cs_file_s *f =3D (struct omap_gpmc_cs_file_s *)opaque; + struct omap_gpmc_cs_file_s *f =3D opaque; uint64_t v; nand_setpins(f->dev, 0, 0, 0, 1, 0); switch (omap_gpmc_devsize(f)) { @@ -205,7 +205,7 @@ static void omap_nand_setio(DeviceState *dev, uint64_t = value, static void omap_nand_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_gpmc_cs_file_s *f =3D (struct omap_gpmc_cs_file_s *)opaque; + struct omap_gpmc_cs_file_s *f =3D opaque; nand_setpins(f->dev, 0, 0, 0, 1, 0); omap_nand_setio(f->dev, value, omap_gpmc_devsize(f), size); } @@ -290,7 +290,7 @@ static void fill_prefetch_fifo(struct omap_gpmc_s *s) static uint64_t omap_gpmc_prefetch_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_gpmc_s *s =3D (struct omap_gpmc_s *) opaque; + struct omap_gpmc_s *s =3D opaque; uint32_t data; if (s->prefetch.config1 & 1) { /* The TRM doesn't define the behaviour if you read from the @@ -320,7 +320,7 @@ static uint64_t omap_gpmc_prefetch_read(void *opaque, h= waddr addr, static void omap_gpmc_prefetch_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_gpmc_s *s =3D (struct omap_gpmc_s *) opaque; + struct omap_gpmc_s *s =3D opaque; int cs =3D prefetch_cs(s->prefetch.config1); if ((s->prefetch.config1 & 1) =3D=3D 0) { /* The TRM doesn't define the behaviour of writing to the @@ -509,7 +509,7 @@ static int gpmc_wordaccess_only(hwaddr addr) static uint64_t omap_gpmc_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_gpmc_s *s =3D (struct omap_gpmc_s *) opaque; + struct omap_gpmc_s *s =3D opaque; int cs; struct omap_gpmc_cs_file_s *f; =20 @@ -621,7 +621,7 @@ static uint64_t omap_gpmc_read(void *opaque, hwaddr add= r, static void omap_gpmc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_gpmc_s *s =3D (struct omap_gpmc_s *) opaque; + struct omap_gpmc_s *s =3D opaque; int cs; struct omap_gpmc_cs_file_s *f; =20 diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c index 54aeaecd696..b7875489da3 100644 --- a/hw/misc/omap_l4.c +++ b/hw/misc/omap_l4.c @@ -52,10 +52,9 @@ hwaddr omap_l4_region_size(struct omap_target_agent_s *t= a, return ta->start[region].size; } =20 -static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_target_agent_s *s =3D (struct omap_target_agent_s *) opaqu= e; + struct omap_target_agent_s *s =3D opaque; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, addr); @@ -79,7 +78,7 @@ static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, static void omap_l4ta_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_target_agent_s *s =3D (struct omap_target_agent_s *) opaqu= e; + struct omap_target_agent_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c index f2f72f6810b..6aa1b3ef7fb 100644 --- a/hw/misc/omap_sdrc.c +++ b/hw/misc/omap_sdrc.c @@ -31,10 +31,9 @@ void omap_sdrc_reset(struct omap_sdrc_s *s) s->config =3D 0x10; } =20 -static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_sdrc_s *s =3D (struct omap_sdrc_s *) opaque; + struct omap_sdrc_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); @@ -89,7 +88,7 @@ static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, static void omap_sdrc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_sdrc_s *s =3D (struct omap_sdrc_s *) opaque; + struct omap_sdrc_s *s =3D opaque; =20 if (size !=3D 4) { omap_badwidth_write32(opaque, addr, value); diff --git a/hw/misc/omap_tap.c b/hw/misc/omap_tap.c index 3f595e8df7e..4d7fb7d85f1 100644 --- a/hw/misc/omap_tap.c +++ b/hw/misc/omap_tap.c @@ -23,10 +23,9 @@ #include "hw/arm/omap.h" =20 /* TEST-Chip-level TAP */ -static uint64_t omap_tap_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_tap_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mpu_state_s *s =3D (struct omap_mpu_state_s *) opaque; + struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { return omap_badwidth_read32(opaque, addr); diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index b67def63813..edd3cf2a1eb 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -321,11 +321,10 @@ void omap_mmc_reset(struct omap_mmc_s *host) device_cold_reset(DEVICE(host->card)); } =20 -static uint64_t omap_mmc_read(void *opaque, hwaddr offset, - unsigned size) +static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) { uint16_t i; - struct omap_mmc_s *s =3D (struct omap_mmc_s *) opaque; + struct omap_mmc_s *s =3D opaque; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, offset); @@ -418,7 +417,7 @@ static void omap_mmc_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { int i; - struct omap_mmc_s *s =3D (struct omap_mmc_s *) opaque; + struct omap_mmc_s *s =3D opaque; =20 if (size !=3D 2) { omap_badwidth_write16(opaque, offset, value); @@ -576,7 +575,7 @@ static const MemoryRegionOps omap_mmc_ops =3D { =20 static void omap_mmc_cover_cb(void *opaque, int line, int level) { - struct omap_mmc_s *host =3D (struct omap_mmc_s *) opaque; + struct omap_mmc_s *host =3D opaque; =20 if (!host->cdet_state && level) { host->status |=3D 0x0002; diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c index 7c7e689707a..8f85c3e3918 100644 --- a/hw/ssi/omap_spi.c +++ b/hw/ssi/omap_spi.c @@ -134,10 +134,9 @@ void omap_mcspi_reset(struct omap_mcspi_s *s) omap_mcspi_interrupt_update(s); } =20 -static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, - unsigned size) +static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_mcspi_s *s =3D (struct omap_mcspi_s *) opaque; + struct omap_mcspi_s *s =3D opaque; int ch =3D 0; uint32_t ret; =20 @@ -226,7 +225,7 @@ static uint64_t omap_mcspi_read(void *opaque, hwaddr ad= dr, static void omap_mcspi_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_mcspi_s *s =3D (struct omap_mcspi_s *) opaque; + struct omap_mcspi_s *s =3D opaque; int ch =3D 0; =20 if (size !=3D 4) { diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c index c407190138c..34e6af7aff5 100644 --- a/hw/timer/omap_gptimer.c +++ b/hw/timer/omap_gptimer.c @@ -159,7 +159,7 @@ static inline void omap_gp_timer_trigger(struct omap_gp= _timer_s *timer) =20 static void omap_gp_timer_tick(void *opaque) { - struct omap_gp_timer_s *timer =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *timer =3D opaque; =20 if (!timer->ar) { timer->st =3D 0; @@ -179,7 +179,7 @@ static void omap_gp_timer_tick(void *opaque) =20 static void omap_gp_timer_match(void *opaque) { - struct omap_gp_timer_s *timer =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *timer =3D opaque; =20 if (timer->trigger =3D=3D gpt_trigger_both) omap_gp_timer_trigger(timer); @@ -189,7 +189,7 @@ static void omap_gp_timer_match(void *opaque) =20 static void omap_gp_timer_input(void *opaque, int line, int on) { - struct omap_gp_timer_s *s =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *s =3D opaque; int trigger; =20 switch (s->capture) { @@ -219,7 +219,7 @@ static void omap_gp_timer_input(void *opaque, int line,= int on) =20 static void omap_gp_timer_clk_update(void *opaque, int line, int on) { - struct omap_gp_timer_s *timer =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *timer =3D opaque; =20 omap_gp_timer_sync(timer); timer->rate =3D on ? omap_clk_getrate(timer->clk) : 0; @@ -262,7 +262,7 @@ void omap_gp_timer_reset(struct omap_gp_timer_s *s) =20 static uint32_t omap_gp_timer_readw(void *opaque, hwaddr addr) { - struct omap_gp_timer_s *s =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *s =3D opaque; =20 switch (addr) { case 0x00: /* TIDR */ @@ -328,7 +328,7 @@ static uint32_t omap_gp_timer_readw(void *opaque, hwadd= r addr) =20 static uint32_t omap_gp_timer_readh(void *opaque, hwaddr addr) { - struct omap_gp_timer_s *s =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *s =3D opaque; uint32_t ret; =20 if (addr & 2) @@ -340,10 +340,9 @@ static uint32_t omap_gp_timer_readh(void *opaque, hwad= dr addr) } } =20 -static void omap_gp_timer_write(void *opaque, hwaddr addr, - uint32_t value) +static void omap_gp_timer_write(void *opaque, hwaddr addr, uint32_t value) { - struct omap_gp_timer_s *s =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *s =3D opaque; =20 switch (addr) { case 0x00: /* TIDR */ @@ -440,10 +439,9 @@ static void omap_gp_timer_write(void *opaque, hwaddr a= ddr, } } =20 -static void omap_gp_timer_writeh(void *opaque, hwaddr addr, - uint32_t value) +static void omap_gp_timer_writeh(void *opaque, hwaddr addr, uint32_t value) { - struct omap_gp_timer_s *s =3D (struct omap_gp_timer_s *) opaque; + struct omap_gp_timer_s *s =3D opaque; =20 if (addr & 2) omap_gp_timer_write(opaque, addr, (value << 16) | s->writeh); diff --git a/hw/timer/omap_synctimer.c b/hw/timer/omap_synctimer.c index 72b997939bd..d93a9344ede 100644 --- a/hw/timer/omap_synctimer.c +++ b/hw/timer/omap_synctimer.c @@ -39,7 +39,7 @@ void omap_synctimer_reset(struct omap_synctimer_s *s) =20 static uint32_t omap_synctimer_readw(void *opaque, hwaddr addr) { - struct omap_synctimer_s *s =3D (struct omap_synctimer_s *) opaque; + struct omap_synctimer_s *s =3D opaque; =20 switch (addr) { case 0x00: /* 32KSYNCNT_REV */ @@ -55,7 +55,7 @@ static uint32_t omap_synctimer_readw(void *opaque, hwaddr= addr) =20 static uint32_t omap_synctimer_readh(void *opaque, hwaddr addr) { - struct omap_synctimer_s *s =3D (struct omap_synctimer_s *) opaque; + struct omap_synctimer_s *s =3D opaque; uint32_t ret; =20 if (addr & 2) --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620528; cv=none; d=zohomail.com; s=zohoarc; b=RiQRoCzvD9za3C3ZwqjlntHzDni18/G1xQNMtptAuXxQT3HCOYnGr2g5K1g/BRMdtPaZr2M5A1WOgKnOscGb9n3tyXe+aR6VhtHyDw16prvVqRoe0ao493eV4pzEDbO8pkGIy3fFiY3TJKvoGhOKxbb2BAtfpM50J5h9o1Kuj2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620528; h=Content-Type:Content-Transfer-Encoding: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=LxSkHZn6MbhceHe34cyd3tpq2bJIskFKLNFL7qC4I0w=; b=OSUELHerp+94YKeY55OBA+zKCklG82/hpgHO5HIfVrrs8LFPJBph/1GPTwOXtP77W2h531LRfe85sfXaMSvuwDdVAVNJcSZ9qtZ2+LHlt7DSnTf4Yu+FWtO4ocI+Do3IfD867zwQfxLs+kZAoVXZnCt7/PPNOCP5Ncly4ogkyCM= 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+importer2=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 1673620528936681.4552780293498; Fri, 13 Jan 2023 06:35:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnL-0001Zh-4i; Fri, 13 Jan 2023 09:12:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKmo-000159-Mb for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:03 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003dl-P0 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:02 -0500 Received: by mail-wm1-x332.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so14041838wma.1 for ; Fri, 13 Jan 2023 06:11:51 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:50 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LxSkHZn6MbhceHe34cyd3tpq2bJIskFKLNFL7qC4I0w=; b=VHJdCBhMJmNqrVDoAVdpneyeI/Kh2SYQicGLQrNneJTnNWF1ar6Y0LgaqGCWd46AAZ 95QYklDJEZNp2qto9duFCxey0mq+ubquZojP4SjyDLrwrdNsJuW4qLa5DcaRovzj1IOU Jy1ocNNeK14N3MGc6t6jZFoNju1clp+jRkpuk4P06inSFH3xzeG8pMbk3O3+/gkSaPAl Fmo4LfYENWn2Ujapit75gjbv0A/UDpBeyUlG6YBRIJSuAU/cpyfU10uUKaC/xCjQhcNW ygwytFVEv2Y5PqiFchGOaM5zn+sfHV3bRcIsjnYrtw3Z59B+bRvMjoZ06MI6mh0ctmbL 1Zqw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LxSkHZn6MbhceHe34cyd3tpq2bJIskFKLNFL7qC4I0w=; b=E5o0JlphDBucQE9+KVUDeB11ZLQmt6Q8T7UHtaBCKrZQwjQrzUyfzVRcqeOAMDZBqS YALMNcrVwj2B29RfhyrHegIdXdWfpVhiU4wIeLEfPsgP1yXGhRe6cCjJGioUuoTsQrSs wKbE8gQ7HsHUeA+dn3n7tUtkic06K90bSeYqLPofTjYtscHVUWv5+cBNh2/O7EW2adQI WYc87U4Y79gDXfhBL0r3IScCeWgLSW7OZ8LVKogaR9+Gh2ekwkvq8GYNsS1DodvDGqlg SGJQgp+Jv9rX1K0Gnu1BWypC8pRLHJR6KANqjrPS9WXLxqTOxiLWnp81nn18nwJAa5v4 zIdg== X-Gm-Message-State: AFqh2kpLFXZ2pMcSk+pPSjUJehBlw+hqcqnx7jkDfiXH0yUeQDpp0GFR v8eIxnrPX3cLVhOSgy47PDln/jw1F7r9SmRv X-Google-Smtp-Source: AMrXdXvs3iF1txbF8ADPnKU+SjwLjUZvD7YD6JxcHHOzpz1rHNZrYIkfTDHfrh/ZD1E2V3MVjJO0FA== X-Received: by 2002:a05:600c:4f84:b0:3d9:f758:e280 with SMTP id n4-20020a05600c4f8400b003d9f758e280mr12742961wmq.24.1673619111192; Fri, 13 Jan 2023 06:11:51 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/38] hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP1_GPIO type name Date: Fri, 13 Jan 2023 14:11:15 +0000 Message-Id: <20230113141126.535646-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620531165100001 From: Philippe Mathieu-Daud=C3=A9 Following docs/devel/style.rst guidelines, rename omap_gpif_s -> Omap1GpioState. This also remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-5-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/omap.h | 6 +++--- hw/gpio/omap_gpio.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index ff6a173f8a6..29d2ed7e3be 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -103,18 +103,18 @@ void omap_i2c_set_fclk(OMAPI2CState *i2c, omap_clk cl= k); =20 /* omap_gpio.c */ #define TYPE_OMAP1_GPIO "omap-gpio" -DECLARE_INSTANCE_CHECKER(struct omap_gpif_s, OMAP1_GPIO, +typedef struct Omap1GpioState Omap1GpioState; +DECLARE_INSTANCE_CHECKER(Omap1GpioState, OMAP1_GPIO, TYPE_OMAP1_GPIO) =20 #define TYPE_OMAP2_GPIO "omap2-gpio" DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO, TYPE_OMAP2_GPIO) =20 -typedef struct omap_gpif_s omap_gpif; typedef struct omap2_gpif_s omap2_gpif; =20 /* TODO: clock framework (see above) */ -void omap_gpio_set_clk(omap_gpif *gpio, omap_clk clk); +void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk); =20 void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk); void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk); diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index b3cb3499bd1..23502315ea5 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -41,7 +41,7 @@ struct omap_gpio_s { uint16_t pins; }; =20 -struct omap_gpif_s { +struct Omap1GpioState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -53,7 +53,7 @@ struct omap_gpif_s { /* General-Purpose I/O of OMAP1 */ static void omap_gpio_set(void *opaque, int line, int level) { - struct omap_gpif_s *p =3D opaque; + Omap1GpioState *p =3D opaque; struct omap_gpio_s *s =3D &p->omap1; uint16_t prev =3D s->inputs; =20 @@ -594,7 +594,7 @@ static const MemoryRegionOps omap2_gpio_module_ops =3D { =20 static void omap_gpif_reset(DeviceState *dev) { - struct omap_gpif_s *s =3D OMAP1_GPIO(dev); + Omap1GpioState *s =3D OMAP1_GPIO(dev); =20 omap_gpio_reset(&s->omap1); } @@ -677,7 +677,7 @@ static const MemoryRegionOps omap2_gpif_top_ops =3D { static void omap_gpio_init(Object *obj) { DeviceState *dev =3D DEVICE(obj); - struct omap_gpif_s *s =3D OMAP1_GPIO(obj); + Omap1GpioState *s =3D OMAP1_GPIO(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 qdev_init_gpio_in(dev, omap_gpio_set, 16); @@ -690,7 +690,7 @@ static void omap_gpio_init(Object *obj) =20 static void omap_gpio_realize(DeviceState *dev, Error **errp) { - struct omap_gpif_s *s =3D OMAP1_GPIO(dev); + Omap1GpioState *s =3D OMAP1_GPIO(dev); =20 if (!s->clk) { error_setg(errp, "omap-gpio: clk not connected"); @@ -742,13 +742,13 @@ static void omap2_gpio_realize(DeviceState *dev, Erro= r **errp) } } =20 -void omap_gpio_set_clk(omap_gpif *gpio, omap_clk clk) +void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk) { gpio->clk =3D clk; } =20 static Property omap_gpio_properties[] =3D { - DEFINE_PROP_INT32("mpu_model", struct omap_gpif_s, mpu_model, 0), + DEFINE_PROP_INT32("mpu_model", Omap1GpioState, mpu_model, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -766,7 +766,7 @@ static void omap_gpio_class_init(ObjectClass *klass, vo= id *data) static const TypeInfo omap_gpio_info =3D { .name =3D TYPE_OMAP1_GPIO, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(struct omap_gpif_s), + .instance_size =3D sizeof(Omap1GpioState), .instance_init =3D omap_gpio_init, .class_init =3D omap_gpio_class_init, }; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619833; cv=none; d=zohomail.com; s=zohoarc; b=PVsA3oy4cUasErcjNBjrcBPFLPM2lc8ecmnrfjZUK93qEjsT+pOzOHLoU0xKAeNuHxyiPwEfcgENFlKcibPup7dU3aGY4iw1IQedSBJHGwHlh8tRkESAobwlJYrGW56sLRVgzzx4CqZTuUSSPWPk3QUN3Qh/jE2EFyAzt/PCOxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619833; h=Content-Type:Content-Transfer-Encoding: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=WJ1ThggjatfCXo15B2y0aj5bS7HJIrmU1S8g9Lpjo5s=; b=fNwpZ6afBw2eqqJB5SQxm7Q0ElmoZU2WuhY68/XPz8UNRF8qHW8f/LzUqx2wEWdMvGbjZ+3+ZFgQA28L99zaBBUJZ8YM2aRQn7cptxms4wGSyWjXeyxmO0tljRJ4er3UyIhdVrX2cv0XKstAYDNZy2A47RsBtg6VyOAZsXTAqQg= 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+importer2=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 SMTP id 1673619833656600.4002232621067; Fri, 13 Jan 2023 06:23:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnH-0001UR-EQ; Fri, 13 Jan 2023 09:12: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 1pGKml-00012v-RX for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmh-0003p7-8s for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -0500 Received: by mail-wm1-x334.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so14041865wma.1 for ; Fri, 13 Jan 2023 06:11:52 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:51 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WJ1ThggjatfCXo15B2y0aj5bS7HJIrmU1S8g9Lpjo5s=; b=o9spxJVxdnIAuLjl0Slpol8qx1XwC2mnrmDZRPjnPMBJ/kiYuGs44dJIhTJVINMwso RzR++i+ueDbRJKlD1iU6yb7qynP+80PpAp9J1Q00rVqAB0VHoE8tUMIGL4FC2XYsn3qg GtmG1EtgpQwrVCz807MQtcs0tNTzdazwmejEiVQHG+w1Lv/1cYIFD9WqlXG0Hgek87h4 HAEWhk6itD38g+ZJHH1zBgMBc045sYblW/1mPICc8iILkD1vt8su9Kq5MXHEcYRMfSMH rZqDZN8pBthl9clFCYm+M7KkNnw9tJJb1TGKFL3FpR0iyfo+e7z8M38CQFMUog1GPrGo +EwA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WJ1ThggjatfCXo15B2y0aj5bS7HJIrmU1S8g9Lpjo5s=; b=ZJQBL+Y2oS8lAo7BLjCqjVZlpz8DpaUF7IVrBv2xMC2CWCEy/sTFQPFgr0GiE8KpFt pLKz/ewPgFJ/H+5NHWKtwZeBEmUFG5Nayqx2LADskB04PvzXv4qHwiG5VeoyYyLsKptu abYVJxEh4tKQ7+rWz1HaxW+00PLFSb+VYlAheX6GDEk4BQ30XRsoK0ALZQx/9I3kJ6Sy pSsvVtFAM1caSu7ZH9bo+73vj6lunIQo+EWs5mLRsS7Bkj93td7mKk3siLObRaqDs5nL 25wtGHEIA0xIu+oLmxhiVvFNgUent2XqtDmC5TEtAs8N6A1cRGhd61gGEUXw/xQ+HwDL 5e2g== X-Gm-Message-State: AFqh2kor2BGx2YKYp4lEclhtbU0ZfZEI9WUqxvKxGTFLgkYCffOTLf21 tG8pEVyBaxQQfLhYNmDYNUQjqq1PWPoOhKri X-Google-Smtp-Source: AMrXdXtOvM+SyJUzqc2KB002BeV1Ep/7oahFFhZ74xJlMNtU9BiKKGNHuHU569JX7A/0YJqNXMcSFw== X-Received: by 2002:a05:600c:35d6:b0:3da:17f5:57b9 with SMTP id r22-20020a05600c35d600b003da17f557b9mr4622479wmq.5.1673619112087; Fri, 13 Jan 2023 06:11:52 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/38] hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP2_GPIO type name Date: Fri, 13 Jan 2023 14:11:16 +0000 Message-Id: <20230113141126.535646-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619834192100001 From: Philippe Mathieu-Daud=C3=A9 Following docs/devel/style.rst guidelines, rename omap2_gpif_s -> Omap2GpioState. This also remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-6-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/omap.h | 9 ++++----- hw/gpio/omap_gpio.c | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 29d2ed7e3be..9e30ba7ba24 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -108,16 +108,15 @@ DECLARE_INSTANCE_CHECKER(Omap1GpioState, OMAP1_GPIO, TYPE_OMAP1_GPIO) =20 #define TYPE_OMAP2_GPIO "omap2-gpio" -DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO, +typedef struct Omap2GpioState Omap2GpioState; +DECLARE_INSTANCE_CHECKER(Omap2GpioState, OMAP2_GPIO, TYPE_OMAP2_GPIO) =20 -typedef struct omap2_gpif_s omap2_gpif; - /* TODO: clock framework (see above) */ void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk); =20 -void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk); -void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk); +void omap2_gpio_set_iclk(Omap2GpioState *gpio, omap_clk clk); +void omap2_gpio_set_fclk(Omap2GpioState *gpio, uint8_t i, omap_clk clk); =20 /* OMAP2 l4 Interconnect */ struct omap_l4_s; diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 23502315ea5..a3341d70f16 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -210,7 +210,7 @@ struct omap2_gpio_s { uint8_t delay; }; =20 -struct omap2_gpif_s { +struct Omap2GpioState { SysBusDevice parent_obj; =20 MemoryRegion iomem; @@ -274,7 +274,7 @@ static inline void omap2_gpio_module_int(struct omap2_g= pio_s *s, int line) =20 static void omap2_gpio_set(void *opaque, int line, int level) { - struct omap2_gpif_s *p =3D opaque; + Omap2GpioState *p =3D opaque; struct omap2_gpio_s *s =3D &p->modules[line >> 5]; =20 line &=3D 31; @@ -601,7 +601,7 @@ static void omap_gpif_reset(DeviceState *dev) =20 static void omap2_gpif_reset(DeviceState *dev) { - struct omap2_gpif_s *s =3D OMAP2_GPIO(dev); + Omap2GpioState *s =3D OMAP2_GPIO(dev); int i; =20 for (i =3D 0; i < s->modulecount; i++) { @@ -613,7 +613,7 @@ static void omap2_gpif_reset(DeviceState *dev) =20 static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, unsigned si= ze) { - struct omap2_gpif_s *s =3D opaque; + Omap2GpioState *s =3D opaque; =20 switch (addr) { case 0x00: /* IPGENERICOCPSPL_REVISION */ @@ -642,7 +642,7 @@ static uint64_t omap2_gpif_top_read(void *opaque, hwadd= r addr, unsigned size) static void omap2_gpif_top_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap2_gpif_s *s =3D opaque; + Omap2GpioState *s =3D opaque; =20 switch (addr) { case 0x00: /* IPGENERICOCPSPL_REVISION */ @@ -699,7 +699,7 @@ static void omap_gpio_realize(DeviceState *dev, Error *= *errp) =20 static void omap2_gpio_realize(DeviceState *dev, Error **errp) { - struct omap2_gpif_s *s =3D OMAP2_GPIO(dev); + Omap2GpioState *s =3D OMAP2_GPIO(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); int i; =20 @@ -771,19 +771,19 @@ static const TypeInfo omap_gpio_info =3D { .class_init =3D omap_gpio_class_init, }; =20 -void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk) +void omap2_gpio_set_iclk(Omap2GpioState *gpio, omap_clk clk) { gpio->iclk =3D clk; } =20 -void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk) +void omap2_gpio_set_fclk(Omap2GpioState *gpio, uint8_t i, omap_clk clk) { assert(i <=3D 5); gpio->fclk[i] =3D clk; } =20 static Property omap2_gpio_properties[] =3D { - DEFINE_PROP_INT32("mpu_model", struct omap2_gpif_s, mpu_model, 0), + DEFINE_PROP_INT32("mpu_model", Omap2GpioState, mpu_model, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -801,7 +801,7 @@ static void omap2_gpio_class_init(ObjectClass *klass, v= oid *data) static const TypeInfo omap2_gpio_info =3D { .name =3D TYPE_OMAP2_GPIO, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(struct omap2_gpif_s), + .instance_size =3D sizeof(Omap2GpioState), .class_init =3D omap2_gpio_class_init, }; =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622083; cv=none; d=zohomail.com; s=zohoarc; b=eqosZWw6wEijcM8cLQgxAOno1S9sp71sZuo7uGpb3cxvQs1nI7mn2oax4qXmW9+oimIkYAQSfO5hLrmfEkKDAIYdxFxx/rj5zq9/PZLRb7nFatSZoG7sW7+6MUHEw7Nq2f9vQ9qpg8UcfdilDc3NcO+Idvyegz1obekR4O+kwXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622083; h=Content-Type:Content-Transfer-Encoding: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=3D9zRpW1XncySFFXDnMUdsKdKAAUfwzl78yy6shZZgY=; b=CktBSuA4Yo59RcXlKxpp1mQqh36soL6F4s66k9OYjRn8l74P0ukjnlswFdLniLKSuwjfUuvR6YqmxkpzNZz1iCA9RXk59CIebZ2INHezSHErL/tWAkSw4BztaG4jFMbzqr9lMlmi8SpBFl7KYgCGw+Dwaws66uH+pFyevMZv33A= 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+importer2=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 1673622083507629.9433206467634; Fri, 13 Jan 2023 07:01:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKmw-00019U-UM; Fri, 13 Jan 2023 09:12:10 -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 1pGKmk-00012U-Hl for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003pI-97 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:58 -0500 Received: by mail-wm1-x333.google.com with SMTP id q8so3554798wmo.5 for ; Fri, 13 Jan 2023 06:11:53 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:52 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3D9zRpW1XncySFFXDnMUdsKdKAAUfwzl78yy6shZZgY=; b=rhCRmtO6AACdw4Xy7MlGcRusMq8SQynpcR0Rx7JB7VrwQrp1Syb+KouBNY5mG2dUXE Cy8uHiQLxNqER23EjzglSKjPw3zfSDnuMOYl0AJcG+KaJ/tnuwDaXHqYCjzbzI8LN8/u VJ3saUkaI3qLX+tDgKiG/Ysv5rloarR3t2YJTg2OVCaT7tVhsJ8u2By2i2UDolOmHkXX MDF+XGzmr1+gGqIMU6O5z6phSssMFEFpBJYHr/797C7bogDcmMFcwskAjKMgdOw7Im20 IVWrGBRTsLlBIxj0+VrPuYVvtcwPPGmfyCwalumzvaPs+Psoof3KBTpxITu8uMrm6Qk6 gmMQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3D9zRpW1XncySFFXDnMUdsKdKAAUfwzl78yy6shZZgY=; b=EMQeYCNjAfYka+bU78Q5agieE54HsQBw6iyAFskzL/k9n6jL9zZh3SviTlMPKxXFpl GN8BdWAYnagwHFeKSBFgozAfGGmdorV6mii+M3uJTjsXvHPtNws1ps878AZL2oEo6w/R ZqXA545IcC6C8FyuBGAPUAbRIfGc84tnV7zUuPV0KK0OIxcfwGE/iUB9N6YMGasDDPGO xjiyDV/PVruTzBaar/y2yPvjhQF6jDFsPi9FfzcxwpEbxu/fPi43rInshBD+NOFnqBVO FJs/O/fMSzKt/0j0UKDsV8/M9ynqi4MhwqgR5qBsKZfP9NFUMxhMdJ/mXQNVx0pisIdY 2pEg== X-Gm-Message-State: AFqh2kpzV2f6LFkmmedw8ZWwm9YO6HAmgPWJuxVvwwsZT+88rxCdlcXq CTNNU4TnA+jnkpGJKCEtb6c24+62MURgNbAh X-Google-Smtp-Source: AMrXdXtkSEQgcUUjNh7TBImTrVPPuqnuQVFaQMYb3zWQNX9uwdw7Vy9gWx56bL2jyVKJ+CqGM7seOQ== X-Received: by 2002:a05:600c:4f41:b0:3d9:f806:2f89 with SMTP id m1-20020a05600c4f4100b003d9f8062f89mr11110984wmq.41.1673619112839; Fri, 13 Jan 2023 06:11:52 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/38] hw/intc/omap_intc: Use CamelCase for TYPE_OMAP_INTC type name Date: Fri, 13 Jan 2023 14:11:17 +0000 Message-Id: <20230113141126.535646-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622084232100001 From: Philippe Mathieu-Daud=C3=A9 Following docs/devel/style.rst guidelines, rename omap_intr_handler_s -> OMAPIntcState. This also remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-7-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/omap.h | 9 ++++----- hw/intc/omap_intc.c | 38 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 9e30ba7ba24..c275d9b681c 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -70,9 +70,8 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent); =20 /* omap_intc.c */ #define TYPE_OMAP_INTC "common-omap-intc" -typedef struct omap_intr_handler_s omap_intr_handler; -DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC, - TYPE_OMAP_INTC) +typedef struct OMAPIntcState OMAPIntcState; +DECLARE_INSTANCE_CHECKER(OMAPIntcState, OMAP_INTC, TYPE_OMAP_INTC) =20 =20 /* @@ -89,8 +88,8 @@ DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC, * (ie the struct omap_mpu_state_s*) to do the clockname to pointer * translation.) */ -void omap_intc_set_iclk(omap_intr_handler *intc, omap_clk clk); -void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk); +void omap_intc_set_iclk(OMAPIntcState *intc, omap_clk clk); +void omap_intc_set_fclk(OMAPIntcState *intc, omap_clk clk); =20 /* omap_i2c.c */ #define TYPE_OMAP_I2C "omap_i2c" diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index 9f6a71ce305..647bf324a8e 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -38,7 +38,7 @@ struct omap_intr_handler_bank_s { unsigned char priority[32]; }; =20 -struct omap_intr_handler_s { +struct OMAPIntcState { SysBusDevice parent_obj; =20 qemu_irq *pins; @@ -60,7 +60,7 @@ struct omap_intr_handler_s { struct omap_intr_handler_bank_s bank[3]; }; =20 -static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq) +static void omap_inth_sir_update(OMAPIntcState *s, int is_fiq) { int i, j, sir_intr, p_intr, p; uint32_t level; @@ -88,7 +88,7 @@ static void omap_inth_sir_update(struct omap_intr_handler= _s *s, int is_fiq) s->sir_intr[is_fiq] =3D sir_intr; } =20 -static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_= fiq) +static inline void omap_inth_update(OMAPIntcState *s, int is_fiq) { int i; uint32_t has_intr =3D 0; @@ -109,7 +109,7 @@ static inline void omap_inth_update(struct omap_intr_ha= ndler_s *s, int is_fiq) =20 static void omap_set_intr(void *opaque, int irq, int req) { - struct omap_intr_handler_s *ih =3D opaque; + OMAPIntcState *ih =3D opaque; uint32_t rise; =20 struct omap_intr_handler_bank_s *bank =3D &ih->bank[irq >> 5]; @@ -136,7 +136,7 @@ static void omap_set_intr(void *opaque, int irq, int re= q) /* Simplified version with no edge detection */ static void omap_set_intr_noedge(void *opaque, int irq, int req) { - struct omap_intr_handler_s *ih =3D opaque; + OMAPIntcState *ih =3D opaque; uint32_t rise; =20 struct omap_intr_handler_bank_s *bank =3D &ih->bank[irq >> 5]; @@ -156,7 +156,7 @@ static void omap_set_intr_noedge(void *opaque, int irq,= int req) static uint64_t omap_inth_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_intr_handler_s *s =3D opaque; + OMAPIntcState *s =3D opaque; int i, offset =3D addr; int bank_no =3D offset >> 8; int line_no; @@ -234,7 +234,7 @@ static uint64_t omap_inth_read(void *opaque, hwaddr add= r, static void omap_inth_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_intr_handler_s *s =3D opaque; + OMAPIntcState *s =3D opaque; int i, offset =3D addr; int bank_no =3D offset >> 8; struct omap_intr_handler_bank_s *bank =3D &s->bank[bank_no]; @@ -336,7 +336,7 @@ static const MemoryRegionOps omap_inth_mem_ops =3D { =20 static void omap_inth_reset(DeviceState *dev) { - struct omap_intr_handler_s *s =3D OMAP_INTC(dev); + OMAPIntcState *s =3D OMAP_INTC(dev); int i; =20 for (i =3D 0; i < s->nbanks; ++i){ @@ -366,7 +366,7 @@ static void omap_inth_reset(DeviceState *dev) static void omap_intc_init(Object *obj) { DeviceState *dev =3D DEVICE(obj); - struct omap_intr_handler_s *s =3D OMAP_INTC(obj); + OMAPIntcState *s =3D OMAP_INTC(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 s->nbanks =3D 1; @@ -380,25 +380,25 @@ static void omap_intc_init(Object *obj) =20 static void omap_intc_realize(DeviceState *dev, Error **errp) { - struct omap_intr_handler_s *s =3D OMAP_INTC(dev); + OMAPIntcState *s =3D OMAP_INTC(dev); =20 if (!s->iclk) { error_setg(errp, "omap-intc: clk not connected"); } } =20 -void omap_intc_set_iclk(omap_intr_handler *intc, omap_clk clk) +void omap_intc_set_iclk(OMAPIntcState *intc, omap_clk clk) { intc->iclk =3D clk; } =20 -void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk) +void omap_intc_set_fclk(OMAPIntcState *intc, omap_clk clk) { intc->fclk =3D clk; } =20 static Property omap_intc_properties[] =3D { - DEFINE_PROP_UINT32("size", struct omap_intr_handler_s, size, 0x100), + DEFINE_PROP_UINT32("size", OMAPIntcState, size, 0x100), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -423,7 +423,7 @@ static const TypeInfo omap_intc_info =3D { static uint64_t omap2_inth_read(void *opaque, hwaddr addr, unsigned size) { - struct omap_intr_handler_s *s =3D opaque; + OMAPIntcState *s =3D opaque; int offset =3D addr; int bank_no, line_no; struct omap_intr_handler_bank_s *bank =3D NULL; @@ -504,7 +504,7 @@ static uint64_t omap2_inth_read(void *opaque, hwaddr ad= dr, static void omap2_inth_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - struct omap_intr_handler_s *s =3D opaque; + OMAPIntcState *s =3D opaque; int offset =3D addr; int bank_no, line_no; struct omap_intr_handler_bank_s *bank =3D NULL; @@ -622,7 +622,7 @@ static const MemoryRegionOps omap2_inth_mem_ops =3D { static void omap2_intc_init(Object *obj) { DeviceState *dev =3D DEVICE(obj); - struct omap_intr_handler_s *s =3D OMAP_INTC(obj); + OMAPIntcState *s =3D OMAP_INTC(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 s->level_only =3D 1; @@ -637,7 +637,7 @@ static void omap2_intc_init(Object *obj) =20 static void omap2_intc_realize(DeviceState *dev, Error **errp) { - struct omap_intr_handler_s *s =3D OMAP_INTC(dev); + OMAPIntcState *s =3D OMAP_INTC(dev); =20 if (!s->iclk) { error_setg(errp, "omap2-intc: iclk not connected"); @@ -650,7 +650,7 @@ static void omap2_intc_realize(DeviceState *dev, Error = **errp) } =20 static Property omap2_intc_properties[] =3D { - DEFINE_PROP_UINT8("revision", struct omap_intr_handler_s, + DEFINE_PROP_UINT8("revision", OMAPIntcState, revision, 0x21), DEFINE_PROP_END_OF_LIST(), }; @@ -676,7 +676,7 @@ static const TypeInfo omap2_intc_info =3D { static const TypeInfo omap_intc_type_info =3D { .name =3D TYPE_OMAP_INTC, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(omap_intr_handler), + .instance_size =3D sizeof(OMAPIntcState), .abstract =3D true, }; =20 --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673623498; cv=none; d=zohomail.com; s=zohoarc; b=TDXIskd/F55QzQZ8DS5sho5CNurDj5txRr1hyTCxUBvON80i8K+nCY5YX57ci/ZA45bePkeedn67m96Ogd+2tyLhkGDZWQjjdMasQnKgQCRrcN2ZhKZpc5ganxdfkOHW5QLU/jlGp0M/YJldvcjSQNEGNYchCBNLca+2/5YAsAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673623498; h=Content-Type:Content-Transfer-Encoding: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=K7L7nETsVwMFzyPJrLglCmIuDx0/wFyIH1/RuTBWzQ8=; b=k1UQcXhB2AXoZT7zl412HKsyZQnIpOvOS0VLwKsESKIptM0pQaIzITynJNLiR4AQvy5xEba3Zjoo6wZknIzd/filpe7oOCOuetiSbR4SSe9zWVoizE7K+ekmAgLIgNiwHsnQy8yLXfyWFzCWJaZp56FxSm+khO3tdYMEoKpkbCE= 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+importer2=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 1673623498019829.1883521098517; Fri, 13 Jan 2023 07:24:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnI-0001VX-IY; Fri, 13 Jan 2023 09:12:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKml-00012h-7V for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:59 -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 1pGKmh-0003pM-96 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:11:58 -0500 Received: by mail-wm1-x336.google.com with SMTP id q8so3554826wmo.5 for ; Fri, 13 Jan 2023 06:11:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:53 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K7L7nETsVwMFzyPJrLglCmIuDx0/wFyIH1/RuTBWzQ8=; b=YLnMVNnjVbSfN+4jlohZ8w9KWK/7rmMGKW/GHBcv2yIrJ2WdQokLH7ptDhsSBPkzDJ dBqCzLwqyfVLLLx2Ncy0V289/fUQn7OlCJFiZ7LZkVRBxm9TB16kaVSLCU7W+OExh4KO qHYNs3a5qv1B+ytNf8BsWYr1wDFjM8DlKYXN7SAZ88mMOtaI/0jGXPAVCPd/oDKkVPcg Qw2pNub+pY5rXLOmVYMHzMuXojd1pPVFF6minEKPyldsswX/bZWZ6Xx1ikiNdNap3vDF 5oOGwsaJGFFE6RHPTUS2j1ccaeiIiUEQQDgw+tELh+kdPbDCFoyBlFZTRKfrlHEy4Mu0 MLcA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K7L7nETsVwMFzyPJrLglCmIuDx0/wFyIH1/RuTBWzQ8=; b=wdmgSWasNxfk1ljHXhdzogm7PIjTBVvy8rcN11qsMFNPbDpj8bh0JEwf0XP6Y0peaM fqblHC8kBtxbhL8T7wmhuPftRPbcjixpPG+B22x+FVBUJedxGwIExaOJV03O5pIusrlF 2vvUavvb0KFaEbYBCJbcc1M8LKo5Bhe1Ja6I+FCrKkiMx1sR09onO4nMN2BIN44XEBlO YDTrr3PNBqj6IflG4jdr45PpK6Z3cLmm1Fu0gEV4wMYqyhRLs6YhiAn/iAoYJDWt0oUO soKxIkn3eqn7tzcX4KA55zis/kbBeR7tH8LeSvxcMiFqYO0X2FPsQpqPWulsXDpd3g5M Vjeg== X-Gm-Message-State: AFqh2kqZnbQmf289vdS9lDthoMR1q/9VzhjL5CiPSIdphm42gFaZCLRF DNGZSbgMeYuPlqTe9krCl20+Ulvkbwf1+zju X-Google-Smtp-Source: AMrXdXsrpEuBQANpqzentmhW7qsxAYUC3ANlkCi/vEzWe5XEP34o2TM+F0/8SUhPbbDKMDpAVEK78Q== X-Received: by 2002:a05:600c:358f:b0:3d1:cdf7:debf with SMTP id p15-20020a05600c358f00b003d1cdf7debfmr60018610wmq.26.1673619113662; Fri, 13 Jan 2023 06:11:53 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/38] hw/arm/stellaris: Drop useless casts from void * to pointer Date: Fri, 13 Jan 2023 14:11:18 +0000 Message-Id: <20230113141126.535646-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673623499342100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-8-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/stellaris.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index a9e96c37f89..051c242e9d6 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -749,7 +749,7 @@ static void stellaris_adc_update(stellaris_adc_state *s) =20 static void stellaris_adc_trigger(void *opaque, int irq, int level) { - stellaris_adc_state *s =3D (stellaris_adc_state *)opaque; + stellaris_adc_state *s =3D opaque; int n; =20 for (n =3D 0; n < 4; n++) { @@ -785,7 +785,7 @@ static void stellaris_adc_reset(stellaris_adc_state *s) static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, unsigned size) { - stellaris_adc_state *s =3D (stellaris_adc_state *)opaque; + stellaris_adc_state *s =3D opaque; =20 /* TODO: Implement this. */ if (offset >=3D 0x40 && offset < 0xc0) { @@ -833,7 +833,7 @@ static uint64_t stellaris_adc_read(void *opaque, hwaddr= offset, static void stellaris_adc_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { - stellaris_adc_state *s =3D (stellaris_adc_state *)opaque; + stellaris_adc_state *s =3D opaque; =20 /* TODO: Implement this. */ if (offset >=3D 0x40 && offset < 0xc0) { --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673632093; cv=none; d=zohomail.com; s=zohoarc; b=W77hwPhK7sHjQy2ToofM2hCgntQDBewk4MxF4LMnF9E18v0QDSQzfWEL2bz2Et9nlx8VdV1gW9/c3rkcuZsZFP62+RJr3zeHKQgpHAbpccW7cBfoiIgXhDzHcHIWCLyBpjAh/92cD72YErWSAa4Y8RnazdE3md9/y4sXvxLBbWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673632093; h=Content-Type:Content-Transfer-Encoding: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=/mW9HpUCcthbdZB5sduQCQbBVJGhP4Uz6vBQL11RdbI=; b=lLPDUgT5zhrubQdC87wccSH1fMfJfMIpOn5FLfmtus6BXIjAqlz2HQiqkR74hD1uzcpVNFTXlpSmegnB6eb5oMRULi5Q2R4BP5Z91uAbNTUVDZHa2RVNz5W++7v5kZg7agceJyNnCSU8gA58QdgGLQuwhuTDnp+Egmhv9147nWs= 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+importer2=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 SMTP id 1673632093356754.5418855060253; Fri, 13 Jan 2023 09:48:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnM-0001cM-Rr; Fri, 13 Jan 2023 09:12:36 -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 1pGKmo-00015G-SM for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:03 -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 1pGKmi-0003pc-9a for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:02 -0500 Received: by mail-wm1-x329.google.com with SMTP id q8so3554853wmo.5 for ; Fri, 13 Jan 2023 06:11:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:53 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/mW9HpUCcthbdZB5sduQCQbBVJGhP4Uz6vBQL11RdbI=; b=Yw4+/brWLhLOxfgnWOzK6mRmONYVvehTRbNejznMQ2ixGfLS1wjK0OSCx4UHeum7Pc z3R6pJoufLqcqfoEttNpgh4BH5/EXFr2sewoMSs6opFWbkTAF3tdqKsbhsCUGlzJP+LZ nIqMKO/09XUiqFZpSe9rGDC4RhktGUbic6j++dM43701Vsu8kEu6ZSOIi3uCiGucEq9l xlqwdHwoGzjuemBF4ah0q3phzEXXkV+jdmvTcV2jtO5jQWHgb4SFY0mdoRVy0V/XWdzX 5YT1Ix4qQQXPa5Y0r2GFljd9Yy0jTJzVpPM3zUW5rJB7GOPDjwPrhnqWUeoRtMkzCgEr 3YQQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/mW9HpUCcthbdZB5sduQCQbBVJGhP4Uz6vBQL11RdbI=; b=BW52SSGoobL3K4b1OaaeU26W4dgYmY5260hfvRSWtRt9xaSU4QdozLs0c8t1sfsk+K phzLGgXhSAxZIvyoAUI1BGMRvzB8quhiL0lH0I0FamundYASlVJyZv9B6i8E4w1sPwtg Ma4FwBzXXDy8UWvrGksJwkvzGmNqdsKnYpVPCCtqRjAsDxI0UrkmVnphYFo2OMBQnG4b WXFBqRUOp0bxHoNfAobJofiYOSbSXCNy4AA1zx2Dul3rtMOMdla8md+Vcv67OGwgNNWG KQplbgKsZlPfn16Cyg/XoHTHmW2ko8l+AwiCxFNTwYIps09sQbEK0/IWRHHzh0rCVEgA 8YfA== X-Gm-Message-State: AFqh2kr/RkwthemnqXey/vd5m2P3pM3tUIi3uBc5ux8ymSw6RZFJ2jxH kCgvar9uUGB2eR2wyH2zOvxYWS0WidzqXSFv X-Google-Smtp-Source: AMrXdXv8Ckt6zzIV6MFCm31InvK4LPiUKKQ0fwftar45/zilXueZZogPchrx3PDIzIQ4MMcdtzVVcQ== X-Received: by 2002:a05:600c:3502:b0:3d9:e75c:756c with SMTP id h2-20020a05600c350200b003d9e75c756cmr18961254wmq.12.1673619114528; Fri, 13 Jan 2023 06:11:54 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/38] hw/arm/stellaris: Use CamelCase for STELLARIS_ADC type name Date: Fri, 13 Jan 2023 14:11:19 +0000 Message-Id: <20230113141126.535646-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673632094239100001 From: Philippe Mathieu-Daud=C3=A9 Following docs/devel/style.rst guidelines, rename stellaris_adc_state -> StellarisADCState. This also remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-9-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/stellaris.c | 73 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 051c242e9d6..67a2293d35f 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -674,9 +674,8 @@ static void stellaris_i2c_init(Object *obj) #define STELLARIS_ADC_FIFO_FULL 0x1000 =20 #define TYPE_STELLARIS_ADC "stellaris-adc" -typedef struct StellarisADCState stellaris_adc_state; -DECLARE_INSTANCE_CHECKER(stellaris_adc_state, STELLARIS_ADC, - TYPE_STELLARIS_ADC) +typedef struct StellarisADCState StellarisADCState; +DECLARE_INSTANCE_CHECKER(StellarisADCState, STELLARIS_ADC, TYPE_STELLARIS_= ADC) =20 struct StellarisADCState { SysBusDevice parent_obj; @@ -700,7 +699,7 @@ struct StellarisADCState { qemu_irq irq[4]; }; =20 -static uint32_t stellaris_adc_fifo_read(stellaris_adc_state *s, int n) +static uint32_t stellaris_adc_fifo_read(StellarisADCState *s, int n) { int tail; =20 @@ -716,7 +715,7 @@ static uint32_t stellaris_adc_fifo_read(stellaris_adc_s= tate *s, int n) return s->fifo[n].data[tail]; } =20 -static void stellaris_adc_fifo_write(stellaris_adc_state *s, int n, +static void stellaris_adc_fifo_write(StellarisADCState *s, int n, uint32_t value) { int head; @@ -736,7 +735,7 @@ static void stellaris_adc_fifo_write(stellaris_adc_stat= e *s, int n, s->fifo[n].state |=3D STELLARIS_ADC_FIFO_FULL; } =20 -static void stellaris_adc_update(stellaris_adc_state *s) +static void stellaris_adc_update(StellarisADCState *s) { int level; int n; @@ -749,7 +748,7 @@ static void stellaris_adc_update(stellaris_adc_state *s) =20 static void stellaris_adc_trigger(void *opaque, int irq, int level) { - stellaris_adc_state *s =3D opaque; + StellarisADCState *s =3D opaque; int n; =20 for (n =3D 0; n < 4; n++) { @@ -771,7 +770,7 @@ static void stellaris_adc_trigger(void *opaque, int irq= , int level) } } =20 -static void stellaris_adc_reset(stellaris_adc_state *s) +static void stellaris_adc_reset(StellarisADCState *s) { int n; =20 @@ -785,7 +784,7 @@ static void stellaris_adc_reset(stellaris_adc_state *s) static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, unsigned size) { - stellaris_adc_state *s =3D opaque; + StellarisADCState *s =3D opaque; =20 /* TODO: Implement this. */ if (offset >=3D 0x40 && offset < 0xc0) { @@ -833,7 +832,7 @@ static uint64_t stellaris_adc_read(void *opaque, hwaddr= offset, static void stellaris_adc_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { - stellaris_adc_state *s =3D opaque; + StellarisADCState *s =3D opaque; =20 /* TODO: Implement this. */ if (offset >=3D 0x40 && offset < 0xc0) { @@ -901,31 +900,31 @@ static const VMStateDescription vmstate_stellaris_adc= =3D { .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (VMStateField[]) { - VMSTATE_UINT32(actss, stellaris_adc_state), - VMSTATE_UINT32(ris, stellaris_adc_state), - VMSTATE_UINT32(im, stellaris_adc_state), - VMSTATE_UINT32(emux, stellaris_adc_state), - VMSTATE_UINT32(ostat, stellaris_adc_state), - VMSTATE_UINT32(ustat, stellaris_adc_state), - VMSTATE_UINT32(sspri, stellaris_adc_state), - VMSTATE_UINT32(sac, stellaris_adc_state), - VMSTATE_UINT32(fifo[0].state, stellaris_adc_state), - VMSTATE_UINT32_ARRAY(fifo[0].data, stellaris_adc_state, 16), - VMSTATE_UINT32(ssmux[0], stellaris_adc_state), - VMSTATE_UINT32(ssctl[0], stellaris_adc_state), - VMSTATE_UINT32(fifo[1].state, stellaris_adc_state), - VMSTATE_UINT32_ARRAY(fifo[1].data, stellaris_adc_state, 16), - VMSTATE_UINT32(ssmux[1], stellaris_adc_state), - VMSTATE_UINT32(ssctl[1], stellaris_adc_state), - VMSTATE_UINT32(fifo[2].state, stellaris_adc_state), - VMSTATE_UINT32_ARRAY(fifo[2].data, stellaris_adc_state, 16), - VMSTATE_UINT32(ssmux[2], stellaris_adc_state), - VMSTATE_UINT32(ssctl[2], stellaris_adc_state), - VMSTATE_UINT32(fifo[3].state, stellaris_adc_state), - VMSTATE_UINT32_ARRAY(fifo[3].data, stellaris_adc_state, 16), - VMSTATE_UINT32(ssmux[3], stellaris_adc_state), - VMSTATE_UINT32(ssctl[3], stellaris_adc_state), - VMSTATE_UINT32(noise, stellaris_adc_state), + VMSTATE_UINT32(actss, StellarisADCState), + VMSTATE_UINT32(ris, StellarisADCState), + VMSTATE_UINT32(im, StellarisADCState), + VMSTATE_UINT32(emux, StellarisADCState), + VMSTATE_UINT32(ostat, StellarisADCState), + VMSTATE_UINT32(ustat, StellarisADCState), + VMSTATE_UINT32(sspri, StellarisADCState), + VMSTATE_UINT32(sac, StellarisADCState), + VMSTATE_UINT32(fifo[0].state, StellarisADCState), + VMSTATE_UINT32_ARRAY(fifo[0].data, StellarisADCState, 16), + VMSTATE_UINT32(ssmux[0], StellarisADCState), + VMSTATE_UINT32(ssctl[0], StellarisADCState), + VMSTATE_UINT32(fifo[1].state, StellarisADCState), + VMSTATE_UINT32_ARRAY(fifo[1].data, StellarisADCState, 16), + VMSTATE_UINT32(ssmux[1], StellarisADCState), + VMSTATE_UINT32(ssctl[1], StellarisADCState), + VMSTATE_UINT32(fifo[2].state, StellarisADCState), + VMSTATE_UINT32_ARRAY(fifo[2].data, StellarisADCState, 16), + VMSTATE_UINT32(ssmux[2], StellarisADCState), + VMSTATE_UINT32(ssctl[2], StellarisADCState), + VMSTATE_UINT32(fifo[3].state, StellarisADCState), + VMSTATE_UINT32_ARRAY(fifo[3].data, StellarisADCState, 16), + VMSTATE_UINT32(ssmux[3], StellarisADCState), + VMSTATE_UINT32(ssctl[3], StellarisADCState), + VMSTATE_UINT32(noise, StellarisADCState), VMSTATE_END_OF_LIST() } }; @@ -933,7 +932,7 @@ static const VMStateDescription vmstate_stellaris_adc = =3D { static void stellaris_adc_init(Object *obj) { DeviceState *dev =3D DEVICE(obj); - stellaris_adc_state *s =3D STELLARIS_ADC(obj); + StellarisADCState *s =3D STELLARIS_ADC(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); int n; =20 @@ -1381,7 +1380,7 @@ static void stellaris_adc_class_init(ObjectClass *kla= ss, void *data) static const TypeInfo stellaris_adc_info =3D { .name =3D TYPE_STELLARIS_ADC, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(stellaris_adc_state), + .instance_size =3D sizeof(StellarisADCState), .instance_init =3D stellaris_adc_init, .class_init =3D stellaris_adc_class_init, }; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622491; cv=none; d=zohomail.com; s=zohoarc; b=i0mg+lbArUOumPc3RzymfdcXUHxzG4fNgtgkIy+MpUVSw0L/cxdiaRLbj/d4CZuC2Rn10gvtHfwzFUbEeVmSNM3mdnETOl6FdaCrFt/IVExPrtbHxRctl/3G4Hs70WTcCAX2yvNNIIAXvCS9jkCQ1K+gF8bZHNWiOP8BWOLFk1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622491; h=Content-Type:Content-Transfer-Encoding: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=3Da7vFEvyDdTxYhPgoNXQkt+agB1JswoE2UlaoVmPJA=; b=debtVETDnTW58KIMJp68caW26rKuHyV0y/1RLP6KQhWltoqUsfW7nZFfQGDJvue6EyE84BjSCpYA+jZodGkGG8A4zRPZQjrBx08KeMwSES6sMtYx7to+6/O2C9rWA0MJEnm/5fWOFoCCrMumgJYzFaQ320eBVDgYZB1DwjoFvvs= 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+importer2=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 SMTP id 167362249149765.0639309350779; Fri, 13 Jan 2023 07:08:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnE-0001TK-Uz; Fri, 13 Jan 2023 09:12:28 -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 1pGKmn-00014H-60 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:01 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmi-0003fm-8h for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:00 -0500 Received: by mail-wm1-x332.google.com with SMTP id j34-20020a05600c1c2200b003da1b054057so3149804wms.5 for ; Fri, 13 Jan 2023 06:11:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:54 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3Da7vFEvyDdTxYhPgoNXQkt+agB1JswoE2UlaoVmPJA=; b=Nh9oPfkmeZCMbiQoTikbXwuOl9Y6GKycqa/4TYsIEuuvwlEOGk1EVUXvDDQ8kQ+utR eDeCrdjRZ5PERonMbBUlTQkrl2a9/3BFO8M7KGiTSVYyYYdwB/p6LjwVgIIX+TIxK2R7 ocF0258c1UWTs9E4+vbWfWp/EMlCSmE4YGcPigItn2TU0qRY5Eq3hGIdEor11o8LqWKJ dmjS/9txC0YH9C1ENPF44vIsfRfQfi+12ao6QYK369B11X/V78XURnxX7EDGm1cxgIgp O2NnPTBzGuD6JzpRq3wm1n5PKgQaDvcwK4SjVCF9Y/p1yyzoipPPxP46XwsJyzVaH2Pg L1OA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Da7vFEvyDdTxYhPgoNXQkt+agB1JswoE2UlaoVmPJA=; b=KiYbpOmBygsix4SvNIibYjduUyRAJnBaBxpUsfB96IjUboy13seonaZEh0IaopjpbE wQMgS57Ef+RIlSSCavmRtWz8reC6E4SAnSNJertdd7WfE44QMsTdIU/Yw4nzLWxhVg+R iDtu2v4541fZE3nXlPwKlzZ3jXdSBmuhr9XUwgdnuuqKFUXJTwJ4p7p2cGy67HhRuDVh rHLpAvCMMlz0pdK39C+9RJ7BkVwc3c1Pw/MgwrDGrFWcE+qqdbEt0LJvDDUdchsqTY37 yVCa/qbK1iBLzjL1eljfxiRyoxwtigBm6XVK+4IL5Oes5TuATcsZ5p8e5tWs7/TGCsYy IrIg== X-Gm-Message-State: AFqh2kow3BEKPNskeBYQBCp7/iGG7J2/8a/Gp86kEdcdre5/ms+C3zWw QSXGNlaROE30D3/tTNWqAkz2ZA41nswiKxuZ X-Google-Smtp-Source: AMrXdXuyTKg0MF2b0JHeiEHjZT/ZZ1QUAmFlofxFfIzRltX4vwdC9nWtMgQSULdkPgvKBG7puPJVjQ== X-Received: by 2002:a05:600c:4e46:b0:3d2:3761:b717 with SMTP id e6-20020a05600c4e4600b003d23761b717mr58925251wmq.37.1673619115301; Fri, 13 Jan 2023 06:11:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/38] hw/arm/bcm2836: Remove definitions generated by OBJECT_DECLARE_TYPE() Date: Fri, 13 Jan 2023 14:11:20 +0000 Message-Id: <20230113141126.535646-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622492910100003 From: Philippe Mathieu-Daud=C3=A9 The typedef and definitions are generated by the OBJECT_DECLARE_TYPE macro in "hw/arm/bcm2836.h": 20 #define TYPE_BCM283X "bcm283x" 21 OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X) The script ran in commit a489d1951c ("Use OBJECT_DECLARE_TYPE when possible") missed them because they are declared in a different file unit. Remove them. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-10-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/bcm2836.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 24354338cad..f894338fc6a 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -16,7 +16,7 @@ #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" =20 -typedef struct BCM283XClass { +struct BCM283XClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ @@ -26,12 +26,7 @@ typedef struct BCM283XClass { hwaddr peri_base; /* Peripheral base address seen by the CPU */ hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */ int clusterid; -} BCM283XClass; - -#define BCM283X_CLASS(klass) \ - OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) -#define BCM283X_GET_CLASS(obj) \ - OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) +}; =20 static Property bcm2836_enabled_cores_property =3D DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0); --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622315; cv=none; d=zohomail.com; s=zohoarc; b=VVq0lY6021HDgJYDEiUZJMj7A6kKUUVVdmif+FKp49wxLQg9GxRIJ0e33bKtXkZbjCltYa3IhIKId/FH47Nf9c9NIxzJyiWfd3YwKGJbBDJVMRrNaqNdB17jFheLZwmdKVXzwIR9ICTXRO7untrvobaGC2AOe9J1rwusWiCL9Qg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622315; h=Content-Type:Content-Transfer-Encoding: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=tpD3Y/TLa5go/ZF5qsKJC0PbSMsoHaH/UgS/kvdff3s=; b=CISILsrctmwLErsKdjvkSt72QKNJrMLkhK0qPP2ogdza1RBtlKVwZ5P3JuBbbJPVK7fi0IUOQjgqWxagDWhovTQ2n+4GLiBIoQ70WIz1NTQpLoWtTBE+2Rg2syoMdIdCg9NzrPUPg7fMRs91DBv+nP7AUyN1BXlxF7CDgvuJ1sI= 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+importer2=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 1673622315830959.6417059720021; Fri, 13 Jan 2023 07:05:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnR-0001li-UW; Fri, 13 Jan 2023 09:12: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 1pGKn2-0001G0-66 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:17 -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 1pGKmj-0003qH-UY for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:04 -0500 Received: by mail-wm1-x333.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so17443400wms.2 for ; Fri, 13 Jan 2023 06:11:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:55 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=tpD3Y/TLa5go/ZF5qsKJC0PbSMsoHaH/UgS/kvdff3s=; b=bh2brmQCKCsSD6PdNT/wVOAwSb4xYMc4wWiSaCmFXX+Cani3kZwd91NquQymRjWVE1 bmnOSiVCxDuU5Cok3FMuL5GE7Ea5iKiHLKCOhnh/jFmzyxr8Aj/s13LSVcZymh6Ro8a/ GOEcBU1XYyrv2jhhx/XK4Lo9+85bd7m9jaF1+V8fIEy4b1HvVXCIJ2G7SKwa+uNEt0ee W+cbwHc2qc/5wyr429jkbHp3+sgUjwOlsseASwbOHy+Xfk2U5zmwTnWukkyPGrt5W/SA bPqZs4+lZS3QCICNrqAPvlVLeaZxU5V1dbEy3E2V+7Efms0MiSd+TA8E5hMiJgnxpz2A QkWg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tpD3Y/TLa5go/ZF5qsKJC0PbSMsoHaH/UgS/kvdff3s=; b=qo4ksTT2QCBZ4ibUGzIh4lkjRp3nUY5RP5wi5MIjhfhd06pCskmG62RW8q35dFq/q5 CA9Odcof3NYRoEHA3k257tCaUtaL0qILhdrqGbO0JyeUW4VDWg3zXj1LwyR0YsRBm2rS ZbMTHUr7yMiCye3XxMhF+Cr0WooNRn91UCsuHD4ychwy1+XB5v4xuhd9ds48wM3V9xrM c9XXgRrFnIJhPZpPatfOnjrdjZozblD9UuEUmclOFfPUeuufkKAwGqmDABV0QVB7HiVl ppcQjlAYv7T5tFZjTc+pZVP9en07KoH0jJzRoJgGv8WduPkDRnAahy4rJqAgIiKSctsT 984A== X-Gm-Message-State: AFqh2kq8Eq/ToWmnCupeBEdoi1xDF9BqUbLnKpgkEVsY5WL8UkulwxCh raFTGNewySPGCAAB5aiEr++whXAZSFbbxfF/ X-Google-Smtp-Source: AMrXdXsx5EZnLclQjBUUaou/02AanLrSAx/P75MMRyMI6eye7Litg9IQ/+aQxlRabJMqEJ17T494Xw== X-Received: by 2002:a05:600c:42d5:b0:3d6:e790:c9a0 with SMTP id j21-20020a05600c42d500b003d6e790c9a0mr69158614wme.10.1673619116227; Fri, 13 Jan 2023 06:11:56 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/38] hw/arm/npcm7xx: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() Date: Fri, 13 Jan 2023 14:11:21 +0000 Message-Id: <20230113141126.535646-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622317191100001 From: Philippe Mathieu-Daud=C3=A9 NPCM7XX models have been commited after the conversion from commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). Manually convert them. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-11-philmd@linaro.org Signed-off-by: Peter Maydell --- include/hw/adc/npcm7xx_adc.h | 7 +++---- include/hw/arm/npcm7xx.h | 18 ++++++------------ include/hw/i2c/npcm7xx_smbus.h | 7 +++---- include/hw/misc/npcm7xx_clk.h | 2 +- include/hw/misc/npcm7xx_gcr.h | 6 +++--- include/hw/misc/npcm7xx_mft.h | 7 +++---- include/hw/misc/npcm7xx_pwm.h | 3 +-- include/hw/misc/npcm7xx_rng.h | 6 +++--- include/hw/net/npcm7xx_emc.h | 5 +---- include/hw/sd/npcm7xx_sdhci.h | 4 ++-- 10 files changed, 26 insertions(+), 39 deletions(-) diff --git a/include/hw/adc/npcm7xx_adc.h b/include/hw/adc/npcm7xx_adc.h index 7d8442107ae..93330a408d2 100644 --- a/include/hw/adc/npcm7xx_adc.h +++ b/include/hw/adc/npcm7xx_adc.h @@ -42,7 +42,7 @@ * @iref: The internal reference voltage, initialized at launch time. * @rv: The calibrated output values of 0.5V and 1.5V for the ADC. */ -typedef struct { +struct NPCM7xxADCState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -60,10 +60,9 @@ typedef struct { uint32_t iref; =20 uint16_t calibration_r_values[NPCM7XX_ADC_NUM_CALIB]; -} NPCM7xxADCState; +}; =20 #define TYPE_NPCM7XX_ADC "npcm7xx-adc" -#define NPCM7XX_ADC(obj) \ - OBJECT_CHECK(NPCM7xxADCState, (obj), TYPE_NPCM7XX_ADC) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxADCState, NPCM7XX_ADC) =20 #endif /* NPCM7XX_ADC_H */ diff --git a/include/hw/arm/npcm7xx.h b/include/hw/arm/npcm7xx.h index ce593235d94..f1b7e4a48d3 100644 --- a/include/hw/arm/npcm7xx.h +++ b/include/hw/arm/npcm7xx.h @@ -52,7 +52,7 @@ =20 #define NPCM7XX_NR_PWM_MODULES 2 =20 -typedef struct NPCM7xxMachine { +struct NPCM7xxMachine { MachineState parent; /* * PWM fan splitter. each splitter connects to one PWM output and @@ -60,11 +60,10 @@ typedef struct NPCM7xxMachine { */ SplitIRQ fan_splitter[NPCM7XX_NR_PWM_MODULES * NPCM7XX_PWM_PER_MODULE]; -} NPCM7xxMachine; +}; =20 #define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx") -#define NPCM7XX_MACHINE(obj) \ - OBJECT_CHECK(NPCM7xxMachine, (obj), TYPE_NPCM7XX_MACHINE) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxMachine, NPCM7XX_MACHINE) =20 typedef struct NPCM7xxMachineClass { MachineClass parent; @@ -77,7 +76,7 @@ typedef struct NPCM7xxMachineClass { #define NPCM7XX_MACHINE_GET_CLASS(obj) \ OBJECT_GET_CLASS(NPCM7xxMachineClass, (obj), TYPE_NPCM7XX_MACHINE) =20 -typedef struct NPCM7xxState { +struct NPCM7xxState { DeviceState parent; =20 ARMCPU cpu[NPCM7XX_MAX_NUM_CPUS]; @@ -105,10 +104,10 @@ typedef struct NPCM7xxState { NPCM7xxFIUState fiu[2]; NPCM7xxEMCState emc[2]; NPCM7xxSDHCIState mmc; -} NPCM7xxState; +}; =20 #define TYPE_NPCM7XX "npcm7xx" -#define NPCM7XX(obj) OBJECT_CHECK(NPCM7xxState, (obj), TYPE_NPCM7XX) +OBJECT_DECLARE_TYPE(NPCM7xxState, NPCM7xxClass, NPCM7XX) =20 #define TYPE_NPCM730 "npcm730" #define TYPE_NPCM750 "npcm750" @@ -122,11 +121,6 @@ typedef struct NPCM7xxClass { uint32_t num_cpus; } NPCM7xxClass; =20 -#define NPCM7XX_CLASS(klass) \ - OBJECT_CLASS_CHECK(NPCM7xxClass, (klass), TYPE_NPCM7XX) -#define NPCM7XX_GET_CLASS(obj) \ - OBJECT_GET_CLASS(NPCM7xxClass, (obj), TYPE_NPCM7XX) - /** * npcm7xx_load_kernel - Loads memory with everything needed to boot * @machine - The machine containing the SoC to be booted. diff --git a/include/hw/i2c/npcm7xx_smbus.h b/include/hw/i2c/npcm7xx_smbus.h index 7d59ee917eb..3555e6836fb 100644 --- a/include/hw/i2c/npcm7xx_smbus.h +++ b/include/hw/i2c/npcm7xx_smbus.h @@ -68,7 +68,7 @@ typedef enum NPCM7xxSMBusStatus { * @rx_cur: The current position of rx_fifo. * @status: The current status of the SMBus. */ -typedef struct NPCM7xxSMBusState { +struct NPCM7xxSMBusState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -104,10 +104,9 @@ typedef struct NPCM7xxSMBusState { uint8_t rx_cur; =20 NPCM7xxSMBusStatus status; -} NPCM7xxSMBusState; +}; =20 #define TYPE_NPCM7XX_SMBUS "npcm7xx-smbus" -#define NPCM7XX_SMBUS(obj) OBJECT_CHECK(NPCM7xxSMBusState, (obj), \ - TYPE_NPCM7XX_SMBUS) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxSMBusState, NPCM7XX_SMBUS) =20 #endif /* NPCM7XX_SMBUS_H */ diff --git a/include/hw/misc/npcm7xx_clk.h b/include/hw/misc/npcm7xx_clk.h index d5c8d16ca42..5ed4a4672b3 100644 --- a/include/hw/misc/npcm7xx_clk.h +++ b/include/hw/misc/npcm7xx_clk.h @@ -175,6 +175,6 @@ struct NPCM7xxCLKState { }; =20 #define TYPE_NPCM7XX_CLK "npcm7xx-clk" -#define NPCM7XX_CLK(obj) OBJECT_CHECK(NPCM7xxCLKState, (obj), TYPE_NPCM7XX= _CLK) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxCLKState, NPCM7XX_CLK) =20 #endif /* NPCM7XX_CLK_H */ diff --git a/include/hw/misc/npcm7xx_gcr.h b/include/hw/misc/npcm7xx_gcr.h index 9419e0a7d2a..c0bbdda77e5 100644 --- a/include/hw/misc/npcm7xx_gcr.h +++ b/include/hw/misc/npcm7xx_gcr.h @@ -55,7 +55,7 @@ */ #define NPCM7XX_GCR_NR_REGS (0x148 / sizeof(uint32_t)) =20 -typedef struct NPCM7xxGCRState { +struct NPCM7xxGCRState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -65,9 +65,9 @@ typedef struct NPCM7xxGCRState { uint32_t reset_pwron; uint32_t reset_mdlr; uint32_t reset_intcr3; -} NPCM7xxGCRState; +}; =20 #define TYPE_NPCM7XX_GCR "npcm7xx-gcr" -#define NPCM7XX_GCR(obj) OBJECT_CHECK(NPCM7xxGCRState, (obj), TYPE_NPCM7XX= _GCR) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxGCRState, NPCM7XX_GCR) =20 #endif /* NPCM7XX_GCR_H */ diff --git a/include/hw/misc/npcm7xx_mft.h b/include/hw/misc/npcm7xx_mft.h index 36785e3ba81..d6384382cea 100644 --- a/include/hw/misc/npcm7xx_mft.h +++ b/include/hw/misc/npcm7xx_mft.h @@ -49,7 +49,7 @@ * @max_rpm: The maximum rpm for fans. Order: A0, B0, A1, B1. * @duty: The duty cycles for fans, relative to NPCM7XX_PWM_MAX_DUTY. */ -typedef struct NPCM7xxMFTState { +struct NPCM7xxMFTState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -61,10 +61,9 @@ typedef struct NPCM7xxMFTState { =20 uint32_t max_rpm[NPCM7XX_MFT_FANIN_COUNT]; uint32_t duty[NPCM7XX_MFT_FANIN_COUNT]; -} NPCM7xxMFTState; +}; =20 #define TYPE_NPCM7XX_MFT "npcm7xx-mft" -#define NPCM7XX_MFT(obj) \ - OBJECT_CHECK(NPCM7xxMFTState, (obj), TYPE_NPCM7XX_MFT) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxMFTState, NPCM7XX_MFT) =20 #endif /* NPCM7XX_MFT_H */ diff --git a/include/hw/misc/npcm7xx_pwm.h b/include/hw/misc/npcm7xx_pwm.h index 7ad632a93a1..bf953440acc 100644 --- a/include/hw/misc/npcm7xx_pwm.h +++ b/include/hw/misc/npcm7xx_pwm.h @@ -101,7 +101,6 @@ struct NPCM7xxPWMState { }; =20 #define TYPE_NPCM7XX_PWM "npcm7xx-pwm" -#define NPCM7XX_PWM(obj) \ - OBJECT_CHECK(NPCM7xxPWMState, (obj), TYPE_NPCM7XX_PWM) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxPWMState, NPCM7XX_PWM) =20 #endif /* NPCM7XX_PWM_H */ diff --git a/include/hw/misc/npcm7xx_rng.h b/include/hw/misc/npcm7xx_rng.h index 5e85fd439d8..650375dc2cd 100644 --- a/include/hw/misc/npcm7xx_rng.h +++ b/include/hw/misc/npcm7xx_rng.h @@ -18,7 +18,7 @@ =20 #include "hw/sysbus.h" =20 -typedef struct NPCM7xxRNGState { +struct NPCM7xxRNGState { SysBusDevice parent; =20 MemoryRegion iomem; @@ -26,9 +26,9 @@ typedef struct NPCM7xxRNGState { uint8_t rngcs; uint8_t rngd; uint8_t rngmode; -} NPCM7xxRNGState; +}; =20 #define TYPE_NPCM7XX_RNG "npcm7xx-rng" -#define NPCM7XX_RNG(obj) OBJECT_CHECK(NPCM7xxRNGState, (obj), TYPE_NPCM7XX= _RNG) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxRNGState, NPCM7XX_RNG) =20 #endif /* NPCM7XX_RNG_H */ diff --git a/include/hw/net/npcm7xx_emc.h b/include/hw/net/npcm7xx_emc.h index eac7f298167..b789007160a 100644 --- a/include/hw/net/npcm7xx_emc.h +++ b/include/hw/net/npcm7xx_emc.h @@ -277,10 +277,7 @@ struct NPCM7xxEMCState { bool rx_active; }; =20 -typedef struct NPCM7xxEMCState NPCM7xxEMCState; - #define TYPE_NPCM7XX_EMC "npcm7xx-emc" -#define NPCM7XX_EMC(obj) \ - OBJECT_CHECK(NPCM7xxEMCState, (obj), TYPE_NPCM7XX_EMC) +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxEMCState, NPCM7XX_EMC) =20 #endif /* NPCM7XX_EMC_H */ diff --git a/include/hw/sd/npcm7xx_sdhci.h b/include/hw/sd/npcm7xx_sdhci.h index d728f0a40de..ad8002f766d 100644 --- a/include/hw/sd/npcm7xx_sdhci.h +++ b/include/hw/sd/npcm7xx_sdhci.h @@ -51,7 +51,7 @@ typedef struct NPCM7xxRegs { uint32_t boottoctrl; } NPCM7xxRegisters; =20 -typedef struct NPCM7xxSDHCIState { +struct NPCM7xxSDHCIState { SysBusDevice parent; =20 MemoryRegion container; @@ -60,6 +60,6 @@ typedef struct NPCM7xxSDHCIState { NPCM7xxRegisters regs; =20 SDHCIState sdhci; -} NPCM7xxSDHCIState; +}; =20 #endif /* NPCM7XX_SDHCI_H */ --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673633406; cv=none; d=zohomail.com; s=zohoarc; b=H6RyJCe40NsnuidR236j8WaRiATCL6KD+u31bTp6qdKT/9f8DxhptpGxmlrd8KN6XK38B0rSprWepmG9dl0ADkuEQewLneeTFjWP1Y697dOA3bhkIs2Qa19VwdtkUItJcuBqRC6zm0K8DTG+Urc5YTdKN6bSa3fGW3w9OB/pzq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673633406; h=Content-Type:Content-Transfer-Encoding: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=U0jVYGVtaVuDTvfYQzXO//xeUpfHpnJsdSaFt2/PTJ4=; b=NEgs/zoVC19pRonH+xEs+pvZaL5oOhOku6kZXKp2egv/gIDLtkZp1O4bH57TDWrpoKImKoqhWevcxckHnqAeRObSDhQyOHvx1lm757cZ/pb9dpO7cNSUU6P0TYzHEMfXyO6rO/OVdwNq0xlNDH4lF19GIB678QkQEUDGv8UoYp0= 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+importer2=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 1673633406348397.7175166767536; Fri, 13 Jan 2023 10:10:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnT-0001mz-RV; Fri, 13 Jan 2023 09:12:43 -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 1pGKn2-0001G7-E3 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:17 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmk-0003qZ-Fs for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:04 -0500 Received: by mail-wm1-x331.google.com with SMTP id g19-20020a05600c4ed300b003d9eb1dbc0aso14475072wmq.3 for ; Fri, 13 Jan 2023 06:11:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:56 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=U0jVYGVtaVuDTvfYQzXO//xeUpfHpnJsdSaFt2/PTJ4=; b=ICOMjXzB7d6oz4aeLRktJwpkU7OC6LyMj0cY8KavUYnfooxUPC6Nsm7yq6GAySvjV0 opgCuRdzaqkePWXm2EzNc8jy23vZw/dEIo4HFnPd/MckTjI3zesG+a/JXDukArFKJCwh NIc3QbrvIvDb976fdqkZPbZAK1UNDOasFKK0YCh0B9qsjk1eC6FQUPIRUqL8rwyM5Tmf Nzg902Rwyu3E3U8+iw1gjCoyXAL4ReQq6hMz+irRPSAdxeJ6YYREgbH7OVSf6GQ6+fgK oSyWpru6lqq31ABk0YwcKte0JrGd1MhlZouNbDFtmlOIJC/OCyo5TzkEiNP+fGA71uwY RmFw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U0jVYGVtaVuDTvfYQzXO//xeUpfHpnJsdSaFt2/PTJ4=; b=bVNnG3CB35q6YqGIL61XczqXVeVv5ktcaAFX8uNvUW5xf6YfHoAV30roKgxp9QaZEn KTNJI4aTsu/gSwNbzyJgu0K/szBV0Z0xYgOWYxbtIQBsg6cEdUc31gV8quya9/Px3G74 S8vtP6q5oEFPgKY3ddG/zXYL/DcjiiL5P6mxqm4nEVI4lQigk5IxS2rEnXo4g9khSqyq hE5YFq6kqdWlFEXi1l9bu1H+QBLml5EM5TvvhrQMfmbnaFbbUn8i1vHN22j8vF35ET9j FnmxK3rm6SCRY6LT/mESkx7GyLNJU+hLoFLYISdx5IdZ1dP7mtT39OMzWzuJli/yuPhY AmLQ== X-Gm-Message-State: AFqh2kpu2k6R8z5FOqYVx6hh16OPWhNB/TmoplOvgH4ydaVQeRzfQUdV 9TEAocN9DQFS5FSKgksWUIGjF/H0IZmFXjVG X-Google-Smtp-Source: AMrXdXsy5/oH0Awx91H7AELyLldEJxwzM2hzLyVVLtbst2UkvZGbs7E5iHImLmURo7VukAbrZTJwwA== X-Received: by 2002:a05:600c:1603:b0:3d1:c895:930c with SMTP id m3-20020a05600c160300b003d1c895930cmr58302550wmn.35.1673619117052; Fri, 13 Jan 2023 06:11:57 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/38] hw/misc/sbsa_ec: Rename TYPE_SBSA_EC -> TYPE_SBSA_SECURE_EC Date: Fri, 13 Jan 2023 14:11:22 +0000 Message-Id: <20230113141126.535646-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673633408424100001 From: Philippe Mathieu-Daud=C3=A9 The structure is named SECUREECState. Rename the type accordingly. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-12-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/misc/sbsa_ec.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/misc/sbsa_ec.c b/hw/misc/sbsa_ec.c index 8d939fe31b1..6f19c21195a 100644 --- a/hw/misc/sbsa_ec.c +++ b/hw/misc/sbsa_ec.c @@ -15,13 +15,14 @@ #include "hw/sysbus.h" #include "sysemu/runstate.h" =20 -typedef struct { +typedef struct SECUREECState { SysBusDevice parent_obj; MemoryRegion iomem; } SECUREECState; =20 -#define TYPE_SBSA_EC "sbsa-ec" -#define SECURE_EC(obj) OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_EC) +#define TYPE_SBSA_SECURE_EC "sbsa-ec" +#define SBSA_SECURE_EC(obj) \ + OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_SECURE_EC) =20 enum sbsa_ec_powerstates { SBSA_EC_CMD_POWEROFF =3D 0x01, @@ -36,7 +37,7 @@ static uint64_t sbsa_ec_read(void *opaque, hwaddr offset,= unsigned size) } =20 static void sbsa_ec_write(void *opaque, hwaddr offset, - uint64_t value, unsigned size) + uint64_t value, unsigned size) { if (offset =3D=3D 0) { /* PSCI machine power command register */ switch (value) { @@ -65,7 +66,7 @@ static const MemoryRegionOps sbsa_ec_ops =3D { =20 static void sbsa_ec_init(Object *obj) { - SECUREECState *s =3D SECURE_EC(obj); + SECUREECState *s =3D SBSA_SECURE_EC(obj); SysBusDevice *dev =3D SYS_BUS_DEVICE(obj); =20 memory_region_init_io(&s->iomem, obj, &sbsa_ec_ops, s, "sbsa-ec", @@ -82,7 +83,7 @@ static void sbsa_ec_class_init(ObjectClass *klass, void *= data) } =20 static const TypeInfo sbsa_ec_info =3D { - .name =3D TYPE_SBSA_EC, + .name =3D TYPE_SBSA_SECURE_EC, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(SECUREECState), .instance_init =3D sbsa_ec_init, --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673620487; cv=none; d=zohomail.com; s=zohoarc; b=BKdGLFbYkP0i7oaDbOTk9tW8Ht5uR/Z7JSxQtIaeKtChRM6Nn9w4GGqCL0/hOq/Hs5jrC2eVcy1xjx3aEZ7Q9REP3XvV74C7dFcefqOmRCafSE7M7WYGFjCNe4nFjbwv8GGnq7vTLx3v1JIHeoZMpSuK4MjPga1pKd6ttGQzJ+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673620487; h=Content-Type:Content-Transfer-Encoding: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=CkFzzLkhlrLOuC53SyPlsstsHQP1png5eWd8aBX/7JQ=; b=m9yVCfKGVdep1WXkovX2TF/7Ql5lgPIWR0hucd7sbaX1YRghym2ysffHCvunLwTfnxbh7eeUe20nvF28TMfak1MYkNx0HXrEy6C4qseoYbUlRn7SxFDJphMeB7rnwU8uyNNV0uxTXDg//NZDJNCAUiTr/Mkt7no2db73+Mau8qU= 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+importer2=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 1673620487417341.84017462582256; Fri, 13 Jan 2023 06:34:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnM-0001aP-3M; Fri, 13 Jan 2023 09:12:36 -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 1pGKn2-0001GE-JW for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:18 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKml-0003ra-5v for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:05 -0500 Received: by mail-wm1-x32f.google.com with SMTP id ay40so15364310wmb.2 for ; Fri, 13 Jan 2023 06:11:58 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11: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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CkFzzLkhlrLOuC53SyPlsstsHQP1png5eWd8aBX/7JQ=; b=m5zI9E8SQdQhB2Q5EZ/xy091uBW9QT1EyLcPcdW2AKfDYClv11MgQpAyUAppnbzJct rpGVm4fEEfbgsMX1DNoX5eSIvpfUY7k9n2ZSrXSxXKrdDq568h9iuWLy+fv344Yo4n/U 4HFp1dTwevtW/0cYlSetJqYyyYZbt+QNqq2vDZP4eHF6BB7wP3E/uZoA7dfYXNHyKWG+ R0G3S1VgwIvrQ7bM4U/dOREYTVs1dM7f6W84DgCh9b12frBHxrHvhrG+DDPyniSWtym4 y1tawIhdcs8JYPfSceY+sds87L+icNRj8jZLqpyN6ouXNI1sghq+s1ICYqecHXbGjMcq o97g== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CkFzzLkhlrLOuC53SyPlsstsHQP1png5eWd8aBX/7JQ=; b=HAGb1goYiV28T6vLaFPgc0LFcQmtpFhkI15YylN/AS2MjI/XBDN6eY60NIQrat4O2P 05f7elfMdNIXAg5hVaPqDLn5YlMNzJnCXZVl5HOKVPQmc0PwqAz9rlFPluUP6S9L2QG5 nxGINZeH00THcaTmfFD1/mwy7WLz0aQ/fH2ydCSyzJC5mArg6Byila62bqoTAEeN7yHz L/8TYHCtLnLz7Biv/BFBJEscw/eP/R1sWK+zUvWRyaf2svU/QRzU/an6b2VieDJc3GtO NC/kVLyOjoBlVrS1AqL2WuF0HJ8UCbbhbcTinTSfWI9WDyJt4LuG4i3maWjltLW/lZr2 cCgg== X-Gm-Message-State: AFqh2kqlCXE2xv4wdDW4mCTSAIgFt3S3JzE/1COOtlMBWWepO1aZ7yqW Tqpvr5fU1tUDe17DetuOu6LQAkAXZuGPgdKA X-Google-Smtp-Source: AMrXdXt9hVA238W+Qf8aR0T1TYNOavIrNOMplCr//tlf3DXFyZJ2WSPS2/k8lgSBsuTaWpXghWfvig== X-Received: by 2002:a7b:c447:0:b0:3c6:e63d:adaf with SMTP id l7-20020a7bc447000000b003c6e63dadafmr59429537wmi.31.1673619117938; Fri, 13 Jan 2023 06:11:57 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/38] hw/misc/sbsa_ec: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() Date: Fri, 13 Jan 2023 14:11:23 +0000 Message-Id: <20230113141126.535646-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673620489077100001 From: Philippe Mathieu-Daud=C3=A9 This model was merged few days before the QOM cleanup from commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible") was pulled and merged. Manually adapt. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230109140306.23161-13-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/misc/sbsa_ec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/misc/sbsa_ec.c b/hw/misc/sbsa_ec.c index 6f19c21195a..86b23a5372f 100644 --- a/hw/misc/sbsa_ec.c +++ b/hw/misc/sbsa_ec.c @@ -21,8 +21,7 @@ typedef struct SECUREECState { } SECUREECState; =20 #define TYPE_SBSA_SECURE_EC "sbsa-ec" -#define SBSA_SECURE_EC(obj) \ - OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_SECURE_EC) +OBJECT_DECLARE_SIMPLE_TYPE(SECUREECState, SBSA_SECURE_EC) =20 enum sbsa_ec_powerstates { SBSA_EC_CMD_POWEROFF =3D 0x01, --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673621085; cv=none; d=zohomail.com; s=zohoarc; b=gxcNJ0IlzqyRXjBg/TgnGUV0O1D8wVA29arPoSIxYToMdzgvl0kXQjztwpboZ1U/6VI3MimTTIWH8ePklHJWdZ0AxBPdKXQQfIHLWgWjNhzw0vfIqVD5Q/GKzHTczMam/rSv2+AKT4n+qeBIRNqBoqAFVT2lRaQCL89XWbTGiFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673621085; h=Content-Type:Content-Transfer-Encoding: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=utsTHAzpxt6XqjZGkDcmnI+U+lAeKY8OK38bR4joovo=; b=UfEbRZf4yU07ErXlFeSsqJoeCfY3lVEAJcUVjdlFwur1LOQ8p3R2hIZp1dp97r1W4SYwjDtp33IMY29BTLgUQOVNnA6uLrc5+2bzVSyLggrR4aU9IlnF78nhcyfYunZ0eks6rcXXaaqSOmgP5s763Bhvd0mBYPK6fH+gqFFvXOM= 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+importer2=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 SMTP id 1673621085025374.836634999225; Fri, 13 Jan 2023 06:44:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnS-0001lm-4O; Fri, 13 Jan 2023 09:12: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 1pGKn2-0001GF-KD for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:18 -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 1pGKml-0003gt-H9 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:05 -0500 Received: by mail-wm1-x32b.google.com with SMTP id ja17so15355767wmb.3 for ; Fri, 13 Jan 2023 06:11:59 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:58 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=utsTHAzpxt6XqjZGkDcmnI+U+lAeKY8OK38bR4joovo=; b=AqD1YCg6Defks4F9lToXx9gpkF2ypiT269JRhjqlrJA5F8tautfY96tkf/BCFXkQwx MjsYCjubDk+DhJFVTkqF96TYeNjzSesSvlqUMdC20qfAKQ951WDlQi+iKv3mfQjeJTlJ kt8MgMRAn39u5DSxEC452vHT3GgLazxJVBplsmXGhdVMro1kmvsqGRYEPHmXOcNNsshq fay4fHSiBuyTVp7cFVscg5yoQLrGeFSvXAUSvnG22sErRdNuED6jDF+yb48lCGTz1z+b 0N9+bhKO5dpogA46Q2+QfMeeVJZ4vGtNO7gxg2sty/iwhvC9akDVvr0Ff4gXpN8+xpKl DgyQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=utsTHAzpxt6XqjZGkDcmnI+U+lAeKY8OK38bR4joovo=; b=gL1Z5KNu+Yc0MKLo2eVlQB5hapmoQHKiimklGgfqfFHl+nCerOmAGF8h8RI5X5CsQf P/K6XKI00GFiQ22cqSRK5/IzUMZryZ04zvlL5GGSCjbVJ8LNCWfy5p+W/J3JTBOn96rh tLxkaQcC8V1lm9ap16Y61asrUW0JHBl4HLr/Ea/xa+OQ+zP3dMiVV4Qk/GhQyompuBCd 2vS1UwWDtBrRtVapkmF77Oyh+YHw38TolfDK39xObaS2EzEvsIu55oI2uRrYYjQR560j WCWsgoqwzsMpKzolQ3qldXLj78SxG9rLikGGHEoXjTmRprHgNWopvDOaDjvWzjBfnyM9 /2Qg== X-Gm-Message-State: AFqh2koymtxif4uOqXPj0OMMvukcZjGEQHyvVcCkYpMkC38RPJGk62ir 4TEwHON4W1W98D1w6vllGAR3U34KKVKhkHjz X-Google-Smtp-Source: AMrXdXtnDwlZEcgIj9lfU1NYIcu7CwS8Q3hIS1nemq3/MIQ+nMxz9w+MjvZ6ADbjTWrcbCT2tSG38w== X-Received: by 2002:a05:600c:5014:b0:3d3:446a:b46a with SMTP id n20-20020a05600c501400b003d3446ab46amr61469047wmr.38.1673619118773; Fri, 13 Jan 2023 06:11:58 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/38] hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic' Date: Fri, 13 Jan 2023 14:11:24 +0000 Message-Id: <20230113141126.535646-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673621087235100003 From: Philippe Mathieu-Daud=C3=A9 This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call, to avoid after a QOM refactor: hw/intc/xilinx_intc.c:45:1: error: declaration of anonymous struct must b= e a definition DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Edgar E. Iglesias Message-id: 20230109140306.23161-14-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/intc/xilinx_intc.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 4c4397b3d2c..6e5012e66eb 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -42,10 +42,10 @@ #define R_MAX 8 =20 #define TYPE_XILINX_INTC "xlnx.xps-intc" -DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, - TYPE_XILINX_INTC) +typedef struct XpsIntc XpsIntc; +DECLARE_INSTANCE_CHECKER(XpsIntc, XILINX_INTC, TYPE_XILINX_INTC) =20 -struct xlx_pic +struct XpsIntc { SysBusDevice parent_obj; =20 @@ -62,7 +62,7 @@ struct xlx_pic uint32_t irq_pin_state; }; =20 -static void update_irq(struct xlx_pic *p) +static void update_irq(XpsIntc *p) { uint32_t i; =20 @@ -87,10 +87,9 @@ static void update_irq(struct xlx_pic *p) qemu_set_irq(p->parent_irq, (p->regs[R_MER] & 1) && p->regs[R_IPR]); } =20 -static uint64_t -pic_read(void *opaque, hwaddr addr, unsigned int size) +static uint64_t pic_read(void *opaque, hwaddr addr, unsigned int size) { - struct xlx_pic *p =3D opaque; + XpsIntc *p =3D opaque; uint32_t r =3D 0; =20 addr >>=3D 2; @@ -106,11 +105,10 @@ pic_read(void *opaque, hwaddr addr, unsigned int size) return r; } =20 -static void -pic_write(void *opaque, hwaddr addr, - uint64_t val64, unsigned int size) +static void pic_write(void *opaque, hwaddr addr, + uint64_t val64, unsigned int size) { - struct xlx_pic *p =3D opaque; + XpsIntc *p =3D opaque; uint32_t value =3D val64; =20 addr >>=3D 2; @@ -154,7 +152,7 @@ static const MemoryRegionOps pic_ops =3D { =20 static void irq_handler(void *opaque, int irq, int level) { - struct xlx_pic *p =3D opaque; + XpsIntc *p =3D opaque; =20 /* edge triggered interrupt */ if (p->c_kind_of_intr & (1 << irq) && p->regs[R_MER] & 2) { @@ -168,7 +166,7 @@ static void irq_handler(void *opaque, int irq, int leve= l) =20 static void xilinx_intc_init(Object *obj) { - struct xlx_pic *p =3D XILINX_INTC(obj); + XpsIntc *p =3D XILINX_INTC(obj); =20 qdev_init_gpio_in(DEVICE(obj), irq_handler, 32); sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq); @@ -179,7 +177,7 @@ static void xilinx_intc_init(Object *obj) } =20 static Property xilinx_intc_properties[] =3D { - DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0), + DEFINE_PROP_UINT32("kind-of-intr", XpsIntc, c_kind_of_intr, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -193,7 +191,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, = void *data) static const TypeInfo xilinx_intc_info =3D { .name =3D TYPE_XILINX_INTC, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(struct xlx_pic), + .instance_size =3D sizeof(XpsIntc), .instance_init =3D xilinx_intc_init, .class_init =3D xilinx_intc_class_init, }; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673634517; cv=none; d=zohomail.com; s=zohoarc; b=CMFeHnaFMCRtxmVmmiszcYcHjogwQ2FPLMVdkvArJYiy1J09DB6SfJ2zyrdo3mKxWjanife081FCk2+WD1MWdyVbqJzo38pfoznxHwUdCqVPXzEHSKrz7L/uKJ6Gv4VGObqVsTHYO3uAxiBNZdxtDGle+MGQLi5Qy8ie6QGzB04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673634517; h=Content-Type:Content-Transfer-Encoding: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=HmdzEgyrds4NnZWZ6I/XMHkwj8I5g3It69CazaZPIlk=; b=X6O+vXc22rknYRzBRI2JLSPPdS/unI3jZWtnDJ7HndarJPM+0yGWKDmVH5o56O9f0+ArPeRV7mtCkm8D3pUzheefidMd0SqxiZG3qpzwBvgo4DTKHcwkQUk0K5cFvbQt4X/cqR9Xo4oN41VS6J5b89gyO/G2g6blV/eLBh7uflQ= 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+importer2=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 1673634517215946.7589740543751; Fri, 13 Jan 2023 10:28:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnL-0001a4-F6; Fri, 13 Jan 2023 09:12:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGKn2-0001GA-D8 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:17 -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 1pGKmm-0003f4-Db for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:05 -0500 Received: by mail-wm1-x32b.google.com with SMTP id m8-20020a05600c3b0800b003d96f801c48so18858298wms.0 for ; Fri, 13 Jan 2023 06:11:59 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:59 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HmdzEgyrds4NnZWZ6I/XMHkwj8I5g3It69CazaZPIlk=; b=nBiJhr+o4D+Oz8dCDOwggv8GYVX85phJcrw+A17d7eJHCYWj+vSZ6JgYLQiQakU8QI qqkZjOezBzTx00zD1/N3Nnbj1/DbWeZN1c0+wwM0h/OnzwR/GCypbkelWoRjOVDBwN2S bv3eJgvQwEbHxFexZi2jREdM1KYTrRGQzilhsptEMkKp+Oqu9DQ7XIpBz1WXmT6QfFF+ R8d6+RcDOlrAjPFPUIvv39qhD970jSDXOudJWe574JstnqY9GJpGnp6Vc71vNrVSEqNg gN+Nu2EXEa8KzNpVjQTCupVYQAZucv05254JpJ6PfZswbk/gTb/x4jFbdbjFbSRM872i VmTA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HmdzEgyrds4NnZWZ6I/XMHkwj8I5g3It69CazaZPIlk=; b=3Pbf10MIXCkSJi6BI7PEFGC8bqsdCE+H6V45wfcLqulaeFLO0Qx29+bVFtfg5PJi48 ZASaYbkfmjU6XvB/bNdsQV07mGQUynvkFLrh/UudsUW5o1xc3VPe011XOwMI/4bXBoLX skGoo9pll/UfFh3hFsJ3QEwBafh2SsaygMJ1bqQC1Rr4eDBrbBw+pDGbHPOQ22SXOuKf GvM62FMq9QxDC4yBeeZDa3LPF7wGnC4DByyy8wsZH5B1atOKAJkgxIa8ee225x701JlP OBC/uDEEUohorLT9hNC1/7uK8KLQNYEtMa4Gk/dpFweWdKzld4yoC72l781YVV9SfN77 FMkg== X-Gm-Message-State: AFqh2kr09V0ce7iNajZGW0EiLjYxE9GU+jbdQlao+Z7/cuMWzDKsR5Cw EyztZSYV/GFcbrs9CcwU6c9RUSVMRPdQF5JA X-Google-Smtp-Source: AMrXdXuiu1CDPsjDo7rPfV7uBsDSuM/B7KzsyLFDKofhR0K5G7s9B1/mYi1sJPdA6hbLwi/QCPZ/wg== X-Received: by 2002:a05:600c:54cb:b0:3cf:d0be:1231 with SMTP id iw11-20020a05600c54cb00b003cfd0be1231mr69556977wmb.13.1673619119679; Fri, 13 Jan 2023 06:11:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/38] hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock' Date: Fri, 13 Jan 2023 14:11:25 +0000 Message-Id: <20230113141126.535646-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@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=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673634517985100007 From: Philippe Mathieu-Daud=C3=A9 This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call, to avoid after a QOM refactor: hw/timer/xilinx_timer.c:65:1: error: declaration of anonymous struct must= be a definition DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Edgar E. Iglesias Message-id: 20230109140306.23161-15-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/timer/xilinx_timer.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index c7f17cd6460..32a9df69e0b 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -62,10 +62,10 @@ struct xlx_timer }; =20 #define TYPE_XILINX_TIMER "xlnx.xps-timer" -DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, - TYPE_XILINX_TIMER) +typedef struct XpsTimerState XpsTimerState; +DECLARE_INSTANCE_CHECKER(XpsTimerState, XILINX_TIMER, TYPE_XILINX_TIMER) =20 -struct timerblock +struct XpsTimerState { SysBusDevice parent_obj; =20 @@ -76,7 +76,7 @@ struct timerblock struct xlx_timer *timers; }; =20 -static inline unsigned int num_timers(struct timerblock *t) +static inline unsigned int num_timers(XpsTimerState *t) { return 2 - t->one_timer_only; } @@ -87,7 +87,7 @@ static inline unsigned int timer_from_addr(hwaddr addr) return addr >> 2; } =20 -static void timer_update_irq(struct timerblock *t) +static void timer_update_irq(XpsTimerState *t) { unsigned int i, irq =3D 0; uint32_t csr; @@ -104,7 +104,7 @@ static void timer_update_irq(struct timerblock *t) static uint64_t timer_read(void *opaque, hwaddr addr, unsigned int size) { - struct timerblock *t =3D opaque; + XpsTimerState *t =3D opaque; struct xlx_timer *xt; uint32_t r =3D 0; unsigned int timer; @@ -155,7 +155,7 @@ static void timer_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { - struct timerblock *t =3D opaque; + XpsTimerState *t =3D opaque; struct xlx_timer *xt; unsigned int timer; uint32_t value =3D val64; @@ -202,7 +202,7 @@ static const MemoryRegionOps timer_ops =3D { static void timer_hit(void *opaque) { struct xlx_timer *xt =3D opaque; - struct timerblock *t =3D xt->parent; + XpsTimerState *t =3D xt->parent; D(fprintf(stderr, "%s %d\n", __func__, xt->nr)); xt->regs[R_TCSR] |=3D TCSR_TINT; =20 @@ -213,7 +213,7 @@ static void timer_hit(void *opaque) =20 static void xilinx_timer_realize(DeviceState *dev, Error **errp) { - struct timerblock *t =3D XILINX_TIMER(dev); + XpsTimerState *t =3D XILINX_TIMER(dev); unsigned int i; =20 /* Init all the ptimers. */ @@ -236,16 +236,15 @@ static void xilinx_timer_realize(DeviceState *dev, Er= ror **errp) =20 static void xilinx_timer_init(Object *obj) { - struct timerblock *t =3D XILINX_TIMER(obj); + XpsTimerState *t =3D XILINX_TIMER(obj); =20 /* All timers share a single irq line. */ sysbus_init_irq(SYS_BUS_DEVICE(obj), &t->irq); } =20 static Property xilinx_timer_properties[] =3D { - DEFINE_PROP_UINT32("clock-frequency", struct timerblock, freq_hz, - 62 * 10000= 00), - DEFINE_PROP_UINT8("one-timer-only", struct timerblock, one_timer_only,= 0), + DEFINE_PROP_UINT32("clock-frequency", XpsTimerState, freq_hz, 62 * 100= 0000), + DEFINE_PROP_UINT8("one-timer-only", XpsTimerState, one_timer_only, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -260,7 +259,7 @@ static void xilinx_timer_class_init(ObjectClass *klass,= void *data) static const TypeInfo xilinx_timer_info =3D { .name =3D TYPE_XILINX_TIMER, .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(struct timerblock), + .instance_size =3D sizeof(XpsTimerState), .instance_init =3D xilinx_timer_init, .class_init =3D xilinx_timer_class_init, }; --=20 2.34.1 From nobody Thu Apr 25 10:44:25 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673622074; cv=none; d=zohomail.com; s=zohoarc; b=fZXyYjqPWP8n6aEEzvCkI7Xwz9nwuM4bQjtzCYiCrE0tIi2Qu7Gsp1LPdZum6Tmbo7/2w2Kj0PweJkaSbwdcOu7W5t/PBJTOatuSNyUR/VxCzss3BYuf4cRTGnehtL3QRYOsYJ6ZxctVHdn77/CNo6uEPIl9BqmjdoJqdkuGqyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673622074; h=Content-Transfer-Encoding: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=cKsR/tB/+nUT8ufiEVALMMa8QtZgWz/J+ACz6TTlZMk=; b=kOomZ4LcXG3RMB/jyL/UvJsjL8yyXXXAomq1PjDMz9JfSwEnJSEACq49m47yMUniveCLfMnJBGvZ/fn8edQan/56j7xKoH+QwhkLrw7+jvT5XsiJH1+AS/ntt96+VSASIVY/P/7dN6dWN3rxq9iKI85DmL+OmuEUKt1EuQNBPnU= 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+importer2=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 1673622074677135.69771016183654; Fri, 13 Jan 2023 07:01:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKnJ-0001WN-6f; Fri, 13 Jan 2023 09:12:33 -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 1pGKn2-0001GG-G1 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:17 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKmn-0003eP-AL for qemu-devel@nongnu.org; Fri, 13 Jan 2023 09:12:06 -0500 Received: by mail-wm1-x32a.google.com with SMTP id z8-20020a05600c220800b003d33b0bda11so1023084wml.0 for ; Fri, 13 Jan 2023 06:12:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id n36-20020a05600c502400b003da0b75de94sm5334464wmr.8.2023.01.13.06.11.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 06:11:59 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cKsR/tB/+nUT8ufiEVALMMa8QtZgWz/J+ACz6TTlZMk=; b=D7LrjU9stCNqwJRMh7gBjAMoX43x29W07JAGJjS3XgKBc4+lRUdlDXi1UuSVH2wWx+ zd4D5zDVhpO+tkuYgmG9e3OI3DrBOorzqzlG36uYkloWM84Y2/MEFfYLOKb9yFk3TFtr GrR9S/8ts17M/fWZNd2ftn9MDH8HIWIX7/ertSg6fFHEM+CijWIKUuIyem9rymNAKxlP Sd5ZeOZaowmAmi8NdIYebCziDoeIa3371QFolDktgLrRTEmiZrkhKon7oXj3EHj8GA3S iyyhAHQR6m1o+8ICTPXkMko36w/CuoXKqtFDC1FEXo7nSYoW8bNwITBab2omBOcyeg0L jbQA== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cKsR/tB/+nUT8ufiEVALMMa8QtZgWz/J+ACz6TTlZMk=; b=sGgaLvRB+adMNz9f7qcfo3pWxV4BydOJxsebyws++Oz55Zu7l45E5weOWZueBJahve QEkeF76C9gC6zPd3Kli2M/BgqJZp5GRFJLK94uFvUMeE4va5jz07b8aj4eB1C/3Wwygy 3fL38vPYDC8/feK16fAHFauss/Rze/RTp5Z7ZeVePnj+0v5F61/xkEIm7NerK0sCCHo0 4Ny09AdfozMOFcvy2CtNpUFKjhP//ayBLVQdJgG9hz5VUAX01/JgkHVsxL4ueM7Ze9RX ADOe7fDvkE9CN79pTDQH6XFYv+rtYmLfrnQZ/EPXIvXweDlXp5TlNigrs0frmR9ty/Xv vTTA== X-Gm-Message-State: AFqh2koW4WNGjtBgAfvxkFfnuKdp27tqcTbOWQpAvZ2Tn4dAfxJ/b4QZ EaJSr7ODRq1WbEDondUdzNlKLdLGpHCtEy// X-Google-Smtp-Source: AMrXdXthaLGlNp6LZUEzlEWduNKL95sPWfdDI2yfdZfZE1q2XPm9uF5+5XUmUCGenuT+JmP1gMSi9Q== X-Received: by 2002:a05:600c:1d18:b0:3d9:73fe:9744 with SMTP id l24-20020a05600c1d1800b003d973fe9744mr49777586wms.26.1673619120481; Fri, 13 Jan 2023 06:12:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 38/38] target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled Date: Fri, 13 Jan 2023 14:11:26 +0000 Message-Id: <20230113141126.535646-39-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113141126.535646-1-peter.maydell@linaro.org> References: <20230113141126.535646-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673622076113100001 Content-Type: text/plain; charset="utf-8" From: Evgeny Iakovlev ARM trusted firmware, when built with FEAT_HCX support, sets SCR_EL3.HXEn b= it to allow EL2 to modify HCRX_EL2 register without trapping it in EL3. Qemu uses a valid mask to clear unsupported SCR_EL3 bits when emulating SCR_EL3 write, and that mask doesn't include SCR_EL3.HXEn bit even if FEAT_HCX is enabled and exposed to the guest. As a result EL3 writes of that bit are ignored. Cc: qemu-stable@nongnu.org Signed-off-by: Evgeny Iakovlev Message-id: 20230105221251.17896-4-eiakovlev@linux.microsoft.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index cee38043540..22ea8fbe368 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1866,6 +1866,9 @@ static void scr_write(CPUARMState *env, const ARMCPRe= gInfo *ri, uint64_t value) if (cpu_isar_feature(aa64_sme, cpu)) { valid_mask |=3D SCR_ENTP2; } + if (cpu_isar_feature(aa64_hcx, cpu)) { + valid_mask |=3D SCR_HXEN; + } } else { valid_mask &=3D ~(SCR_RW | SCR_ST); if (cpu_isar_feature(aa32_ras, cpu)) { --=20 2.34.1