From patchwork Tue Jul 30 09:21:37 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: 815274 Delivered-To: patch@linaro.org Received: by 2002:a5d:4acf:0:b0:367:895a:4699 with SMTP id y15csp210438wrs; Tue, 30 Jul 2024 02:23:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVgrezm+5ddMS9v2ZXYNdRk9Jn5rq4D23GJx2YIbE1EDRnGUQHsrgyW4I/WoCrAys3tL8sdcasxPx3//IpvKVlf X-Google-Smtp-Source: AGHT+IFtQjliHDpUdgfzCfcpRMoEJ8bAPd1GWybtasOqWlmqNuBnjRLuJ/+eEvqZ5T0EXGbqp8Ra X-Received: by 2002:a05:6214:40c:b0:6b9:5fb9:113f with SMTP id 6a1803df08f44-6bb55a7a9admr144692676d6.27.1722331381796; Tue, 30 Jul 2024 02:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722331381; cv=none; d=google.com; s=arc-20160816; b=to4GBTkggdXIpzLk76L4JzJYbw2w4NISde0gFpzsifZq+C9HdiW2ximkL4gPn49m1D 5ecNY4RCVZ6/3OVL+wGGeY1hb9Bdn09DgE1FPXPB6TQ6TY5I8SNjZViVlPSBS3NdUr2c CKQDwz9YMzltVBFTb0Ioa6d9GxwgC1UYiLtBJ63FyaGlaHX2/x0unoCXg8QWAw/+xmcQ ril8xRdZGH/BRkJFpG5utDuJJQZ2h0uwh32HDdRrfgV3l8eLBg5yb8wJNLcHAF8cvzfY JD3SK82yCSr/mtsal61AMdJ2wFg0VUXsfjrgqHREVBIAg3WwFWv91mJui42JcrMK5upr aftA== 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=Ugc2yLiSsI07WG//ugTlVImvOO+yujn7Q1YmHPiaYeY=; fh=0a1hE22G74W5F4G5a1EIh7TNSrHN0drAqcdv1Y9cvc8=; b=puGSBJoXBHOmkV5NdMGO36araK4EyIZBoEKBz9BzDyPs5A9dErvT7cHR81A2JmAGEO miWg2GBl8zTfaS/sLbx828e5rfIMHQ9RSs8502CgeZt1HTLR6AUPymXEeURrd5OlkYiC ODNVT8oXmd5WZnAXue1DulGgbSjhdCM1fL0wTWtxQNDl5oUKCHNdhcVCDda+/9pp7m8s 8fB91B1iRzAK+W0shvU9rXI2sMFhWh73gYANy+E5wTi6nlFJEf1IjqLXdJNydp7IefkE TQr0Z7Ga6plJHgJl6hOVOm0TEllC6gvZktnFQkjMppIB6Ak86NkBC3YX2nJZ83VJ7FIb SOEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=svE9vyBe; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bb3f8e9c51si130372906d6.155.2024.07.30.02.23.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jul 2024 02:23:01 -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=svE9vyBe; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYj3j-0001G6-JV; Tue, 30 Jul 2024 05:22:19 -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 1sYj3h-00018g-TN for qemu-devel@nongnu.org; Tue, 30 Jul 2024 05:22:17 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYj3g-0005nY-AH for qemu-devel@nongnu.org; Tue, 30 Jul 2024 05:22:17 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4281faefea9so12650615e9.2 for ; Tue, 30 Jul 2024 02:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722331334; x=1722936134; 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=Ugc2yLiSsI07WG//ugTlVImvOO+yujn7Q1YmHPiaYeY=; b=svE9vyBe4iLfuPzZ3CPXE+TN9XEPe1Pa4WFrbu0faWq9YD120fY/baAVbXZ4/mssYI f7jMRXgKz33DhaQ2YFPCL5XqeaY/8l/wTlCFVc1jPjSLbsU4eTqBTwZG3SsmefmYfc5o g2n/abH1neRSolNakGn2SYN1f+JG7H8hwzbSWHudoX7009r6cgfni+84rOpNcoabg6MO qKR+XqZOty/fNPPdlUPL/vAytzPpW2TDgXstWvTgVyB7RMD2Nzx3zDNKJ/WU2KNgknZv Oc6t/EfZVyPDb13G/gyzhyOJ12HFysaldlNSb6+uj0dVQ5i8mOpNiMXkd67pmC0w9lwf vsyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722331334; x=1722936134; 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=Ugc2yLiSsI07WG//ugTlVImvOO+yujn7Q1YmHPiaYeY=; b=f+8i1vO2sSz+CR+Uokav2ed27mRdFjo9YjBXuL6pn1Q700+DWDJW48PIFoY7ltMNfc J8tIDBPzgHzm13Cyf9KjtjZ8pxTcVVIyN1Tc8SaHMTDZ6Q8ig9Wt0Ymy0pILe6S3eTRj fHhGAUeluQjDgIX0SFcbzaeaTZzkmXli8NvGaPmNCDMdCLoLLw8q0KuoG3tg9+EXMPSK X0Q/4YKveAiVKrb5f6Y/qYUmN2ATGS5ctvgL/57oGdO1R/M/m97fxIkiAzZewUfDNoLi BrxvMtagPo7aImjvMJi7sF1aLEImj470j24S+CS05h3SXanh9GZcfuOYMH+aRd0Y5CGE Q2tw== X-Gm-Message-State: AOJu0YxXUHYh6FGkMCsAHbjeD4NDXbzC4Y6eOk2bnX9E1Uxl8ePGqHlG Kijd6cZdtHWHn1f/RNYI/qDr9BE8UCalZXMTTYFZG31SApvVnSa76zIbPjcMihra2FOVWqZXXBO Yo2A= X-Received: by 2002:a05:600c:4f8e:b0:426:6e9a:7a1c with SMTP id 5b1f17b1804b1-42811e12d86mr67992635e9.25.1722331334313; Tue, 30 Jul 2024 02:22:14 -0700 (PDT) Received: from localhost.localdomain (82.red-88-28-10.dynamicip.rima-tde.net. [88.28.10.82]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42809e4423dsm173477325e9.13.2024.07.30.02.22.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jul 2024 02:22:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Zheyu Ma , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 4/5] hw/sd/sdhci: Trace ADMA descriptors Date: Tue, 30 Jul 2024 11:21:37 +0200 Message-ID: <20240730092138.32443-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730092138.32443-1-philmd@linaro.org> References: <20240730092138.32443-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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é Reviewed-by: Richard Henderson --- hw/sd/sdhci.c | 8 ++++++++ hw/sd/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8293d83556..66b9364e9e 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -693,6 +693,11 @@ typedef struct ADMADescr { uint8_t incr; } ADMADescr; +static void trace_adma_description(const char *type, const ADMADescr *dscr) +{ + trace_sdhci_adma_desc(type, dscr->addr, dscr->length, dscr->attr, dscr->incr); +} + static void get_adma_description(SDHCIState *s, ADMADescr *dscr) { uint32_t adma1 = 0; @@ -710,6 +715,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) dscr->length = (uint16_t)extract64(adma2, 16, 16); dscr->attr = (uint8_t)extract64(adma2, 0, 7); dscr->incr = 8; + trace_adma_description("ADMA2_32", dscr); break; case SDHC_CTRL_ADMA1_32: dma_memory_read(s->dma_as, entry_addr, &adma1, sizeof(adma1), @@ -723,6 +729,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) } else { dscr->length = 4 * KiB; } + trace_adma_description("ADMA1_32", dscr); break; case SDHC_CTRL_ADMA2_64: dma_memory_read(s->dma_as, entry_addr, &dscr->attr, 1, @@ -735,6 +742,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) dscr->addr = le64_to_cpu(dscr->addr); dscr->attr &= (uint8_t) ~0xC0; dscr->incr = 12; + trace_adma_description("ADMA2_64", dscr); break; } } diff --git a/hw/sd/trace-events b/hw/sd/trace-events index 43671dc791..3d3f5c1cb7 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -35,6 +35,7 @@ sdhci_access(const char *access, unsigned int size, uint64_t offset, const char sdhci_read_dataport(uint16_t data_count) "all %u bytes of data have been read from input buffer" sdhci_write_dataport(uint16_t data_count) "write buffer filled with %u bytes of data" sdhci_capareg(const char *desc, uint16_t val) "%s: %u" +sdhci_adma_desc(const char *type, uint64_t addr, uint16_t length, uint8_t attr, uint8_t incr) "%s addr:0x%08"PRIx64" len:0x%x, attr:0x%x, incr:%u" # sd.c sdcard_normal_command(const char *proto, const char *cmd_desc, uint8_t cmd, uint32_t arg, const char *state) "%s %20s/ CMD%02d arg 0x%08x (state %s)"