diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-09 13:04:39 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-09 13:06:51 +0200 |
commit | f57f513d9bb0f0b92e37c0d7f73cbb751f046df2 (patch) | |
tree | 7ed77bc4cceae72665e3150e5b10646fb9a1ba08 /c/src/lib/libbsp/powerpc/qoriq/startup/portal.c | |
parent | bsp/qoriq: Set M and G bits in ENTRY_DEV_CACHED() (diff) | |
download | rtems-f57f513d9bb0f0b92e37c0d7f73cbb751f046df2.tar.bz2 |
bsp/qoriq: Add portal clear functions
Diffstat (limited to 'c/src/lib/libbsp/powerpc/qoriq/startup/portal.c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/qoriq/startup/portal.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/portal.c b/c/src/lib/libbsp/powerpc/qoriq/startup/portal.c new file mode 100644 index 0000000000..f20eaf4d28 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/portal.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * 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. + */ + +#include <bsp/qoriq.h> + +#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT) + +#include <libcpu/powerpc-utility.h> + +void qoriq_clear_ce_portal(void *base, size_t size) +{ + size_t offset; + + for (offset = 0; offset < size; offset += 64) { + ppc_data_cache_block_clear_to_zero_2(base, offset); + ppc_data_cache_block_flush_2(base, offset); + } +} + +void qoriq_clear_ci_portal(void *base, size_t size) +{ + uint32_t zero; + size_t offset; + + zero = 0; + + for (offset = 0; offset < size; offset += 4) { + ppc_write_word(zero, (char *) base + offset); + } +} + +#endif |