diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-17 15:37:22 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-28 14:30:46 +0100 |
commit | 0f3f454fd504ea3ae0694ef54f55755c83299d2b (patch) | |
tree | 0ae931356dc07df401d5f0315658c2ac073eb0c8 | |
parent | ac16e3b9611297697ffd8f6d80166c2c05f745e5 (diff) |
validation: Check bootloader L2C settings
Update #4925.
-rw-r--r-- | spec/build/testsuites/validation/bsps/objsparcgr740.yml | 14 | ||||
-rw-r--r-- | spec/build/testsuites/validation/bsps/validation-bsp-0.yml | 2 | ||||
-rw-r--r-- | testsuites/validation/bsps/tc-sparc-gr740.c | 128 |
3 files changed, 144 insertions, 0 deletions
diff --git a/spec/build/testsuites/validation/bsps/objsparcgr740.yml b/spec/build/testsuites/validation/bsps/objsparcgr740.yml new file mode 100644 index 0000000000..6fc8f1efbe --- /dev/null +++ b/spec/build/testsuites/validation/bsps/objsparcgr740.yml @@ -0,0 +1,14 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: objects +cflags: [] +copyrights: +- Copyright (C) 2023 embedded brains GmbH & Co. KG +cppflags: [] +cxxflags: [] +enabled-by: sparc/gr740 +includes: [] +install: [] +links: [] +source: +- testsuites/validation/bsps/tc-sparc-gr740.c +type: build diff --git a/spec/build/testsuites/validation/bsps/validation-bsp-0.yml b/spec/build/testsuites/validation/bsps/validation-bsp-0.yml index af811b8502..45cf8a0420 100644 --- a/spec/build/testsuites/validation/bsps/validation-bsp-0.yml +++ b/spec/build/testsuites/validation/bsps/validation-bsp-0.yml @@ -15,6 +15,8 @@ links: uid: objgrlib - role: build-dependency uid: objsparcgr712rc +- role: build-dependency + uid: objsparcgr740 source: - testsuites/validation/bsps/ts-validation-bsp-0.c stlib: [] diff --git a/testsuites/validation/bsps/tc-sparc-gr740.c b/testsuites/validation/bsps/tc-sparc-gr740.c new file mode 100644 index 0000000000..1f73b39ef0 --- /dev/null +++ b/testsuites/validation/bsps/tc-sparc-gr740.c @@ -0,0 +1,128 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup BspSparcLeon3ValGr740 + */ + +/* + * Copyright (C) 2023 embedded brains GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file is part of the RTEMS quality process and was automatically + * generated. If you find something that needs to be fixed or + * worded better please post a report or patch to an RTEMS mailing list + * or raise a bug report: + * + * https://www.rtems.org/bugs.html + * + * For information on updating and regenerating please refer to the How-To + * section in the Software Requirements Engineering chapter of the + * RTEMS Software Engineering manual. The manual is provided as a part of + * a release. For development sources please refer to the online + * documentation at: + * + * https://docs.rtems.org + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <bsp.h> +#include <grlib/io.h> +#include <grlib/l2cache-regs.h> + +#include "tx-support.h" + +#include <rtems/test.h> + +/** + * @defgroup BspSparcLeon3ValGr740 spec:/bsp/sparc/leon3/val/gr740 + * + * @ingroup TestsuitesBspsValidationBsp0 + * + * @brief This test case collection provides validation test cases for the + * ``sparc/gr740`` BSP. + * + * This test case performs the following actions: + * + * - Validate the required L2C bootloader settings. + * + * - Check that the bootloader did set the L2CACCC.128WF register field. + * + * - Check that the bootloader did clear the L2CACCC.DBPF register field. + * + * - Check that the bootloader did set the L2CACCC.SPLIT register field. + * + * - Check that the bootloader did clear the L2CERR.COMP register field. + * + * @{ + */ + +/** + * @brief Validate the required L2C bootloader settings. + */ +static void BspSparcLeon3ValGr740_Action_0( void ) +{ + l2cache *regs; + uint32_t accc; + uint32_t err; + + regs = (l2cache *) LEON3_L2CACHE_BASE; + accc = grlib_load_32( ®s->l2caccc ); + err = grlib_load_32( ®s->l2cerr ); + + /* + * Check that the bootloader did set the L2CACCC.128WF register field. + */ + T_ne_u32( accc & L2CACHE_L2CACCC_128WF, 0 ); + + /* + * Check that the bootloader did clear the L2CACCC.DBPF register field. + */ + T_eq_u32( accc & L2CACHE_L2CACCC_DBPF, 0 ); + + /* + * Check that the bootloader did set the L2CACCC.SPLIT register field. + */ + T_ne_u32( accc & L2CACHE_L2CACCC_SPLIT, 0 ); + + /* + * Check that the bootloader did clear the L2CERR.COMP register field. + */ + T_eq_u32( err & L2CACHE_L2CERR_COMP, 0 ); +} + +/** + * @fn void T_case_body_BspSparcLeon3ValGr740( void ) + */ +T_TEST_CASE( BspSparcLeon3ValGr740 ) +{ + BspSparcLeon3ValGr740_Action_0(); +} + +/** @} */ |