From patchwork Thu Feb 15 22:13:25 2018 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: 874205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WRdlXcyH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zjBMp2PvCz9t3M for ; Fri, 16 Feb 2018 09:51:17 +1100 (AEDT) Received: from localhost ([::1]:39487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emSMx-0000pW-9B for incoming@patchwork.ozlabs.org; Thu, 15 Feb 2018 17:51:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emRnU-0005xt-RS for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:14:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emRnU-0005bR-0K for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:14:32 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:46988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emRnT-0005bL-S8 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 17:14:31 -0500 Received: by mail-qk0-x244.google.com with SMTP id g129so1548600qkb.13 for ; Thu, 15 Feb 2018 14:14:31 -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=/0I8Q/GQHeXpakE+ySkDyPRbUSowim8IsfQuas1wIjY=; b=WRdlXcyH00wfO2TeB4Ci6OSpofcrodSwP0GbZGMud3R0ryoDZJpMBWhlC/VclKcwfj rC/fo10w+SVd9Sh5n28hq+4fPlVfy1NvuHHOX4jNx+5d7+tKuW2rmrg4LvkcMc73uRHl 6RKa5O+eFfKksz7+guToUM1a/Fj91xtSiYEbvPS7uGkCzWjujbEX2fNkCR0Dyl6S/sBe 7dmjOP3e3mx9ufB4Kz55MBbvggHavLz62xc+ElXuMnSljS0uzSl8cL+yAsosu5Eeoy/u g7gocDMtuM7ql4OR1MixiMPnR2p4XP7K9xhM0ZD+VWA50C81DDiudp7JEWGIGipBbysl A78g== 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=/0I8Q/GQHeXpakE+ySkDyPRbUSowim8IsfQuas1wIjY=; b=ZXvLl+ye5TNGfZnRZ6Cu4JbwAu5yGejWFDbALH5WYMAa749Wo3Gt7NiLNTLShKcjsT pk4zAqCg8cnbPZSIO2ftc8Jn8gtOnTKGwnwDu9Bu6uyQPZew9L64VzhJkOQwrCJJPYWY Nlhax5hunahL+77I7vPy+CAj7G50OGNX//HFKilZdIvr5ZDo49tPB82KMrwvwR3WW1jU IgEtx7mhAamRM81W6xSIF4BbO61XihMGOAT1B8ECG2RhUWle/blF5+eyZczzqc67zcMi VErHWqefTDLZvGJSWiJVgy3NymuFgHoTMXY/Pgk79BvDUc5fo7vUKd5d9a357rjWc4Y6 9J2w== X-Gm-Message-State: APf1xPCD2U9ZYYRcL8jHindotFshySBKNqbH4jvj9qzmazjCsLU/Wjtf yahdF+SKf4S+Q1baEQYR+IA= X-Google-Smtp-Source: AH8x225LwnjsMJLiFVTIXU1Hgw3blLLxM+PkAUQxguoRkcOlIwQnPsKeVrbHCBuNnUzgUmoAl2XHkg== X-Received: by 10.55.41.131 with SMTP id p3mr6465134qkp.309.1518732871471; Thu, 15 Feb 2018 14:14:31 -0800 (PST) Received: from x1.lan ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id t5sm10732075qtn.44.2018.02.15.14.14.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 14:14:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell , Igor Mitsyanko Date: Thu, 15 Feb 2018 19:13:25 -0300 Message-Id: <20180215221325.7611-21-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215221325.7611-1-f4bug@amsat.org> References: <20180215221325.7611-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH v4 20/20] sdcard: add an enum for the SD PHY Spec version 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" , Prasad J Pandit , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" So far this device intends to model the Spec v1.10 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/sd/sd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b9429b06ca..d4565626ce 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -47,6 +47,11 @@ //#define DEBUG_SD 1 +typedef enum { + SD_PHY_SPEC_VER_1_10 = 110, + SD_PHY_SPEC_VER_2_00 = 200, /* not yet supported */ +} sd_phy_spec_ver_t; + typedef enum { sd_r0 = 0, /* no response */ sd_r1, /* normal response command */ @@ -122,6 +127,7 @@ struct SDState { qemu_irq inserted_cb; QEMUTimer *ocr_power_timer; const char *proto_name; + int spec_version; bool enable; uint8_t dat_lines; bool cmd_line; @@ -2169,6 +2175,7 @@ static void sd_realize(DeviceState *dev, Error **errp) int ret; sd->proto_name = sd->spi ? "SPI" : "SD"; + sd->spec_version = SD_PHY_SPEC_VER_1_10; if (sd->blk && blk_is_read_only(sd->blk)) { error_setg(errp, "Cannot use read-only drive as SD card");