From patchwork Fri Jul 12 16:27:14 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: 812335 Delivered-To: patch@linaro.org Received: by 2002:adf:fac3:0:b0:367:895a:4699 with SMTP id a3csp776734wrs; Fri, 12 Jul 2024 09:29:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWsdrd/1agGShfa1n3Y5yPQUZrXMd0LYFfuTGNurPZhoUBBr5b0e5/dvtJzFQuOUutXXyEovJOyNAebARblID1n X-Google-Smtp-Source: AGHT+IH+VFpBkddqjh8hN8HdryjqdSVsE1IihHagA8WNpL8VwejW+piYC+Bw7obN1NLkwn5/pPbn X-Received: by 2002:a05:6214:ac9:b0:6b5:ea99:bdcb with SMTP id 6a1803df08f44-6b61c1c4107mr160465636d6.42.1720801767740; Fri, 12 Jul 2024 09:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720801767; cv=none; d=google.com; s=arc-20160816; b=Tm5LHAl682KAa1O3eXUs9OYuTOJTrN6s6bql0tiB3j2SQ4KZjThemZPOXgk9rRR1XA j1A5/x7XU9taYfL2GHM1RETVZn3daaB4G0QEPON9xUrjZWb4vLbR6aVz/DuuvAy4Z1/U zAtZOZRyK39VpNsyEMOQtlFXuv2Dc11w4y9J43M44Viu9CQqm7QhJtk8Ea13xq2wj/E9 eVJC9YxUCZgq+Q5DMgmi5eoNMTUSFDxDYP5NoVnAESUtPYh/w8k8enw1SwMvzwiI9dKx tsvKROJOAGiJ7+TsoibfVnB7k9wQfWVOh/M2KCkEHMaaIBC4F8iXxVt4FDED4PRUFrEG HvOA== 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=5v0lhbhFJNzaNnnpGempJ4TqJKsskD8Q6hiPRfCwH2w=; fh=TW6+ULwo1p4b9zwtgcIpKT4kG3RJoiJN3Pv7qtK92ok=; b=c91r1J1HEMUwhVs5bBumtWxBcsTSrV3eQoyFz0cTP5pXRt9r9hYU3NCXcoW0BAe0AP JBrAWSE2TzBt0ix2Uxc0AwJZXbwklHmU0+0sfeZk50OUvIqaHwFHhAFpIz1jbkqhqJT7 mj8S7Y+8uWgM/TTptsEOrM/6kd83K4sMB2CctTd9zgtCon1d/MdbdPONV3/5qeVWrF/A XmC6qD5p986AAnrJFbiNnPLZbOmNfIy2J26/yfqasMRNvepc/PzI8Y0CYzwYewd0sz/C CmVvwOo14A2AHyUdBSNV+sz1ZcbBW4tCGzH4+HAFvvlKzyh3Lp5Q6FwDSo1i9bCbxkul Va6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoUvpwCg; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b61bac9764si99866056d6.447.2024.07.12.09.29.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jul 2024 09:29:27 -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=FoUvpwCg; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSJ7x-0005dn-Cg; Fri, 12 Jul 2024 12:28:09 -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 1sSJ7s-0005VP-6G for qemu-devel@nongnu.org; Fri, 12 Jul 2024 12:28:04 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSJ7q-00020g-Fq for qemu-devel@nongnu.org; Fri, 12 Jul 2024 12:28:03 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4266fcb311cso14943725e9.1 for ; Fri, 12 Jul 2024 09:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720801677; x=1721406477; 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=5v0lhbhFJNzaNnnpGempJ4TqJKsskD8Q6hiPRfCwH2w=; b=FoUvpwCgymd4jAGYwOFijW4fwywDFil/AvJIhW048fZWmuK2ZIuqPZ/6NFWbL2kd7M iVMukrjmvzeC3qGTjoQu+umPT1TwtndM2eCym1OfDJprwYM1yLdwaGrFiWH3VQAOl3QF mNG9QoSKwh3xikgkFSnbJZ2I0AstlXyItOpZajJ8Js2mHXeOmpKmWTylAIJqRCBKlz9m sQ/rGtf2HMHhKmDc2ZN0HPMspUW7quOvCxXXVqNM0XoPDcLcB07Zrwz2Cawx3P5uux2n JdFa+xN1/FT9+74EGilX24wudXxhuxm1jCKVMYuScmBLKhZGL9+mpwj6m8omYVH0ocdJ MwsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720801677; x=1721406477; 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=5v0lhbhFJNzaNnnpGempJ4TqJKsskD8Q6hiPRfCwH2w=; b=EFey2NFapnSOzhNms+h8SsMMm3eOwiR+EJuqduf/DLW9lkh9yqsCA76O1rnz4xFmO6 nIwAt//lCtueHSY/k8W562+TBbWEmYreN1S1u1WSz0tDPpvImr2pSYSzm4lm87A7pP5o D8FSGOd6ZF5sbUS6tCOCVHTu4r84coZAFCnxNhkz8gJx9eMPLBSvLO/Xa+dIf148uPwY uthNWcni2PJpGZfHp8hO0YRpai5O8qC++Vxnd/YX/w0reNd+p5aZWX5zq93qdqBKEFN/ 7QRvBpa9WWJC3FqJLIFw2AtINc/n/bfuTDyJeTV94XDBpOJN2+sOySNGnm3L9T34VmFS heuQ== X-Gm-Message-State: AOJu0Yx2e7fX908JQH/uRUq5RsOcTqGH80OnKez1JEenUzCGbAIr7HyE v4Pw1soasDcFjeL97wyyyl/eSxl+GIlAty8O7Mt1dYfR9Ybpn9Lz0n2Kvm9AO1I/bmSep/DHYVj 2 X-Received: by 2002:a05:6000:ec4:b0:365:f52f:cd44 with SMTP id ffacd0b85a97d-367cead8fa4mr7617932f8f.57.1720801677685; Fri, 12 Jul 2024 09:27:57 -0700 (PDT) Received: from localhost.localdomain (nsg93-h02-176-184-54-152.dsl.sta.abo.bbox.fr. [176.184.54.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cdfa06desm10619430f8f.76.2024.07.12.09.27.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 12 Jul 2024 09:27:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Andrew Jeffery Subject: [PATCH v49 06/11] hw/sd/sdcard: Add emmc_cmd_PROGRAM_CID handler (CMD26) Date: Fri, 12 Jul 2024 18:27:14 +0200 Message-ID: <20240712162719.88165-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240712162719.88165-1-philmd@linaro.org> References: <20240712162719.88165-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery --- hw/sd/sd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 09077f0154..a90612af58 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1568,6 +1568,12 @@ static sd_rsp_type_t sd_cmd_WRITE_SINGLE_BLOCK(SDState *sd, SDRequest req) return sd_cmd_to_receivingdata(sd, req, addr, sd->blk_len); } +/* CMD26 */ +static sd_rsp_type_t emmc_cmd_PROGRAM_CID(SDState *sd, SDRequest req) +{ + return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); +} + /* CMD27 */ static sd_rsp_type_t sd_cmd_PROGRAM_CSD(SDState *sd, SDRequest req) { @@ -1917,9 +1923,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) } break; - case 26: /* CMD26: PROGRAM_CID */ - return sd_cmd_to_receivingdata(sd, req, 0, sizeof(sd->cid)); - default: qemu_log_mask(LOG_GUEST_ERROR, "SD: Unknown CMD%i\n", req.cmd); return sd_illegal; @@ -2478,6 +2481,7 @@ static const SDProto sd_proto_emmc = { [20] = {3, sd_adtc, "WRITE_DAT_UNTIL_STOP", sd_cmd_unimplemented}, [23] = {2, sd_ac, "SET_BLOCK_COUNT", sd_cmd_SET_BLOCK_COUNT}, [24] = {4, sd_adtc, "WRITE_SINGLE_BLOCK", sd_cmd_WRITE_SINGLE_BLOCK}, + [26] = {4, sd_adtc, "PROGRAM_CID", emmc_cmd_PROGRAM_CID}, [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},