From patchwork Tue Jul 16 18:41:35 2024 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: 812795 Delivered-To: patch@linaro.org Received: by 2002:a5d:42c4:0:b0:367:895a:4699 with SMTP id t4csp447302wrr; Tue, 16 Jul 2024 11:43:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXxJIx6yHGkPygIILnZoXDN8RcNNCL1OcPvLcBHxF/+uKrZSl+qllHzhdy0KO5mbJv7HD7NXeEPndU1mIu+zSqB X-Google-Smtp-Source: AGHT+IEEZxwil68/YVqXW1ET/NDNwNi/5fe1t7XnrLdnr+rYrxl+Uuz8EkGwTY6dYjoRDdyZmbzw X-Received: by 2002:a05:6902:1107:b0:e03:5897:770e with SMTP id 3f1490d57ef6-e05d56d705dmr4824739276.27.1721155424334; Tue, 16 Jul 2024 11:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721155424; cv=none; d=google.com; s=arc-20160816; b=UZ6Qk/RJsrp2QT+ezofPI8FfJ76r4JfQpIhuBBqXOPNf2fa3P2w6daLCI2U5kTHS72 rT4hi1wdyrr8qoDm49G4zfG3ORosOLhuSPCC6rHZVC+wT6tC71q0Y7RYgnCBKOzW3sb4 qmjzCYT7ACqrdovBeA063wD8cl+18Y5kyqleAm82N3cKNyaQCAvGrwgB50HErtwIb2po pDDi11AFSzj/51jC6sHFEk9DPcSsN9GCHmdokQxOugRi+AHs1M0GVnOctZCKzMufdAPy u+gH8WTwI6D2UiISnryvAUZT6SzcSDpxEzob/gFdpc5Kw3yZcXd1CrcMDYjS0FveRcwl 2z+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=25d8r/+FljDN61432gFDtIj9k/AKYUKw9R2OfNlM2/Y=; fh=8ly4dktE5qX7scQRc1qmWVsO0MVOdxfDtQTaDzdLLVc=; b=ea7u4IqsfbupNl/Q3aRkNrZgUvCOswFeEOiNaNC0FqQT47IfxSJylfvKPyQoF0OE5l JB+pFiL7DAItX7iqfk4jOK4PnvL862eCbe1JGSqFbNMJRA7FBbizZwbWK55YhCLGVr1C ScOeXw6lMUzBJ4FTlqZohYrOY3RMQGv3KSE6KLM+xSNsUy9N56nysUrYjXLyquSOGhQA 62Q2FsjUOPxEsVAg8O4OL/TG+ypLN8DfENVWJdMi9KCwqmB3axSngemE2Mk1nwef/JDj 9SprEcxq8tgk0+rSxpGPbbcp6lf+gqO2T5pUFEA0z89relNOBrkGhbiLRZ1qAc6CT3sy Djtg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkUt3VNW; 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-6b780eeadf5si19788866d6.434.2024.07.16.11.43.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jul 2024 11:43:44 -0700 (PDT) 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=lkUt3VNW; 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 1sTn7o-0000JZ-HS; Tue, 16 Jul 2024 14:42:08 -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 1sTn7k-0008UX-9Y for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:42:04 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTn7i-0007L8-PO for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:42:04 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4266fd39527so43704785e9.1 for ; Tue, 16 Jul 2024 11:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721155320; x=1721760120; 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=25d8r/+FljDN61432gFDtIj9k/AKYUKw9R2OfNlM2/Y=; b=lkUt3VNWtIVDPyy9lW8YeeFGFswrLc66ezotrtvNxvJsqbxjsd9jcW87Vg5ThyKbz9 ft+2usm6W5aBbXjTTZD9iTZ89DqZln1X8Deo3CSecnE42iPk/iX/2cwka0BATfbGs9fq S+7sa8i8C0ztiXwkebq4Yv6zwt8JoQLiZ/PvOSKptKNzzXqWu1srYkNe86t8ruPLY/94 lTXOQj+xCoaG2QJD13VAHt9WjBvgJjuv2fFNLRKlNJeXEygWAxvMG2odxAg0Txs78RX/ bwA5KuEwPMDzpx/6DEroPxt7UqCNkqDm5/KvnqXG4OoBvBhUSk0b8NHNSk8qps9g7rqz dJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721155320; x=1721760120; 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=25d8r/+FljDN61432gFDtIj9k/AKYUKw9R2OfNlM2/Y=; b=Bu6I+e/7U8oB8mFFMjsMKBq6OnaQga9ojwW5M+FuFTECyayOItVqYxF7uCtPXtZYdA i3bTR6VSyV2EH5q8ybXD2NP5Z4evDF3MqUw0EMrQ2K9XT2LuiAKU3+lGWXVPGPX2EwkV prbgylDkjEZOI69FhelFDqTFLs6JRiwfAkjCyl+g+eZxhlfs5BJK3mVpxsWsYd0K1OR4 RKgUFYOrFsEteIiNe0ONkxkBSRD8YvhGC11+0advCq/DKDERxGFibaozg71Fh6DmCpTJ 8Gh+hEtRo4PypQfYHm4n34ZofcTGbQrI02CgBdlEKzWXbQoG78gbvmAhuGlMUkhrBKKg IEHw== X-Gm-Message-State: AOJu0YxAtz78Fvw7ry7f3BuSXTerk4KJW/Y5xlMUc4wysxSBNWnz9PRf 4++dSj8+U4yv3N+4LplWljty3BASJUWoW1Zjp+SJMxDeg+qn3Cd23CT49TRCgacT5s5nsP8xQXd AN67kLw== X-Received: by 2002:a05:600c:4fd5:b0:426:5546:71a with SMTP id 5b1f17b1804b1-427ba656518mr19501355e9.2.1721155319826; Tue, 16 Jul 2024 11:41:59 -0700 (PDT) Received: from localhost.localdomain ([176.187.209.82]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427a14d32e8sm165818145e9.17.2024.07.16.11.41.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Jul 2024 11:41:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Andrew Jeffery Subject: [PULL 02/11] hw/sd/sdcard: Register generic command handlers Date: Tue, 16 Jul 2024 20:41:35 +0200 Message-ID: <20240716184144.42463-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240716184144.42463-1-philmd@linaro.org> References: <20240716184144.42463-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=ham 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 Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Message-Id: <20240712162719.88165-3-philmd@linaro.org> --- hw/sd/sd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index ea01bf6e28..0093bbab3e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2442,6 +2442,29 @@ static const SDProto sd_proto_emmc = { /* Only v4.3 is supported */ .name = "eMMC", .cmd = { + [0] = {0, sd_bc, "GO_IDLE_STATE", sd_cmd_GO_IDLE_STATE}, + [1] = {0, sd_bcr, "SEND_OP_COND", sd_cmd_SEND_OP_COND}, + [2] = {0, sd_bcr, "ALL_SEND_CID", sd_cmd_ALL_SEND_CID}, + [7] = {0, sd_ac, "(DE)SELECT_CARD", sd_cmd_DE_SELECT_CARD}, + [9] = {0, sd_ac, "SEND_CSD", sd_cmd_SEND_CSD}, + [10] = {0, sd_ac, "SEND_CID", sd_cmd_SEND_CID}, + [12] = {0, sd_ac, "STOP_TRANSMISSION", sd_cmd_STOP_TRANSMISSION}, + [13] = {0, sd_ac, "SEND_STATUS", sd_cmd_SEND_STATUS}, + [15] = {0, sd_ac, "GO_INACTIVE_STATE", sd_cmd_GO_INACTIVE_STATE}, + [16] = {2, sd_ac, "SET_BLOCKLEN", sd_cmd_SET_BLOCKLEN}, + [17] = {2, sd_adtc, "READ_SINGLE_BLOCK", sd_cmd_READ_SINGLE_BLOCK}, + [23] = {2, sd_ac, "SET_BLOCK_COUNT", sd_cmd_SET_BLOCK_COUNT}, + [24] = {4, sd_adtc, "WRITE_SINGLE_BLOCK", sd_cmd_WRITE_SINGLE_BLOCK}, + [27] = {4, sd_adtc, "PROGRAM_CSD", sd_cmd_PROGRAM_CSD}, + [28] = {6, sd_ac, "SET_WRITE_PROT", sd_cmd_SET_WRITE_PROT}, + [29] = {6, sd_ac, "CLR_WRITE_PROT", sd_cmd_CLR_WRITE_PROT}, + [30] = {6, sd_adtc, "SEND_WRITE_PROT", sd_cmd_SEND_WRITE_PROT}, + [35] = {5, sd_ac, "ERASE_WR_BLK_START", sd_cmd_ERASE_WR_BLK_START}, + [36] = {5, sd_ac, "ERASE_WR_BLK_END", sd_cmd_ERASE_WR_BLK_END}, + [38] = {5, sd_ac, "ERASE", sd_cmd_ERASE}, + [42] = {7, sd_adtc, "LOCK_UNLOCK", sd_cmd_LOCK_UNLOCK}, + [55] = {8, sd_ac, "APP_CMD", sd_cmd_APP_CMD}, + [56] = {8, sd_adtc, "GEN_CMD", sd_cmd_GEN_CMD}, }, };