summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/lpc32xx
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-12-03 09:29:08 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-12-03 09:29:08 +0000
commit598a450518f10d4c0fba932035ffba094ced8a37 (patch)
tree2a0818527079d5d716a7b5ca236f00e75e12c433 /c/src/lib/libbsp/arm/lpc32xx
parent2010-12-03 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-598a450518f10d4c0fba932035ffba094ced8a37.tar.bz2
2010-12-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/lpc32xx.h: Added I2S module. * Makefile.am, bsp_specs, preinstall.am, startup/bspstarthooks.c, startup/linkcmds.lpc32xx, startup/linkcmds.lpc32xx_mzx, startup/linkcmds.lpc32xx_mzx_stage_1, startup/linkcmds.lpc32xx_mzx_stage_2, startup/linkcmds.lpc32xx_phycore: Update due to linker command file changes.
Diffstat (limited to 'c/src/lib/libbsp/arm/lpc32xx')
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/ChangeLog10
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/Makefile.am3
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/bsp_specs2
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/include/lpc32xx.h12
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/preinstall.am12
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c48
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx2
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx8
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_18
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_28
-rw-r--r--c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_phycore10
11 files changed, 69 insertions, 54 deletions
diff --git a/c/src/lib/libbsp/arm/lpc32xx/ChangeLog b/c/src/lib/libbsp/arm/lpc32xx/ChangeLog
index 300b151d44..7754ab46f2 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/ChangeLog
+++ b/c/src/lib/libbsp/arm/lpc32xx/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * include/lpc32xx.h: Added I2S module.
+ * Makefile.am, bsp_specs, preinstall.am, startup/bspstarthooks.c,
+ startup/linkcmds.lpc32xx, startup/linkcmds.lpc32xx_mzx,
+ startup/linkcmds.lpc32xx_mzx_stage_1,
+ startup/linkcmds.lpc32xx_mzx_stage_2,
+ startup/linkcmds.lpc32xx_phycore: Update due to linker command file
+ changes.
+
2010-11-12 Sebastian Huber <sebastian.huber@embedded-brains.de>
* rtc/rtc-config.c: Fixed type.
diff --git a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
index 5b5f345de9..b50a30197f 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc32xx/Makefile.am
@@ -35,10 +35,10 @@ include_bsp_HEADERS += ../../shared/include/irq-info.h
include_bsp_HEADERS += ../../shared/include/stackalloc.h
include_bsp_HEADERS += ../../shared/include/uart-output-char.h
include_bsp_HEADERS += ../../shared/tod.h
-include_bsp_HEADERS += ../shared/include/linker-symbols.h
include_bsp_HEADERS += ../shared/include/start.h
include_bsp_HEADERS += ../shared/lpc/include/lpc-timer.h
include_bsp_HEADERS += ../shared/lpc/include/lpc-dma.h
+include_bsp_HEADERS += ../shared/lpc/include/lpc-i2s.h
include_bsp_HEADERS += include/irq.h
include_bsp_HEADERS += include/mmu.h
include_bsp_HEADERS += include/lpc32xx.h
@@ -64,7 +64,6 @@ project_lib_DATA = start.$(OBJEXT)
project_lib_DATA += startup/linkcmds
project_lib_DATA += startup/linkcmds.lpc32xx
-project_lib_DATA += ../shared/startup/linkcmds.base
EXTRA_DIST = startup/linkcmds.lpc32xx_phycore \
startup/linkcmds.lpc32xx_mzx_stage_1 \
diff --git a/c/src/lib/libbsp/arm/lpc32xx/bsp_specs b/c/src/lib/libbsp/arm/lpc32xx/bsp_specs
index 9be7e23eb6..082653ad22 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/bsp_specs
+++ b/c/src/lib/libbsp/arm/lpc32xx/bsp_specs
@@ -4,7 +4,7 @@
*startfile:
%{!qrtems: %(old_startfile)} \
-%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e start}}
+%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e _start}}
*link:
%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
diff --git a/c/src/lib/libbsp/arm/lpc32xx/include/lpc32xx.h b/c/src/lib/libbsp/arm/lpc32xx/include/lpc32xx.h
index 48bde5958c..6f9242b4cb 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/include/lpc32xx.h
+++ b/c/src/lib/libbsp/arm/lpc32xx/include/lpc32xx.h
@@ -27,6 +27,7 @@
#include <bsp/utility.h>
#include <bsp/lpc-timer.h>
#include <bsp/lpc-dma.h>
+#include <bsp/lpc-i2s.h>
/**
* @defgroup lpc32xx_reg Register Definitions
@@ -232,9 +233,6 @@ typedef struct {
} lpc32xx_spi;
typedef struct {
-} lpc32xx_i2s;
-
-typedef struct {
} lpc32xx_sd_card;
typedef struct {
@@ -501,12 +499,12 @@ typedef struct {
uint32_t reserved_3 [LPC32XX_RESERVED(0x2008c000, 0x20090000, lpc32xx_ssp)];
lpc32xx_spi spi_2;
uint32_t reserved_4 [LPC32XX_RESERVED(0x20090000, 0x20094000, lpc32xx_spi)];
- lpc32xx_i2s i2s_0;
- uint32_t reserved_5 [LPC32XX_RESERVED(0x20094000, 0x20098000, lpc32xx_i2s)];
+ lpc_i2s i2s_0;
+ uint32_t reserved_5 [LPC32XX_RESERVED(0x20094000, 0x20098000, lpc_i2s)];
lpc32xx_sd_card sd_card;
uint32_t reserved_6 [LPC32XX_RESERVED(0x20098000, 0x2009c000, lpc32xx_sd_card)];
- lpc32xx_i2s i2s_1;
- uint32_t reserved_7 [LPC32XX_RESERVED(0x2009c000, 0x200a8000, lpc32xx_i2s)];
+ lpc_i2s i2s_1;
+ uint32_t reserved_7 [LPC32XX_RESERVED(0x2009c000, 0x200a8000, lpc_i2s)];
lpc32xx_nand_mlc nand_mlc;
uint32_t reserved_8 [LPC32XX_RESERVED(0x200a8000, 0x31000000, lpc32xx_nand_mlc)];
lpc_dma dma;
diff --git a/c/src/lib/libbsp/arm/lpc32xx/preinstall.am b/c/src/lib/libbsp/arm/lpc32xx/preinstall.am
index 176de03027..31f48b1fb2 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/preinstall.am
+++ b/c/src/lib/libbsp/arm/lpc32xx/preinstall.am
@@ -86,10 +86,6 @@ $(PROJECT_INCLUDE)/bsp/tod.h: ../../shared/tod.h $(PROJECT_INCLUDE)/bsp/$(dirsta
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/tod.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/tod.h
-$(PROJECT_INCLUDE)/bsp/linker-symbols.h: ../shared/include/linker-symbols.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/linker-symbols.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/linker-symbols.h
-
$(PROJECT_INCLUDE)/bsp/start.h: ../shared/include/start.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/start.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/start.h
@@ -102,6 +98,10 @@ $(PROJECT_INCLUDE)/bsp/lpc-dma.h: ../shared/lpc/include/lpc-dma.h $(PROJECT_INCL
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/lpc-dma.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/lpc-dma.h
+$(PROJECT_INCLUDE)/bsp/lpc-i2s.h: ../shared/lpc/include/lpc-i2s.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/lpc-i2s.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/lpc-i2s.h
+
$(PROJECT_INCLUDE)/bsp/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
@@ -158,7 +158,3 @@ $(PROJECT_LIB)/linkcmds.lpc32xx: startup/linkcmds.lpc32xx $(PROJECT_LIB)/$(dirst
$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.lpc32xx
TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds.lpc32xx
-$(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
-TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
-
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c
index 4b1831c8ae..d8559866ef 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/bspstarthooks.c
@@ -44,7 +44,7 @@
LINKER_SYMBOL(lpc32xx_translation_table_base);
-static void BSP_START_SECTION clear_bss(void)
+static void BSP_START_TEXT_SECTION clear_bss(void)
{
const int *end = (const int *) bsp_section_bss_end;
int *out = (int *) bsp_section_bss_begin;
@@ -66,6 +66,14 @@ static void BSP_START_SECTION clear_bss(void)
static const BSP_START_DATA_SECTION lpc32xx_mmu_config
lpc32xx_mmu_config_table [] = {
{
+ .begin = (uint32_t) bsp_section_fast_text_begin,
+ .end = (uint32_t) bsp_section_fast_text_end,
+ .flags = LPC32XX_MMU_CODE
+ }, {
+ .begin = (uint32_t) bsp_section_fast_data_begin,
+ .end = (uint32_t) bsp_section_fast_data_end,
+ .flags = LPC32XX_MMU_READ_WRITE_DATA
+ }, {
.begin = (uint32_t) bsp_section_start_begin,
.end = (uint32_t) bsp_section_start_end,
.flags = LPC32XX_MMU_CODE
@@ -86,10 +94,6 @@ static void BSP_START_SECTION clear_bss(void)
.end = (uint32_t) bsp_section_data_end,
.flags = LPC32XX_MMU_READ_WRITE_DATA
}, {
- .begin = (uint32_t) bsp_section_fast_begin,
- .end = (uint32_t) bsp_section_fast_end,
- .flags = LPC32XX_MMU_CODE
- }, {
.begin = (uint32_t) bsp_section_bss_begin,
.end = (uint32_t) bsp_section_bss_end,
.flags = LPC32XX_MMU_READ_WRITE_DATA
@@ -124,7 +128,7 @@ static void BSP_START_SECTION clear_bss(void)
}
};
- static void BSP_START_SECTION set_translation_table_entries(
+ static void BSP_START_TEXT_SECTION set_translation_table_entries(
uint32_t *ttb,
const lpc32xx_mmu_config *config
)
@@ -141,7 +145,7 @@ static void BSP_START_SECTION clear_bss(void)
}
}
- static void BSP_START_SECTION
+ static void BSP_START_TEXT_SECTION
setup_translation_table_and_enable_mmu(uint32_t ctrl)
{
uint32_t const dac =
@@ -169,7 +173,7 @@ static void BSP_START_SECTION clear_bss(void)
}
#endif
-static void BSP_START_SECTION setup_mmu_and_cache(void)
+static void BSP_START_TEXT_SECTION setup_mmu_and_cache(void)
{
uint32_t ctrl = 0;
@@ -192,7 +196,7 @@ static void BSP_START_SECTION setup_mmu_and_cache(void)
#error "unexpected main oscillator frequency"
#endif
-static void BSP_START_SECTION setup_pll(void)
+static void BSP_START_TEXT_SECTION setup_pll(void)
{
uint32_t pwr_ctrl = LPC32XX_PWR_CTRL;
@@ -211,13 +215,13 @@ static void BSP_START_SECTION setup_pll(void)
}
}
-void BSP_START_SECTION bsp_start_hook_0(void)
+void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
{
setup_pll();
setup_mmu_and_cache();
}
-static void BSP_START_SECTION stop_dma_activities(void)
+static void BSP_START_TEXT_SECTION stop_dma_activities(void)
{
#ifdef LPC32XX_STOP_GPDMA
if ((LPC32XX_DMACLK_CTRL & 0x1) != 0) {
@@ -251,7 +255,7 @@ static void BSP_START_SECTION stop_dma_activities(void)
#endif
}
-static void BSP_START_SECTION setup_uarts(void)
+static void BSP_START_TEXT_SECTION setup_uarts(void)
{
uint32_t uartclk_ctrl = 0;
@@ -286,7 +290,7 @@ static void BSP_START_SECTION setup_uarts(void)
#endif
}
-static void BSP_START_SECTION setup_timer(void)
+static void BSP_START_TEXT_SECTION setup_timer(void)
{
volatile lpc_timer *timer = LPC32XX_STANDARD_TIMER;
@@ -301,7 +305,7 @@ static void BSP_START_SECTION setup_timer(void)
timer->tcr = LPC_TIMER_TCR_EN;
}
-void BSP_START_SECTION bsp_start_hook_1(void)
+void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
{
stop_dma_activities();
setup_uarts();
@@ -331,12 +335,20 @@ void BSP_START_SECTION bsp_start_hook_1(void)
(size_t) bsp_section_data_size
);
- /* Copy .fast section */
+ /* 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_begin,
- (const int *) bsp_section_fast_load_begin,
- (size_t) bsp_section_fast_size
+ (int *) bsp_section_fast_data_begin,
+ (const int *) bsp_section_fast_data_load_begin,
+ (size_t) bsp_section_fast_data_size
);
/* Clear .bss section */
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx
index 278a23ec5b..4989ae3c9a 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx
@@ -14,4 +14,4 @@ lpc32xx_magic_zero_begin = 0x05000000;
lpc32xx_magic_zero_end = 0x07000000;
lpc32xx_magic_zero_size = lpc32xx_magic_zero_end - lpc32xx_magic_zero_end;
-INCLUDE linkcmds.base
+INCLUDE linkcmds.armv4
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx
index cd42c4537b..aa56251cae 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx
@@ -35,10 +35,10 @@
*/
MEMORY {
- RAM_INT (AIW) : ORIGIN = 0x08000000, LENGTH = 256k
- RAM_MMU (AIW) : ORIGIN = 0x80000000, LENGTH = 16k /* SDRAM on DYCS0 */
- RAM_EXT (AIW) : ORIGIN = 0x80004000, LENGTH = 32M - 16k /* SDRAM on DYCS0 */
- NIRVANA : ORIGIN = 0, LENGTH = 0
+ RAM_INT : ORIGIN = 0x08000000, LENGTH = 256k
+ RAM_MMU : ORIGIN = 0x80000000, LENGTH = 16k /* SDRAM on DYCS0 */
+ RAM_EXT : ORIGIN = 0x80004000, LENGTH = 32M - 16k /* SDRAM on DYCS0 */
+ NIRVANA : ORIGIN = 0, LENGTH = 0
}
REGION_ALIAS ("REGION_START", RAM_EXT);
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_1 b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_1
index 0954f0b588..368766c65f 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_1
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_1
@@ -35,10 +35,10 @@
*/
MEMORY {
- RAM_INT (AIW) : ORIGIN = 0x08000000, LENGTH = 232k
- RAM_VEC (AIW) : ORIGIN = 0x0803a000, LENGTH = 8k
- RAM_MMU (AIW) : ORIGIN = 0x0803c000, LENGTH = 16k
- NIRVANA : ORIGIN = 0, LENGTH = 0
+ RAM_INT : ORIGIN = 0x08000000, LENGTH = 232k
+ RAM_VEC : ORIGIN = 0x0803a000, LENGTH = 8k
+ RAM_MMU : ORIGIN = 0x0803c000, LENGTH = 16k
+ NIRVANA : ORIGIN = 0, LENGTH = 0
}
REGION_ALIAS ("REGION_START", RAM_INT);
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_2 b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_2
index dc64394982..8ac0de00d6 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_2
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_mzx_stage_2
@@ -35,10 +35,10 @@
*/
MEMORY {
- RAM_INT (AIW) : ORIGIN = 0x08000000, LENGTH = 256k
- RAM_MMU (AIW) : ORIGIN = 0x81c00000, LENGTH = 16k /* SDRAM on DYCS0 */
- RAM_EXT (AIW) : ORIGIN = 0x81c04000, LENGTH = 4M - 16k /* SDRAM on DYCS0 */
- NIRVANA : ORIGIN = 0, LENGTH = 0
+ RAM_INT : ORIGIN = 0x08000000, LENGTH = 256k
+ RAM_MMU : ORIGIN = 0x81c00000, LENGTH = 16k /* SDRAM on DYCS0 */
+ RAM_EXT : ORIGIN = 0x81c04000, LENGTH = 4M - 16k /* SDRAM on DYCS0 */
+ NIRVANA : ORIGIN = 0, LENGTH = 0
}
REGION_ALIAS ("REGION_START", RAM_EXT);
diff --git a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_phycore b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_phycore
index 6db6497b44..61b858611c 100644
--- a/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_phycore
+++ b/c/src/lib/libbsp/arm/lpc32xx/startup/linkcmds.lpc32xx_phycore
@@ -36,11 +36,11 @@
*/
MEMORY {
- RAM_INT (AIW) : ORIGIN = 0x08000000, LENGTH = 256k
- RAM_MMU (AIW) : ORIGIN = 0x80000000, LENGTH = 16k /* SDRAM on DYCS0 */
- RAM_EXT (AIW) : ORIGIN = 0x80004000, LENGTH = 64M - 16k /* SDRAM on DYCS0 */
- ROM_EXT (RX) : ORIGIN = 0xe0000000, LENGTH = 2M /* NOR flash on CS0 */
- NIRVANA : ORIGIN = 0, LENGTH = 0
+ RAM_INT : ORIGIN = 0x08000000, LENGTH = 256k
+ RAM_MMU : ORIGIN = 0x80000000, LENGTH = 16k /* SDRAM on DYCS0 */
+ RAM_EXT : ORIGIN = 0x80004000, LENGTH = 64M - 16k /* SDRAM on DYCS0 */
+ ROM_EXT : ORIGIN = 0xe0000000, LENGTH = 2M /* NOR flash on CS0 */
+ NIRVANA : ORIGIN = 0, LENGTH = 0
}
REGION_ALIAS ("REGION_START", RAM_EXT);