From patchwork Tue Jan 28 10:45:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Philippe Mathieu-Daudé --- 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));