xref: /linux/drivers/soc/fsl/qbman/qman_test.c (revision 0cce284537fb42d9c28b9b31038ffc9b464555f5)
1*de775623SClaudiu Manoil /* Copyright 2008 - 2016 Freescale Semiconductor, Inc.
2*de775623SClaudiu Manoil  *
3*de775623SClaudiu Manoil  * Redistribution and use in source and binary forms, with or without
4*de775623SClaudiu Manoil  * modification, are permitted provided that the following conditions are met:
5*de775623SClaudiu Manoil  *     * Redistributions of source code must retain the above copyright
6*de775623SClaudiu Manoil  *	 notice, this list of conditions and the following disclaimer.
7*de775623SClaudiu Manoil  *     * Redistributions in binary form must reproduce the above copyright
8*de775623SClaudiu Manoil  *	 notice, this list of conditions and the following disclaimer in the
9*de775623SClaudiu Manoil  *	 documentation and/or other materials provided with the distribution.
10*de775623SClaudiu Manoil  *     * Neither the name of Freescale Semiconductor nor the
11*de775623SClaudiu Manoil  *	 names of its contributors may be used to endorse or promote products
12*de775623SClaudiu Manoil  *	 derived from this software without specific prior written permission.
13*de775623SClaudiu Manoil  *
14*de775623SClaudiu Manoil  * ALTERNATIVELY, this software may be distributed under the terms of the
15*de775623SClaudiu Manoil  * GNU General Public License ("GPL") as published by the Free Software
16*de775623SClaudiu Manoil  * Foundation, either version 2 of that License or (at your option) any
17*de775623SClaudiu Manoil  * later version.
18*de775623SClaudiu Manoil  *
19*de775623SClaudiu Manoil  * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
20*de775623SClaudiu Manoil  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21*de775623SClaudiu Manoil  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22*de775623SClaudiu Manoil  * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
23*de775623SClaudiu Manoil  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24*de775623SClaudiu Manoil  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25*de775623SClaudiu Manoil  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26*de775623SClaudiu Manoil  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27*de775623SClaudiu Manoil  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28*de775623SClaudiu Manoil  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29*de775623SClaudiu Manoil  */
30*de775623SClaudiu Manoil 
31*de775623SClaudiu Manoil #include "qman_test.h"
32*de775623SClaudiu Manoil 
33*de775623SClaudiu Manoil MODULE_AUTHOR("Geoff Thorpe");
34*de775623SClaudiu Manoil MODULE_LICENSE("Dual BSD/GPL");
35*de775623SClaudiu Manoil MODULE_DESCRIPTION("QMan testing");
36*de775623SClaudiu Manoil 
test_init(void)37*de775623SClaudiu Manoil static int test_init(void)
38*de775623SClaudiu Manoil {
39*de775623SClaudiu Manoil 	int loop = 1;
40*de775623SClaudiu Manoil 	int err = 0;
41*de775623SClaudiu Manoil 
42*de775623SClaudiu Manoil 	while (loop--) {
43*de775623SClaudiu Manoil #ifdef CONFIG_FSL_QMAN_TEST_STASH
44*de775623SClaudiu Manoil 		err = qman_test_stash();
45*de775623SClaudiu Manoil 		if (err)
46*de775623SClaudiu Manoil 			break;
47*de775623SClaudiu Manoil #endif
48*de775623SClaudiu Manoil #ifdef CONFIG_FSL_QMAN_TEST_API
49*de775623SClaudiu Manoil 		err = qman_test_api();
50*de775623SClaudiu Manoil 		if (err)
51*de775623SClaudiu Manoil 			break;
52*de775623SClaudiu Manoil #endif
53*de775623SClaudiu Manoil 	}
54*de775623SClaudiu Manoil 	return err;
55*de775623SClaudiu Manoil }
56*de775623SClaudiu Manoil 
test_exit(void)57*de775623SClaudiu Manoil static void test_exit(void)
58*de775623SClaudiu Manoil {
59*de775623SClaudiu Manoil }
60*de775623SClaudiu Manoil 
61*de775623SClaudiu Manoil module_init(test_init);
62*de775623SClaudiu Manoil module_exit(test_exit);
63