From patchwork Sat Mar 8 19:02:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 871540 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp288067wri; Sat, 8 Mar 2025 11:04:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUV2VdmURM1xt+AaF41Zc5gXzg78MV/km86x7W3tqwM4o2V4+RMzyoAHS3ABH/cs0T1TEO/VQ==@linaro.org X-Google-Smtp-Source: AGHT+IHFB66opQ4gEahbtDdQsjUthqnU2e8ABYZ6cvc5/XS8ZbPq/1QpxynvztRANiH9R5qx5nxF X-Received: by 2002:a05:6214:ca6:b0:6e8:fa33:2965 with SMTP id 6a1803df08f44-6e90061fa6emr107530126d6.14.1741460664983; Sat, 08 Mar 2025 11:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741460664; cv=none; d=google.com; s=arc-20240605; b=A9PH2yg/7rzJmzn2+yMN8BifHF+lUI/kNTjbE1jfTFn1B+9bAPn/gqrwf05cbnpRVu HVV3yZTIe7tWuMJdfKcp0mCLx9E2bXenDoX7E2EG6UHxVQLehtgbxlqA3pBsQA1OH8lE lPyfq7nLxSs/w4fE1u14ggEpnX+m0CnwZqU6m100A6auyNe1nWVP7MbxREN73uYo5jNG sXqCcfDLYLisq+ibdO8Od+A9g9AepfiOzpGM3SS8FTBWONgDmqvRUjHuPLi2X8kOfRtW NzVKUskoxy1OBQNT2zT9wPR3onkblfKf/BUPId3bnAREkJeO/adIhip4jgZic19ZniNf 3QOw== 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=F+yC7kcIFYBDlEb5elpDYxZqmpjHBPCkNQfWZnM7SA0=; fh=F3LZ7Ho0wh1mL+BCaS26f8UzmrWpxs/ZtxWzNF270Rk=; b=EgmMbmj0fIqJiPimqSPLq3gVgp/PT4kC6J7NrZ0YniYVySXCZSpMNNdX9F5idd3ybT RMpC6jnw+p8waRicG8zzatSYyVK0vIak0esGTZAQfePg75941Jev95b/Cqo/E8TsPW7q JJicmilsNNvHRuM4zYoTk1u/Q8FSUXgZySNofnV1uV72n9B+Nn2FtbRPniCuJ7K1kLUM B0yUKD0gpHG936sBK6y6kVzGvjoiPT+d9uf/yLcfqyowvjHNQynmSQgvnEknS2Did1ZQ N28JGB5jDhwoZFXq4K0UUe4ts4QAXr0qfovqPHqM5w061qUvMw+Lr5q1J0fhPMONfM4C DB/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C1mePILG; 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-6e8f7090d8fsi60400226d6.112.2025.03.08.11.04.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Mar 2025 11:04:24 -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=C1mePILG; 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 1tqzS1-00077r-SP; Sat, 08 Mar 2025 14:03:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqzRj-0006m2-59 for qemu-devel@nongnu.org; Sat, 08 Mar 2025 14:02:52 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqzRY-0003UK-Ei for qemu-devel@nongnu.org; Sat, 08 Mar 2025 14:02:45 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43bc30adad5so17561765e9.1 for ; Sat, 08 Mar 2025 11:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741460557; x=1742065357; 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=F+yC7kcIFYBDlEb5elpDYxZqmpjHBPCkNQfWZnM7SA0=; b=C1mePILG8sVuHo/ueoqNt0XxoEcLFKwynu4L+UOvlWM4bTOyGzc2fHuWrzUJraQPOo sJQxQqhragwb13HwZ1sfzvXHqJqqIBanEz437szcfhBJL0C74bcTesquwkAjtxrzQJOi x9y1YvIZLvhSFTvG3C5TeNvHjTVdoPczQJqz3fKr/WLLuGa1332lvkiYkUTVchG8uBNz PwexHTZLi7YP5UA3J0JK48WODwyl6F3HcFk2xhsUYAMVph4YFJNet7uyrnPf9zYnPA/3 Q7jK3G8QOoOJ8fF4HbhuSaVNvHnG2So9SlZvD1hmZwQ6pTDdGLDuboo8BYpvbjM3m9W+ yy7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741460557; x=1742065357; 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=F+yC7kcIFYBDlEb5elpDYxZqmpjHBPCkNQfWZnM7SA0=; b=G1MdVZ/XozrB/OzW6H6NbDwPDpjNYBh/0W/+u2TvLAUJ+ML7JLGGHImhIgdxeBZXek PZ1l0IrbIw7uufEpDM6VgaAxYBk9ZuokheB6G1tR2M5loG3HD43oXb+s4I2Qg5RSss7G hTCldELWzQoZFMe7ARSEnHkWmHNGaAuLtlgGHF3TMupSsA140853gXQC7l8/D7wqclt0 Pn6W379fBgKqEUE4ZC7qlploI4O0v8GeAahVg4+6+tb07q55kdXIMnPQwwzLjdA43FEN VBKlhxAl+nf8if64p6EQ+BwXjRZwk0xfJy3SZQ8htETjjFw6YdY/sgHdwNi6diD76TEp +26A== X-Forwarded-Encrypted: i=1; AJvYcCUX+4uK5+i0MK4Ielniz/UbFlyfUJRgJzi3nLSO2sau/RSo8xKlj+u00mzGnpGRV4eGnkDvLoHvM+Hv@nongnu.org X-Gm-Message-State: AOJu0YwZzZzEiG5ECpifachEKYQcwV9q9VGLdZW9amgh0nFBNLrsGynV Gg+yB31T+NWJEiELdZzbUyKNVRjpT+vkkONtzO3l7jWcwJSQF+Eg20tCsfP58iA= X-Gm-Gg: ASbGnctDB9KzAsaQH2ZHN0+wx6lKjOZRxdmpTk2qfyIsnMSHgdFo7b7XRrnHKy/WMYe AOkMa9kEXniWVv9Te+i5HhE9lVOmpl9CItFgUbZFC3yZtYlbFN4W21t25nHEBq0+AAJFs9YsmgJ Vwvcl92jvIHv+2VxQicCd71D5eBdoI7jB3K1exxU7bfJhJPGFIcOPE4IoWnb3PsZ6aJRU5MlfZJ 0Cf5QU91j+hksTMk8bcXbz36QazmFwge06wDOzIqNB9xDQqebj2IUPZyWiYHzyu7bEHRfRFHkpB ia2335h6c0LJEcP+HZl+O0cW9R5m5DAlDPmIUtwQBjboyIjP0mBK2Jt2J9WnZj4riA6vzWNLZpw bQcfvw29hPxgIHvVUOjQ= X-Received: by 2002:a5d:6d05:0:b0:391:13d6:c9ec with SMTP id ffacd0b85a97d-39132d88ee1mr5624207f8f.20.1741460557363; Sat, 08 Mar 2025 11:02:37 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c1037b4sm9653479f8f.92.2025.03.08.11.02.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 08 Mar 2025 11:02:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: BALATON Zoltan , qemu-devel@nongnu.org Cc: Bernhard Beschow , Peter Maydell , qemu-ppc@nongnu.org, Andrey Smirnov , Jean-Christophe Dubois , Bin Meng , qemu-arm@nongnu.org, qemu-block@nongnu.org, Guenter Roeck , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 01/12] hw/sd/sdhci: Remove need for SDHCIState::vendor field Date: Sat, 8 Mar 2025 20:02:19 +0100 Message-ID: <20250308190230.7508-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250308190230.7508-1-philmd@linaro.org> References: <20250308190230.7508-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All instances of TYPE_IMX_USDHC set vendor=SDHCI_VENDOR_IMX. No need to special-case it. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci-internal.h | 1 - include/hw/sd/sdhci.h | 4 ---- hw/arm/fsl-imx25.c | 2 -- hw/arm/fsl-imx6.c | 2 -- hw/arm/fsl-imx6ul.c | 2 -- hw/arm/fsl-imx7.c | 2 -- hw/arm/fsl-imx8mp.c | 2 -- hw/sd/sdhci.c | 14 ++++---------- 8 files changed, 4 insertions(+), 25 deletions(-) diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h index 9f768c418e0..9072b06bdde 100644 --- a/hw/sd/sdhci-internal.h +++ b/hw/sd/sdhci-internal.h @@ -311,7 +311,6 @@ extern const VMStateDescription sdhci_vmstate; DEFINE_PROP_UINT8("endianness", _state, endianness, DEVICE_LITTLE_ENDIAN), \ DEFINE_PROP_UINT8("sd-spec-version", _state, sd_spec_version, 2), \ DEFINE_PROP_UINT8("uhs", _state, uhs_mode, UHS_NOT_SUPPORTED), \ - DEFINE_PROP_UINT8("vendor", _state, vendor, SDHCI_VENDOR_NONE), \ \ /* Capabilities registers provide information on supported * features of this specific host controller implementation */ \ diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 38c08e28598..48247e9a20f 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -99,7 +99,6 @@ struct SDHCIState { uint8_t endianness; uint8_t sd_spec_version; uint8_t uhs_mode; - uint8_t vendor; /* For vendor specific functionality */ /* * Write Protect pin default active low for detecting SD card * to be protected. Set wp_inverted to invert the signal. @@ -108,9 +107,6 @@ struct SDHCIState { }; typedef struct SDHCIState SDHCIState; -#define SDHCI_VENDOR_NONE 0 -#define SDHCI_VENDOR_IMX 1 - /* * Controller does not provide transfer-complete interrupt when not * busy. diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 5359a6d8d3b..02214ca1a1c 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -243,8 +243,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) &error_abort); object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg", IMX25_ESDHC_CAPABILITIES, &error_abort); - object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor", - SDHCI_VENDOR_IMX, &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) { return; } diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index dc86338b3a5..a114dc0d63d 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -327,8 +327,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) &error_abort); object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg", IMX6_ESDHC_CAPABILITIES, &error_abort); - object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor", - SDHCI_VENDOR_IMX, &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) { return; } diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index 34c4aa15cd0..ce8d3ef535f 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -531,8 +531,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) FSL_IMX6UL_USDHC2_IRQ, }; - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor", - SDHCI_VENDOR_IMX, &error_abort); sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort); sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0, diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index 3374018cde0..ed1f10bca26 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -471,8 +471,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) FSL_IMX7_USDHC3_IRQ, }; - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor", - SDHCI_VENDOR_IMX, &error_abort); sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort); sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0, diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c index 1ea98e14635..c3f6da63220 100644 --- a/hw/arm/fsl-imx8mp.c +++ b/hw/arm/fsl-imx8mp.c @@ -524,8 +524,6 @@ static void fsl_imx8mp_realize(DeviceState *dev, Error **errp) { fsl_imx8mp_memmap[FSL_IMX8MP_USDHC3].addr, FSL_IMX8MP_USDHC3_IRQ }, }; - object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor", - SDHCI_VENDOR_IMX, &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), errp)) { return; } diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 1f45a77566c..149b748cbee 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1731,16 +1731,10 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) case USDHC_VENDOR_SPEC: s->vendor_spec = value; - switch (s->vendor) { - case SDHCI_VENDOR_IMX: - if (value & USDHC_IMX_FRC_SDCLK_ON) { - s->prnsts &= ~SDHC_IMX_CLOCK_GATE_OFF; - } else { - s->prnsts |= SDHC_IMX_CLOCK_GATE_OFF; - } - break; - default: - break; + if (value & USDHC_IMX_FRC_SDCLK_ON) { + s->prnsts &= ~SDHC_IMX_CLOCK_GATE_OFF; + } else { + s->prnsts |= SDHC_IMX_CLOCK_GATE_OFF; } break;