summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/beagle/startup
diff options
context:
space:
mode:
authorBen Gras <beng@shrike-systems.com>2014-11-03 19:53:40 +0100
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-03 14:19:47 -0600
commit53dd6d6130c870d12351d8ca75e4ac9dcc834c86 (patch)
tree022804b833f8fdb47a15ab8940743f91726776b5 /c/src/lib/libbsp/arm/beagle/startup
parentAdded BeagleBoard BSP (diff)
downloadrtems-53dd6d6130c870d12351d8ca75e4ac9dcc834c86.tar.bz2
BSP for several Beagle products
Specifically the beagleboard, beagleboard xM, beaglebone, beaglebone black. More info on these targets: http://www.beagleboard.org/ This commit forms a basic BSP by combining Claas's work with . new clock and irq code and definitions for beagle targets (beagleboard and beaglebones), mostly reused from the Minix codebase, thus making irqs, ticks and non-polled console mode work too . new timer code for ns timing with high timer resolution, 24MHz on the AM335X and 13MHz on the DM37XX . select the console uart based on target at configure time . removing all the lpc32xx-specific macros and code and other unused code and definitions that the beagle bsp was based on . re-using some standard functions instead of lpc32xx versions . fixed some whitespace problem in preinstall.am . fixed some compile warnings . configure MMU: set 1MB sections directly in the TTBR, just to show the difference between cacheable RAM and non-cacheable device memory and invalid ranges; this lets us turn on caches and not rely on boot loader MMU configuration. Verified to work when MMU is initially either on or off when RTEMS gets control. Thanks for testing, commentary, improvements and fixes to Chris Johns, Brandon Matthews, Matt Carberry, Romain Bornet, AZ technology and others. Signed-Off-By: Ben Gras <beng@shrike-systems.com>
Diffstat (limited to 'c/src/lib/libbsp/arm/beagle/startup')
-rw-r--r--c/src/lib/libbsp/arm/beagle/startup/bspreset.c62
-rw-r--r--c/src/lib/libbsp/arm/beagle/startup/bspstart.c30
-rw-r--r--c/src/lib/libbsp/arm/beagle/startup/bspstarthooks.c360
-rw-r--r--c/src/lib/libbsp/arm/beagle/startup/bspstartmmu.c58
-rw-r--r--c/src/lib/libbsp/arm/beagle/startup/linkcmds.beagle56
5 files changed, 136 insertions, 430 deletions
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspreset.c b/c/src/lib/libbsp/arm/beagle/startup/bspreset.c
index d937a18abd..5865b7badf 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspreset.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspreset.c
@@ -1,48 +1,42 @@
-/**
- * @file
- *
- * @ingroup beagle
- *
- * @brief Reset code.
- */
-
/*
- * Copyright (c) 2012 Claas Ziemke. All rights reserved.
- *
- * Claas Ziemke
- * Kernerstrasse 11
- * 70182 Stuttgart
- * Germany
- * <claas.ziemke@gmx.net>
+ * Copyright (c) 2014 Ben Gras <beng@shrike-systems.com>. All rights reserved.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
+ * http://www.rtems.org/license/LICENSE.
*/
-#include <stdbool.h>
-
-#include <bspopts.h>
+#include <bsp.h>
#include <bsp/bootcard.h>
-#include <bsp/beagle.h>
-static void watchdog_reset(void)
-{
- #ifdef BEAGLE_ENABLE_WATCHDOG_RESET
- //BEAGLE_TIMCLK_CTRL |= TIMCLK_CTRL_WDT;
- //beagle.wdt.mctrl |= WDTTIM_MCTRL_M_RES1 | WDTTIM_MCTRL_M_RES2;
- //beagle.wdt.emr = WDTTIM_EMR_MATCH_CTRL_SET(beagle.wdt.emr, 0x2);
- //beagle.wdt.ctrl |= WDTTIM_CTRL_COUNT_ENAB;
- //beagle.wdt.match0 = 1;
- //beagle.wdt.counter = 0;
- #endif
-}
+#define AM335X_CM_BASE 0x44E00000
+#define AM335X_CM_SIZE 0x1000
+
+#define AM335X_PRM_DEVICE_OFFSET 0xf00
+#define AM335X_PRM_RSTCTRL_REG 0x00
+#define AM335X_RST_GLOBAL_WARM_SW_BIT 0
-void bsp_reset( void)
+#define DM37XX_CM_BASE 0x48307000
+#define DM37XX_CM_SIZE 0x1000
+#define DM37XX_PRM_RSTCTRL_REG 0x250
+#define DM37XX_RST_DPLL3_BIT 2
+
+void bsp_reset(void)
{
- watchdog_reset();
+#if IS_DM3730
+ static uint32_t reset_base = DM37XX_CM_BASE;
+ while (true) {
+ mmio_set((reset_base + DM37XX_PRM_RSTCTRL_REG),
+ (1 << DM37XX_RST_DPLL3_BIT));
+ }
+#endif
+#if IS_AM335X
+ static uint32_t reset_base = AM335X_CM_BASE;
while (true) {
- /* Do nothing */
+ mmio_set((reset_base + AM335X_PRM_DEVICE_OFFSET +
+ AM335X_PRM_RSTCTRL_REG),
+ (1 << AM335X_RST_GLOBAL_WARM_SW_BIT));
}
+#endif
}
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
index 9cdd04a8fb..b1565640c6 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstart.c
@@ -1,33 +1,29 @@
-/**
- * @file
- *
- * @ingroup beagle
- *
- * @brief Startup code.
- */
-
/*
- * Copyright (c) 2012 Claas Ziemke. All rights reserved.
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
*
- * Claas Ziemke
- * Kernerstrasse 11
- * 70182 Stuttgart
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
* Germany
- * <claas.ziemke@gmx.net>
+ * <info@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.com/license/LICENSE.
+ * http://www.rtems.org/license/LICENSE.
*/
#include <bsp.h>
#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
-#include <bsp/irq.h>
-#include <bsp/linker-symbols.h>
-#include <bsp/beagle.h>
void bsp_start(void)
{
+#if IS_DM3730
+ const char* type = "dm3730-based";
+#endif
+#if IS_AM335X
+ const char* type = "am335x-based";
+#endif
bsp_interrupt_initialize();
+ printk("\nRTEMS Beagleboard: %s\n", type);
}
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/beagle/startup/bspstarthooks.c
index 4538b0c2d9..2efa3042a8 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/bspstarthooks.c
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstarthooks.c
@@ -1,366 +1,32 @@
-/**
- * @file
- *
- * @ingroup beagle
- *
- * @brief Startup code.
- */
-
/*
- * Copyright (c) 2012 Claas Ziemke. All rights reserved.
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
*
- * Claas Ziemke
- * Kernerstrasse 11
- * 70182 Stuttgart
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
* Germany
- * <claas.ziemke@gmx.net>
+ * <info@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.com/license/LICENSE.
+ * http://www.rtems.org/license/LICENSE.
*/
#include <bsp.h>
#include <bsp/start.h>
-#include <bsp/beagle.h>
-#include <bsp/linker-symbols.h>
-#include <bsp/uart-output-char.h>
-#include <libcpu/arm-cp15.h>
-
-#ifdef BEAGLE_DISABLE_READ_WRITE_DATA_CACHE
- #define BEAGLE_MMU_READ_WRITE_DATA BEAGLE_MMU_READ_WRITE
-#else
- #define BEAGLE_MMU_READ_WRITE_DATA BEAGLE_MMU_READ_WRITE_CACHED
-#endif
-
-#ifdef BEAGLE_DISABLE_READ_ONLY_PROTECTION
- #define BEAGLE_MMU_READ_ONLY_DATA BEAGLE_MMU_READ_WRITE_CACHED
- #define BEAGLE_MMU_CODE BEAGLE_MMU_READ_WRITE_CACHED
-#else
- #define BEAGLE_MMU_READ_ONLY_DATA BEAGLE_MMU_READ_ONLY_CACHED
- #define BEAGLE_MMU_CODE BEAGLE_MMU_READ_ONLY_CACHED
-#endif
-
-//LINKER_SYMBOL(beagle_translation_table_base);
-
-static BSP_START_TEXT_SECTION void clear_bss(void)
-{
- const int *end = (const int *) bsp_section_bss_end;
- int *out = (int *) bsp_section_bss_begin;
-
- /* Clear BSS */
- while (out != end) {
- *out = 0;
- ++out;
- }
-}
-
-/*#ifndef BEAGLE_DISABLE_MMU
- typedef struct {
- uint32_t begin;
- uint32_t end;
- uint32_t flags;
- } beagle_mmu_config;
-
- static const BSP_START_DATA_SECTION beagle_mmu_config
- beagle_mmu_config_table [] = {
- {
- .begin = (uint32_t) bsp_section_fast_text_begin,
- .end = (uint32_t) bsp_section_fast_text_end,
- .flags = BEAGLE_MMU_CODE
- }, {
- .begin = (uint32_t) bsp_section_fast_data_begin,
- .end = (uint32_t) bsp_section_fast_data_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
-#ifdef BEAGLE_SCRATCH_AREA_SIZE
- }, {
- .begin = (uint32_t) &beagle_scratch_area [0],
- .end = (uint32_t) &beagle_scratch_area [BEAGLE_SCRATCH_AREA_SIZE],
- .flags = BEAGLE_MMU_READ_ONLY_DATA
-#endif
- }, {
- .begin = (uint32_t) bsp_section_start_begin,
- .end = (uint32_t) bsp_section_start_end,
- .flags = BEAGLE_MMU_CODE
- }, {
- .begin = (uint32_t) bsp_section_vector_begin,
- .end = (uint32_t) bsp_section_vector_end,
- .flags = BEAGLE_MMU_READ_WRITE_CACHED
- }, {
- .begin = (uint32_t) bsp_section_text_begin,
- .end = (uint32_t) bsp_section_text_end,
- .flags = BEAGLE_MMU_CODE
- }, {
- .begin = (uint32_t) bsp_section_rodata_begin,
- .end = (uint32_t) bsp_section_rodata_end,
- .flags = BEAGLE_MMU_READ_ONLY_DATA
- }, {
- .begin = (uint32_t) bsp_section_data_begin,
- .end = (uint32_t) bsp_section_data_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
- }, {
- .begin = (uint32_t) bsp_section_bss_begin,
- .end = (uint32_t) bsp_section_bss_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
- }, {
- .begin = (uint32_t) bsp_section_work_begin,
- .end = (uint32_t) bsp_section_work_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
- }, {
- .begin = (uint32_t) bsp_section_stack_begin,
- .end = (uint32_t) bsp_section_stack_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
- }, {
- .begin = 0x0U,
- .end = 0x100000U,
- .flags = BEAGLE_MMU_READ_ONLY_CACHED
- }, {
- .begin = 0x20000000U,
- .end = 0x200c0000U,
- .flags = BEAGLE_MMU_READ_WRITE
- }, {
- .begin = 0x30000000U,
- .end = 0x32000000U,
- .flags = BEAGLE_MMU_READ_WRITE
- }, {
- .begin = 0x40000000U,
- .end = 0x40100000U,
- .flags = BEAGLE_MMU_READ_WRITE
- }, {
- .begin = (uint32_t) beagle_magic_zero_begin,
- .end = (uint32_t) beagle_magic_zero_end,
- .flags = BEAGLE_MMU_READ_WRITE_DATA
- }
- };
-
- static BSP_START_TEXT_SECTION void set_translation_table_entries(
- uint32_t *ttb,
- const beagle_mmu_config *config
- )
- {
- uint32_t i = ARM_MMU_SECT_GET_INDEX(config->begin);
- uint32_t iend =
- ARM_MMU_SECT_GET_INDEX(ARM_MMU_SECT_MVA_ALIGN_UP(config->end));
-
- if (config->begin != config->end) {
- while (i < iend) {
- ttb [i] = (i << ARM_MMU_SECT_BASE_SHIFT) | config->flags;
- ++i;
- }
- }
- }
-
- static BSP_START_TEXT_SECTION void
- setup_translation_table_and_enable_mmu(uint32_t ctrl)
- {
- uint32_t const dac =
- ARM_CP15_DAC_DOMAIN(BEAGLE_MMU_CLIENT_DOMAIN, ARM_CP15_DAC_CLIENT);
- uint32_t *const ttb = (uint32_t *) beagle_translation_table_base;
- size_t const config_entry_count =
- sizeof(beagle_mmu_config_table) / sizeof(beagle_mmu_config_table [0]);
- size_t i = 0;
-
- arm_cp15_set_domain_access_control(dac);
- arm_cp15_set_translation_table_base(ttb);
-
- // Initialize translation table with invalid entries
- for (i = 0; i < ARM_MMU_TRANSLATION_TABLE_ENTRY_COUNT; ++i) {
- ttb [i] = 0;
- }
-
- for (i = 0; i < config_entry_count; ++i) {
- set_translation_table_entries(ttb, &beagle_mmu_config_table [i]);
- }
-
- // Enable MMU and cache
- ctrl |= ARM_CP15_CTRL_I | ARM_CP15_CTRL_C | ARM_CP15_CTRL_M;
- arm_cp15_set_control(ctrl);
- }
-#endif*/
-
-/*static BSP_START_TEXT_SECTION void setup_mmu_and_cache(void)
-{
- uint32_t ctrl = 0;
-
- // Disable MMU and cache, basic settings
- ctrl = arm_cp15_get_control();
- ctrl &= ~(ARM_CP15_CTRL_I | ARM_CP15_CTRL_R | ARM_CP15_CTRL_C
- | ARM_CP15_CTRL_V | ARM_CP15_CTRL_M);
- ctrl |= ARM_CP15_CTRL_S | ARM_CP15_CTRL_A;
- arm_cp15_set_control(ctrl);
-
- arm_cp15_cache_invalidate();
- arm_cp15_tlb_invalidate();
-
- #ifndef BEAGLE_DISABLE_MMU
- //setup_translation_table_and_enable_mmu(ctrl);
- #endif
-}*/
-
-/*BSP_START_TEXT_SECTION bool beagle_start_pll_setup(
- uint32_t hclkpll_ctrl,
- uint32_t hclkdiv_ctrl,
- bool force
-)
-{
- uint32_t pwr_ctrl = BEAGLE_PWR_CTRL;
- bool settings_ok =
- ((BEAGLE_HCLKPLL_CTRL ^ hclkpll_ctrl) & BSP_MSK32(1, 16)) == 0
- && ((BEAGLE_HCLKDIV_CTRL ^ hclkdiv_ctrl) & BSP_MSK32(0, 8)) == 0;
-
- if ((pwr_ctrl & PWR_NORMAL_RUN_MODE) == 0 || (!settings_ok && force)) {
- // Disable HCLK PLL output
- BEAGLE_PWR_CTRL = pwr_ctrl & ~PWR_NORMAL_RUN_MODE;
-
- // Configure HCLK PLL
- BEAGLE_HCLKPLL_CTRL = hclkpll_ctrl;
- while ((BEAGLE_HCLKPLL_CTRL & HCLK_PLL_LOCK) == 0) {
- // Wait
- }
-
- // Setup HCLK divider
- BEAGLE_HCLKDIV_CTRL = hclkdiv_ctrl;
+#include <bsp/arm-cp15-start.h>
+#include <bsp/arm-a8core-start.h>
- // Enable HCLK PLL output
- BEAGLE_PWR_CTRL = pwr_ctrl | PWR_NORMAL_RUN_MODE;
- }
-
- return settings_ok;
-}*/
-
-#if BEAGLE_OSCILLATOR_MAIN != 13000000U
- #error "unexpected main oscillator frequency"
-#endif
-
-/*static BSP_START_TEXT_SECTION void setup_pll(void)
-{
- uint32_t hclkpll_ctrl = BEAGLE_HCLKPLL_CTRL_INIT_VALUE;
- uint32_t hclkdiv_ctrl = BEAGLE_HCLKDIV_CTRL_INIT_VALUE;
-
- beagle_start_pll_setup(hclkpll_ctrl, hclkdiv_ctrl, false);
-}*/
+#include <bsp/uart-output-char.h>
BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
{
- //setup_pll();
- //setup_mmu_and_cache();
-}
-
-/*static BSP_START_TEXT_SECTION void stop_dma_activities(void)
-{
- #ifdef BEAGLE_STOP_GPDMA
- BEAGLE_DO_STOP_GPDMA;
- #endif
-
- #ifdef BEAGLE_STOP_ETHERNET
- BEAGLE_DO_STOP_ETHERNET;
- #endif
-
- #ifdef BEAGLE_STOP_USB
- BEAGLE_DO_STOP_USB;
- #endif
-}*/
-
-static BSP_START_TEXT_SECTION void setup_uarts(void)
-{
- uint32_t uartclk_ctrl = 0;
-
- #ifdef BEAGLE_CONFIG_U3CLK
- uartclk_ctrl |= 1U << 0;
- BEAGLE_U3CLK = BEAGLE_CONFIG_U3CLK;
- #endif
- #ifdef BEAGLE_CONFIG_U4CLK
- uartclk_ctrl |= 1U << 1;
- BEAGLE_U4CLK = BEAGLE_CONFIG_U4CLK;
- #endif
- #ifdef BEAGLE_CONFIG_U5CLK
- uartclk_ctrl |= 1U << 2;
- BEAGLE_U5CLK = BEAGLE_CONFIG_U5CLK;
- #endif
- #ifdef BEAGLE_CONFIG_U6CLK
- uartclk_ctrl |= 1U << 3;
- BEAGLE_U6CLK = BEAGLE_CONFIG_U6CLK;
- #endif
-
- #ifdef BEAGLE_CONFIG_UART_CLKMODE
- BEAGLE_UART_CLKMODE = BEAGLE_CONFIG_UART_CLKMODE;
- #endif
-
- BEAGLE_UARTCLK_CTRL = uartclk_ctrl;
- BEAGLE_UART_CTRL = 0x0;
- BEAGLE_UART_LOOP = 0x0;
-
- #ifdef BEAGLE_CONFIG_U5CLK
- // Clock is already set in BEAGLE_U5CLK
- BSP_CONSOLE_UART_INIT(0x01);
- #endif
}
-/*static BSP_START_TEXT_SECTION void setup_timer(void)
-{
- volatile beagle_timer *timer = BEAGLE_STANDARD_TIMER;
-
- BEAGLE_TIMCLK_CTRL1 = (1U << 2) | (1U << 3);
-
- timer->tcr = BEAGLE_TIMER_TCR_RST;
- timer->ctcr = 0x0;
- timer->pr = 0x0;
- timer->ir = 0xff;
- timer->mcr = 0x0;
- timer->ccr = 0x0;
- timer->tcr = BEAGLE_TIMER_TCR_EN;
-}*/
-
BSP_START_TEXT_SECTION void bsp_start_hook_1(void)
{
- //stop_dma_activities();
- setup_uarts();
- //setup_timer();
-
- // Copy .text section
- arm_cp15_instruction_cache_invalidate();
- bsp_start_memcpy(
- (int *) bsp_section_text_begin,
- (const int *) bsp_section_text_load_begin,
- (size_t) bsp_section_text_size
- );
-
- // Copy .rodata section
- arm_cp15_instruction_cache_invalidate();
- bsp_start_memcpy(
- (int *) bsp_section_rodata_begin,
- (const int *) bsp_section_rodata_load_begin,
- (size_t) bsp_section_rodata_size
- );
-
- // Copy .data section
- arm_cp15_instruction_cache_invalidate();
- bsp_start_memcpy(
- (int *) bsp_section_data_begin,
- (const int *) bsp_section_data_load_begin,
- (size_t) bsp_section_data_size
- );
-
- // Copy .fast_text section
- arm_cp15_instruction_cache_invalidate();
- bsp_start_memcpy(
- (int *) bsp_section_fast_text_begin,
- (const int *) bsp_section_fast_text_load_begin,
- (size_t) bsp_section_fast_text_size
- );
-
- // Copy .fast_data section
- arm_cp15_instruction_cache_invalidate();
- bsp_start_memcpy(
- (int *) bsp_section_fast_data_begin,
- (const int *) bsp_section_fast_data_load_begin,
- (size_t) bsp_section_fast_data_size
- );
-
- // Clear .bss section
- clear_bss();
-
-
-
- // At this point we can use objects outside the .start section
+ arm_a8core_start_hook_1();
+ bsp_start_copy_sections();
+ beagle_setup_mmu_and_cache();
+ bsp_start_clear_bss();
}
diff --git a/c/src/lib/libbsp/arm/beagle/startup/bspstartmmu.c b/c/src/lib/libbsp/arm/beagle/startup/bspstartmmu.c
new file mode 100644
index 0000000000..157edfa0a7
--- /dev/null
+++ b/c/src/lib/libbsp/arm/beagle/startup/bspstartmmu.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <info@embedded-brains.de>
+ *
+ * Copyright (c) 2014 Chris Johns. All rights reserved.
+ *
+ * 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.h>
+#include <bsp/start.h>
+#include <bsp/arm-cp15-start.h>
+
+#define ARM_SECTIONS 4096 /* all sections needed to describe the
+ virtual address space */
+#define ARM_SECTION_SIZE (1024 * 1024) /* how much virtual memory is described
+ by one section */
+
+//static uint32_t pagetable[ARM_SECTIONS] __attribute__((aligned (1024*16)));
+
+BSP_START_DATA_SECTION static const arm_cp15_start_section_config
+beagle_mmu_config_table[] = {
+ ARMV7_CP15_START_DEFAULT_SECTIONS,
+ {
+ .begin = 0x40000000U,
+ .end = 0x4FFFFFFFU,
+ .flags = ARMV7_MMU_DEVICE
+ }
+};
+
+/*
+ * Make weak and let the user override.
+ */
+BSP_START_TEXT_SECTION void beagle_setup_mmu_and_cache(void) __attribute__ ((weak));
+
+BSP_START_TEXT_SECTION void beagle_setup_mmu_and_cache(void)
+{
+ /* turn mmu off first in case it's on */
+ uint32_t ctrl = arm_cp15_start_setup_mmu_and_cache(
+ ARM_CP15_CTRL_M | ARM_CP15_CTRL_A, /* clear - mmu off */
+ ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z
+ );
+
+ arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache(
+ ctrl,
+ (uint32_t *) bsp_translation_table_base,
+ ARM_MMU_DEFAULT_CLIENT_DOMAIN,
+ &beagle_mmu_config_table[0],
+ RTEMS_ARRAY_SIZE(beagle_mmu_config_table)
+ );
+}
diff --git a/c/src/lib/libbsp/arm/beagle/startup/linkcmds.beagle b/c/src/lib/libbsp/arm/beagle/startup/linkcmds.beagle
index 29e948d4e7..93f1a4989a 100644
--- a/c/src/lib/libbsp/arm/beagle/startup/linkcmds.beagle
+++ b/c/src/lib/libbsp/arm/beagle/startup/linkcmds.beagle
@@ -1,53 +1,45 @@
/**
* @file
*
- * @ingroup beagle_linker
- *
- * @brief Memory map.
- */
-
-/**
- * @defgroup beagle_linker BeagleBoard Application Memory Map
- *
- * @ingroup bsp_linker
- *
- * @brief BeagleBoard application memory map.
+ * @ingroup arm_beagle
*
+ * @brief Linker script for beagles.
*/
MEMORY {
- RAM : ORIGIN = 0x80000000, LENGTH = 32M
- NIRVANA : ORIGIN = 0, LENGTH = 0
+ /* Beagleboards and beaglebones all
+ * have either 256M or 512M memory. We just
+ * use 256M for all.
+ */
+ RAM : ORIGIN = 0x80000000, LENGTH = 256M - 4M
+ RAM_MMU : ORIGIN = 0x80000000 + 256M - 4M, LENGTH = 16k
}
-REGION_ALIAS ("REGION_START", RAM);
-REGION_ALIAS ("REGION_VECTOR", RAM);
-REGION_ALIAS ("REGION_TEXT", RAM);
-REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
-REGION_ALIAS ("REGION_RODATA", RAM);
-REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
-REGION_ALIAS ("REGION_DATA", RAM);
-REGION_ALIAS ("REGION_DATA_LOAD", RAM);
-REGION_ALIAS ("REGION_FAST_TEXT", RAM);
+REGION_ALIAS ("REGION_START", RAM);
+REGION_ALIAS ("REGION_VECTOR", RAM);
+REGION_ALIAS ("REGION_TEXT", RAM);
+REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
+REGION_ALIAS ("REGION_RODATA", RAM);
+REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
+REGION_ALIAS ("REGION_DATA", RAM);
+REGION_ALIAS ("REGION_DATA_LOAD", RAM);
+REGION_ALIAS ("REGION_FAST_TEXT", RAM);
REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
-REGION_ALIAS ("REGION_FAST_DATA", RAM);
+REGION_ALIAS ("REGION_FAST_DATA", RAM);
REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
-REGION_ALIAS ("REGION_BSS", RAM);
-REGION_ALIAS ("REGION_WORK", RAM);
-REGION_ALIAS ("REGION_STACK", RAM);
-
-//beagle_scratch_area = ORIGIN (RAM_SCRATCH);
+REGION_ALIAS ("REGION_BSS", RAM);
+REGION_ALIAS ("REGION_WORK", RAM);
+REGION_ALIAS ("REGION_STACK", RAM);
bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 4096;
bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1024;
bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;
-beagle = 0x20020000;
+bsp_vector_table_in_start_section = 1;
-beagle_magic_zero_begin = 0x05000000;
-beagle_magic_zero_end = 0x07000000;
-beagle_magic_zero_size = beagle_magic_zero_end - beagle_magic_zero_end;
+bsp_translation_table_base = ORIGIN (RAM_MMU);
+bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);
INCLUDE linkcmds.armv4