From patchwork Thu Sep 17 20:42:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 53855 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 5ADA122A0D for ; Thu, 17 Sep 2015 20:43:40 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf10077969lbb.3 for ; Thu, 17 Sep 2015 13:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=QjVMi7GFkfqIMF6wI2VsbTVwilVQQDgm6ZOYmLqjN+g=; b=XXbhJrx3dY2w2booh4JU94LrlqyPpl2S3tCHYbdiJaElDsBVDl8JSAB+Ur59x1UoWa YYfFE7cTwF0MqKB8/FWpw0OCZkWmu9XVreK+EkLgmDYwQpTbkI2WIQHQ6f4NYlVfzLSQ 29mF4/FiP3Ou2z9adG2YBl+t5qW0DX0TWQ3Gyava38/pUoiYgPfzpnG/OTtHMs7vG+ra 0zciHNUF67BBP6LbZV9GOoe+WU6ORwgiJ/CWpxQC9pDfTYZGxma18rhsjU32iLfUfzbp 5BP4OeBKN5J0299XpYQn8O6ipy5RsIkpdEPhJDdH4U8It7AQGEN06xGFMPy2+ZnYV/ln X/Jg== X-Gm-Message-State: ALoCoQnKdE79QL6WvRMZVtuMtRz8khNBu1z5bPRhV/wjZln8mpp6trnut+z5A3hnrvIrESbhN4Lp X-Received: by 10.180.89.104 with SMTP id bn8mr3494311wib.4.1442522619305; Thu, 17 Sep 2015 13:43:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls140964laf.78.gmail; Thu, 17 Sep 2015 13:43:39 -0700 (PDT) X-Received: by 10.152.3.196 with SMTP id e4mr1405127lae.68.1442522619017; Thu, 17 Sep 2015 13:43:39 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id x5si3451624lbb.5.2015.09.17.13.43.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 13:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbvu2 with SMTP id vu2so15633914lbb.0 for ; Thu, 17 Sep 2015 13:43:38 -0700 (PDT) X-Received: by 10.112.51.142 with SMTP id k14mr1295666lbo.76.1442522618904; Thu, 17 Sep 2015 13:43:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp3279877lbq; Thu, 17 Sep 2015 13:43:38 -0700 (PDT) X-Received: by 10.180.230.197 with SMTP id ta5mr32983749wic.26.1442522618237; Thu, 17 Sep 2015 13:43:38 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id fz6si6458762wic.116.2015.09.17.13.43.37; Thu, 17 Sep 2015 13:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75BE04B873; Thu, 17 Sep 2015 22:43:29 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zYARoRbpFmQo; Thu, 17 Sep 2015 22:43:29 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A14CF4B86C; Thu, 17 Sep 2015 22:43:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA6B54B80A for ; Thu, 17 Sep 2015 22:42:56 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WNoKUojkkx9c for ; Thu, 17 Sep 2015 22:42:56 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 43D574B80E for ; Thu, 17 Sep 2015 22:42:52 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HKgnAx026985; Thu, 17 Sep 2015 15:42:50 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HKgn8c006699; Thu, 17 Sep 2015 15:42:49 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 17 Sep 2015 15:42:49 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HKgnIX032522; Thu, 17 Sep 2015 15:42:49 -0500 From: Nishanth Menon To: Date: Thu, 17 Sep 2015 15:42:42 -0500 Message-ID: <1442522562-20764-5-git-send-email-nm@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442522562-20764-1-git-send-email-nm@ti.com> References: <1442522562-20764-1-git-send-email-nm@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH V3 4/4] test: Add basic tests for remoteproc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nm@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Use the sandbox environment for the basic tests. Reviewed-by: Simon Glass Tested-by: Simon Glass Signed-off-by: Nishanth Menon Acked-by: Simon Glass --- Changes since V1: - Comment cleanup (dropped '..') - Picked up Simon's Tested and Reviewed tags from V2 V2: https://patchwork.ozlabs.org/patch/511749/ V1: did not exist test/dm/Makefile | 1 + test/dm/remoteproc.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 test/dm/remoteproc.c diff --git a/test/dm/Makefile b/test/dm/Makefile index eda964318593..7b3626cb3294 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -24,6 +24,7 @@ obj-$(CONFIG_DM_MMC) += mmc.o obj-$(CONFIG_DM_PCI) += pci.o obj-$(CONFIG_RAM) += ram.o obj-y += regmap.o +obj-$(CONFIG_REMOTEPROC) += remoteproc.o obj-$(CONFIG_RESET) += reset.o obj-$(CONFIG_DM_RTC) += rtc.o obj-$(CONFIG_DM_SPI_FLASH) += sf.o diff --git a/test/dm/remoteproc.c b/test/dm/remoteproc.c new file mode 100644 index 000000000000..0e5f3305a252 --- /dev/null +++ b/test/dm/remoteproc.c @@ -0,0 +1,67 @@ +/* + * (C) Copyright 2015 + * Texas Instruments Incorporated - http://www.ti.com/ + * SPDX-License-Identifier: GPL-2.0+ + */ +#include +#include +#include +#include +#include +#include +/** + * dm_test_remoteproc_base() - test the operations after initializations + * @uts: unit test state + * + * Return: 0 if test passed, else error + */ +static int dm_test_remoteproc_base(struct unit_test_state *uts) +{ + if (!rproc_is_initialized()) + ut_assertok(rproc_init()); + + /* Ensure we are initialized */ + ut_asserteq(true, rproc_is_initialized()); + + + /* platform data device 1 */ + ut_assertok(rproc_stop(0)); + ut_assertok(rproc_reset(0)); + /* -> invalid attempt tests */ + ut_asserteq(-EINVAL, rproc_start(0)); + ut_asserteq(-EINVAL, rproc_ping(0)); + /* Valid tests */ + ut_assertok(rproc_load(0, 1, 0)); + ut_assertok(rproc_start(0)); + ut_assertok(rproc_is_running(0)); + ut_assertok(rproc_ping(0)); + ut_assertok(rproc_reset(0)); + ut_assertok(rproc_stop(0)); + + /* dt device device 1 */ + ut_assertok(rproc_stop(1)); + ut_assertok(rproc_reset(1)); + ut_assertok(rproc_load(1, 1, 0)); + ut_assertok(rproc_start(1)); + ut_assertok(rproc_is_running(1)); + ut_assertok(rproc_ping(1)); + ut_assertok(rproc_reset(1)); + ut_assertok(rproc_stop(1)); + + /* dt device device 2 */ + ut_assertok(rproc_stop(0)); + ut_assertok(rproc_reset(0)); + /* -> invalid attempt tests */ + ut_asserteq(-EINVAL, rproc_start(0)); + ut_asserteq(-EINVAL, rproc_ping(0)); + /* Valid tests */ + ut_assertok(rproc_load(2, 1, 0)); + ut_assertok(rproc_start(2)); + ut_assertok(rproc_is_running(2)); + ut_assertok(rproc_ping(2)); + ut_assertok(rproc_reset(2)); + ut_assertok(rproc_stop(2)); + + return 0; +} +DM_TEST(dm_test_remoteproc_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);