From patchwork Wed Jul 10 14:13:58 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: 811778 Delivered-To: patch@linaro.org Received: by 2002:adf:ee12:0:b0:367:895a:4699 with SMTP id y18csp775407wrn; Wed, 10 Jul 2024 07:15:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXuYtMUxcCebCRkKQd6uH7QeL8Q098gklqNovAzmB4A72GfLpcsgiq15PxadTZBWg5pkxIU1E851M7QERx2OYGH X-Google-Smtp-Source: AGHT+IEChOR2aTk+ntZKak+YX7Dhrgzd5RtV6NlewNJnm8bLm1AxFH2ja+OithGn8xxQUbveWqiL X-Received: by 2002:a05:6214:246d:b0:6b2:c034:6aa3 with SMTP id 6a1803df08f44-6b61bf35eb5mr52115646d6.35.1720620959269; Wed, 10 Jul 2024 07:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720620959; cv=none; d=google.com; s=arc-20160816; b=asJvoa6uOCsmgumOrXdyeLnj4EmEKEHj/+une8eKjs7xZHnfVk4PTKDUvpIb5YbRBg zwjPkLH9J0NW9nov4VDwPwoPjU/siJIPQI1Rz2/RwLgVBAf+0Eu8eabxs95rfBJukb/3 DoZKorFNKHTRvZZFeGz5nPjB68p3k4hcsKHUgzQ0S3RajLD+X6kYJbCT21EKp/QckK+k RSIRsSunLQo7r4gmCdHlNPtRqzkI7B5xrTHKHTbSApFbnpLuwpJzJR6qmOdAhpy+QpFc sPu4jP+SBJAGYlgGS5Y4g8EIquy7BFYcu2LbHHeeLBOAbcyy4kFFJztMl/Khnkge20SH hmfQ== 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=5A72BhSEgW2r7oVyXyiETrkNoXhVnGhowikXNWfzjCw=; fh=eI8N6o5U11RIgdEbhF9aLRajXTUvSXR3iDLpmaRaPIk=; b=ezwvvey9Tcm4uIkQdYo0h/PoQ+T46HvHkcyxc3rku2uLia8552Hvenkn4Y09NKO/yO RuRdl7Ue2MJKFoUgG2R8B96uqimBNGuRL66bA1f9iCjyXyi7UpUkSzrFHL6ITZGl2uDD OQ4w569Jl96vHh1EHfUwfLdvWGv6OpldeKRJodXHOyEdDMMPJUyvE89VZO2c7IFcRD4h 87X+bsdDSrneGXxrlAwZZkWinNq1/PWwKkjeoHodsOB30Z+z+fkUmEovuRavGw6RkQNT YXLx5Dgs0d9EPLQY64qXLVH3w9XydIVFZRgPWe983noSXL8f20VnGnt86eoVowTX86eZ qxTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZPa7TqL; 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-6b61bafe3bbsi47193316d6.577.2024.07.10.07.15.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2024 07:15:59 -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=sZPa7TqL; 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 1sRY5X-0005ux-Tz; Wed, 10 Jul 2024 10:14:31 -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 1sRY5W-0005im-0n for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:14:30 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRY5T-0003pV-Ne for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:14:29 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ebe40673d8so85008341fa.3 for ; Wed, 10 Jul 2024 07:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720620865; x=1721225665; 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=5A72BhSEgW2r7oVyXyiETrkNoXhVnGhowikXNWfzjCw=; b=sZPa7TqLzfYK8tHyPob2zJulumiKbUdkhSpFSYu072oVeQCRab3MLQtu84IQGPnHto UQzUms4VXAS4TrUbp0/j0phyRS5zulOAhQ/Mtu07t7Ot16Ap9UkM6Mqwt+rm+23X530V AOZ/ebzw0OZBNkSpR1LGIwECksqazE0YcWz8I7Y2tpr2ni2T2JjfTUAbpOGbebh92XTZ tKJwolzLl7XXAdpub0/r54OZQ24OaWtYQKr0Qq/NPl5GVC76fGaOF6bnjokKl8/WMudM fz8roZRIVVPc8KBUMT4IglfcCBeTaxvrZ4VdJooZU1s4GQi/TyCCflfySNZffX4Hz9GP TDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720620865; x=1721225665; 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=5A72BhSEgW2r7oVyXyiETrkNoXhVnGhowikXNWfzjCw=; b=grgqSDjGtABRoZBE6GAwCPVMOxZyowvBan2Eo4DGDhXhIV4CRQl6a3gUNinL6W3OWV ouHJglBLHrgGNOERMkeJDhNDce2tkCFqCQwR5F0wy4w3GQEjqOxrhY/HGLzWNYwlyrj3 XrohoY0X/gNYCnuSVpoC9Me5rOVgodcY37yKXM/0heIWcdpfcvwUkK5Y04O8mn9nac+e yVqsZmtVYdHaQUgCwJjxDkq327ik5v9w15M9hB7hNo+lTq24YbCcLu7anvw1uhqAcgxr iN1bg0Pd9/vXKOdgCehZZuo8z/UrLZE+84lyHeqdLeSOq2P3wp1o8Up0uFQfEjfoR4/+ +AoQ== X-Gm-Message-State: AOJu0YxtVrD4X1HgogCKjn5BtIYnCVWKvXvNTDfGPbmYjmK2whydv+vZ DDhWlEdReInShQf2uvOgKAJYZ0p2deUJxAmnJuQNwXrUcT3H8QdbaYsLUrGzAbK2TIycN5Useal I X-Received: by 2002:a2e:8297:0:b0:2ec:6639:120a with SMTP id 38308e7fff4ca-2eeb30bbb0fmr39555241fa.10.1720620865522; Wed, 10 Jul 2024 07:14:25 -0700 (PDT) Received: from m1x-phil.lan ([176.176.167.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde84707sm5367623f8f.35.2024.07.10.07.14.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jul 2024 07:14:25 -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 02/12] hw/sd/sdcard: Register generic command handlers Date: Wed, 10 Jul 2024 16:13:58 +0200 Message-ID: <20240710141408.69275-3-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::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.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é --- hw/sd/sd.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a4b6c7baba..fc78d4e561 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}, }, };