From patchwork Thu Jun 27 17:10:40 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: 807883 Delivered-To: patch@linaro.org Received: by 2002:adf:e842:0:b0:362:4979:7f74 with SMTP id d2csp913114wrn; Thu, 27 Jun 2024 10:12:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUftErc31Osh2lVtQqzNC6LY2N6q8QHWRvuvE0fLMRBsHN+GhlRrC1xc3owZ4zC/byvZUdzKSkuBOK/Tu/ZGygl X-Google-Smtp-Source: AGHT+IGVwEQEMSLtqmmv9OXU8UkETgqw/tB7ssRp5oBhClOMonpj2TiQAkqZuFP3fsnQoGv+88+b X-Received: by 2002:a05:6808:120b:b0:3d2:2afb:fbc with SMTP id 5614622812f47-3d545a8d37fmr14473416b6e.57.1719508337068; Thu, 27 Jun 2024 10:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719508337; cv=none; d=google.com; s=arc-20160816; b=TKZHg1bEpTaKyaoRQAKWtpwxPLebFWzpHS13VdUWEin1fByWsDl654Zh7CKatQ9OGn 6B0qCSqoFuQjs2PvZwzVPOp28uKG0+s8FrG2PfH5bweBC+ldfWEVdPATNaYlBCAYSAkF 70v1k1G4dL8b7IvVXwu63gzfAi/tSuUSencW/nQQypot3Hs6V8JWE6WmyX7V8vjzG74I v2iHqSo7VmzymfU4sQ/EyIrdmAJW/HMIYqxmUuHaHmWjJOHi64Hd3XnC20EaxQWunkOu Fh4HaXVHO7twqWEI1ti4awWS2cjdlhNPgEH5jS91xXzANtmK6vbdUvOgkneqGv6oGMv2 60Yw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=eQi11i6sS/5zW2RybooXX9phFmWU7bnalYMVQCv/JUk=; fh=WUqfD5CNolTLXU3odpyK/irI96uSRBSbw3kHmNv9290=; b=q2Ya0xVHl0KhOPCfO+GgFJZw0CqxaNn0/u1NMlcSUY0Z/xz9R2jCyY0tC7WIfnzf+n 5kNy08qjJBNNXm76JSoaeVVQUj+88S2sW3NmGivT2PIk9wdsHVDsDkvT3XJ5DX6GmWQ+ LREbp2lzVLAVqBdn7+0SsGV1Sr/qs1K6q+YVOm6zKbKifI2TnVtnNA1rvB+CtYjkVrvo mA97apQT9NwXePd/cvfdE/8OFX/FPx1afFEnQM8345QZtl6hplMELe1gcQssW8vGcM4P jXDfmnVY8JXH3LuidnlNDJ49wjMoS09jXju/1Ra7cRmIsqV/XUtTm1YvGVV4fIhWGOnK CH4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pc5iUN9P; 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 a1e0cc1a2514c-80fd1156cc2si274825241.129.2024.06.27.10.12.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2024 10:12:16 -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=pc5iUN9P; 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 1sMseR-00079C-Fy; Thu, 27 Jun 2024 13:11:15 -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 1sMseP-00078l-1y for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:11:13 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMseL-0001oA-Oj for qemu-devel@nongnu.org; Thu, 27 Jun 2024 13:11:12 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-52ce674da85so5275224e87.2 for ; Thu, 27 Jun 2024 10:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719508267; x=1720113067; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eQi11i6sS/5zW2RybooXX9phFmWU7bnalYMVQCv/JUk=; b=pc5iUN9PclnEyd+8ZRGVrQ25mlAP7+UfuqaMd6ChHX765HddTovvbH83gwNUAKwgmk U4aF1b/0ntnBxOeXw0A0zcNtHuAwSrLSQoZK7ZPfuhNpvndpadX2FxnOY0elFn65GqIP fH2bYVhlWtpXLzEV/SHtdHvvUxaDUx6wELHGGw0VpD2RgMqVg+9dwUOqt5rkqOq/JQ2m 4THz2R/OJBlkTlHmAD+Q7hPeOyP2UJKVGB9XisasqTeAx7ufWM1TBQ/PV2/JuQIIMYVG gp6c0MtovuDOP4kDA7KlgegciiO/rZIHcCy/Rqa1YGLfu5gNYx7ptaJIJRiYp08ulPOk ZqUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719508267; x=1720113067; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eQi11i6sS/5zW2RybooXX9phFmWU7bnalYMVQCv/JUk=; b=aD4mxCngA8eEOxZHv3JDsrntuGhYAURlqxHl4LlPw/37cTmnHsf8A6y6p6i2wkL30Z e0fh8gOpzSTTTQD7Hwy3Z26SguZUxhTK90JEIAr6eP4TpLH/zt1MwoyUrD3yAOAQwC2k pige2e1z73TN0l+erjHFP/DmQ7sss7uWUmFDexC5HW0/EI46fSImdA3AjFrynax8fxcD eBPZO3Fp2oVM3v+LBVD9yuShue+wjXdJfhe9i+ztdWbvMD6I49tDxPeoMkpNNJ8HMLs3 wnZp1kwX4GGpZ4pou+F8ECmzh7iFG7C1A5r+soSaPGxjA2xtcFHtP1+TjFHa8Wh8sJDH Ehug== X-Gm-Message-State: AOJu0Yx8HR+6qHpgFMPVPQ8ZAwIzoPsQmfBAZ59nY80y8so0dF5fJ1uN fKtz2sYB4KjmPwKutlH7HeTow+pJKbLiSAixLU8BUVRI9633Ql+n+HkvBLbpMYev0VaaxH9dXv1 iSOk= X-Received: by 2002:a05:6512:10c7:b0:52b:9c8a:734f with SMTP id 2adb3069b0e04-52ce185d33amr13908920e87.50.1719508267399; Thu, 27 Jun 2024 10:11:07 -0700 (PDT) Received: from localhost.localdomain (33.red-95-127-46.staticip.rima-tde.net. [95.127.46.33]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36743699b02sm2505219f8f.85.2024.06.27.10.11.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 27 Jun 2024 10:11:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , Luc Michel , Francisco Iglesias , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Vincent Palatin , Sai Pavan Boddu , Bin Meng , =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH 00/19] hw/sd: Add support for eMMC cards Date: Thu, 27 Jun 2024 19:10:40 +0200 Message-ID: <20240627171059.84349-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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 Trying to land what Vincent Palatin started 13 years ago! https://lore.kernel.org/qemu-devel/1311635951-11047-5-git-send-email-vpalatin@chromium.org/ with fixes from Sai, Joel and Cédric. I reviewed Cédric patches but still plan to review the EXT_CSD layout and Joel "boot config" patches. In order to avoid deviation with the spec, the experimental 'x-aspeed-emmc-kludge' property is used. Based-on: <20240627164815.82606-1-philmd@linaro.org> Full series for testing: https://gitlab.com/philmd/qemu/-/tags/emmc-v4 Including Aspeed branch from Cédric on top (aspeed-9.1): https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v4 Cédric Le Goater (5): hw/sd/sdcard: Basis for eMMC support hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR() handler hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23) hw/sd/sdcard: Adapt sd_cmd_ALL_SEND_CID handler for eMMC (CMD2) hw/sd/sdcard: Adapt sd_cmd_APP_CMD handler for eMMC (CMD55) Joel Stanley (3): hw/sd/sdcard: Support boot area in emmc image hw/sd/sdcard: Subtract bootarea size from blk hw/sd/sdcard: Add boot config support Luc Michel (1): hw/sd/sdcard: Implement eMMC sleep state (CMD5) Philippe Mathieu-Daudé (6): hw/sd/sdcard: Introduce set_csd/set_cid handlers hw/sd/sdcard: Cover more SDCardStates hw/sd/sdcard: Register generic command handlers hw/sd/sdcard: Register unimplemented command handlers hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26) hw/sd/sdcard: Add experimental 'x-aspeed-emmc-kludge' property Sai Pavan Boddu (3): hw/sd/sdcard: Add emmc_cmd_SEND_OP_COND handler (CMD1) hw/sd/sdcard: add emmc_cmd_SEND_TUNING_BLOCK handler (CMD21) hw/sd/sdcard: Add mmc SWITCH function support (CMD6) Vincent Palatin (1): hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8) hw/sd/sdmmc-internal.h | 3 + include/hw/sd/sd.h | 6 + hw/sd/sd.c | 419 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 420 insertions(+), 8 deletions(-)