From patchwork Mon Mar 10 00:06:08 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: 14009108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2A7CC28B2E for ; Mon, 10 Mar 2025 00:09:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trQfQ-0001uk-30; Sun, 09 Mar 2025 20:06:48 -0400 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 1trQfL-0001pv-47 for qemu-devel@nongnu.org; Sun, 09 Mar 2025 20:06:43 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trQfD-0007It-LK for qemu-devel@nongnu.org; Sun, 09 Mar 2025 20:06:42 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43cfa7e7f54so1252325e9.1 for ; Sun, 09 Mar 2025 17:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741565194; x=1742169994; 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=QSCzkaWIhjHTeY3hvC0iPh38QiDjdtlUv2/bUUP3CZQ=; b=xB3cRIu4YwBsEV1XSmZOJ8cIlthIe+qreXMWFecgSQJm46m72J95mycCX9CQWMwDZl NvK9BD21pm7hA6ZHKElqRIz+1Z/qbn2WBBLkfct5+ax9FJY+wXkC2yvm4kvgLX8HW8py XfpqhoN+KCPo9mQ/SmyHA4dBiS4xXkPhOXiQA286SjXRvfZqW6NO7ZQEdnxcZWZW5rOZ HjWj8x4Y2V43poiejokYBhHlNZWbidDz7svgx+YWB5k3B3ggrdOAqCfayOxglFicuZKD Tiszd20zCJUDnrHkEwWp1Rn8IIC4UWKdAOdnsoVEvC/GbFHzKG+AtkLwprznSH3FIvBl GaCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741565194; x=1742169994; 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=QSCzkaWIhjHTeY3hvC0iPh38QiDjdtlUv2/bUUP3CZQ=; b=SoNXgaFpx5lMFwRe/akjNM423i6QnWTgtxIAQIkcCRed6SHW4FIbL+P48yF0YmiEa9 YEdyeS8vZM/0V7+SutkTWYDBVocPyUYQPYr/Iw504NCAtLML+aYKxqFJ42YXtyJDIepV urmpFhPO6QPFQip8MgBeKBZeplnOJWjY4pK8Ar1g+/gWI4zJPlng31Uu+nJXtQKjAi/c Cham/+x46nFmFSBliGlhVtL561kUohoYDEkd/iuB/TsbuBxEdaqA5hdbPmIQsS0B/Zb+ WVnvblriXUbIDIKYusjr5FF+V/of2wjClr24Tdmmzxp77kVfXHjv7IoBIPQCBV0K+Upt C8Tg== X-Forwarded-Encrypted: i=1; AJvYcCWIhKm97Rajuc+KpHy6DmWr2jKrbPefFqBRGaFb6Bvrhsvm/y2xQ1esuRVdF0tPyp6kWK1ud+hfDbfP@nongnu.org X-Gm-Message-State: AOJu0YyQMP1xqYMyOcQthUs/SLuCC5Wrb3ziP0vU3rrN+rc9QUqDLrrX n43XCcpWoHTkzxlYNUhIcpPuMAH3ChTHExSqNyfydwd3JBMRXm0Xb8Im6PfXukg= X-Gm-Gg: ASbGncv8i7ePiFmTxbHnpu2bnpB4yktjS0SyJFOLVG7XAOfwmbK6pY54Jd07t2tWxfy RV83vzNUqSeNF0fqYRpEXEpKoxnnq9/ncRpX6j6Ju59r/6W8ImTA7ffrTLTVzyDVP36seB43xAA 9zbshMaxpmjRqv+K6li8X0NB2uU7xE90M5Qw0AziXB0n3WIXRhR3XCHirWoqotrbZQgN9ydKRhF RLPDqPZXweLSy7MhyzKNtQewtyUOn3/q9G+RIF/fY5XLkrFpNgddWAFUu1I3V4wz+mnSthbfLnh /ZLk+ERo/G5+nqq3eXNBx45rpuqFJf+zwTcPjNHSXC00pT3wvY+GFPEzErQt+82gnhiqfToBOQe nUqAA2nG7sZpl4URTng4= X-Google-Smtp-Source: AGHT+IFbKwVNHM+WpFEKBfNJvsjk7dqcL6E6e9F2hjbj3R6N2hwQR7KolOqI9zLWIxHHnb9PxpCqKA== X-Received: by 2002:a05:600c:4ba8:b0:43b:4829:8067 with SMTP id 5b1f17b1804b1-43ce4abb2f5mr41307265e9.6.1741565194123; Sun, 09 Mar 2025 17:06:34 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43cea7f2afasm32401525e9.3.2025.03.09.17.06.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Mar 2025 17:06:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: BALATON Zoltan , qemu-devel@nongnu.org Cc: Steven Lee , Joel Stanley , Bernhard Beschow , Peter Maydell , qemu-arm@nongnu.org, Andrey Smirnov , Paolo Bonzini , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Eduardo Habkost , qemu-ppc@nongnu.org, =?utf-8?q?Danie?= =?utf-8?q?l_P=2E_Berrang=C3=A9?= , Guenter Roeck , Andrew Jeffery , Troy Lee , Jean-Christophe Dubois , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , qemu-block@nongnu.org, Jamin Lin Subject: [PATCH v5 02/14] hw/sd/sdhci: Remove need for SDHCIState::vendor field Date: Mon, 10 Mar 2025 01:06:08 +0100 Message-ID: <20250310000620.70120-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250310000620.70120-1-philmd@linaro.org> References: <20250310000620.70120-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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é Reviewed-by: BALATON Zoltan Reviewed-by: Bernhard Beschow --- 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;