From patchwork Wed Jul 10 14:14:02 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: 811780 Delivered-To: patch@linaro.org Received: by 2002:adf:ee12:0:b0:367:895a:4699 with SMTP id y18csp775549wrn; Wed, 10 Jul 2024 07:16:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXakYHDGETm+ZKJOn7Cww64V05pBbo8VyLOjsaTVOIDVfeE6hB0jpxU5ezxLGW3TEALVIkQeGrR6kW/Yezfuh6A X-Google-Smtp-Source: AGHT+IF/8OJR+n8X/gawLDKlk9+mJLVaqAzwAD87QIQVaat+R6TBTSzdHNKk6OUEhQPAqp80V8gb X-Received: by 2002:a05:620a:2901:b0:79f:6bc:d98 with SMTP id af79cd13be357-79f19a6a708mr772651785a.36.1720620972731; Wed, 10 Jul 2024 07:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720620972; cv=none; d=google.com; s=arc-20160816; b=jk8TFFhiihZJN2M3HGwWnew9Revn4o7CFtON3fRcvHF+2MEOy1yfZMbCg7Sii00gSe hcgY7/EHWdmYn/CsuwBRSLslzeumI6PqdrIvXHq9FL0+lNvS14AfDG4sRyr8nbMDb5Bw TVxB4Yc1xEodRvW3UgAoLnxuB8Zlv/uMiq6Ow6otnNcKHyCT6BPDXDpADRcwYPOYWbfa WOlIiW6p2TyS2irjb+wOU+Rirh8myv6vOwBj8kDsByH+xblOZQVtDG8CJ2Wqys+5/0lc zO3iCgA0E9GL4Qy9IA01ETFL56Ztp9Yz5KCcQIVW7w7rlfZBd2lXDWGfUcxQ7OnPRn3D OWwA== 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=5jntY4rbxkV0U31BLAJxtgRo8uMbZXfthoHz8ocRbQY=; fh=eI8N6o5U11RIgdEbhF9aLRajXTUvSXR3iDLpmaRaPIk=; b=KfOnrft0rgAX8VXBp7O3/3zrAlLjWgatmJTtfPrBOxeb9Zsj/iPkXQ2KZF0LRMRMwF q3lh2snDoOV8DKrVjHAPsSLv572PJjb1i/I+9LuB5zP1yIhkw1kns6QhjGAqUlsoPnNf jxGNULl+9y9w6f4ntOGkMXMV4RgIts7ulcOe2NrFWtxZG6jK46X6MMDtKCt2CTffBigR PCSmyVCAafS24FemjtH2jRUv7idYX9FMQagYVMNKsbJXSfaEisGz5Dh0765m3FrVvv42 VMS14fr+rLs7dhs3tfNQsXDxv+uNSTTI8kgEAEGhmXrYHkpeL3rOolkv1c/JSNoPfBSc d4oA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rlWJczvM; 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 af79cd13be357-79f190a1cb2si469389285a.229.2024.07.10.07.16.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2024 07:16:12 -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=rlWJczvM; 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 1sRY6r-0002PV-KV; Wed, 10 Jul 2024 10:15:54 -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 1sRY5v-0007qj-Rb for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:15:01 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRY5s-0003yN-2k for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:14:55 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ec61eeed8eso76269661fa.0 for ; Wed, 10 Jul 2024 07:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720620890; x=1721225690; 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=5jntY4rbxkV0U31BLAJxtgRo8uMbZXfthoHz8ocRbQY=; b=rlWJczvMR9GC/fTqiQ+YzhLt9cpc4IelvTWnhR7MLdKfPofmg69Go6CEk1F1tPlaCZ +iMOXrYXb2DFVqtyQN8c8t1BNDzpaIofLEtNoPBsO6aeg0kx9wEQ9chD1DiOPUOlBL1Q 5x2eHk7LfWyUy1bNTfWBA1jXoUTgzASeKPqZzbLGprliZcjzodMMou6iev1nzamm7CgZ Ao5UZozjyJ5kLBfbThuHXrMGburue0QWlOV7pRYLM4UWBwlAp2wR3kAMK0OZRfOfFwv9 wBSQ5hpqkd22S8kmiL4t5eNqEfRfqJT1a+sys3HrvO6tgD13z/8a2RX21p0drolVjJA0 /wPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720620890; x=1721225690; 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=5jntY4rbxkV0U31BLAJxtgRo8uMbZXfthoHz8ocRbQY=; b=izfsqSvmvjc8l4VofBeOBARsnsmWf+XQP1BUHUyemmwR6NOB5m2RkXOcGst53Oip0j oS8JpSdS1caDKEulqyOPbOWXK1gjR2B5bzMTWVQOttZU7P85C+osHpMmdRTnVfrKj53V pjqb2fXr0ypUPM3uGrc2/GVojix9sZ6iwgiQ2Z0EwNhp7cuLhKAElwk2RSPYc6E6o+2t 2PXx8Vm1LvmJfH86kjAvsFczsTw1Gu944zn7fmiYcc07AnS3P1Mwbitcf7B2GsESQP2B hmhILA5hovUE0azJggaBofE8zSCdWZ0g0HaZPJDtuICswwjdLFDyAwoFtrrXJkChtoG3 CR4w== X-Gm-Message-State: AOJu0YyPspGcYUR2Zw8X60O66cp63Z5qUcz2sJcuojsGoBt9E9HQwJt4 WG+nUURkkNRcOFwIIfUSftY4br/VLIT7huLM42BoJOy9ZQ8plhQcMsBy3KHqkDAEIhdrpBOxGpS n X-Received: by 2002:a2e:9c8f:0:b0:2ee:bd1b:84c with SMTP id 38308e7fff4ca-2eebd1b173cmr20288141fa.0.1720620890154; Wed, 10 Jul 2024 07:14:50 -0700 (PDT) Received: from m1x-phil.lan ([176.176.167.117]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427165c69f0sm60227135e9.30.2024.07.10.07.14.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jul 2024 07:14:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Steven Lee , Andrew Jeffery , Francisco Iglesias , Sai Pavan Boddu , Luc Michel , qemu-arm@nongnu.org, qemu-block@nongnu.org, Troy Lee , Jamin Lin , Peter Maydell , Joel Stanley , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH v48 06/12] hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26) Date: Wed, 10 Jul 2024 16:14:02 +0200 Message-ID: <20240710141408.69275-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240710141408.69275-1-philmd@linaro.org> References: <20240710141408.69275-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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=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+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 550f63418e..3628686832 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 mmc_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", mmc_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},