Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7625BEB64DA for ; Sun, 16 Jul 2023 03:39:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A92086354; Sun, 16 Jul 2023 05:39:48 +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="j4ArTIxu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7923D8630D; Sun, 16 Jul 2023 05:39:46 +0200 (CEST) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 26FF486290 for ; Sun, 16 Jul 2023 05:39:44 +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-il1-x136.google.com with SMTP id e9e14a558f8ab-3487d75e4c5so3491205ab.0 for ; Sat, 15 Jul 2023 20:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689478782; x=1692070782; 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=alo4Ocwjg9PiVD18hTilEkQbP3vkZIFQ/dPD9YBNHX8=; b=j4ArTIxuWzwxtSaXGLtPCIk87YkxXHncLOF/ffI5ATYA/T/K4qe/Yi+z0/ESLcXR58 Xiu1xEBQxRDip8Q+GLp4voWdcrpU41R+qFu5YUtI6Au0fcWn101txwLJcCkjK5/OtOPp vZFJ6WTK7t8OCakpSRsAiSyz0fQCRfKpxpgAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689478782; x=1692070782; 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=alo4Ocwjg9PiVD18hTilEkQbP3vkZIFQ/dPD9YBNHX8=; b=HTAlsgC0WzQv5KGpZcIaOqRNLzowkwvJ66DoML1a5+6z6WEcN/7sNkFfseUGUY4kxn ClC8+xvcgXw20IqYQXoqK3TsIdjSMO7Yg1ernlnb9l9v8RnD/uRQWySJ+sSKjWaoZWbH 2ByX6ow5hGNaaqDma+RFW2AdWli40ohr6Ev8p42Ykk6S02vG6coSUF5MyhthstGYLsCH 1quEUogVYinxQJgBn8wW2F+2weW+9vf+Tyr/QhAzC5RAummhVk55MshyB4CP9+/R7txe QzCXaCHrdi4cXljGETA9v017wN+P9VSKYzoCpJK5jOuShMONs00mfUgc2iSytQX13UIa /xAQ== X-Gm-Message-State: ABy/qLbGg7VDN0jWc9t6AIpKRsVSAsDJ3pHCpR5/PkNZy5EVlPVYgr2l z/ThCDUiGVB14axNKtzTy4nNChrR/Oei2n7ghKU= X-Google-Smtp-Source: APBJJlG+P68Ihp+FYCl1VqWDqYjJphj5Bgrmncy20DhIfiKafqDNtsoZ3qJKPjnTVcl8QUpOR69SYw== X-Received: by 2002:a92:cf50:0:b0:345:d977:5057 with SMTP id c16-20020a92cf50000000b00345d9775057mr8372083ilr.4.1689478782731; Sat, 15 Jul 2023 20:39:42 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x24-20020a029718000000b0042aec33bc26sm3714493jai.18.2023.07.15.20.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 20:39:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Nikhil M Jain , Heinrich Schuchardt , Bin Meng , Simon Glass Subject: [PATCH v5 01/46] bdinfo: Add tests for serial settings Date: Sat, 15 Jul 2023 21:38:34 -0600 Message-ID: <20230716033929.253357-2-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716033929.253357-1-sjg@chromium.org> References: <20230716033929.253357-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Since the original patch was written, tests have been added for the 'bdinfo' command. Add the missing pieces so that the tests pass. Signed-off-by: Simon Glass Fixes: 68130503fbd ("bdinfo: Show information about the serial port") --- (no changes since v1) test/cmd/bdinfo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c index cddf1a46d491..6480393fd5d8 100644 --- a/test/cmd/bdinfo.c +++ b/test/cmd/bdinfo.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -191,6 +192,19 @@ static int bdinfo_test_move(struct unit_test_state *uts) ut_assert_nextline("devicetree = %s", fdtdec_get_srcname()); } + if (IS_ENABLED(CONFIG_DM_SERIAL)) { + struct serial_device_info info; + + ut_assertnonnull(gd->cur_serial_dev); + ut_assertok(serial_getinfo(gd->cur_serial_dev, &info)); + + ut_assertok(test_num_l(uts, "serial addr", info.addr)); + ut_assertok(test_num_l(uts, " width", info.reg_width)); + ut_assertok(test_num_l(uts, " shift", info.reg_shift)); + ut_assertok(test_num_l(uts, " offset", info.reg_offset)); + ut_assertok(test_num_l(uts, " clock", info.clock)); + } + ut_assertok(ut_check_console_end(uts)); return 0; -- 2.41.0.455.g037347b96a-goog