summaryrefslogtreecommitdiffstats
path: root/bsps/powerpc/qoriq/start/portal.c
blob: f20eaf4d2856dce289b52fa84ee9f97fafb14ed8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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