From patchwork Tue Jun 25 06:10:04 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: 807250 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp2199669wrt; Mon, 24 Jun 2024 23:10:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWrX8vPpuDM3BCLUOGRUmPyH5r30Kgjw13mKPQw05+YgVCDM77zQOtTawSOZgRQgoaOMpk/QnrjAyAgVX196ezL X-Google-Smtp-Source: AGHT+IGdbI6QGkjUJYL5UaSyQSKq+AFsniNYvp7Jot5+J50gIOxUzdUYXtN/Hl925wSl774LYB83 X-Received: by 2002:a67:f513:0:b0:48f:4b58:a9a8 with SMTP id ada2fe7eead31-48f52932462mr6463689137.4.1719295837082; Mon, 24 Jun 2024 23:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719295837; cv=none; d=google.com; s=arc-20160816; b=k2182/kNzqDu2agNSdi5LnvLuleJPN1nBcp4Tir9y1sEHHHZiSvo0YslUnK3vNWBCO s+bhLu4OfZV3yR1uexgpR2X2QbUkGJu4ysdXPd1PE0J1sWFxkReDfvPcmW27gOPs/zzx oqbY3z8edThyO1c3SBX7FL0tQUU/yF+Ji6Jbdzr1Mr6Z6HudHfrluohx6RTau7qn12Co 8ibMWvVn3Bo0OXwEcIncalNgxJ6pHhXFoRmPmlBqBekpv3SyG6kgr318f1bPkonoHjv7 sVbAEpJ3J2SxOng7lq/l4n782iUGAx0SEr8WTMflpr54vCA6TdQ5/PcFSHadXtUBL3Bh EE0w== 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=ZOXFsLpSPLofRD0Jmvs9SG5wPUgCX8BKUuO9YF3zklc=; fh=/JlK2oR+rOwYm4wA2OuQV1gEZ6kNvrQcYuDHZ182k9M=; b=C+/uWwFYJup481GXexYNnJk6l01OFf0HjHht7KPtl7SVw0RC7poLdOvAfErq2UnP9c zH2GVh/ktE4Hslaww6UiSmJSPspRRjRBigxddHqvg+P6gjT18vnH9UhX16WKLgMPiwir zgWFOLiM4thf0pVaXidLeeCjSejalGK9Kovhw9oI2AzQEEs+fHkvSmvgU7gYePqOOlwN ZTPcZl1E+6suhXxW0u7S+AuR/d8+LKrKR1h+T7kBbWLvqwvxCkzIt5cI4fyZGCukId+w j5r788Kl+4aN13rNKJnYryaCUsFQxzK/MmyllwfTVWKxxrh/K6mRUdwNMY1o0UAXAjTz hglQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iATWOa5q; 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 d75a77b69052e-444c2c08316si109527961cf.288.2024.06.24.23.10.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2024 23:10:37 -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=iATWOa5q; 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 1sLzNt-0007r3-6s; Tue, 25 Jun 2024 02:10:29 -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 1sLzNo-0007k2-Mv for qemu-devel@nongnu.org; Tue, 25 Jun 2024 02:10:24 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLzNl-0005Vh-E4 for qemu-devel@nongnu.org; Tue, 25 Jun 2024 02:10:23 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ec408c6d94so58881761fa.3 for ; Mon, 24 Jun 2024 23:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719295819; x=1719900619; 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=ZOXFsLpSPLofRD0Jmvs9SG5wPUgCX8BKUuO9YF3zklc=; b=iATWOa5ql23tTfL0+JTMPQJb1sAn0DsTaa1RPgbRKSmY6CTFYNu/64C5deoBwIYD5g XlvuGEsTFNMRaNDv4ArHFzsXwLO7gPNVNHfE4u3jUrQOnWGptWjgCx3sjOQW93V20zam RV6RXL9L1QnK8gWKDef9lAugU7t7/B4NNy7nUNnVsDBi5QOkAHSHkbBzSx9PJFJIq223 yzbVRxpp2/hpqS288VWw3ZIIgj8jGgbZPkane4EYp38kINuyQgcXwOZd3lc/8rpVCuJh kvEnnZI/LJQFUjsy37EINZ+NlgkXn781BD5IU8ujVUTcxnTUwDyuvajthdw3rRdCX5ko fQhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719295819; x=1719900619; 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=ZOXFsLpSPLofRD0Jmvs9SG5wPUgCX8BKUuO9YF3zklc=; b=eDaA4qSt4Z3dMsrcArkmAE9AZPKrssb+eFFjKmj/H2z8wy0MU3SWX0PRIbs36/FpUI bxqwgIL8R/APVKeV6ffWse8dxIdTyyRaiy8nD13UQmEzuGav0vDL+Q+avt65dxkWUEV3 znafC0ng/RdwC00L7ARd2Q+gvwaMx70KXmk2bB9M3rjD+rvodbixrgc9lbyZc6ObRCMi z39pSvzpL/r6uQ2eEh4601a0TFL6KZNVSACawUzYrVQYS6YL/wmxMcwVBqiv2xC9cquW FPEVy9bwEa7nPLEEDRXCs/Zj7MqeDrDM+WpqnjI/aM6xDe5Dq0ASW/lBHUskYh07APve hjeg== X-Gm-Message-State: AOJu0YyxFdCB6Wsjb51FBmDOKhExoEC3haOKN4WBAL8PwZ0919+NBh/4 GFdQhoMyRTUlZeITSyV7e8aWUbS7vqITf62sgj/b1p6kW/TNCdK+XMt6PDW1hEQRK4FoYYoT3Ra X X-Received: by 2002:a2e:a546:0:b0:2ec:6cbe:5e4c with SMTP id 38308e7fff4ca-2ec6cbe606amr8161451fa.26.1719295818627; Mon, 24 Jun 2024 23:10:18 -0700 (PDT) Received: from m1x-phil.lan (bd137-h02-176-184-46-22.dsl.sta.abo.bbox.fr. [176.184.46.22]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366389b8ad2sm11859573f8f.33.2024.06.24.23.10.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 23:10:18 -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?= , qemu-block@nongnu.org, Bin Meng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 00/11] hw/sd/sd: Introduce sd_cmd_to_sendingdata() and sd_generic_read_byte() Date: Tue, 25 Jun 2024 08:10:04 +0200 Message-ID: <20240625061015.24095-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::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.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 Consolitate reading bytes on the DAT lines by introducing a pair of helpers to reuse in all commands sending data. Based-on: <20240625055354.23273-1-philmd@linaro.org> Philippe Mathieu-Daudé (11): hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte hw/sd/sdcard: Convert SWITCH_FUNCTION to generic_read_byte (CMD6) hw/sd/sdcard: Convert SEND_CSD/SEND_CID to generic_read_byte (CMD9 & 10) hw/sd/sdcard: Duplicate READ_SINGLE_BLOCK / READ_MULTIPLE_BLOCK cases hw/sd/sdcard: Convert READ_SINGLE_BLOCK to generic_read_byte (CMD17) hw/sd/sdcard: Convert SEND_TUNING_BLOCK to generic_read_byte (CMD19) hw/sd/sdcard: Convert SEND_WRITE_PROT to generic_read_byte (CMD30) hw/sd/sdcard: Convert GEN_CMD to generic_read_byte (CMD56) hw/sd/sdcard: Convert SD_STATUS to generic_read_byte (ACMD13) hw/sd/sdcard: Convert SEND_NUM_WR_BLOCKS to generic_read_byte (ACMD22) hw/sd/sdcard: Convert SEND_SCR to generic_read_byte (ACMD51) hw/sd/sd.c | 223 ++++++++++++++++++++++++----------------------------- 1 file changed, 100 insertions(+), 123 deletions(-)