From nobody Fri Oct 24 20:22:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518748694706421.6975449340895; Thu, 15 Feb 2018 18:38:14 -0800 (PST) Received: from localhost ([::1]:57565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVuV-0003p9-S8 for importer@patchew.org; Thu, 15 Feb 2018 21:38:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVn4-0005oE-7L for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:30:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVn1-0002fo-4b for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:30:22 -0500 Received: from mail-ua0-x241.google.com ([2607:f8b0:400c:c08::241]:37009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVn0-0002fg-VB for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:30:19 -0500 Received: by mail-ua0-x241.google.com with SMTP id q8so1107839uae.4 for ; Thu, 15 Feb 2018 18:30:18 -0800 (PST) Received: from x1.lan ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id q5sm6295200uaj.17.2018.02.15.18.30.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 18:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9iKQclT2JgnRw7DfHyavMjksYafurrWeDjDITAZV2Kc=; b=s2RCWT5RjZgKRO9oln2ixPJE2he9juucoLozTF5dEVnU6BSlGPdwXZlsiAN6BpOK7f WDonmDASHiTkJQ2BgtCdcqVQhf1IltAR01t3sR6uujjPBHOeK29YNgRzRa13dJX8aaCr ZbZpaLR+VMu7I4JOybDkk8IGNAmpymeSh6eJUH+vsy5OFul34w3MTeW4OoJl40SKREOt MqoH7QE8VB0nKJm2FCy69Ia8RYCsZNzbw4crxLH+Wv4u7kdnFQA7PO7xZKYuiMsFYnVC KGiR7E8EYigaZL34qC+kR9sCs2Z8Z51jR69xzaJvy5PcbIt1wR4sdVzW7GI74DyNWm4I MK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9iKQclT2JgnRw7DfHyavMjksYafurrWeDjDITAZV2Kc=; b=mFNCbM9XU4LxGaIFQuR7as4rfDaxfuWdpSD+7/ocVb9WFKwNVVTuOt0MAEIl04BQ5F 4lO9bXbNa3EMzfEyN2jT0gVbwgDMJHaNPVDLv+pnQKLA2CEFd2+NsrwEM5BYcrGJK08K ZkrjT61jwiT5E1/frUwBdkjPbkb8IpEg0YM0F8YIthJ7HT+YJDMNfSkC/pEsN8B5MJSM 299NYC+C38HQsZAKA60HzD9OiNxAuZnGq7/0w/Y3FDMSzUxAVwW29NfzH1xigA6GjgDI GpWEuq9bTK5u5HiQJZqOUfZIagZxR7y8kdzj9PkQ29aJ2IBav7hOLp0fAXFwMh2F9jkv Wv9A== X-Gm-Message-State: APf1xPCsOECeZOdt+zGtNyJav7iG3YHHXDZqjNxDvyMwmPib1AhtI7QM I11LmOzXkgw3MwFJWqS5kJg= X-Google-Smtp-Source: AH8x225YJQwV6VoisRLV0My10EuPpswmjuWoSsAT9/C6rJcIkqlyxSgDo+v5iG5Pks7jHhep+tlqOA== X-Received: by 10.159.56.79 with SMTP id q15mr3530017uad.137.1518748218382; Thu, 15 Feb 2018 18:30:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Thu, 15 Feb 2018 23:29:32 -0300 Message-Id: <20180216022933.10945-8-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180216022933.10945-1-f4bug@amsat.org> References: <20180216022933.10945-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::241 Subject: [Qemu-devel] [PATCH v3 7/7] hw/sd: move sdcard legacy API to "hw/sd/sdcard_legacy.h" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" , Stefan Weil , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Michael Walle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 omap_mmc.c is the last user left. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- include/hw/sd/sd.h | 16 -------------- include/hw/sd/sdcard_legacy.h | 50 +++++++++++++++++++++++++++++++++++++++= ++++ hw/sd/omap_mmc.c | 2 +- hw/sd/sd.c | 1 + 4 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 include/hw/sd/sdcard_legacy.h diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 4491db98de..58528b4d2c 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -131,22 +131,6 @@ typedef struct { void (*set_readonly)(DeviceState *dev, bool readonly); } SDBusClass; =20 -/* Legacy functions to be used only by non-qdevified callers */ -SDState *sd_init(BlockBackend *bs, bool is_spi); -int sd_do_command(SDState *sd, SDRequest *req, - uint8_t *response); -void sd_write_data(SDState *sd, uint8_t value); -uint8_t sd_read_data(SDState *sd); -void sd_set_cb(SDState *sd, 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 *sd, bool enable); - /* Functions to be used by qdevified callers (working via * an SDBus rather than directly with SDState) */ diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h new file mode 100644 index 0000000000..8681f8089b --- /dev/null +++ b/include/hw/sd/sdcard_legacy.h @@ -0,0 +1,50 @@ +/* + * 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_data(SDState *card, uint8_t value); +uint8_t sd_read_data(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 5b47cadf11..be14ac4f40 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -19,7 +19,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "hw/arm/omap.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" =20 struct omap_mmc_s { qemu_irq irq; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 72d32f7845..ae2d915977 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -34,6 +34,7 @@ #include "hw/hw.h" #include "sysemu/block-backend.h" #include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" #include "qapi/error.h" #include "qemu/bitmap.h" #include "hw/qdev-properties.h" --=20 2.16.1