From patchwork Tue Jan 28 10:45:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860378 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286187wrx; Tue, 28 Jan 2025 02:46:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBYqG0xLBVhdWkTx7CaM6doeJlrJrQRu+yd5qPnRvG/BOF86M1u0+N6v0jIfDdiWraKXhfdA==@linaro.org X-Google-Smtp-Source: AGHT+IGPjFqYM1L0C/aHH+RhDXxXldIKFzrnc92QY4Vd/zXuhYhRwTPhqrsnLm0BouGDDJ9Fy2qv X-Received: by 2002:a05:622a:610d:b0:467:60da:12ad with SMTP id d75a77b69052e-46fc493f2bcmr49307021cf.5.1738061173918; Tue, 28 Jan 2025 02:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061173; cv=none; d=google.com; s=arc-20240605; b=ke706kunaa8fUw95LZoe3X64xibIkI4HDWFW0Xnq8YDQwPjHrg3swYEVBSW3EB68yz EzKCZq9Nbog6hqmxubHfEdhJiAa5hgP9/uAbw9zcOGCqCqIUTQmBYnocy1nZ2c1/Fq1Q kW8uIwbXPTN9iYunpi25sn9f2DVkov1t+caGGGbAmYmcML4hHA3qqvDQlljgbjdz0gDY gtqHmKaL7E71fRRA4etF6kMcesy5dMgLXd9F030WQAplMNRpncA2UAOhccYV73wg8+O1 To0KhbwLZLHUcZ1yDrNy+KEtqY84NgVFWJsJU1VWTrtDKeq2z+rR1wPJUrZicwgxlMcC 6atg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zcfm9SzMz6jhWF/u427K9kqe8ff3/Kqz7PzZhpvPw/Y=; fh=QLFtIQpLFo2aHxv7r8gOiVpF7ohccNdB4Kz1GPq8J8A=; b=cF8XDDW8wk73XZAUV1USw9Od3HKNBCxdM6DGDozj+P+jskEOEh+VlXQKQhVQbvV210 y9vlGKeL5LCjha5zpy+1z+8s4E5Lti5FZe8tCvBB+Ntm2Cj2eAF08nQB6Y5yFGwmcNFW zwTow6Oev6zwk9gBy+iriJAT3VhYtCojYjZlBTMhPyS7A7g0zQsFOCmIp22lN4n3PZ83 PnsIwCCMPoRQ2Dyyzq+ZDDdVxf1DmhZzd1i8RG2oa7XDsneHUPcYmGpizv9eFVobJiBs 4BHjPBbUgKSNydm/9QaQHo98+FsXXC/UXQa2qPkGlYQuwEZZqOQSA5knhVNUmbP3Auef 3bSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lvyySGqt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e66b6500csi131314211cf.234.2025.01.28.02.46.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:46:13 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lvyySGqt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6M-0001An-30; Tue, 28 Jan 2025 05:45: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 1tcj5y-00017X-LQ for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:27 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj5w-0003VC-8g for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:25 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3862a921123so3644476f8f.3 for ; Tue, 28 Jan 2025 02:45:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061123; x=1738665923; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zcfm9SzMz6jhWF/u427K9kqe8ff3/Kqz7PzZhpvPw/Y=; b=lvyySGqt7lq0rbSP8bQWG3D5JJIQnha6WDTbS8f0gBhdSET/XKxZplK/03361iLEFO msXZg2uPBynKxEACiheUD1pp1izqqup8wE5URbY3mSjvGekeIYGNdvQ56ulpyG9qCgrP y9p+yWyYOWJ10OtWvT99IM3EVClFevyAE8052nk0EJEOTQJhdejcn1NvTEcWbkRAR40O 1RepAY8vH9n4SmCN6qTlPYeDfQKwpNXcF60fT5unb9kYsMMWqE1tcvCDo1x988YDFVPK SpHAAgYW/7mQHFCbbM7Q9WPpoTysvMw6ss/dkhDP1NN8GydyXRrcqOufSjhVWMdt/+YJ f4Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061123; x=1738665923; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zcfm9SzMz6jhWF/u427K9kqe8ff3/Kqz7PzZhpvPw/Y=; b=S97vQbNUlEYyHOeB55Cnx3CdFVHycPCvSu/nbsALT97W+EV0jAg+n2eGR1ZT+XS1k+ 1RuVpOSSKCKkqn9zDB8119OuJDLnF/SKEIsTaRv5fmYdgIOYZYOTxkhSl03MFFNYDIFE PbgnMS9CGVARAkQJnG9RPn1f15dChrOdeVUsKFG4AceyV9gkUEkquTcYZvw4MqBenHCw XuUOJ0msxjK0+SCa/12M6SPXDds4+wq9TRV3JHV/bJaFmK702PrwsGPI+JguIiPkkJFo JNIf7eSUGTzzMxTsDPrpaERd1/ewWaQRZejw+INoi1aDxWTzX7KL7SpIb7MPcJ1KeG/8 +EBA== X-Forwarded-Encrypted: i=1; AJvYcCVujrImU4QuyDYf/M5sbXjf3OUkjTrt7CKrcNC+q8jWLGEqV+Dt/lcU2B3G18aI8atWKZNiJEtiTs8m@nongnu.org X-Gm-Message-State: AOJu0YwIiVa6GZBev/Z8Wx0u7ECLgGUuitmFnk9Tch+54ON2u07OsKuO KtaUC6OQGISON++jL3G0VjWEA0DRrLQJWfGVnj7mjyQH4sHObX4ssvQhG27RpAU= X-Gm-Gg: ASbGnctO0Voa2SsST3+tCl60ew3d9z8aGzDDSOPu9Gj4tbiQTTR8XVltvtTVH8BMpR7 6GdIbiYRi7lzIZJnId9d5Awjiqx2o8sSDt0P8cvVaHj3dcGi8xyvmecU/PAOIEn6jRh1TBrNnCJ udO88Tsy7VGdWPn493YxOQu4n3EqR6ytULQsQD0VECdbR56hEKnciPfkBSwt3C4d+V9yCO6vrOA WQqO00TMJJ9A5esq45L3kNXiwIqRMMWVoVdrvi2nwCYDz7xnE+tWV0h8CPjnN9CU890o6KDDZn3 1Fh3CjGYUpPYeHwN39is X-Received: by 2002:a05:6000:1849:b0:38a:8888:c0b6 with SMTP id ffacd0b85a97d-38bf57bfcf5mr46327535f8f.51.1738061122744; Tue, 28 Jan 2025 02:45:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:21 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 01/11] hw/sd/omap_mmc: Do a minimal conversion to QDev Date: Tue, 28 Jan 2025 10:45:09 +0000 Message-Id: <20250128104519.3981448-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Do a minimal conversion of the omap_mmc device model to QDev. In this commit we do the bare minimum to produce a working device: * add the SysBusDevice parent_obj and the usual type boilerplate * omap_mmc_init() now returns a DeviceState* * reset is handled by sysbus reset, so the SoC reset function doesn't need to call omap_mmc_reset() any more * code that should obviously be in init/realize is moved there from omap_mmc_init() We leave various pieces of cleanup to later commits: * rationalizing 'struct omap_mmc_s *' to 'OMAPMMCState *' * using gpio lines rather than having omap_mmc_init() directly set s->irq, s->dma * switching away from the legacy SD API and instead having the SD card plugged into a bus Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/hw/arm/omap.h | 15 ++++---- hw/arm/omap1.c | 1 - hw/sd/omap_mmc.c | 83 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 76 insertions(+), 23 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 420ed1d5735..6339c5a581e 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -529,12 +529,13 @@ struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem, omap_clk clk); /* omap_mmc.c */ -struct omap_mmc_s; -struct omap_mmc_s *omap_mmc_init(hwaddr base, - MemoryRegion *sysmem, - BlockBackend *blk, - qemu_irq irq, qemu_irq dma[], omap_clk clk); -void omap_mmc_reset(struct omap_mmc_s *s); +#define TYPE_OMAP_MMC "omap-mmc" +OBJECT_DECLARE_SIMPLE_TYPE(omap_mmc_s, OMAP_MMC) + +DeviceState *omap_mmc_init(hwaddr base, + MemoryRegion *sysmem, + BlockBackend *blk, + qemu_irq irq, qemu_irq dma[], omap_clk clk); /* omap_i2c.c */ I2CBus *omap_i2c_bus(DeviceState *omap_i2c); @@ -601,7 +602,7 @@ struct omap_mpu_state_s { /* MPU public TIPB peripherals */ struct omap_32khz_timer_s *os_timer; - struct omap_mmc_s *mmc; + DeviceState *mmc; struct omap_mpuio_s *mpuio; diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index f3a0ac40e48..ea07b9aa31e 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3716,7 +3716,6 @@ static void omap1_mpu_reset(void *opaque) omap_uart_reset(mpu->uart[0]); omap_uart_reset(mpu->uart[1]); omap_uart_reset(mpu->uart[2]); - omap_mmc_reset(mpu->mmc); omap_mpuio_reset(mpu->mpuio); omap_uwire_reset(mpu->microwire); omap_pwl_reset(mpu->pwl); diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 1d4e30e6b7b..9cba437f74e 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -21,11 +21,15 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "qapi/error.h" #include "hw/irq.h" +#include "hw/sysbus.h" #include "hw/arm/omap.h" #include "hw/sd/sdcard_legacy.h" -struct omap_mmc_s { +typedef struct omap_mmc_s { + SysBusDevice parent_obj; + qemu_irq irq; qemu_irq *dma; qemu_irq coverswitch; @@ -66,7 +70,7 @@ struct omap_mmc_s { int cdet_enable; int cdet_state; qemu_irq cdet; -}; +} OMAPMMCState; static void omap_mmc_interrupts_update(struct omap_mmc_s *s) { @@ -297,7 +301,7 @@ static void omap_mmc_pseudo_reset(struct omap_mmc_s *host) host->fifo_len = 0; } -void omap_mmc_reset(struct omap_mmc_s *host) +static void omap_mmc_reset(struct omap_mmc_s *host) { host->last_cmd = 0; memset(host->rsp, 0, sizeof(host->rsp)); @@ -328,7 +332,9 @@ void omap_mmc_reset(struct omap_mmc_s *host) * into any bus, and we must reset it manually. When omap_mmc is * QOMified this must move into the QOM reset function. */ - device_cold_reset(DEVICE(host->card)); + if (host->card) { + device_cold_reset(DEVICE(host->card)); + } } static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) @@ -583,29 +589,76 @@ static const MemoryRegionOps omap_mmc_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -struct omap_mmc_s *omap_mmc_init(hwaddr base, - MemoryRegion *sysmem, - BlockBackend *blk, - qemu_irq irq, qemu_irq dma[], omap_clk clk) +DeviceState *omap_mmc_init(hwaddr base, + MemoryRegion *sysmem, + BlockBackend *blk, + qemu_irq irq, qemu_irq dma[], omap_clk clk) { - struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1); + DeviceState *dev; + OMAPMMCState *s; + + dev = qdev_new(TYPE_OMAP_MMC); + s = OMAP_MMC(dev); + sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); s->irq = irq; s->dma = dma; s->clk = clk; - s->lines = 1; /* TODO: needs to be settable per-board */ - s->rev = 1; - memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc", 0x800); - memory_region_add_subregion(sysmem, base, &s->iomem); + memory_region_add_subregion(sysmem, base, + sysbus_mmio_get_region(SYS_BUS_DEVICE(s), 0)); /* Instantiate the storage */ s->card = sd_init(blk, false); if (s->card == NULL) { exit(1); } + return dev; +} + +static void omap_mmc_reset_hold(Object *obj, ResetType type) +{ + OMAPMMCState *s = OMAP_MMC(obj); omap_mmc_reset(s); - - return s; } + +static void omap_mmc_initfn(Object *obj) +{ + OMAPMMCState *s = OMAP_MMC(obj); + + /* In theory these could be settable per-board */ + s->lines = 1; + s->rev = 1; + + memory_region_init_io(&s->iomem, obj, &omap_mmc_ops, s, "omap.mmc", 0x800); + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); +} + +static void omap_mmc_realize(DeviceState *dev, Error **errp) +{ +} + +static void omap_mmc_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + ResettableClass *rc = RESETTABLE_CLASS(oc); + + rc->phases.hold = omap_mmc_reset_hold; + dc->realize = omap_mmc_realize; +} + +static const TypeInfo omap_mmc_info = { + .name = TYPE_OMAP_MMC, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(OMAPMMCState), + .instance_init = omap_mmc_initfn, + .class_init = omap_mmc_class_init, +}; + +static void omap_mmc_register_types(void) +{ + type_register_static(&omap_mmc_info); +} + +type_init(omap_mmc_register_types) From patchwork Tue Jan 28 10:45:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860380 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286419wrx; Tue, 28 Jan 2025 02:47:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVias1Q5oFsx6Nl5XWyEUQ4btc1S0OfQma+YERgnNVGNgW6PunoOAGgjQe5uaNi6wbHHZNBCA==@linaro.org X-Google-Smtp-Source: AGHT+IHx/pB27/eNidcWNjrH7ygTl9gg3KoEArhlphVxN22c+fmeZi9S7MxNwBNblpmEvW1m0i4r X-Received: by 2002:a05:620a:424d:b0:7b6:5d83:123e with SMTP id af79cd13be357-7be63252b5bmr9364669885a.54.1738061219929; Tue, 28 Jan 2025 02:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061219; cv=none; d=google.com; s=arc-20240605; b=hEYw8/acvtCVWngpau/AdBT6aQWQt3s1XpkNSysirZj7p9l9iLI7jRjj652k3vYZQB k3CW5jUV8FhAfL5q+2pLfrlK8mFCvLYU6Q/OcJVhHHd7F7s7sjY/g8hzaztiT+/KTeXr 3SalHUeZJlacdVh2YeWuWNc+7sVRbET9cdhRfD5kzSWqY1h7Mqu/y1Td/tIKircDwCsp jJw8Zs7JQn08WPW/lxgOP7/raP3M4g+id/3vGtXody9UWBXbkPIJlSbiC7878yuys9uf +05QUe9DLV7Gf6cfl8mTD5mn0v1qpFx6P/WqDicyQ1mHBQSfR1VPoWrfXSUyAzi3DnpM Jrqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XrDcp9C2vowFkhJ2ur3N47jalbiWCpVSVZgOh5cHSxg=; fh=M++EodUV7TJ2XezKqhjCsw2tgccgzoINeGn61TfgDZg=; b=M/nRe9p4tPGAHPbRwW5qOLuMo/1z/8PQhQnfLkOmgNINxdkRAsG7qm2YU4H1rzBc9R 8omYHVjEcDDWxUKnndUIuc06eQcA9DsbfuDgp5mObfnYvGpwcneideOJQkkL1xGwHMRp 6RRLumf4TIFZl8XvaDUDYX7BHWPDev/LjF/z6+25vE4xf/Lzuxq6+94HH1Gc1zJ/4hQ+ uh6YddWJwKsi14p+8qZNFuhtTmOVMUxDhiOIPiisiTerbonqN74HgA+GdzhPelf38rQ9 VpWh/OBYjOMf3+vs/d2AkTRLAim56U/LV8Pjh5Qkr+twa2JwbtNG9Z/UPNnpa1bspudY gi9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVxxfbk5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e6688ac3fsi133818941cf.181.2025.01.28.02.46.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:46:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVxxfbk5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6R-0001E7-GY; Tue, 28 Jan 2025 05:45:55 -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 1tcj60-00017d-4s for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:28 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj5y-0003Vu-Ep for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:27 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so55932205e9.2 for ; Tue, 28 Jan 2025 02:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061124; x=1738665924; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XrDcp9C2vowFkhJ2ur3N47jalbiWCpVSVZgOh5cHSxg=; b=QVxxfbk5UOllJQq7NMzjpdzh+Wdu/jcnCk4RG9CYqX/i9QH0RZH0qj4neajXn82Ese VMeRXePuTYL2Ko/1V9vW7+j7hV3vzpufUSaN3RDh7PMDGT/lgXtDRh3PfC/Zaji6B0s+ ggE0eObxg5r+KCES6M+dvE5b32djQazUNl04q0xkuhZqeTd4Qugb0i+d6MRAEH+a54aS iAtZS/BhT4nuzq5CFeNxCC+q1pDWP1dREsJsedKEM0lwh1obxGWuXr4mJESxZarUbu6I zGNimoxCeaXnv3kZaer1WbQrSses6duaKQCxxlGzoxhOXkVj8dDFHeT7RhUffugLUYk9 WPyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061124; x=1738665924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XrDcp9C2vowFkhJ2ur3N47jalbiWCpVSVZgOh5cHSxg=; b=sfsMuuJQelMzvJq7CJhKUI994tAg88g184MJRnm2IK86V7F5tA03IvLKPGdKGmILk3 /fciAGYaojTrV6xkXi+rjk0sVpGBbXoNRjxVdiSpuvaOf3hu/Q0pRZxkz1AuKgdr+vO7 Kx7ne85v4THpA3GTw9OHbske4ZeY8s+LCV4GAW9Oia4NLYJmQsEHSLgB+3rTKZ+TH2/t 077duDigyJHOM5V1ifY/vZSvWvrIcF9VS9pBRQuT/iid3hXvvQLEX3DhVks/2nRfM68e lbFVjoVbKkoqFzF+R+Yx/6rmgSrQ696um7EFHA1Qpwqb1hUC4ELd7x56U+27s1vX/JDw JPfw== X-Forwarded-Encrypted: i=1; AJvYcCW1YvldBeFVPlxfcgRuRNdvttiFnzZZ2uVOvJf6JMdOIeuQ4etnh7gIINtNnCt57ha/mOabc2t6/qly@nongnu.org X-Gm-Message-State: AOJu0YxE2gzjVTbgFAJateYsreQYff9ytCLzgprBmWtBifjNwOc0J5tm vJk6VTZc9McQm7Y4FWldwOL/VpMnB5z85oS+qfLngpfQRepFHK2FvBUP5nIj1P4= X-Gm-Gg: ASbGnctm8f+0pLUiAcHDyn10XOFpWZAreVW5k9EMxayUGMEBbJiT/vIsrLmkqXBhyUg 2NmAhMx9l6MMEw04Dx0UCTGHy5WjKOF7xGI+4RIBEgIr6fNVSYbMKDrWCrukhQgRREYTR/DBzlo KsDdE4JgANVD5nq3HB8C6gDHXF4CVSmjuztGdXgwqgOcBl7c4sNSgXvroSnMkDoSlNKE3jkXyvO iZ/JZy2Po852wUwo8VeaK70Xgv7a5kkhV90baQPnOmUbwfri7ot56Nw2NgBEhJF+ova2kjAH7N8 u2ZA8GjaDw+TmmDXqvtM X-Received: by 2002:a05:600c:3114:b0:434:a386:6cf with SMTP id 5b1f17b1804b1-438913bff57mr404650415e9.2.1738061123943; Tue, 28 Jan 2025 02:45:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:23 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 02/11] hw/sd/omap_mmc: Convert remaining 'struct omap_mmc_s' uses to OMAPMMCState Date: Tue, 28 Jan 2025 10:45:10 +0000 Message-Id: <20250128104519.3981448-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Mechanically convert the remaining uses of 'struct omap_mmc_s' to 'OMAPMMCState'. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/hw/arm/omap.h | 2 +- hw/sd/omap_mmc.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 6339c5a581e..7d1a1afc4f8 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -530,7 +530,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem, /* omap_mmc.c */ #define TYPE_OMAP_MMC "omap-mmc" -OBJECT_DECLARE_SIMPLE_TYPE(omap_mmc_s, OMAP_MMC) +OBJECT_DECLARE_SIMPLE_TYPE(OMAPMMCState, OMAP_MMC) DeviceState *omap_mmc_init(hwaddr base, MemoryRegion *sysmem, diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 9cba437f74e..dd45abc075e 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -27,7 +27,7 @@ #include "hw/arm/omap.h" #include "hw/sd/sdcard_legacy.h" -typedef struct omap_mmc_s { +typedef struct OMAPMMCState { SysBusDevice parent_obj; qemu_irq irq; @@ -72,12 +72,12 @@ typedef struct omap_mmc_s { qemu_irq cdet; } OMAPMMCState; -static void omap_mmc_interrupts_update(struct omap_mmc_s *s) +static void omap_mmc_interrupts_update(OMAPMMCState *s) { qemu_set_irq(s->irq, !!(s->status & s->mask)); } -static void omap_mmc_fifolevel_update(struct omap_mmc_s *host) +static void omap_mmc_fifolevel_update(OMAPMMCState *host) { if (!host->transfer && !host->fifo_len) { host->status &= 0xf3ff; @@ -125,7 +125,7 @@ typedef enum { SD_TYPE_ADTC = 3, /* addressed with data transfer */ } MMCCmdType; -static void omap_mmc_command(struct omap_mmc_s *host, int cmd, int dir, +static void omap_mmc_command(OMAPMMCState *host, int cmd, int dir, MMCCmdType type, int busy, sd_rsp_type_t resptype, int init) { @@ -234,7 +234,7 @@ static void omap_mmc_command(struct omap_mmc_s *host, int cmd, int dir, host->status |= 0x0001; } -static void omap_mmc_transfer(struct omap_mmc_s *host) +static void omap_mmc_transfer(OMAPMMCState *host) { uint8_t value; @@ -289,19 +289,19 @@ static void omap_mmc_transfer(struct omap_mmc_s *host) static void omap_mmc_update(void *opaque) { - struct omap_mmc_s *s = opaque; + OMAPMMCState *s = opaque; omap_mmc_transfer(s); omap_mmc_fifolevel_update(s); omap_mmc_interrupts_update(s); } -static void omap_mmc_pseudo_reset(struct omap_mmc_s *host) +static void omap_mmc_pseudo_reset(OMAPMMCState *host) { host->status = 0; host->fifo_len = 0; } -static void omap_mmc_reset(struct omap_mmc_s *host) +static void omap_mmc_reset(OMAPMMCState *host) { host->last_cmd = 0; memset(host->rsp, 0, sizeof(host->rsp)); @@ -340,7 +340,7 @@ static void omap_mmc_reset(struct omap_mmc_s *host) static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) { uint16_t i; - struct omap_mmc_s *s = opaque; + OMAPMMCState *s = opaque; if (size != 2) { return omap_badwidth_read16(opaque, offset); @@ -433,7 +433,7 @@ static void omap_mmc_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { int i; - struct omap_mmc_s *s = opaque; + OMAPMMCState *s = opaque; if (size != 2) { omap_badwidth_write16(opaque, offset, value); From patchwork Tue Jan 28 10:45:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860384 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286650wrx; Tue, 28 Jan 2025 02:47:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgpuXGcMnfgjVw3L0aRMxkXIA5nATv21O46asmY/v8TFaYis31t0KTLwNglhbNnmQWT0Z0gQ==@linaro.org X-Google-Smtp-Source: AGHT+IHD0Awp3K3HwwLg9+d8ccblgnt1UTlNdQ2tKQVd2i2C35EQDJnVDYQ4x3Mf/IhmZK8j48Pv X-Received: by 2002:a05:6214:c25:b0:6d8:899e:c3bf with SMTP id 6a1803df08f44-6e1b21c47f9mr599967096d6.34.1738061260288; Tue, 28 Jan 2025 02:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061260; cv=none; d=google.com; s=arc-20240605; b=VqgzP86Rro4buJnyFJ+h2zElHKv/fqoOnnULrH6vQr6Z9+3COa8Ku9O06Z0jSxjRHL iQW12FUzdwWoeGVt6dkxs1DdnNboQ7ZLetVIi2iG7YkjtQ2LtNx3++ga5+eFwZRY2/oa hUOmxhUXE+oa4ASvOwXE8X4EQn9oL9blgjXFUzxOXZE68PhU/Q4OCXrMq+xKg5Du5l6V jEUSvyd953wy8qTfjGLAbssylqxodeKZQv/1cjTC+fyXexvcvoHsJSrhEkHJnIMaQ+dY BRvNoZ6l0RSmOnrJN6tx8/HtZgy62x8BuffFxxnXu9rzc47m+U+cXMreN3An6IeVhPje xDew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kVKf2PwS8I38xe+s6q6G1j7KxzUeSwKx/0XZ7RVEtQ4=; fh=CYh/mWquWlHugSrEke29gAeQoJ/Y5/SjisZhwB2mA+A=; b=Dk3Cc5L6dUCpk3iYAaA7ekSEtgF/iYgA0AzWQJXuafAFVSt5O7I8RVlzgIEgIvMmnz RY9bki8UwU9rUYxc7Nxn9X9NE+5aHoaQs42E8crtfdEe39JeaCVsE0gw2kQE5a/VkotK eNLODsoVsRoXWitYTTuvCjJfTSEqyQx2t7bZHwXPzBF+Alm15Zec9OijLsFbCTEStK34 BfgAfw0o9lOKhlCEeU1mlYiBtKVNsn8Vowaz37EOD0s2SDoPWQhg9XDHXhB6WLXeoIZJ KvGut9sTF1+yZ4pN0+PtFUYQb27NjpSBKhPOD/ACWQ3Z8vJK5+x6N6X28wYnzti6n4tg 78Pw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nob02JZd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e206021c6dsi125703676d6.393.2025.01.28.02.47.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:47:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nob02JZd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6q-0001SN-03; Tue, 28 Jan 2025 05:46:20 -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 1tcj62-00018P-4p for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:30 -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 1tcj5y-0003WZ-Vi for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:29 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43618283dedso57778355e9.3 for ; Tue, 28 Jan 2025 02:45:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061125; x=1738665925; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kVKf2PwS8I38xe+s6q6G1j7KxzUeSwKx/0XZ7RVEtQ4=; b=nob02JZdE4dkqFMj/PwL5Ut1kCqXGMSZmVj9wVeFYkUyr6HsIth3iWovEq10Rm7YrJ dAG/xmrcTJNc2m3FCNQz2s1CQDSOyURpsnQ/lRdN2X5IBY7R3GPMDNSfzJ8gNaJkEbKD HAgpFG7pBBEKh44500gFTUE6k8hx6sC9FoApJNOeu18uFy3dhZD5tjYhj9Jt7MDHo3c4 UNS+CWmtFo6KLD1jCYm0h1J2bjk7jTHGg+rrYM0py8/3VF4pR8ZKtwaIqzpnWT8/ms9C G4EBfRPi+U+A4U3idfJmHKhPhnuJZOh1oNku/XzAHRWSkDPoWPsRcOkLtPxlKZWp/e3r jHMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061125; x=1738665925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kVKf2PwS8I38xe+s6q6G1j7KxzUeSwKx/0XZ7RVEtQ4=; b=pEks02IkmCwi/atkLlr5sBexZJwarSSyG3IIEvpZCmEOUYz+eMBo/QxFtq3PVVxBpM Lq4G++DHOHaSqrk9iZQ0po3R7U7t+qhuiWPyKqs0zKPZPopJ3gG065gXChyRTV8hGqcX rHeZ2pxiHuSHhJWSOsRdP52UB174q2sQ3iLjEu7ZWF+ik9w5g65YJG53wclMmoCBsRyH GK8pUGiw+TCopkefHtOKG686544kMTY6gM+wRDUv9N7yFwXcbgXbDoD2BhrGfn2D5FRU k2PbaXd1ZSYINAaAmZKQwKzm49KBg8SHSHLkXkjpPQ/UNQ/NecFrUbQUjErdC2Ut5bD5 tNDw== X-Forwarded-Encrypted: i=1; AJvYcCX2jAxcPJIHdv/EYG8+MpXlyDF8NfyAKWuFlyD1FWEawsMZN3EcC4MJIz91iMbeXU7XJnjWmeW11ei2@nongnu.org X-Gm-Message-State: AOJu0Yz0n55ZKP5IAo3+F8g/K56bhWT085bIajnr08xRDTxkgziVB+ot tCtkizUHOtT2IJgFXGBRLt8GKG/BBohfDCj9xwEmcynrvZnp9An1jXZs+AR0L4w= X-Gm-Gg: ASbGncvO8DtrfnDKPhpQ6XlnTOL/RnM6mS2sp7UbDglRxBvMkfGWUsEo7g56JaLo4Po RLdwqLxz1kpxALdw4vWThipmsJXQadyj41qK5Lmcp+X1JyxkE2Jz+PiSK2xNmm8IueYK+rwYLZt W+XrrYrh76W92oEGqMKPopOwvnu6aQVRhjAvEdA36uH2yXTalOGZWRb14VwAB/mcaW03xYOdK6w Kd1xLJcHc3mgRS0XWrmEepIW4Nj9qSMMlONZVKQsb+oAil3yq+t7sdCvq9qeh9R8ar5iDodpLrG u8zQJh2fDiGNlSd4roFj X-Received: by 2002:a05:6000:144e:b0:38a:88bc:d57d with SMTP id ffacd0b85a97d-38bf56562e1mr36755509f8f.2.1738061124937; Tue, 28 Jan 2025 02:45:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:24 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 03/11] hw/sd/omap_mmc: Convert output qemu_irqs to gpio and sysbus IRQ APIs Date: Tue, 28 Jan 2025 10:45:11 +0000 Message-Id: <20250128104519.3981448-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The omap_mmc device has three outbound qemu_irq lines: * one actual interrupt line * two which connect to the DMA controller and are signalled for TX and RX DMA Convert these to a sysbus IRQ and two named GPIO outputs. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/sd/omap_mmc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index dd45abc075e..d497e31a6c5 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -31,7 +31,8 @@ typedef struct OMAPMMCState { SysBusDevice parent_obj; qemu_irq irq; - qemu_irq *dma; + qemu_irq dma_tx_gpio; + qemu_irq dma_rx_gpio; qemu_irq coverswitch; MemoryRegion iomem; omap_clk clk; @@ -87,22 +88,22 @@ static void omap_mmc_fifolevel_update(OMAPMMCState *host) if (host->fifo_len > host->af_level && host->ddir) { if (host->rx_dma) { host->status &= 0xfbff; - qemu_irq_raise(host->dma[1]); + qemu_irq_raise(host->dma_rx_gpio); } else host->status |= 0x0400; } else { host->status &= 0xfbff; - qemu_irq_lower(host->dma[1]); + qemu_irq_lower(host->dma_rx_gpio); } if (host->fifo_len < host->ae_level && !host->ddir) { if (host->tx_dma) { host->status &= 0xf7ff; - qemu_irq_raise(host->dma[0]); + qemu_irq_raise(host->dma_tx_gpio); } else host->status |= 0x0800; } else { - qemu_irq_lower(host->dma[0]); + qemu_irq_lower(host->dma_tx_gpio); host->status &= 0xf7ff; } } @@ -601,12 +602,13 @@ DeviceState *omap_mmc_init(hwaddr base, s = OMAP_MMC(dev); sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); - s->irq = irq; - s->dma = dma; s->clk = clk; memory_region_add_subregion(sysmem, base, sysbus_mmio_get_region(SYS_BUS_DEVICE(s), 0)); + qdev_connect_gpio_out_named(dev, "dma-tx", 0, dma[0]); + qdev_connect_gpio_out_named(dev, "dma-rx", 0, dma[1]); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); /* Instantiate the storage */ s->card = sd_init(blk, false); @@ -633,6 +635,10 @@ static void omap_mmc_initfn(Object *obj) memory_region_init_io(&s->iomem, obj, &omap_mmc_ops, s, "omap.mmc", 0x800); sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); + + sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); + qdev_init_gpio_out_named(DEVICE(obj), &s->dma_tx_gpio, "dma-tx", 1); + qdev_init_gpio_out_named(DEVICE(obj), &s->dma_rx_gpio, "dma-rx", 1); } static void omap_mmc_realize(DeviceState *dev, Error **errp) From patchwork Tue Jan 28 10:45:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860383 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286603wrx; Tue, 28 Jan 2025 02:47:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWkCOsUMXL/DYBZzAgS7fcSlQ5Z/Lo+y59X0XqqgJ6CXn4CEX+vocrv5ayEbDOPZIIkqeH/rA==@linaro.org X-Google-Smtp-Source: AGHT+IGPRkb52vDJutJ6fjjFHgOm7A8/1nXnj1W1YHCfkgGvq3FsndMamP1Nq26xiei8jL+5/3tG X-Received: by 2002:a05:622a:4c:b0:468:fb3c:5e5e with SMTP id d75a77b69052e-46e1284db10mr642090951cf.0.1738061250841; Tue, 28 Jan 2025 02:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061250; cv=none; d=google.com; s=arc-20240605; b=gOVdqy20zSNJQgSB5ZoLoyvdQRuoYeiaZaElEjXAe8kvMvvWqrzkdb4ndKGlR+21kQ FTTTLwVlG+RJL32OUt018LnjHSc+C14ENiPm3rdPVnymaQX9+U377b7hrn5HmOkplhzh x7YuJGId7/rtnLs6KlciwiybI5HmmbO3uDQ36skmXStoFsqip+evc6tLfbz/bX8xYxFA HW5KupVku+tdQ6sq9FwQmTjliWb8B5oMUddklbp1DSHvbiY5zDKLly4kfrhAMswVNqW0 8P5tkMQLPzim7eHihGqrkSp4gYG3DUnKElsHFoNqB3vj4mamVIdoQADJgt3Rnwf/gb0e V7kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zJjNi5BZ7mcnb7aQo8EZDoTwnCfEh31OBc5WYUuoav8=; fh=tULcCdTY4I9koNJHAdrwTrrYAUOBJkyD2flmxneyR90=; b=Uk4aJXY0RC2GMGp01I6om//TSnP1cYokLticW0Ij9rp6UfvL+7xb+SpRhzMGLtjPmo lgMny6cgpylW8w4j5pIexbptUwn6ugLgpFdwibu9aYknWBq/g6lYbpwiDOAkfBpJl/Iv nXn3f7AqaugrydrvP80NVhzSlaqrYN1xUVPFxSY7zm8t71BaMAZ84K3uC52KEbBWPecb V5qfrmRML/73mFg9dQuqITtOuJtlOegA13knVzEvbpLDjkKF5yY/1uNs7kh09hxy4y6T D9Brw+5WIJZk9dSi5wIonHHfA9/dkJIrzXpVHVR3VZq6V6HI3buqviZGZvYGoBRQC8M2 VdLg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c0768Urk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e66ba57a9si116481021cf.556.2025.01.28.02.47.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c0768Urk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6c-0001Jz-Ej; Tue, 28 Jan 2025 05:46:06 -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 1tcj65-0001A5-Jj for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj5z-0003Wy-SJ for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:31 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4361f796586so59796085e9.3 for ; Tue, 28 Jan 2025 02:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061126; x=1738665926; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zJjNi5BZ7mcnb7aQo8EZDoTwnCfEh31OBc5WYUuoav8=; b=c0768Urk5oWd94LArugm4RbjpWTKd0ATVHChZTlS17NkKaurgW8gTFLZ0HHCgRLYft bQhAb/4QN3cIT98kMrlMWd4fiNDpe9nzd1u9+19OGPtO0stPMPrkmd1rhMbuzYaZ4QbX 8LW65LoBQqgnhdH243//wpla1kUDXtvHquBhi2ZoyRmuua3vlmUoDo5tVK0esSheaHte /9skiOKMqREr+FCvC+IUTGGvEjPmXOxBc6XLO0vilHDJjIc4B2bsokIKnE4h0APEhvt4 ShHq5AwLjVpNuan9aXkhm2NoTFXfm6q/oAVhiRZB1FwDdM8PttStqZrsRfrqN38ks6lD hfDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061126; x=1738665926; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zJjNi5BZ7mcnb7aQo8EZDoTwnCfEh31OBc5WYUuoav8=; b=Jr11xek6bgfJpXvLaLltFZE/vHdCxjqqwmaXnhA2jblkGddtUEJlQFYSU5Rl346tdl pfoMJs6HhsdMdr18VjOlA6NC2KtETbymNbgR7k6PTDXOxnCYKfJ7tQxXQmKezjR98oMl ZhJSz6jn8adrsnwlrUWpD6Ivy7K2Vg3vIPTyMjLtc12VvrhyUDmaCezjdMMa1tjXLCI3 bQ3vvhVbFsiBAhAKbp7IGLORL035JdQRbrplFOuLGQmHhrZlKjyh2k6KS/oA+cYHk31Y BAnHxqlogxVopsry26TPaMVLyW72oExT4JE7tNYGgunLVowooUUautgIGhV8HwMwf13j 1wDA== X-Forwarded-Encrypted: i=1; AJvYcCUus8XQgrLcWlSDyaWm4oBnHvUgTLCwcUFUL/cZzu8KUIyps3T+h29vcXe+t6GDLnIYg9GBz55GDiYD@nongnu.org X-Gm-Message-State: AOJu0YxkkODZhMOE8XMpz1y+BmwYu+whmvv5n3+EKZFxdgxMAY8Aa90R YlEEsW/1TIlr9/HOfK2vVHXC0q+c5CH3NqbrlOPLlQ/fhtcrPPuuQXsWIcJu0D0= X-Gm-Gg: ASbGnctOpY3cUjLTgh9hIW6HDVu2rdAfuKPgMZiiLXk7tmHryCjhzRBmLgKkf8UFQoV Uya8NxVaCEa7CqFRXlNPF467UM+P+ypAGRHZPe1EY0VqcPXluqOAicvGQKfsKUZOQ9ShOE8EqBN Un+lPe7RsxsTc+pIRvah79WPOGuutYb/G3gLqlYzRssRxuisRz1ugzKT25lxRAsBHCrgTutWuYD u9nHq+SgTkFopKbFtHR/LgYQdBmQYZcNKBmdyv7B1O2UjNwXnIyyOZDgaFtMeVQ+ay5r851uZvQ HTHqTbZDANWgIOk7tPMt X-Received: by 2002:a5d:6d86:0:b0:388:c75d:be97 with SMTP id ffacd0b85a97d-38bf564960cmr40457824f8f.11.1738061126031; Tue, 28 Jan 2025 02:45:26 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:25 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 04/11] hw/sd/omap_mmc: Convert to SDBus API Date: Tue, 28 Jan 2025 10:45:12 +0000 Message-Id: <20250128104519.3981448-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the OMAP MMC controller to the new SDBus API: * the controller creates an SDBus bus * instead of sd_foo functions on the SDState object, call sdbus_foo functions on the SDBus * the board code creates a proper TYPE_SD_CARD object and attaches it to the controller's SDBus, instead of the controller creating a card directly via sd_init() that never gets attached to any bus * because the SD card object is on a bus, it gets reset automatically by the "traverse the qbus tree resetting things" code, and we don't need to manually reset the card from the controller reset function Signed-off-by: Peter Maydell --- include/hw/arm/omap.h | 1 - hw/arm/omap1.c | 10 +++++++++- hw/sd/omap_mmc.c | 30 ++++++++++-------------------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 7d1a1afc4f8..d20c55a8957 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -534,7 +534,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(OMAPMMCState, OMAP_MMC) DeviceState *omap_mmc_init(hwaddr base, MemoryRegion *sysmem, - BlockBackend *blk, qemu_irq irq, qemu_irq dma[], omap_clk clk); /* omap_i2c.c */ diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index ea07b9aa31e..15ba0a0d0c4 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -29,6 +29,7 @@ #include "hw/qdev-properties.h" #include "hw/arm/boot.h" #include "hw/arm/omap.h" +#include "hw/sd/sd.h" #include "system/blockdev.h" #include "system/system.h" #include "hw/arm/soc_dma.h" @@ -3981,11 +3982,18 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *dram, warn_report("missing SecureDigital device"); } s->mmc = omap_mmc_init(0xfffb7800, system_memory, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, qdev_get_gpio_in(s->ih[1], OMAP_INT_OQN), &s->drq[OMAP_DMA_MMC_TX], omap_findclk(s, "mmc_ck")); + if (dinfo) { + DeviceState *card = qdev_new(TYPE_SD_CARD); + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, qdev_get_child_bus(s->mmc, "sd-bus"), + &error_fatal); + } + s->mpuio = omap_mpuio_init(system_memory, 0xfffb5000, qdev_get_gpio_in(s->ih[1], OMAP_INT_KEYBOARD), qdev_get_gpio_in(s->ih[1], OMAP_INT_MPUIO), diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index d497e31a6c5..46fdeac1121 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -30,13 +30,14 @@ typedef struct OMAPMMCState { SysBusDevice parent_obj; + SDBus sdbus; + qemu_irq irq; qemu_irq dma_tx_gpio; qemu_irq dma_rx_gpio; qemu_irq coverswitch; MemoryRegion iomem; omap_clk clk; - SDState *card; uint16_t last_cmd; uint16_t sdio; uint16_t rsp[8]; @@ -158,7 +159,7 @@ static void omap_mmc_command(OMAPMMCState *host, int cmd, int dir, request.arg = host->arg; request.crc = 0; /* FIXME */ - rsplen = sd_do_command(host->card, &request, response); + rsplen = sdbus_do_command(&host->sdbus, &request, response); /* TODO: validate CRCs */ switch (resptype) { @@ -247,10 +248,10 @@ static void omap_mmc_transfer(OMAPMMCState *host) if (host->fifo_len > host->af_level) break; - value = sd_read_byte(host->card); + value = sdbus_read_byte(&host->sdbus); host->fifo[(host->fifo_start + host->fifo_len) & 31] = value; if (-- host->blen_counter) { - value = sd_read_byte(host->card); + value = sdbus_read_byte(&host->sdbus); host->fifo[(host->fifo_start + host->fifo_len) & 31] |= value << 8; host->blen_counter --; @@ -262,10 +263,10 @@ static void omap_mmc_transfer(OMAPMMCState *host) break; value = host->fifo[host->fifo_start] & 0xff; - sd_write_byte(host->card, value); + sdbus_write_byte(&host->sdbus, value); if (-- host->blen_counter) { value = host->fifo[host->fifo_start] >> 8; - sd_write_byte(host->card, value); + sdbus_write_byte(&host->sdbus, value); host->blen_counter --; } @@ -328,14 +329,6 @@ static void omap_mmc_reset(OMAPMMCState *host) host->clkdiv = 0; omap_mmc_pseudo_reset(host); - - /* Since we're still using the legacy SD API the card is not plugged - * into any bus, and we must reset it manually. When omap_mmc is - * QOMified this must move into the QOM reset function. - */ - if (host->card) { - device_cold_reset(DEVICE(host->card)); - } } static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) @@ -592,7 +585,6 @@ static const MemoryRegionOps omap_mmc_ops = { DeviceState *omap_mmc_init(hwaddr base, MemoryRegion *sysmem, - BlockBackend *blk, qemu_irq irq, qemu_irq dma[], omap_clk clk) { DeviceState *dev; @@ -610,11 +602,6 @@ DeviceState *omap_mmc_init(hwaddr base, qdev_connect_gpio_out_named(dev, "dma-rx", 0, dma[1]); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); - /* Instantiate the storage */ - s->card = sd_init(blk, false); - if (s->card == NULL) { - exit(1); - } return dev; } @@ -643,6 +630,9 @@ static void omap_mmc_initfn(Object *obj) static void omap_mmc_realize(DeviceState *dev, Error **errp) { + OMAPMMCState *s = OMAP_MMC(dev); + + qbus_init(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS, dev, "sd-bus"); } static void omap_mmc_class_init(ObjectClass *oc, void *data) From patchwork Tue Jan 28 10:45:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860388 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286989wrx; Tue, 28 Jan 2025 02:48:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXBEv3s9nmG6qQ4Z3ksXolhCCjoHzTuqmBF6XQ9hH/SarZjF3vaZwIjaUKR74MRgdbNNpBQ0w==@linaro.org X-Google-Smtp-Source: AGHT+IFQ+T4pKuB+u696rEzr7Hx6gQoOstM7IGbqvJojho17uc9Zk0jxK9Kaq+fEzOjCEOVyelZj X-Received: by 2002:a05:620a:3950:b0:7b6:d58b:9dce with SMTP id af79cd13be357-7be63288566mr6067061185a.51.1738061336600; Tue, 28 Jan 2025 02:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061336; cv=none; d=google.com; s=arc-20240605; b=S5Shm0CKFnlQI7+djoJgJFZCbl+FQMYzBvenxPzhCVDaDLTwyhs9LmxP80CgODIx0r MxT7aKxFwen8iocTm5UqLv65IzWNpMchk62KaYMIOPfY5Dw00tJCn4k3UaIfbwjptY9G y9mrlH9KpRjI6KWYtt0FSVcnqwgn4qajOPfPY2VNB3RGwKoUlafdUygLPRSLIaf2KdCW vl7o/VH1FOLLGRgwRnZMnWM8Nq0KaOxbO3CPj1EAZlXGaML/ntHSyJ+mbEENv0RxGMyV lBK7nXncQqsB72mK28K/4y8IfX8pCeLj93qky1LK3ttbAIq+0gSuJ7gUtrTdzhWljyh1 slCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FhOuLd7arurLv4UbtgWbigCBbLZ+aw4LgTQlp527aNE=; fh=Xxvnv3nw6UNTWprvygJ/R7ITp0CR0WEMPqWjdqL1hWU=; b=bLV+bJjbi5OtKp7Cje6+QHAP4ue8MD+Kf6IGzgAjXeMFR2uqFQcqidEhfx1n5a/amB WPI5MMML9JtsJSBzlU/tnSz/DY4O/mY4JzElOrMjSNIRCiERCKcObdlTOZqthP560ZqE XlHfuRj1mwNt73zYeL1lfMFfcZmzxRH6zGuXaTQb4Ejp3NjCXzFU1MPifGIC24HvHApB /aK2rq/CnUPEum+IHskSc5TUmr1apNLE9WBaKp3YXgatMJrMDqNRNBjuP+VhZ93EANcj nCNGJUbo9QfHt0JDT0vvHMjSpaXf9ja5HEQVXRmTdRaxQbRnwwc3FqiOiVx9XqzzJ7TX DAYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QNR6j+jE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9aeee539si1360191685a.380.2025.01.28.02.48.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QNR6j+jE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6c-0001Jn-BR; Tue, 28 Jan 2025 05:46:06 -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 1tcj66-0001AD-Kl for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj61-0003XV-UV for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:33 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3863c36a731so4509380f8f.1 for ; Tue, 28 Jan 2025 02:45:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061127; x=1738665927; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FhOuLd7arurLv4UbtgWbigCBbLZ+aw4LgTQlp527aNE=; b=QNR6j+jEMTAB3Ey+Ulztu9arK5Px/zlCCaMFuRL4dOc26EC3/1IY3CmfM7Hx+1m+qX 8sJoCqLIRnGNvzobko0OnmxLYyLtkpIgPZtv6hR3KSn96+8IG8WBIL6ABvbXwwWVanty VnG7jbCA19jTeiLIpUnkQ+Q31bSHn14kQIHgryBeXZWlzbhuO3IUiMlNIi0Nv9wXRW9Y JUb0uH3jh1e0Unryi1kPavNEIlTxXEzbnkGBCPllJgyXuVwcVoa9UUFKmlRvktWVSsEG BGoUqxDW27cppTqOA7n8GFXT4vvwm4taNfoZJkx7X7LKU99+5Y99XI+NJyae6JwbpQqU ZckQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061127; x=1738665927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FhOuLd7arurLv4UbtgWbigCBbLZ+aw4LgTQlp527aNE=; b=JcDnt4tugm3Sbdojol237/tq+m7oHhp/fsOeKEJKCmU1HX9soeZkt7KlsgUe8VnjPz gwk1kWq/l+rfQT5kfXIudzZAEc1j93dVrx169Ts8xFLajzSw0QDCtCIWpl/vej/ROJAi MGhKVIZTx+vkCjR6igRqiGjukKD8vyPHXI/BqGIS5ttPltclSL08XjRdCfTthCKd/ZB+ Fg7FD+EGZGjhp9Djxy03zfTTdFuyq/ewSgPwU+3ksO2CWkYYwKPTYJdv5YL/jfpj8rPl NQZvTh05j8SWrf1bf3b15oquKqb5hfzEBC+5UDe9rg+Izga3uyYMc8H/4AVFCoxtb9ca KLuQ== X-Forwarded-Encrypted: i=1; AJvYcCVJuzdJOnnb3DV2Ssp4kxU8/hEjxlJtpVh2eWCt7CIoNe9y4gJYOcqSybZuFkUAsYdvx/Wd1Nzo5+KV@nongnu.org X-Gm-Message-State: AOJu0YwT18W1cNFPtU0zwf3HinghLdMAQZ2BY4YQ5LoHNh/Odpx+QuwG vFCV2JB/7QX6i8bhyQIWDpXh8DXeDfsmSdkDhWkkjxVesrZoLwaYj/GLo6Z5dGrn3H3sanHJiva g X-Gm-Gg: ASbGncuq3RgaDa7X3YYXq7Nz4uw5yZ74MXTDgb8s5A8y2BnotAUbRa5Oow5ypAaoRis Yn66Na/wOgwJCj526/ph8ShC/AHYwRwUbR5yt3BRFk8w5ctzeXjB6CtmXXNAU4lI5zl3GJvjuAZ r4jKkOTJ9hD5MBplAwlJTXD5hUaeugsntIpBR1Yh9azvbnmLQCOd4/ZNp8+m+C9DIWyXdZ1opk2 lDq8WwVRCDk2G1uMKxP+oOh+uoAeic41gFPXVYSe0dyxoTySn3vH03LWn8zNXZN81nJrlfPndcx KkWU3y2DJ2nfoTTn2I// X-Received: by 2002:a5d:64c2:0:b0:385:df73:2f18 with SMTP id ffacd0b85a97d-38bf59ed533mr51002112f8f.51.1738061127029; Tue, 28 Jan 2025 02:45:27 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:26 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 05/11] hw/sd/omap_mmc: Use similar API for "wire up omap_clk" to other OMAP devices Date: Tue, 28 Jan 2025 10:45:13 +0000 Message-Id: <20250128104519.3981448-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The approach we've settled on for handling the omap_clk wiring for OMAP devices converted to QDev is to have a function omap_foo_set_clk() whose implementation just sets the field directly in the device's state struct. (See the "TODO" comment near the top of omap.h.) Make omap_mmc do the same. Signed-off-by: Peter Maydell --- include/hw/arm/omap.h | 3 +++ hw/sd/omap_mmc.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index d20c55a8957..7cb87ea89cd 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -535,6 +535,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(OMAPMMCState, OMAP_MMC) DeviceState *omap_mmc_init(hwaddr base, MemoryRegion *sysmem, qemu_irq irq, qemu_irq dma[], omap_clk clk); +/* TODO: clock framework (see above) */ +void omap_mmc_set_clk(DeviceState *dev, omap_clk clk); + /* omap_i2c.c */ I2CBus *omap_i2c_bus(DeviceState *omap_i2c); diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 46fdeac1121..fcec2899afb 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -583,6 +583,13 @@ static const MemoryRegionOps omap_mmc_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; +void omap_mmc_set_clk(DeviceState *dev, omap_clk clk) +{ + OMAPMMCState *s = OMAP_MMC(dev); + + s->clk = clk; +} + DeviceState *omap_mmc_init(hwaddr base, MemoryRegion *sysmem, qemu_irq irq, qemu_irq dma[], omap_clk clk) @@ -594,7 +601,7 @@ DeviceState *omap_mmc_init(hwaddr base, s = OMAP_MMC(dev); sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); - s->clk = clk; + omap_mmc_set_clk(dev, clk); memory_region_add_subregion(sysmem, base, sysbus_mmio_get_region(SYS_BUS_DEVICE(s), 0)); From patchwork Tue Jan 28 10:45:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860382 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286599wrx; Tue, 28 Jan 2025 02:47:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXRVRM9dwRnaSTZPd5VOVj6roMKU3RTu4MeVYnraC3i4tYsWJp1ImxmlXAyUj1r2zIoF8wO0g==@linaro.org X-Google-Smtp-Source: AGHT+IFl9mzgzDqXut/bI6idpUv7/l66vQpBePjF8q4SDSyQqFojCYiSWX+v2F2lY5UakjptJvlC X-Received: by 2002:ac8:5907:0:b0:467:5f8c:94b6 with SMTP id d75a77b69052e-46e12b57036mr674419391cf.35.1738061250040; Tue, 28 Jan 2025 02:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061250; cv=none; d=google.com; s=arc-20240605; b=kLOpAOQtnhiw5/HIgk9GGFQfHqJq2Ii/bdXXXDxDYu4sel5rK9O3TbZ7Iwl/C+rNRI JfFpLdYKa2FAOfZOkzFwNubFlJDUPox2IX8cqQN3vKyMw1MRM9vjD6a+Ccb1J4Xk4shr 9Mh6FGvg8P9RU2Gjy5m/UconAKvIr2r/UEwmVrLELTwEeyK1n2FMtS3JXARHmosD0P8K zGNZR2qMBxt0pP5FgnLUzg53jdGqBja+tiee+giqC7L21s0wWjrIMzvqckqZrvSP61/h LhbUhW74sSE/qxRuVArzCzp0OP6QePbkQFUD6YLchWDrz+hLAzbixqTUAf5EjJFsTbR/ CA7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5CvEPXzfVhE9gpoEHv/zIext3ELuNXpVwzWWv2pS9vE=; fh=A3j4B60P1gpWe0Br9tLd1sb0GxE7pF8YFIhk7rZtrAQ=; b=ZJdvwGZw8ehDT2avt7GUkmOJd31pga08uKkeWnN8KYaT1yziguxZmMoghfgmCtYv6Q bzI2YCaCTfhxj3h0QfurBwcfk4TNAdljxwDN5QZWdMZq7Z4IjrW+r5w9o2xuF/I7Ua73 8/aY4pu5tSfkQR0S+uvlonlXUf2tYY7igxpgDxV5ILde1sGAsbUxCdlZHYxMYs5g+BfB YJBGF4hr2X/LGOhh7+WqTvmnwlBff/1Ew6RNW0bLC95s9B0Oot0Cy2DNqHAk7RVLaUjc vFT/QT+K3IhBIDv+92mEwl3xHiUE74E6j9BQko4CSs4ZdieYDgomEsMtXtPMZNK3EkTu jubQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zgtsjtsr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e205f00c5asi117053736d6.292.2025.01.28.02.47.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zgtsjtsr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6Y-0001I3-VW; Tue, 28 Jan 2025 05:46:03 -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 1tcj65-0001A7-Tn for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -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 1tcj61-0003Y9-Tl for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:32 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436341f575fso59928975e9.1 for ; Tue, 28 Jan 2025 02:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061128; x=1738665928; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5CvEPXzfVhE9gpoEHv/zIext3ELuNXpVwzWWv2pS9vE=; b=Zgtsjtsr/LvvOK/IrZPzcg/OPl7/knd3l8j7vjrc5aCMeVqqYL1YImY2a0hynIgCLn CDnRgqFDy7V+haGw9vvN5MRSvdrJBwzapUniorUZnG1dPdnzPqyWIsfJ5qsO8W9cILAB KXmuUdPlllurqUlbT1Iv5jWd2L2Y6ssUW8cuNaz6zcWegdDHQ3EbCFj3F2fZ50xim8qD dvJMsyZMMuoe7fyl8Id05DuYgpBoIP7e6t16udad+AzmDoIgYl8BdVp0k027BIF/eAJb PyRAfgta8C+UEWlVOiI06CrouCGhxKfsS+71cPCb4TyuOwkk1wsFsOimu3uZG1a1d6DZ VT0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061128; x=1738665928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5CvEPXzfVhE9gpoEHv/zIext3ELuNXpVwzWWv2pS9vE=; b=VwwRP3AyoBkCr9o6AN3J0y2BgXBq+j2qJ6LRwZka2e23AnC3uGQeVtsDLvtwp/SQb5 c0hGAeH6ZsoESwj8Vok2zE0rQflEWY9hgoa00n2qNcXv8X6Ywst2sjr6jEH7aEP3yw0u OgcNw7/TwSKqCXz/cqX/HxtjscN4ansq6pHdhLu+HlO+LXGopwhrUPm57J90e6ibX/yC HYMSNxV20xUVsVWbszes8hfmpmJIHhTncJ1oGBCAxXhem0F5Ci/snkdAHhFaJtD8rvfj M3/0ICe/yqoPc7HsdHCoZ0TnGWShV1fWYiV+DLoOZBD2nJCftpzrKTxoSJ70yKKa1uKQ ELnA== X-Forwarded-Encrypted: i=1; AJvYcCU6vxSh2UJNx+Fy35D6f9Vi4k0Ko/+kBiRjmBKy/ZhZ+VdjLGB6kuKM5FhBUbHVCUW3TQ9hJdMUqrV/@nongnu.org X-Gm-Message-State: AOJu0YzU/5YUI6E0gs3jnYUK+2WYqgN2HuQPpvZqjH3E+uWBuuvskGo2 N00ZX9tWkybpm/2MtU9fktEV23oX9Oq6AxSvbjU0GUOQM494ucPVxbdZ7GpWWb4= X-Gm-Gg: ASbGncsJVNvHW4fmFZ6Iln+pqNdnQUVYf0lEe/SIbCRmym8rbafl3/aNmLcV4vKaEei 7peDdg4pF3NFJmWgXh3UD/xAiUvAAi5Abcd2n5Vf8wd8xAxilxoz5EyxN/ykIneyE7RT2OMXTbU xrK/GXuea6i0UyORPzMA6nbfuGMgQ/TE9zoSn876c1JX1/4bU7jOv54N4aDFMXu0qQyhh5+SOc0 QsQhLVBy8mOHjvtHOMZL/LKW7qwAanTYfYgg4MHE3m8bmIBWJHibSPGTJayQCvvyo9Ty/8RF++3 SomrJb+opHoxWaXu0s1S X-Received: by 2002:a5d:64ec:0:b0:385:f66a:4271 with SMTP id ffacd0b85a97d-38bf5649632mr37686789f8f.4.1738061128079; Tue, 28 Jan 2025 02:45:28 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:27 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 06/11] hw/arm/omap1: Inline creation of MMC Date: Tue, 28 Jan 2025 10:45:14 +0000 Message-Id: <20250128104519.3981448-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Our style for other conversions of OMAP devices to qdev has been to inline the creation and wiring into omap310_mpu_init() -- see for instance the handling of omap-intc, omap-gpio and omap_i2c. Do the same for omap-mmc. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/arm/omap1.c | 15 +++++++++++---- hw/sd/omap_mmc.c | 22 ---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 15ba0a0d0c4..ca2eb0d1576 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3981,10 +3981,17 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *dram, if (!dinfo && !qtest_enabled()) { warn_report("missing SecureDigital device"); } - s->mmc = omap_mmc_init(0xfffb7800, system_memory, - qdev_get_gpio_in(s->ih[1], OMAP_INT_OQN), - &s->drq[OMAP_DMA_MMC_TX], - omap_findclk(s, "mmc_ck")); + + s->mmc = qdev_new(TYPE_OMAP_MMC); + sysbus_realize_and_unref(SYS_BUS_DEVICE(s->mmc), &error_fatal); + omap_mmc_set_clk(s->mmc, omap_findclk(s, "mmc_ck")); + + memory_region_add_subregion(system_memory, 0xfffb7800, + sysbus_mmio_get_region(SYS_BUS_DEVICE(s->mmc), 0)); + qdev_connect_gpio_out_named(s->mmc, "dma-tx", 0, s->drq[OMAP_DMA_MMC_TX]); + qdev_connect_gpio_out_named(s->mmc, "dma-rx", 0, s->drq[OMAP_DMA_MMC_RX]); + sysbus_connect_irq(SYS_BUS_DEVICE(s->mmc), 0, + qdev_get_gpio_in(s->ih[1], OMAP_INT_OQN)); if (dinfo) { DeviceState *card = qdev_new(TYPE_SD_CARD); diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index fcec2899afb..dacbea13aad 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -590,28 +590,6 @@ void omap_mmc_set_clk(DeviceState *dev, omap_clk clk) s->clk = clk; } -DeviceState *omap_mmc_init(hwaddr base, - MemoryRegion *sysmem, - qemu_irq irq, qemu_irq dma[], omap_clk clk) -{ - DeviceState *dev; - OMAPMMCState *s; - - dev = qdev_new(TYPE_OMAP_MMC); - s = OMAP_MMC(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); - - omap_mmc_set_clk(dev, clk); - - memory_region_add_subregion(sysmem, base, - sysbus_mmio_get_region(SYS_BUS_DEVICE(s), 0)); - qdev_connect_gpio_out_named(dev, "dma-tx", 0, dma[0]); - qdev_connect_gpio_out_named(dev, "dma-rx", 0, dma[1]); - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); - - return dev; -} - static void omap_mmc_reset_hold(Object *obj, ResetType type) { OMAPMMCState *s = OMAP_MMC(obj); From patchwork Tue Jan 28 10:45:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860381 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286480wrx; Tue, 28 Jan 2025 02:47:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXqI2MOUOiFYVTgcgi+qP0Q7Bt+B7RACUL99fckhKtj8RGD5qPkl0un+FfIRiEHJNN3uytUsg==@linaro.org X-Google-Smtp-Source: AGHT+IGpQ+r+yNRkIwt0l/IZXeftm/1c+j1FZQaybTI+94dC76hqB9TZttDs95T7L992QZcTYoCZ X-Received: by 2002:a05:620a:4093:b0:7b6:d312:c5c6 with SMTP id af79cd13be357-7bff3f75e76mr488898485a.9.1738061228181; Tue, 28 Jan 2025 02:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061228; cv=none; d=google.com; s=arc-20240605; b=g2vVDju/2YdJquP4XKGSclQoAGnec3gfleUYdPTxOm4Agjv2u9g0fWcw2wuWa+Z21k 0wspDw2nJCiJdM+ON3a89eWSXcGqgRzm4CqEJR7vy+rhfx4YHkpn9YgUTvB4SN61aqsN yABHn4O2/qxWQjhcvLxld8EFnYmzLmBI9QDUOHd2Sk71ZReGbSjS4usNjTDJO+Swd1vo fEv+48DFMZlfXbLP+KnYTR2PrB34m/6ROihsLUSNtDVcXK6eS00RVYSEQIj1Kpm5Mt3m HNpUwYQRmXRX93dVDoQg6dDwWx3pytGAffMHzWNOxa3OW4MO8De/RknfmwbiECJ6ozF3 /gLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ane9GQydmwnJiMFHOBDXlrUGP0wnx1nfccZAfAb02YM=; fh=iNu3zBea76qsVm5UohrA32BfuEV6u21xyiqdNBRHJME=; b=jW4Q2tMRr4GvdEhORZmVrSCwRlUWxIXrAARr5dpsxgJytccQRPkiYXjj0bjCQ1FF0u OADXGardfGp/qyqPb1e2NhtxwVAqya11rEV9U9baUGEkPf7zZmxeitXKCesd2HTV2tTr ISOVMP3KiFwCTKcwQl9soG+Qb0Bdj3q8NMXWw874dCxrJVrJp63I6x/AhUk5bYerEmZ7 rmF4J60mXwzGZsAuK/VWjQj6wH6Eh0BD3iYh0T+RgA9EDE97JqQj39r44QSasUuAw2oX ppbtP4O5P1atsJAUZR9xAxqxRfu6FFKmsIpEEDRGdBqZWM42MKkBq24v9tgOyPTxt9Z2 gk+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cCXCqCJ/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9ae84570si1346864285a.129.2025.01.28.02.47.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:47:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cCXCqCJ/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6a-0001Ik-7P; Tue, 28 Jan 2025 05:46: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 1tcj67-0001AG-5F for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj65-0003Yf-C4 for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:34 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38a34e8410bso2720594f8f.2 for ; Tue, 28 Jan 2025 02:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061129; x=1738665929; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ane9GQydmwnJiMFHOBDXlrUGP0wnx1nfccZAfAb02YM=; b=cCXCqCJ/e1UWsRMmFPudHZWLExXOMug/UKklTYM9PaabZTSaiUylVkFZPntU5Qp2Zq VcIXhuksyMQ3F1A3QIKZ5RhxfEsDX0yCAEMFx4exOzYXu5vk9w87ef2Y/T8BvPyV9ubU UAoWtnaX5t0ngM/VS1KEv367waKbcZdGE9bQI0366gouE8oFvTLYMnr/eh0oi+cv5l5Y Iwehg7jUrwYqguGfBTSIRQQDFeIAeAfFOHrAGTsmic3eAV4U3LGCKoq13v0rsK5NC8yn Y5z1Kg5q7hz2gLVdGoHet3B5H+cUm3syG8Thow/AaXp8UzmOENyImuqdGgXS0cZG6zZr aNbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061129; x=1738665929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ane9GQydmwnJiMFHOBDXlrUGP0wnx1nfccZAfAb02YM=; b=KiVHSopMer39YrojyQF5lMjYGBNT5P8Ivd+JO4swRVIGo963HXW0PBUnVoN6be/PW7 bV7I6Q8dcFr+lU3iDalickpUt5DfyEasJYhWcv1OdyQFWIaquMijJGSw/XqP+jUV5Z3l EfTqGmo3erPRWlOZ39FcJAyKGgzOl8OsQ2IoHluFCyYAw8yQkqfboc4ja1RXqusmwyqk nOa/WjCsmffs9es+RLpXXBACjeDevuA2C9xH1WxnakYaLvL4vd2ceQ1jKEvktyoq/CgW yNqaHEXUt9L1uWYnu0fgawqc/Z99ct+tgPOcCI+qytx7vYqLg+pkO6ssEKU8bbeKABj1 rm+A== X-Forwarded-Encrypted: i=1; AJvYcCVELrU4D/5RBOeTdgADuwRh4ULnD1BYWcFb+yQdHiOmMYpivG5WA8WTO4LXirNWhOaMdhmZkaU2j/FD@nongnu.org X-Gm-Message-State: AOJu0YyIxRJ/mMnH+g7vIZuuctAdT8Yb2/r0mOvDSLajJmlzvsAWAH5e svZ8n2cQk9efCwhNLGtelp1s1VkHh2kRyxmd35XeGnqi81x+nzHHpVzILc9kMFg= X-Gm-Gg: ASbGncv2NeiyeUsohzJ698NQcAMiJYkShaw7PCigQ6KpXldebTJcb4tBRXXgbZbskXe IwxIRVcNrW0kx1L3zxPqV9OQ/kcRjte/QThBOKSLeb8XTbc0MFpAv/iGoRkcC1QPZ6CDGvZz4WD wGvuq1g2iSu6svZlf7HcuUWSh0XDnkMwR++3r9ikqDMZ1561MsXN8hh2pURJpHp0cIdI+0VrkTZ P+JKllJ6734XDzw+ua91FH8X7wqqAmB3ZKLmouQ7J/QGDv+HwoTF5oErb8ILTM9/7oo2Mg4GJ0L gS1dRiKJz8zOeXhk4YBB X-Received: by 2002:a05:6000:1f85:b0:38b:e32a:109d with SMTP id ffacd0b85a97d-38bf59e1d83mr35900134f8f.34.1738061129221; Tue, 28 Jan 2025 02:45:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:28 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 07/11] hw/sd/omap_mmc: Remove unused coverswitch qemu_irq Date: Tue, 28 Jan 2025 10:45:15 +0000 Message-Id: <20250128104519.3981448-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The coverswitch qemu_irq is never connected to anything, and the only thing we do with it is set it in omap_mmc_reset(). Remove it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/sd/omap_mmc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index dacbea13aad..07d47421bc8 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -35,7 +35,6 @@ typedef struct OMAPMMCState { qemu_irq irq; qemu_irq dma_tx_gpio; qemu_irq dma_rx_gpio; - qemu_irq coverswitch; MemoryRegion iomem; omap_clk clk; uint16_t last_cmd; @@ -325,7 +324,6 @@ static void omap_mmc_reset(OMAPMMCState *host) host->transfer = 0; host->cdet_wakeup = 0; host->cdet_enable = 0; - qemu_set_irq(host->coverswitch, host->cdet_state); host->clkdiv = 0; omap_mmc_pseudo_reset(host); From patchwork Tue Jan 28 10:45:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860389 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp287036wrx; Tue, 28 Jan 2025 02:49:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7dpZvi5u9qZD/l4q2Enzv23u/Mf91A5zawQLNhoFc5tUxV6RAuWibwFQJDETueGnhEJqsqA==@linaro.org X-Google-Smtp-Source: AGHT+IGwDR+ORyFvGfUEi7L29XtoPvjd8zrzso65alvIXwbGGmxOQm1hGWakE2QsDtEjSvK7dlhL X-Received: by 2002:a05:620a:24c8:b0:7b7:142d:53a4 with SMTP id af79cd13be357-7be6325bfbdmr6522728285a.51.1738061344942; Tue, 28 Jan 2025 02:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061344; cv=none; d=google.com; s=arc-20240605; b=gOvyyiyChk6C73IRUXA1gv3OyAfgXFU+y4M+5Gzt6ZP0TJv8FmBt9CzUIB19ECalRj jCPFDPUc15ILZLzTR5R+IsIjQ9N9QuxjcETmdyDUTASfsHxNnb6y+yWgv2zcVzwG+YlC qFoC65+M0yghqAVJqcKSQ2QpgF1wB0ldB5hjyLTo+wgZ4JY7Lv2l+X5aXeObl3xFmJqz 79nkRPuOcicJYn365OYKcDVsj0i39sOC2cS1eeq1fSYgCHa5NO6KtfFsQ8vc7RYrr825 zajzl17R8uDpvrYnnDWd5DxPSEaT6gKyvARIsr9ZEQTUQIUzrtcA1tw94OodQccKmIDB edhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E1f0V/uP3+Z6Rm6pHIUK22c1PN0PD4Ozc5f+Izcv90c=; fh=H72PwoE/C1li2PvlaHQTebso+vM6XvGBNIbU8pfVjEw=; b=dbQMn+iPBh5WOtcnqX1jvQ9HOOLeYQfaOsNSMhjw3jfF7vfMcfDmBfyRkomGEYGve+ 5jeTDZ6+Fw6fo2w9tG8RtWyGBgK8XAJj1YaQwa0Y5fiQyeqHu8IumEmUeGskYCCER4Py MHZM8DB6QxORZFGM0jmdMn/iRK9YV9cjgTTt9AyVZG63tVnYMzx/cvX0q04ha3GMKwmG 0qxAonH0Tet7k/K/pOKE3hnn6TGKJhrRWe2jT07fa+kl277SYd0iliDJ5awAmwgDZFrB 2kJMh8jzmohRW+VVhqQGnQ0+ggrwQmExbdu4mEy+FATprUq+kDHu76bvM1z3nLJCyJWZ z0tQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k/jo6XOt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9aee179esi1190480985a.276.2025.01.28.02.49.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:49:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k/jo6XOt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6s-0001ag-1Y; Tue, 28 Jan 2025 05:46:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcj69-0001AV-Fs for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj66-0003ZV-DV for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:37 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so2905946f8f.2 for ; Tue, 28 Jan 2025 02:45:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061130; x=1738665930; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E1f0V/uP3+Z6Rm6pHIUK22c1PN0PD4Ozc5f+Izcv90c=; b=k/jo6XOtx1Z4WFxJCq7VqUn9Ym7KcBs0ix8JkMLKFiK4Ws0rd9xAiGlq25uphvrEj2 +yu2uCycaFxQyKiTGa+DT/r73LYKDcQwwUgQA08zajR1cMqXAsAU0t6AooamtaeiluPS 02F+WEV//BLnC0th3jKYBMmGLwSK9FOt5U5qqclIaQU9i8CoFtj2kUyRkz3QvgA5s6bu wYrZJUO0NZpFNZY/9QnMrc6jNjystFkKJtDN2DOjqvvsIIh/StW0S2Z4rsgJBzgHx0zV 24RHwHEBzdSOm0OLU4IgubK7fBEdXjPSAuU0lqWJBM6LI5hAo0FoojCxdfy8IQou7Lm5 ukaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061130; x=1738665930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E1f0V/uP3+Z6Rm6pHIUK22c1PN0PD4Ozc5f+Izcv90c=; b=r20wALS0NI1ipujSZ9EPHJdvGXgVcjjBfTuykdrufgLn5sd6sYYUyXkyJwqKmZNTf2 ksnUytog1k9V3E1gqohfBW8Rtyq0vbBd6Nxdtxp1VnjwTvRLa8kVc/Z60Jq/HBViY6gP uN8klit/ffuA00Dx5dNOxKQA5jFYOmIGhi8N//6rzHN5gWWx9P8ehDyuoNsh7ez3OeN2 oDPENU/r4TA+4jBO1gUXwRkLP712h+K2DjaEF9JNkyuWLyptiBc3L66/tTM6EXgbvftH rIGwKdpiCOZMvi4dZpgLOSmcXUF8jLtaS9+6JCwI9yBe1UkXopsJP5/5BLmFQFUFf6zL F6Zw== X-Forwarded-Encrypted: i=1; AJvYcCWiRghlnYzO7/8zMz9qDbjoZw+KNH6ZvBkLQGkSOqy6v0A7YR6zPkGm4CocfDTnDwZFI60QVC7+FwyX@nongnu.org X-Gm-Message-State: AOJu0Yyx1hBulR0M8002yin5uscjqxH3+tzaGhv5m7Nk08721bKBOFXH w9krRHQf+gfn0ilXr8dx9ICZu08tTe+7c16ftIZhIKPAtvXcDBwiZw5o15jj9o8= X-Gm-Gg: ASbGncvKSQLqmG4Z1wPm49tbsE5VN79Q6JSHjzpkxmwOKHzaAdB2pqxpaI/hrAmxn3x 5I029ICxwCSGiT1bjn4vu2BSh9yyjWkXx1kXo2YGkcrkuveoGKksD32BmAzqTaxDZAZPSUez4S8 JKZM9okWQCPrROFecHZuLgAr2x/xwANPRYHBXBHnDAjX8CqxyYelXcj3Xx3XHxv9oRDF7Sdxkul ImZRa3/T+PycYJjm9xpHXyyA8G7QOk4v+6L6IIA6lxX6aLpWEA370W276fNOjV998tmfrsJSwDk /w0Ff0s7m56xtU39boJZ X-Received: by 2002:a5d:64a1:0:b0:385:e8dd:b143 with SMTP id ffacd0b85a97d-38bf56627d7mr34514066f8f.19.1738061130339; Tue, 28 Jan 2025 02:45:30 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:29 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 08/11] hw/sd/omap_mmc: Untabify Date: Tue, 28 Jan 2025 10:45:16 +0000 Message-Id: <20250128104519.3981448-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is a very old source file, and still has some lingering hard-coded tabs; untabify it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- I don't propose to try to bring the whole file up to modern coding style, but hard-coded tabs are a particular wart. --- hw/sd/omap_mmc.c | 124 +++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 07d47421bc8..c1598135f44 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -110,11 +110,11 @@ static void omap_mmc_fifolevel_update(OMAPMMCState *host) /* These must match the encoding of the MMC_CMD Response field */ typedef enum { - sd_nore = 0, /* no response */ - sd_r1, /* normal response command */ - sd_r2, /* CID, CSD registers */ - sd_r3, /* OCR register */ - sd_r6 = 6, /* Published RCA response */ + sd_nore = 0, /* no response */ + sd_r1, /* normal response command */ + sd_r2, /* CID, CSD registers */ + sd_r3, /* OCR register */ + sd_r6 = 6, /* Published RCA response */ sd_r1b = -1, } sd_rsp_type_t; @@ -230,7 +230,7 @@ static void omap_mmc_command(OMAPMMCState *host, int cmd, int dir, if (timeout) host->status |= 0x0080; else if (cmd == 12) - host->status |= 0x0005; /* Makes it more real */ + host->status |= 0x0005; /* Makes it more real */ else host->status |= 0x0001; } @@ -339,32 +339,32 @@ static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) } switch (offset) { - case 0x00: /* MMC_CMD */ + case 0x00: /* MMC_CMD */ return s->last_cmd; - case 0x04: /* MMC_ARGL */ + case 0x04: /* MMC_ARGL */ return s->arg & 0x0000ffff; - case 0x08: /* MMC_ARGH */ + case 0x08: /* MMC_ARGH */ return s->arg >> 16; - case 0x0c: /* MMC_CON */ + case 0x0c: /* MMC_CON */ return (s->dw << 15) | (s->mode << 12) | (s->enable << 11) | (s->be << 10) | s->clkdiv; - case 0x10: /* MMC_STAT */ + case 0x10: /* MMC_STAT */ return s->status; - case 0x14: /* MMC_IE */ + case 0x14: /* MMC_IE */ return s->mask; - case 0x18: /* MMC_CTO */ + case 0x18: /* MMC_CTO */ return s->cto; - case 0x1c: /* MMC_DTO */ + case 0x1c: /* MMC_DTO */ return s->dto; - case 0x20: /* MMC_DATA */ + case 0x20: /* MMC_DATA */ /* TODO: support 8-bit access */ i = s->fifo[s->fifo_start]; if (s->fifo_len == 0) { @@ -379,42 +379,42 @@ static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) omap_mmc_interrupts_update(s); return i; - case 0x24: /* MMC_BLEN */ + case 0x24: /* MMC_BLEN */ return s->blen_counter; - case 0x28: /* MMC_NBLK */ + case 0x28: /* MMC_NBLK */ return s->nblk_counter; - case 0x2c: /* MMC_BUF */ + case 0x2c: /* MMC_BUF */ return (s->rx_dma << 15) | (s->af_level << 8) | (s->tx_dma << 7) | s->ae_level; - case 0x30: /* MMC_SPI */ + case 0x30: /* MMC_SPI */ return 0x0000; - case 0x34: /* MMC_SDIO */ + case 0x34: /* MMC_SDIO */ return (s->cdet_wakeup << 2) | (s->cdet_enable) | s->sdio; - case 0x38: /* MMC_SYST */ + case 0x38: /* MMC_SYST */ return 0x0000; - case 0x3c: /* MMC_REV */ + case 0x3c: /* MMC_REV */ return s->rev; - case 0x40: /* MMC_RSP0 */ - case 0x44: /* MMC_RSP1 */ - case 0x48: /* MMC_RSP2 */ - case 0x4c: /* MMC_RSP3 */ - case 0x50: /* MMC_RSP4 */ - case 0x54: /* MMC_RSP5 */ - case 0x58: /* MMC_RSP6 */ - case 0x5c: /* MMC_RSP7 */ + case 0x40: /* MMC_RSP0 */ + case 0x44: /* MMC_RSP1 */ + case 0x48: /* MMC_RSP2 */ + case 0x4c: /* MMC_RSP3 */ + case 0x50: /* MMC_RSP4 */ + case 0x54: /* MMC_RSP5 */ + case 0x58: /* MMC_RSP6 */ + case 0x5c: /* MMC_RSP7 */ return s->rsp[(offset - 0x40) >> 2]; /* OMAP2-specific */ - case 0x60: /* MMC_IOSR */ - case 0x64: /* MMC_SYSC */ + case 0x60: /* MMC_IOSR */ + case 0x64: /* MMC_SYSC */ return 0; - case 0x68: /* MMC_SYSS */ - return 1; /* RSTD */ + case 0x68: /* MMC_SYSS */ + return 1; /* RSTD */ } OMAP_BAD_REG(offset); @@ -433,7 +433,7 @@ static void omap_mmc_write(void *opaque, hwaddr offset, } switch (offset) { - case 0x00: /* MMC_CMD */ + case 0x00: /* MMC_CMD */ if (!s->enable) break; @@ -448,17 +448,17 @@ static void omap_mmc_write(void *opaque, hwaddr offset, omap_mmc_update(s); break; - case 0x04: /* MMC_ARGL */ + case 0x04: /* MMC_ARGL */ s->arg &= 0xffff0000; s->arg |= 0x0000ffff & value; break; - case 0x08: /* MMC_ARGH */ + case 0x08: /* MMC_ARGH */ s->arg &= 0x0000ffff; s->arg |= value << 16; break; - case 0x0c: /* MMC_CON */ + case 0x0c: /* MMC_CON */ s->dw = (value >> 15) & 1; s->mode = (value >> 12) & 3; s->enable = (value >> 11) & 1; @@ -478,27 +478,27 @@ static void omap_mmc_write(void *opaque, hwaddr offset, omap_mmc_pseudo_reset(s); break; - case 0x10: /* MMC_STAT */ + case 0x10: /* MMC_STAT */ s->status &= ~value; omap_mmc_interrupts_update(s); break; - case 0x14: /* MMC_IE */ + case 0x14: /* MMC_IE */ s->mask = value & 0x7fff; omap_mmc_interrupts_update(s); break; - case 0x18: /* MMC_CTO */ + case 0x18: /* MMC_CTO */ s->cto = value & 0xff; if (s->cto > 0xfd && s->rev <= 1) printf("MMC: CTO of 0xff and 0xfe cannot be used!\n"); break; - case 0x1c: /* MMC_DTO */ + case 0x1c: /* MMC_DTO */ s->dto = value & 0xffff; break; - case 0x20: /* MMC_DATA */ + case 0x20: /* MMC_DATA */ /* TODO: support 8-bit access */ if (s->fifo_len == 32) break; @@ -509,18 +509,18 @@ static void omap_mmc_write(void *opaque, hwaddr offset, omap_mmc_interrupts_update(s); break; - case 0x24: /* MMC_BLEN */ + case 0x24: /* MMC_BLEN */ s->blen = (value & 0x07ff) + 1; s->blen_counter = s->blen; break; - case 0x28: /* MMC_NBLK */ + case 0x28: /* MMC_NBLK */ s->nblk = (value & 0x07ff) + 1; s->nblk_counter = s->nblk; s->blen_counter = s->blen; break; - case 0x2c: /* MMC_BUF */ + case 0x2c: /* MMC_BUF */ s->rx_dma = (value >> 15) & 1; s->af_level = (value >> 8) & 0x1f; s->tx_dma = (value >> 7) & 1; @@ -535,38 +535,38 @@ static void omap_mmc_write(void *opaque, hwaddr offset, break; /* SPI, SDIO and TEST modes unimplemented */ - case 0x30: /* MMC_SPI (OMAP1 only) */ + case 0x30: /* MMC_SPI (OMAP1 only) */ break; - case 0x34: /* MMC_SDIO */ + case 0x34: /* MMC_SDIO */ s->sdio = value & (s->rev >= 2 ? 0xfbf3 : 0x2020); s->cdet_wakeup = (value >> 9) & 1; s->cdet_enable = (value >> 2) & 1; break; - case 0x38: /* MMC_SYST */ + case 0x38: /* MMC_SYST */ break; - case 0x3c: /* MMC_REV */ - case 0x40: /* MMC_RSP0 */ - case 0x44: /* MMC_RSP1 */ - case 0x48: /* MMC_RSP2 */ - case 0x4c: /* MMC_RSP3 */ - case 0x50: /* MMC_RSP4 */ - case 0x54: /* MMC_RSP5 */ - case 0x58: /* MMC_RSP6 */ - case 0x5c: /* MMC_RSP7 */ + case 0x3c: /* MMC_REV */ + case 0x40: /* MMC_RSP0 */ + case 0x44: /* MMC_RSP1 */ + case 0x48: /* MMC_RSP2 */ + case 0x4c: /* MMC_RSP3 */ + case 0x50: /* MMC_RSP4 */ + case 0x54: /* MMC_RSP5 */ + case 0x58: /* MMC_RSP6 */ + case 0x5c: /* MMC_RSP7 */ OMAP_RO_REG(offset); break; /* OMAP2-specific */ - case 0x60: /* MMC_IOSR */ + case 0x60: /* MMC_IOSR */ if (value & 0xf) printf("MMC: SDIO bits used!\n"); break; - case 0x64: /* MMC_SYSC */ - if (value & (1 << 2)) /* SRTS */ + case 0x64: /* MMC_SYSC */ + if (value & (1 << 2)) /* SRTS */ omap_mmc_reset(s); break; - case 0x68: /* MMC_SYSS */ + case 0x68: /* MMC_SYSS */ OMAP_RO_REG(offset); break; From patchwork Tue Jan 28 10:45:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860387 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286972wrx; Tue, 28 Jan 2025 02:48:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUd1np0G2zaFKOd4uvEZOQYqUhtGB3nNgSKrmJ+gQCxRZFsiTEZePVzXwNyYz4ZPK/VxFqCXQ==@linaro.org X-Google-Smtp-Source: AGHT+IFRy+wcWKGsNyPYWj5lyeYd4S1C7c4fDNXbDg4Ctlg30djQOvN4cn1RSCv03Vis3qEoVqmo X-Received: by 2002:a05:622a:28e:b0:467:81f0:6d63 with SMTP id d75a77b69052e-46e12a3fae5mr650894671cf.17.1738061330762; Tue, 28 Jan 2025 02:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061330; cv=none; d=google.com; s=arc-20240605; b=luuL0jTySq+Kc9eHuaC7AkaiPhu8dFzmag5rT1387NlcRpWw8/Qr/ygaKwSyquNolC FrmdaCpRF1YmdgUbWtBUSlTmIpUuekx12F3Raosj3TAldCozmO3dgPkZxIwZNs6MyVKv PVNTBq9sgqlK5EUhMUE6iCkZO2gMsRO7nV7m6MYB1BROwgs3oMf/mAt20EdZkrk32IS6 V/TE35RlTyVjKH0N4cdbrZnmmqyhpr13CpZusqqAw12Vy35zkQfp3iD3HEunF96ie4B4 WrY/k1lZDiiVjqhdjTz1scuT/P5Re6sxoHMQGk4bSDuCf/cfr7mTdo4rZB6sdOL0SkZo XeLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P84lmvWRoPuZSyE7d4+2LbnhWUe5f771b5Xano3sRNQ=; fh=Br6zGeTT6Byp3mOOotirFMXiT+Fp9gimwRY/HFEUedA=; b=Z25jyL5MfeTC6NWJd/zJY0Q/CzNJsGRhJEb1Ob+ShfKgUUrCKjCnGjUt17WtP7j4Dj oHNR5y/VFWJyeV5Q5pLKeCf2lX4R36FEIJLZiS1AE2NKlyCsR5lnQa+yAiewttqvX+vO nIIw+wu152xfZcBt8NbcawjEWtFChNfN3fXhHh0jvxddZ7MoYxjLDP8lgC/6LiLpVKf/ 0jityamOhV6tYEP0VZ505a9ACG37MxJcuQIgKgu623HAtSop4pptH7MW7zUnl4pzkkcC Q7cVIOcRbdXK8dPohA9X5tDvjJ0mYUVzQIu6JsKDCj5DLpeg1ycck6R9qgfyE5561DUM EVTw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQ3aaO2w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e66ba75b8si126889131cf.497.2025.01.28.02.48.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:48:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQ3aaO2w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj7V-0002Qu-7F; Tue, 28 Jan 2025 05:47: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 1tcj6E-0001B3-Ux for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:48 -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 1tcj66-0003a2-Ck for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:42 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso40570275e9.0 for ; Tue, 28 Jan 2025 02:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061131; x=1738665931; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P84lmvWRoPuZSyE7d4+2LbnhWUe5f771b5Xano3sRNQ=; b=OQ3aaO2wabwlC+BpjNqzVUObLquPwFMMt1Pp53vcDoOjZJ75SvT4Q2ov2CzqDE2cm1 mHS5miJyb0dfd+Yz3ITcs6DNSssPhO6SrbeDJ/zlxHuYMjVWcJDWB6qmxR0/8Rfx13z1 1hLY74PKeqUEBFH833plgPMxvDGqVaKJdsSUa7keXQVvASzLpdEmOXmss/CdOPmaY/DH hb0yKcjaFeHONxyEUlgzA9Zrzq+kdF1Dhl/BtrNty9UH02RnlBCYiPLie1WlSdLmw7H7 aiR989cnHWl3FQQwu3iVUq4Ku3mKHN7P1bFeQ8sdSoxiCdEC84uiTJ6YSLafnU4dLqA0 6wvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061131; x=1738665931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P84lmvWRoPuZSyE7d4+2LbnhWUe5f771b5Xano3sRNQ=; b=YZB+QQAgBIBCAilBlGAk0CxH4OGoc3hTL7ejo71R5lxuIXtfQYQXwbkeQQxWvt9YkZ RIpPyw/wixGFfdrjVc23xRlOpbJdlPILFh74gzsv+RZz/xgnXTWh3eyLkZ6pBJW3zyWP P/h5RChzLZNRhmC+RLGkRHRt4cPwcCAXm/qFe/G+X2CuScAzz+BfWEueBMi6jc0eOlJr V2QULR3PrPapvmI3N14kXXOIraFDE5oiJt6UODUQzZHfYSCfFcAcE0q5uajQc6KZ7xij Kd56cEEz4eJOt4pMLXc9+hUq+eNqls1vWBfhZnTKHKguW1SXMcJ3+dIX9FN99L0iemQ0 0dPA== X-Forwarded-Encrypted: i=1; AJvYcCXicfR5gwNACaKNBxO8BnuS4CbsWtkTgqWuYagR89kf0ZrMcq0xQiSxb5m+MtUhKypl0S3asNA0UyKt@nongnu.org X-Gm-Message-State: AOJu0Yxe7I16MgGQdm3/QpDrCzQaPuuQ7jLMCwMoOmW7JSilew1mPosJ nI9w7ok8zJLeLM67uqgMvgVJG6S2f1X8hrq8eHOLMoIi2rS2GmtcWrUkLObqtPM= X-Gm-Gg: ASbGncumxY3BX7fvGG2r8gzOxf/hVDtmOfrQv9KYuyGwj8LX2dlaJPaaCh3rG3JqXOj SBHl/qSuqJ8miiYHMKig64SI/Fjrf9wbvtj3RaYXSMU8uDTZ3oNtJKoh2cnyPjqPTSzdmNgvNxx t+DZADCjt1L9f4E2d4GV+CuBU8IhdH5l1GvZ7gIuiR9ql0O7lDsIAP1HT08AsxPdOrJLTbSnUD1 jVTHltQ2UaCHzeOrUHODszbwnL2rHakeZURr/Fc4s/PP+uDVeE4rJ461jLc/n4OGWtb/KP7g9mj zdFtP8gJzKC6BtOip2XI X-Received: by 2002:adf:fb84:0:b0:385:e328:8908 with SMTP id ffacd0b85a97d-38c49a5d44dmr1754140f8f.29.1738061131513; Tue, 28 Jan 2025 02:45:31 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:30 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 09/11] hw/sd: Remove unused 'enable' method from SDCardClass Date: Tue, 28 Jan 2025 10:45:17 +0000 Message-Id: <20250128104519.3981448-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The SDCardClass has an 'enable' method, but nothing actually invokes it. The underlying implementation is sd_enable(), which is documented in sdcard_legacy.h as something that should not be used and was only present for the benefit of the now-removed nseries boards. Unlike all the other method pointers in SDCardClass, this one doesn't have an sdbus_foo() function wrapper in hw/sd/core.c. Remove the unused method. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/hw/sd/sd.h | 1 - hw/sd/sd.c | 1 - 2 files changed, 2 deletions(-) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index f2458f37b3c..d6bad175131 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -119,7 +119,6 @@ struct SDCardClass { void (*set_voltage)(SDState *sd, uint16_t millivolts); uint8_t (*get_dat_lines)(SDState *sd); bool (*get_cmd_line)(SDState *sd); - void (*enable)(SDState *sd, bool enable); bool (*get_inserted)(SDState *sd); bool (*get_readonly)(SDState *sd); void (*set_cid)(SDState *sd); diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 0330d432fd0..f781fd1641d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2831,7 +2831,6 @@ static void sdmmc_common_class_init(ObjectClass *klass, void *data) sc->read_byte = sd_read_byte; sc->receive_ready = sd_receive_ready; sc->data_ready = sd_data_ready; - sc->enable = sd_enable; sc->get_inserted = sd_get_inserted; sc->get_readonly = sd_get_readonly; } From patchwork Tue Jan 28 10:45:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860386 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286943wrx; Tue, 28 Jan 2025 02:48:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9SwaqBFm4R4LIF/aBri+Md3qwGrtjyE/QnH1BK7Va7TqCTTu+Burj/HotcGld9ERkQ2pl+g==@linaro.org X-Google-Smtp-Source: AGHT+IFum4ePpKA0SfbG34zaxG8/soULf49VjB3wFF4RmxysL1Pz+jizy3xHK4Rgg6JnwLt8efx7 X-Received: by 2002:a05:622a:1115:b0:467:6563:8b1d with SMTP id d75a77b69052e-46fc494870fmr38953651cf.6.1738061320314; Tue, 28 Jan 2025 02:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061320; cv=none; d=google.com; s=arc-20240605; b=CWhhNNszMhJPFwAu4ZPe7lJ/JJ1cuzx03pzT10FpIemab6b+7cpL8dGH8e/vo7LwiC kJ88wHsmQH2bb6DqLhhPk/KuLxqRR/+oH/xqZnFri0BPxYC6w1E2K1yJs9U95uehzH4F yV/bc1hqJ6IPhmzuwMCq765OjGLrDZ8zSITGgnJC5L9tFs19UoeEIlx/eLUNaouKaBq5 wmtTI74dHJ+EeoXC50EjsJWt78jCBy6KikuH5NKDMSsV6FFhGwCl6GI38GxYC9DLoPfY 9XN4klRpee3sHDRtPtYVOT2QvVRTMncDV/mqEZjU0cG/U6+pKoGEOKk3Xc5mjC26rczJ iT7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hXVaYgjVnVDD5iua1WW8j0IeQfgPY/QrMi/c0hN7fA0=; fh=QJ/ET5zvoH1iINi6AMeiFuWBqdmmR12FbjXQAZW8Hh4=; b=N0ZeQUrxtrFJmcf9ZmCbZkEQ83aW9+VimqP1ZV1MrE6HaLPL6wS5b3Een3nbH3AEA7 Ws5Qd8exK4/4BVvlAlnYaC4hjYAFzAX5QtVk2A7Ege4rL6jd8xVjzdeu0kE2tctsIy8/ 5SgjOE1GlSRBKw+fD+zEZx3X3sOAsLGv+942VFJ0C8pcY4islOaLrfnOC0pKYYRuCWTU WnC9+IEu9kV3gfKxTm3P/KNZL/EdInbo037SsFiLXzIkhYxh07hSlLMC0Ew8OuHyRct/ di9siBBx62zWLdh1CbAp3/Ht+yndd07DT6JAk3G3QswdLSR4UepxhC0Dz9NznqkatDcR zbuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bAOFDtA4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e205df6332si115083726d6.210.2025.01.28.02.48.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bAOFDtA4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6m-0001QU-4B; Tue, 28 Jan 2025 05:46:19 -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 1tcj6A-0001Aa-Cf for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -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 1tcj66-0003aR-CK for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:38 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-436249df846so36373915e9.3 for ; Tue, 28 Jan 2025 02:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061133; x=1738665933; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hXVaYgjVnVDD5iua1WW8j0IeQfgPY/QrMi/c0hN7fA0=; b=bAOFDtA4g+rPXcWYs7HuUTOMMwlvF+ybNE8I/eRwQXdx9XevaHS+tElu7lhUIKOv+O fCL3Ppfwrnxzp/ftsP+enVX+1l7WQtGNqeMs/+4+yunPA9aUXOQSShHUi0EWrHt5T4QP rnh+YDDCOKzBq8qvXDEemMQl/S7Lq0aviGJkJgZVrveivxv/jzXHHZFUAliFCJhgTn9X ZwKik8SdJT2xzXE7qkxI7uurZ5VdYCzD6a1OOXRXBL8G+/Yjsph60VHC8Xuyw3iGSHDL 7i7+G9udeWc0IIAnamAXdenFzf7f+MvS3Xm58arBApYSSyruUAQrHIKEPJRSw4ocDNYQ rXYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061133; x=1738665933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hXVaYgjVnVDD5iua1WW8j0IeQfgPY/QrMi/c0hN7fA0=; b=cn7TqgSkqpYEuTNgUujVqyeg/DVe0RaHkXKT0XXux1bMtk22XawxlmNoGxim10ublR lVh2xLzHwCx97hgV2WXKd+BjpwnjLXHiruelFiLC7xKWQ8e0QObH7lbiHzGUxY4kchwm OEfmzC6Yu3H2IqaSU7V2rSDd1KvGp5FY0Hq4zzhuBH/Ekv4XNX/uVE2eCjbmCmBYCZpA ftzt9Fh8Qu2Al03UxpTA+9ZZZDt5GPvjdNSL878AhYL22Pjs7zIc2HSbF9huSdznL9Cd rb5fb/BxWbkq1iGYrC0Ern0PSgAcVklus+ztu9R7g/pzxChucWyy//LSE1AUsXsHajN0 xNgA== X-Forwarded-Encrypted: i=1; AJvYcCWHNgXFMAQHYi1ngKh5fXeJh1IFDbDlDNybCRfgz4JZkZ0IQkHVQ5KxPSJ3Bgih4mMn3+LoHd0QFsjQ@nongnu.org X-Gm-Message-State: AOJu0Ywt9Guh08S5OLZvSmMn5Qik6pDkkBO3CP+tMjaBD1kwPw/SqWiy Mcf1AUS8K4Q36dN1iP0avOEvjoKnAA+kMbUIojIYiDixjruIJS3ZD8JUdck1Qz4= X-Gm-Gg: ASbGncupN8nCX0GnZHQKp0v3wdDhV80+0dulq2WHYgfKelxaqMTFpIBvNWjNn7uiNWm kZtGYKGwJR41GW2/e5gQZL1nTdN+6iPBTEfqSQjiN7FB4nSg3tnDsS4aWYV3j1FL8Vx+cpCvXCH wNsAxr22M7Ko+NH40i1t1mG1u4wnQAbli/UJPjib+P4R9oLY18y++4fAFC2PcxE3LSf7IJVfbO8 wxly3omojj6FxwNZ8bgEGc8DVA3S/PKPrLDfba4yhamNI1EvrZruzRBeJRWP12yh1jrsG3FYmrE Hot8INZuV9De9qT7XDulL8PEfJZRRas= X-Received: by 2002:a5d:648a:0:b0:38b:f44b:8663 with SMTP id ffacd0b85a97d-38bf57c0ac9mr37236217f8f.55.1738061132720; Tue, 28 Jan 2025 02:45:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:31 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 10/11] hw/sd: Remove unused legacy functions, stop killing mammoths Date: Tue, 28 Jan 2025 10:45:18 +0000 Message-Id: <20250128104519.3981448-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The sdcard_legacy.h header defines function prototypes for the "legacy" SD card API, which was used by non-qdevified SD controller models. We've now converted the only remaining non-qdev SD controller, so we can drop the legacy API. Entirely unused functions: sd_init(), sd_set_cb(), sd_enable() Functions which now become static inside sd.c (they are the underlying implementations of methods on SDCardClass): sd_do_command(), sd_write_byte(), sd_read_byte() Removal of sd_init() means that we can also remove the me_no_qdev_me_kill_mammoth_with_rocks flag, the codepaths that were only reachable when it was set, and the inserted_cb and readonly_cb qemu_irq lines that went with that. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/hw/sd/sdcard_legacy.h | 50 ----------------------- hw/sd/omap_mmc.c | 2 +- hw/sd/sd.c | 77 ++++------------------------------- 3 files changed, 9 insertions(+), 120 deletions(-) delete mode 100644 include/hw/sd/sdcard_legacy.h diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h deleted file mode 100644 index 0dc38895551..00000000000 --- a/include/hw/sd/sdcard_legacy.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SD Memory Card emulation (deprecated legacy API) - * - * Copyright (c) 2006 Andrzej Zaborowski - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef HW_SDCARD_LEGACY_H -#define HW_SDCARD_LEGACY_H - -#include "hw/sd/sd.h" - -/* Legacy functions to be used only by non-qdevified callers */ -SDState *sd_init(BlockBackend *blk, bool is_spi); -int sd_do_command(SDState *card, SDRequest *request, uint8_t *response); -void sd_write_byte(SDState *card, uint8_t value); -uint8_t sd_read_byte(SDState *card); -void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert); - -/* sd_enable should not be used -- it is only used on the nseries boards, - * where it is part of a broken implementation of the MMC card slot switch - * (there should be two card slots which are multiplexed to a single MMC - * controller, but instead we model it with one card and controller and - * disable the card when the second slot is selected, so it looks like the - * second slot is always empty). - */ -void sd_enable(SDState *card, bool enable); - -#endif /* HW_SDCARD_LEGACY_H */ diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index c1598135f44..d31456ad236 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -25,7 +25,7 @@ #include "hw/irq.h" #include "hw/sysbus.h" #include "hw/arm/omap.h" -#include "hw/sd/sdcard_legacy.h" +#include "hw/sd/sd.h" typedef struct OMAPMMCState { SysBusDevice parent_obj; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index f781fd1641d..74bb7f39bbf 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -39,7 +39,6 @@ #include "hw/registerfields.h" #include "system/block-backend.h" #include "hw/sd/sd.h" -#include "hw/sd/sdcard_legacy.h" #include "migration/vmstate.h" #include "qapi/error.h" #include "qemu/bitmap.h" @@ -120,10 +119,6 @@ typedef struct SDProto { struct SDState { DeviceState parent_obj; - /* If true, created by sd_init() for a non-qdevified caller */ - /* TODO purge them with fire */ - bool me_no_qdev_me_kill_mammoth_with_rocks; - /* SD Memory Card Registers */ uint32_t ocr; uint8_t scr[8]; @@ -177,8 +172,6 @@ struct SDState { uint32_t data_offset; size_t data_size; uint8_t data[512]; - qemu_irq readonly_cb; - qemu_irq inserted_cb; QEMUTimer *ocr_power_timer; bool enable; uint8_t dat_lines; @@ -892,17 +885,10 @@ static void sd_cardchange(void *opaque, bool load, Error **errp) trace_sdcard_ejected(); } - if (sd->me_no_qdev_me_kill_mammoth_with_rocks) { - qemu_set_irq(sd->inserted_cb, inserted); - if (inserted) { - qemu_set_irq(sd->readonly_cb, readonly); - } - } else { - sdbus = SD_BUS(qdev_get_parent_bus(dev)); - sdbus_set_inserted(sdbus, inserted); - if (inserted) { - sdbus_set_readonly(sdbus, readonly); - } + sdbus = SD_BUS(qdev_get_parent_bus(dev)); + sdbus_set_inserted(sdbus, inserted); + if (inserted) { + sdbus_set_readonly(sdbus, readonly); } } @@ -1000,48 +986,6 @@ static const VMStateDescription sd_vmstate = { }, }; -/* Legacy initialization function for use by non-qdevified callers */ -SDState *sd_init(BlockBackend *blk, bool is_spi) -{ - Object *obj; - DeviceState *dev; - SDState *sd; - Error *err = NULL; - - obj = object_new(is_spi ? TYPE_SD_CARD_SPI : TYPE_SD_CARD); - dev = DEVICE(obj); - if (!qdev_prop_set_drive_err(dev, "drive", blk, &err)) { - error_reportf_err(err, "sd_init failed: "); - return NULL; - } - - /* - * Realizing the device properly would put it into the QOM - * composition tree even though it is not plugged into an - * appropriate bus. That's a no-no. Hide the device from - * QOM/qdev, and call its qdev realize callback directly. - */ - object_ref(obj); - object_unparent(obj); - sd_realize(dev, &err); - if (err) { - error_reportf_err(err, "sd_init failed: "); - return NULL; - } - - sd = SD_CARD(dev); - sd->me_no_qdev_me_kill_mammoth_with_rocks = true; - return sd; -} - -void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert) -{ - sd->readonly_cb = readonly; - sd->inserted_cb = insert; - qemu_set_irq(readonly, sd->blk ? !blk_is_writable(sd->blk) : 0); - qemu_set_irq(insert, sd->blk ? blk_is_inserted(sd->blk) : 0); -} - static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len) { trace_sdcard_read_block(addr, len); @@ -2196,8 +2140,8 @@ static bool cmd_valid_while_locked(SDState *sd, unsigned cmd) return cmd_class == 0 || cmd_class == 7; } -int sd_do_command(SDState *sd, SDRequest *req, - uint8_t *response) { +static int sd_do_command(SDState *sd, SDRequest *req, + uint8_t *response) { int last_state; sd_rsp_type_t rtype; int rsplen; @@ -2349,7 +2293,7 @@ static bool sd_generic_read_byte(SDState *sd, uint8_t *value) return false; } -void sd_write_byte(SDState *sd, uint8_t value) +static void sd_write_byte(SDState *sd, uint8_t value) { int i; @@ -2478,7 +2422,7 @@ void sd_write_byte(SDState *sd, uint8_t value) } } -uint8_t sd_read_byte(SDState *sd) +static uint8_t sd_read_byte(SDState *sd) { /* TODO: Append CRCs */ const uint8_t dummy_byte = 0x00; @@ -2561,11 +2505,6 @@ static bool sd_data_ready(SDState *sd) return sd->state == sd_sendingdata_state; } -void sd_enable(SDState *sd, bool enable) -{ - sd->enable = enable; -} - static const SDProto sd_proto_spi = { .name = "SPI", .cmd = { From patchwork Tue Jan 28 10:45:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 860379 Delivered-To: patch@linaro.org Received: by 2002:a5d:6b8c:0:b0:385:e875:8a9e with SMTP id n12csp286301wrx; Tue, 28 Jan 2025 02:46:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVMGv2B9vvfz8ktdLTcivbRCPghoaImng/AaFi795IenxR8z34Rg+OoDdC5vLJE32DpZHI1/Q==@linaro.org X-Google-Smtp-Source: AGHT+IHXlenYswTiUG+ijYNp1oukmRroM7AWSRmCNGnEzwf4J/8oZi5aCmgszfDx7aGyhOxvTTFT X-Received: by 2002:a05:6214:d63:b0:6e1:69ba:346 with SMTP id 6a1803df08f44-6e1b21594cemr825477466d6.10.1738061194858; Tue, 28 Jan 2025 02:46:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738061194; cv=none; d=google.com; s=arc-20240605; b=X+Xt6Kh29jE9y5v3jodL9acFffwKbfdghpT9wJcttYX1LEKtwOnzdU34yKp9UDeLRT WK1cj8tI3pVkbi7nOOyh2/15bn4a0ugnGMXnK4xX74EkIj9hdCD0urkabnsGz3Ivbo3e gj9DOHhHt960BzziMNpHDz1hlOSco7ZGp7HgwrXj5SBYuM3CwSQPke8YMZMOxwm1z7+R yI/pWeDZQGprGI1k2YL8ke7/XUkjjNt2JhQswQQYuK8yogoMNARRHYj4p5zxNTRvl2dh QPqk+Mbu6UH4Dfn2ADyWvWtYHmYLwlY9TseDhsNt7fDi8ZuagBbMfge9noaCzQD6xyJx +d4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yra2hKs7hlszYhHH5kmHgDMQvYtSgS7xsph+xNM9Ghs=; fh=A97/iOffPx0L7qKdtR8255lBwbYmj4xzdLgKCUqohbY=; b=U78qdyPdfLlzfyjhBao2T4N7OBiz6NdKOfoVEfZ5qg/tkcgAtv54VfnJN1w+vBMCUF 8q0S/EhlvlXkuwM80bIARXAQtM5RqrGm5cdzVXvEjypcd+257vczpVZzWHMf2fnlg4uY VEMZguv5Q4um9M+54KbDt2e7QtDyDnUdm3a4CsMAJ8a93065NRi8nqgvMUHLn3WXBqQS REZDaJJovncCqDJZrfK0BcF+cAk1GzhqIeDLIu73IyToCLrSJzzNW/sIUfP4V7VVg3Ge L+iUqXj9JQxsRB6oh0amDVnrs5lEWeZo1hi6aq7OieZKDE3pJd4a/Xl7LyRE/WgmzbIr D3nQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzZb2v0y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46e66b88104si139702921cf.368.2025.01.28.02.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Jan 2025 02:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzZb2v0y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcj6a-0001JY-V9; Tue, 28 Jan 2025 05:46: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 1tcj6A-0001Ab-Ly for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:39 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcj67-0003bc-6e for qemu-devel@nongnu.org; Tue, 28 Jan 2025 05:45:38 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43618283d48so38515065e9.1 for ; Tue, 28 Jan 2025 02:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738061134; x=1738665934; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yra2hKs7hlszYhHH5kmHgDMQvYtSgS7xsph+xNM9Ghs=; b=vzZb2v0yKdSlAauETvb1y/k4M0l9G3KtplqvCVytpdVkdgLhT305L5aReMngP11SWn C2ZvcXIemzqUhFiTeIQ0TL8wTwHIFwa+wyYLNYJ2nZ5J68f85YFNYKNhSwc4+tBd27Q5 z6qU/S5jRHZR1B7Qat5xVC3JIyBrJv2yVBs6tDcIhORl18GY7ZKndQNJ5GpMWVe8KICY OyPEp7AU8X3JUCkKey6g3fXWL50v/tGbZNLhdk4NVbKkssvp9LFW+YYhL7dcUhgOgEuj vWB9JGBWDbt+7n69+JSLeXiJ2gOAgtYqXqriK/RWqHA/fQ/kMODdZfht5K4DKIcVraBo o0+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738061134; x=1738665934; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yra2hKs7hlszYhHH5kmHgDMQvYtSgS7xsph+xNM9Ghs=; b=soGGzlC2X4qK/jQ5RMkku/VQ32M/ROfYZuWrK+w3x9dDTW9q53oRmr8//wjBy3BsQ7 wRpw8zpD7MdUqvPERSCtpdQ8vb3D61mwoPL/hJX3ZkKmT5q/R5sbNp7S2wNz5PJWC61u AMVqmSwnVQBc9gRVFTlByBUotqSlZ7Ky1FvMhO/XMtQJ3uIyBLkCl+gfHqX8gHiVXrGN sKi2t8z2MKmkdLl8GiANRGHn+bI8fILFxX5BsKmlvCS9e6IPBk6QeF5lUqNUBIKHbEzv kPtz0+rzlwbUDTL/NPF5CEy8SR850z7y6pgCKBCQqDbRGgseHu09vGWzcQzldlsKbAVR Xoag== X-Forwarded-Encrypted: i=1; AJvYcCUr0wRqb5EtKa27gx4BhCqBGxpkty4fmYBDSV4CwqGZ40VYyuRRwjFTm0g/WUetwcN6ETnjbTZfYl2W@nongnu.org X-Gm-Message-State: AOJu0Yxfk3pRzEm5e4d4YdMRXfO6mXCQL87gw8P+2HuATcjy01/3sfeH eVcTWJ674mz43l7Eftiqg4A/3BKKO3C0z1JwBj9OjrS9U4eIWsjmdFFnQDjZ8PQ= X-Gm-Gg: ASbGncuzjAxb+u/YvkkTJOrbuMV/RFclw/nBoCqa4nYYqBoAyGM9SK9WbMzfGRwUyLd yhXFWZOdoe9Mc/XqNclas5ACIMk6OupGGZqK+VlgGe+7u0+OR+PTtFl3C/HX79EvipkCbIhHeLu uEa/yhwxYzeb9o8N35h6HjK1YhFTbEQ1qhCduVqqB86FxjL4B0pFbE78U4VubmhxdBM5wTwXcs+ 5Rib4tB/t0rtLR+iwDyTdQOi2sqFFEsAThm/TVnCTBjln+gGir6fnBp0a/BUUc0zP8sxu0bvYeT YaxIqhXFjO8rsUT18TPP X-Received: by 2002:adf:a1cc:0:b0:38a:a074:9f3c with SMTP id ffacd0b85a97d-38bf5663dbcmr35230039f8f.16.1738061133781; Tue, 28 Jan 2025 02:45:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c418esm13920133f8f.95.2025.01.28.02.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 02:45:33 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , Bernhard Beschow Subject: [PATCH 11/11] hw/sd: Remove unused SDState::enable Date: Tue, 28 Jan 2025 10:45:19 +0000 Message-Id: <20250128104519.3981448-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250128104519.3981448-1-peter.maydell@linaro.org> References: <20250128104519.3981448-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now that sd_enable() has been removed, SD::enable is set to true in sd_instance_init() and then never changed. So we can remove it. Note that the VMSTATE_UNUSED() size argument should be '1', not 'sizeof(bool)', as noted in the CAUTION comment in vmstate.h. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/sd/sd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 74bb7f39bbf..e541c57f8c3 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -173,7 +173,6 @@ struct SDState { size_t data_size; uint8_t data[512]; QEMUTimer *ocr_power_timer; - bool enable; uint8_t dat_lines; bool cmd_line; }; @@ -292,12 +291,12 @@ static const char *sd_acmd_name(SDState *sd, uint8_t cmd) static uint8_t sd_get_dat_lines(SDState *sd) { - return sd->enable ? sd->dat_lines : 0; + return sd->dat_lines; } static bool sd_get_cmd_line(SDState *sd) { - return sd->enable ? sd->cmd_line : false; + return sd->cmd_line; } static void sd_set_voltage(SDState *sd, uint16_t millivolts) @@ -976,7 +975,7 @@ static const VMStateDescription sd_vmstate = { VMSTATE_UINT32(data_offset, SDState), VMSTATE_UINT8_ARRAY(data, SDState, 512), VMSTATE_UNUSED_V(1, 512), - VMSTATE_BOOL(enable, SDState), + VMSTATE_UNUSED(1), VMSTATE_END_OF_LIST() }, .subsections = (const VMStateDescription * const []) { @@ -2146,7 +2145,7 @@ static int sd_do_command(SDState *sd, SDRequest *req, sd_rsp_type_t rtype; int rsplen; - if (!sd->blk || !blk_is_inserted(sd->blk) || !sd->enable) { + if (!sd->blk || !blk_is_inserted(sd->blk)) { return 0; } @@ -2297,8 +2296,9 @@ static void sd_write_byte(SDState *sd, uint8_t value) { int i; - if (!sd->blk || !blk_is_inserted(sd->blk) || !sd->enable) + if (!sd->blk || !blk_is_inserted(sd->blk)) { return; + } if (sd->state != sd_receivingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, @@ -2429,8 +2429,9 @@ static uint8_t sd_read_byte(SDState *sd) uint8_t ret; uint32_t io_len; - if (!sd->blk || !blk_is_inserted(sd->blk) || !sd->enable) + if (!sd->blk || !blk_is_inserted(sd->blk)) { return dummy_byte; + } if (sd->state != sd_sendingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, @@ -2664,7 +2665,6 @@ static void sd_instance_init(Object *obj) sd->proto = sc->proto; sd->last_cmd_name = "UNSET"; - sd->enable = true; sd->ocr_power_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, sd_ocr_powerup, sd); }