source: rtems/bsps/arm/xilinx-zynqmp/start/bspstartmmu.c @ 77f9a1b

5
Last change on this file since 77f9a1b was 77f9a1b, checked in by Jeff Kubascik <jeff.kubascik@…>, on 04/10/19 at 23:38:55

bsp/xilinx-zynqmp: Implement Ultra96 target

Modifications to get xilinx-zynqmp BSP working on an Ultra96 board.

Update #3682.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (C) 2013 embedded brains GmbH
5 *
6 * Copyright (C) 2019 DornerWorks
7 *
8 * Written by Jeff Kubascik <jeff.kubascik@dornerworks.com>
9 *        and Josh Whitehead <josh.whitehead@dornerworks.com>
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#define ARM_CP15_TEXT_SECTION BSP_START_TEXT_SECTION
34
35#include <bsp.h>
36#include <bsp/start.h>
37#include <bsp/arm-cp15-start.h>
38#include <bsp/arm-a9mpcore-start.h>
39
40BSP_START_DATA_SECTION static const arm_cp15_start_section_config
41zynqmp_mmu_config_table[] = {
42  ARMV7_CP15_START_DEFAULT_SECTIONS,
43#if defined(RTEMS_SMP)
44  {
45    .begin = 0xffff0000U,
46    .end = 0xffffffffU,
47    .flags = ARMV7_MMU_DEVICE
48  },
49#endif
50  {
51    .begin = 0xf9000000U,
52    .end = 0xf9100000U,
53    .flags = ARMV7_MMU_DEVICE
54  }, {
55    .begin = 0xfd000000U,
56    .end = 0xffc00000U,
57    .flags = ARMV7_MMU_DEVICE
58  }
59};
60
61/*
62 * Make weak and let the user override.
63 */
64BSP_START_TEXT_SECTION void zynqmp_setup_mmu_and_cache(void) __attribute__ ((weak));
65
66BSP_START_TEXT_SECTION void zynqmp_setup_mmu_and_cache(void)
67{
68  uint32_t ctrl = arm_cp15_start_setup_mmu_and_cache(
69    ARM_CP15_CTRL_TRE | ARM_CP15_CTRL_A,
70    ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z
71  );
72
73  arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(
74    ctrl,
75    (uint32_t *) bsp_translation_table_base,
76    ARM_MMU_DEFAULT_CLIENT_DOMAIN,
77    &zynqmp_mmu_config_table[0],
78    RTEMS_ARRAY_SIZE(zynqmp_mmu_config_table)
79  );
80}
Note: See TracBrowser for help on using the repository browser.