From nobody Tue Oct 22 22:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1729000680310284.6571972842804; Tue, 15 Oct 2024 06:58:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0i33-0004QM-1T; Tue, 15 Oct 2024 09:57:17 -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 1t0i2w-0004P4-KU for qemu-devel@nongnu.org; Tue, 15 Oct 2024 09:57:11 -0400 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0i2u-0007QQ-R5 for qemu-devel@nongnu.org; Tue, 15 Oct 2024 09:57:10 -0400 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t0i2o-0006wE-48; Tue, 15 Oct 2024 15:57:02 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0i2n-0022uc-M5; Tue, 15 Oct 2024 15:57:01 +0200 Received: from jlu by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1t0i2n-00HZp4-1x; Tue, 15 Oct 2024 15:57:01 +0200 From: Jan Luebbe To: qemu-devel@nongnu.org Cc: Jan Luebbe , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org Subject: [PATCH] hw/sd/sdcard: Allow user creation of eMMCs Date: Tue, 15 Oct 2024 15:56:49 +0200 Message-Id: <20241015135649.4189256-1-jlu@pengutronix.de> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: jlu@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: qemu-devel@nongnu.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a0a:edc0:2:b01:1d::104; envelope-from=jlu@pengutronix.de; helo=metis.whiteo.stw.pengutronix.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1729000683421116600 Content-Type: text/plain; charset="utf-8" For testing eMMC-specific functionality (such as handling boot partitions), it would be very useful to attach them to generic VMs such as x86_64 via the sdhci-pci device: ... -drive if=3Dnone,id=3Demmc-drive,file=3Demmc.img,format=3Draw \ -device sdhci-pci \ -device emmc,id=3Demmc0,drive=3Demmc-drive,boot-partition-size=3D1048576 \ ... While most eMMCs are soldered to boards, they can also be connected to SD controllers with just a passive adapter, such as: https://docs.radxa.com/en/accessories/emmc-to-usd https://github.com/voltlog/emmc-wfbga153-microsd The only change necessary to make the options above work is to avoid disabling user_creatable, so do that. The SDHCI-PCI driver in the Linux kernel already supports this just fine. Signed-off-by: Jan Luebbe Acked-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a5d2d929a8af..2d3467c3d956 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2865,8 +2865,6 @@ static void emmc_class_init(ObjectClass *klass, void = *data) dc->desc =3D "eMMC"; dc->realize =3D emmc_realize; device_class_set_props(dc, emmc_properties); - /* Reason: Soldered on board */ - dc->user_creatable =3D false; =20 sc->proto =3D &sd_proto_emmc; =20 --=20 2.39.5