summaryrefslogtreecommitdiffstats
path: root/bsps/arm/tms570/include/bsp/tms570_selftest_parity.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /bsps/arm/tms570/include/bsp/tms570_selftest_parity.h
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'bsps/arm/tms570/include/bsp/tms570_selftest_parity.h')
-rw-r--r--bsps/arm/tms570/include/bsp/tms570_selftest_parity.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/bsps/arm/tms570/include/bsp/tms570_selftest_parity.h b/bsps/arm/tms570/include/bsp/tms570_selftest_parity.h
new file mode 100644
index 0000000000..a1c3ec7b3e
--- /dev/null
+++ b/bsps/arm/tms570/include/bsp/tms570_selftest_parity.h
@@ -0,0 +1,110 @@
+/**
+ * @file tms570_selftest_parity.h
+ *
+ * @ingroup tms570
+ *
+ * @brief Check of module parity based protection logic to work.
+ */
+/*
+ * Copyright (c) 2016 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+ *
+ * Czech Technical University in Prague
+ * Zikova 1903/4
+ * 166 36 Praha 6
+ * Czech Republic
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef LIBBSP_ARM_TMS570_SELFTEST_PARITY_H
+#define LIBBSP_ARM_TMS570_SELFTEST_PARITY_H
+
+#include <stdint.h>
+
+/**
+ * The magic number used to switch most of the peripherals
+ * into parity protection test mode
+ */
+#define TMS570_SELFTEST_PAR_CR_KEY 0xA
+
+typedef struct tms570_selftest_par_desc tms570_selftest_par_desc_t;
+
+typedef void tms570_selftest_par_fnc_t( const tms570_selftest_par_desc_t *desc );
+
+/**
+ * Decriptor specifying registers addresses and values used to test
+ * that parity protection is working for given hardware
+ * module/peripheral. It is used during initial chip self-tests.
+ */
+struct tms570_selftest_par_desc {
+ unsigned char esm_prim_grp; /**< ESM primary signalling group number. */
+ unsigned char esm_prim_chan; /**< ESM primary signalling channel number. */
+ unsigned char esm_sec_grp; /**< ESM optional/alternative signalling group. */
+ unsigned char esm_sec_chan; /**< ESM optional/alternative signalling channel. */
+ int fail_code; /**< Error code reported to
+ bsp_selftest_fail_notification() in the case of the test failure. */
+ volatile uint32_t *ram_loc; /**< Address of memory protected by parity. */
+ volatile uint32_t *par_loc; /**< Address of mapping of parity bits into CPU
+ * address space. */
+ uint32_t par_xor; /**< Bitmask used to alter parity to cause
+ * intentional parity failure. */
+ volatile uint32_t *par_cr_reg; /**< Address of module parity test control register. */
+ uint32_t par_cr_test; /**< Mask of bit which cause switch to a test mode. */
+ volatile uint32_t *par_st_reg; /**< Optional module parity status register which. */
+ uint32_t par_st_clear; /**< Optional value which is written to status register
+ * to clear error. */
+ tms570_selftest_par_fnc_t *partest_fnc; /**< Function which specialized for given kind
+ * of peripheral/module mechanism testing. */
+ volatile void *fnc_data; /**< Pointer to the base of tested peripheral registers.
+ * It is required by some test functions (CAN and MibSPI) */
+};
+
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_het1_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_htu1_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_het2_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_htu2_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_adc1_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_adc2_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_can1_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_can2_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_can3_desc;
+extern const tms570_selftest_par_desc_t
+ tms570_selftest_par_vim_desc;
+const tms570_selftest_par_desc_t
+ tms570_selftest_par_dma_desc;
+const tms570_selftest_par_desc_t
+ tms570_selftest_par_spi1_desc;
+const tms570_selftest_par_desc_t
+ tms570_selftest_par_spi3_desc;
+const tms570_selftest_par_desc_t
+ tms570_selftest_par_spi5_desc;
+
+extern const tms570_selftest_par_desc_t *const
+tms570_selftest_par_list[];
+
+extern const int tms570_selftest_par_list_size;
+
+void tms570_selftest_par_check_std( const tms570_selftest_par_desc_t *desc );
+
+void tms570_selftest_par_check_can( const tms570_selftest_par_desc_t *desc );
+
+void tms570_selftest_par_check_mibspi( const tms570_selftest_par_desc_t *desc );
+
+void tms570_selftest_par_run(
+ const tms570_selftest_par_desc_t *
+ const *desc_arr,
+ int desc_cnt
+);
+
+#endif /* LIBBSP_ARM_TMS570_SELFTEST_PARITY_H */