source: rtems/bsps/bfin/shared/mmu.c @ e2bd1f6

5
Last change on this file since e2bd1f6 was e2bd1f6, checked in by Sebastian Huber <sebastian.huber@…>, on 03/21/18 at 15:38:43

bsp/bfin: Move libcpu content to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[30abd24]1/*  Blackfin MMU Support
[359e537]2 *
[30abd24]3 *  Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
4 *             written by Allan Hessenflow <allanh@kallisti.com>
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
[c499856]8 *  http://www.rtems.org/license/LICENSE.
[30abd24]9 */
[359e537]10
[30abd24]11
12#include <rtems.h>
13
[6ff3add]14#include <libcpu/memoryRegs.h>
[9dd2fdb9]15#include <libcpu/mmu.h>
[30abd24]16
17/* NOTE: see notes in mmu.h */
18
19void bfin_mmu_init(bfin_mmu_config_t *config) {
20  intptr_t addr;
21  intptr_t data;
22  int i;
23
24  addr = (intptr_t) ICPLB_ADDR0;
25  data = (intptr_t) ICPLB_DATA0;
26  for (i = 0; i < sizeof(config->instruction) / sizeof(config->instruction[0]);
27       i++) {
28    *(uint32_t volatile *) addr = (uint32_t) config->instruction[i].address;
29    addr += ICPLB_ADDR_PITCH;
30    *(uint32_t volatile *) data = config->instruction[i].flags;
31    data += ICPLB_DATA_PITCH;
32  }
[6ff3add]33  *(uint32_t volatile *) IMEM_CONTROL |= IMEM_CONTROL_ENICPLB;
[30abd24]34  addr = (intptr_t) DCPLB_ADDR0;
35  data = (intptr_t) DCPLB_DATA0;
36  for (i = 0; i < sizeof(config->data) / sizeof(config->data[0]); i++) {
37    *(uint32_t volatile *) addr = (uint32_t) config->data[i].address;
38    addr += DCPLB_ADDR_PITCH;
39    *(uint32_t volatile *) data = config->data[i].flags;
40    data += DCPLB_DATA_PITCH;
41  }
[6ff3add]42  *(uint32_t volatile *) DMEM_CONTROL |= DMEM_CONTROL_ENDCPLB;
[30abd24]43}
44
Note: See TracBrowser for help on using the repository browser.