From patchwork Wed Jul 29 01:41:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1338094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=N/co3fo9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BGbql1BM0z9sRK for ; Wed, 29 Jul 2020 11:41:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E78E48249D; Wed, 29 Jul 2020 03:41:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="N/co3fo9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D7B58249D; Wed, 29 Jul 2020 03:41:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 181658247F for ; Wed, 29 Jul 2020 03:41:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x242.google.com with SMTP id l84so6807356oig.10 for ; Tue, 28 Jul 2020 18:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pXMuTFSgFRm5z9Y+8Mu09NGrBnPoYaHXoeiac4B10Cw=; b=N/co3fo93m0pONx+qYdhxVD4eaOjHiqY0ts7mJJmdJbC1z9ImwemYMMRWcEa4OmBVO edOXRAYFrRJDk+au9m/Y2S5XiOr4xDJOD4i3wIpNnd1s4FvrYmDZYYhqW0+0emcZlxef Keg1DwSzxwArId6qE+Nereb7FLp+RGuZTNLPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pXMuTFSgFRm5z9Y+8Mu09NGrBnPoYaHXoeiac4B10Cw=; b=LKQf8RGX2/jBCjJwOQ9PNAY850RNfTNnC4P1pJ0hlDI7AXzIqsto4LLo7xrdalSKD8 8kIbDbFIbYKzWlvVfTQwSlFlKbUqd0IoC6/Lot1nFyVF2Eg3ibyZUmYFfXHAMU/51i99 sQvW+I5r4a+6DLpWQYNOIGxVEt9BHai/RENVJHmEv/C2/ELE7cFUJpCqryhpTs49kT7d J37N1ja3Quu4FPPAODK5IfOS+jTe0qY1e2dXQ/YXC5jhU6+nbNiZLLD5NT28YftU3/ML eVxsTRRYh3GLq9GmL+TqogLMIUpmfiiwYr6rdZ0cyzIW6pR2uqrGeXrsfGcJjm6IZZxC OgUg== X-Gm-Message-State: AOAM532gJs7f3KFjeMpPtP7+hjRu8ey0f71eF6EAs5DwOWo/HiXVvnLh zWXVpoz7QgMkQflcF+Uk8+V8U+I1384d1w== X-Google-Smtp-Source: ABdhPJxUt8xWqI1rviKRnuCPrMYyyknVtFYKa2Tw/b6SH1MzmH63iNifUapknUpxhUnuA8Y3YJcDfQ== X-Received: by 2002:aca:ec4d:: with SMTP id k74mr5653199oih.160.1595986877490; Tue, 28 Jul 2020 18:41:17 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j35sm88029ota.23.2020.07.28.18.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 18:41:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH v2 0/5] cmd: Fix 'md' and add a memory-search command Date: Tue, 28 Jul 2020 19:41:09 -0600 Message-Id: <20200729014114.1960556-1-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.rc0.142.g3c755180ce-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add various fixes and improvements to this command that were missed in the original version. Unfortunately I forgot to send v2. Changes in v2: - Add new patch to check part of a console line or skip it - Rename the Kconfig to CONFIG_CMD_MEM_SEARCH - Use a separate var for the remaining search length - Drop unnecessary ':' in the U_BOOT_CMD - Enable the command for sandbox - Split the argc/argv changes over two lines - Add the missing cover-letter tags - Correct a bug when auto-repeating right at the end (and add test) - Move tests to a new suite of their own, instead of DM tests - Add -q flag to the 'quiet' test to test operation when console is enabled Simon Glass (5): test: Add a way to check part of a console line or skip it console: Always define the console-recording functions dm: Rename DM test flags to make them more generic test: Add a flag for tests that need console recording cmd: Update the memory-search command cmd/Kconfig | 2 +- cmd/mem.c | 30 ++++++----- common/console.c | 4 +- configs/sandbox_defconfig | 1 + doc/README.commands | 2 +- include/console.h | 40 +++++++++++++- include/dm/test.h | 9 ---- include/test/suites.h | 1 + include/test/test.h | 11 ++++ include/test/ut.h | 59 +++++++++++++++++++++ test/cmd/Makefile | 3 +- test/cmd/mem.c | 20 +++++++ test/cmd/mem_search.c | 108 ++++++++++++++++++++++++++++---------- test/cmd_ut.c | 12 +++++ test/dm/acpi.c | 28 +++++----- test/dm/acpi_dp.c | 2 +- test/dm/acpigen.c | 18 +++---- test/dm/adc.c | 16 +++--- test/dm/audio.c | 2 +- test/dm/axi.c | 6 +-- test/dm/blk.c | 10 ++-- test/dm/board.c | 2 +- test/dm/bootcount.c | 2 +- test/dm/bus.c | 26 ++++----- test/dm/cache.c | 2 +- test/dm/clk.c | 6 +-- test/dm/clk_ccf.c | 2 +- test/dm/core.c | 30 +++++------ test/dm/cpu.c | 2 +- test/dm/devres.c | 12 ++--- test/dm/dma.c | 6 +-- test/dm/dsi_host.c | 2 +- test/dm/eth.c | 16 +++--- test/dm/fdtdec.c | 4 +- test/dm/firmware.c | 2 +- test/dm/gpio.c | 20 +++---- test/dm/hwspinlock.c | 2 +- test/dm/i2c.c | 16 +++--- test/dm/i2s.c | 2 +- test/dm/irq.c | 10 ++-- test/dm/led.c | 12 ++--- test/dm/mailbox.c | 2 +- test/dm/mdio.c | 2 +- test/dm/mdio_mux.c | 2 +- test/dm/misc.c | 2 +- test/dm/mmc.c | 4 +- test/dm/nop.c | 2 +- test/dm/ofnode.c | 12 ++--- test/dm/ofread.c | 2 +- test/dm/osd.c | 4 +- test/dm/p2sb.c | 2 +- test/dm/panel.c | 2 +- test/dm/pch.c | 4 +- test/dm/pci.c | 26 ++++----- test/dm/pci_ep.c | 2 +- test/dm/phy.c | 6 +-- test/dm/pmc.c | 2 +- test/dm/pmic.c | 10 ++-- test/dm/power-domain.c | 2 +- test/dm/pwm.c | 2 +- test/dm/ram.c | 2 +- test/dm/regmap.c | 10 ++-- test/dm/regulator.c | 20 +++---- test/dm/remoteproc.c | 4 +- test/dm/reset.c | 6 +-- test/dm/rng.c | 2 +- test/dm/rtc.c | 14 ++--- test/dm/serial.c | 2 +- test/dm/sf.c | 4 +- test/dm/simple-pm-bus.c | 2 +- test/dm/smem.c | 2 +- test/dm/soc.c | 2 +- test/dm/sound.c | 4 +- test/dm/spi.c | 4 +- test/dm/spmi.c | 6 +-- test/dm/syscon-reset.c | 2 +- test/dm/syscon.c | 6 +-- test/dm/sysreset.c | 8 +-- test/dm/tee.c | 2 +- test/dm/test-fdt.c | 46 ++++++++-------- test/dm/test-main.c | 10 ++-- test/dm/timer.c | 2 +- test/dm/usb.c | 12 ++--- test/dm/video.c | 26 ++++----- test/dm/virtio.c | 8 +-- test/dm/wdt.c | 2 +- test/lib/lmb.c | 18 +++---- test/ut.c | 22 ++++++++ 88 files changed, 556 insertions(+), 342 deletions(-) create mode 100644 test/cmd/mem.c