From aa091bce4486e6285e41d4894d78d6f555b3ea73 Mon Sep 17 00:00:00 2001 From: nemecep1 Date: Thu, 17 Feb 2011 20:55:41 +0100 Subject: [PATCH] Some common files for lpc23xx are now symlinked from lpc21xx. Signed-off-by: nemecep1 --- .../mach-lpc23xx/libs/hal/hal_machperiph.h | 13 +- arch/arm/mach-lpc23xx/libs/hal/ivt.S | 35 +---- arch/arm/mach-lpc23xx/libs/hal/startup.S | 129 +----------------- 3 files changed, 3 insertions(+), 174 deletions(-) mode change 100644 => 120000 arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h mode change 100644 => 120000 arch/arm/mach-lpc23xx/libs/hal/ivt.S mode change 100644 => 120000 arch/arm/mach-lpc23xx/libs/hal/startup.S diff --git a/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h b/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h deleted file mode 100644 index 9e790d8..0000000 --- a/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _HAL_MACHPERIPH_H -#define _HAL_MACHPERIPH_H - -extern unsigned int system_frequency; /*!< System Clock Frequency (Core Clock) */ - -void system_clock_init(void); - -void lpc_watchdog_init(int on,int timeout_ms); -void lpc_watchdog_feed(); - -#endif /* _HAL_MACHPERIPH_H */ - diff --git a/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h b/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h new file mode 120000 index 0000000..e38a6ea --- /dev/null +++ b/arch/arm/mach-lpc23xx/libs/hal/hal_machperiph.h @@ -0,0 +1 @@ +../../../mach-lpc21xx/libs/hal/hal_machperiph.h \ No newline at end of file diff --git a/arch/arm/mach-lpc23xx/libs/hal/ivt.S b/arch/arm/mach-lpc23xx/libs/hal/ivt.S deleted file mode 100644 index ae9032a..0000000 --- a/arch/arm/mach-lpc23xx/libs/hal/ivt.S +++ /dev/null @@ -1,34 +0,0 @@ -/* Setup vector table. Note that undf, pabt, dabt, fiq just execute -a null loop. */ - -.section .ivt,"ax" - .code 32 - .align 0 - - .global hal_vectors - -hal_vectors: LDR PC, Reset_Addr - LDR PC, Undef_Addr - LDR PC, SWI_Addr - LDR PC, PAbt_Addr - LDR PC, DAbt_Addr - NOP /* Reserved Vector */ - LDR PC, IRQ_Addr - LDR PC, FIQ_Addr - -Reset_Addr: .word reset_handler -Undef_Addr: .word Undef_Handler -SWI_Addr: .word SWI_Handler -PAbt_Addr: .word PAbt_Handler -DAbt_Addr: .word DAbt_Handler - .word 0 /* Reserved Address */ -IRQ_Addr: .word irq_handler_resolver -FIQ_Addr: .word FIQ_Handler - -Undef_Handler: B Undef_Handler -SWI_Handler: B SWI_Handler -PAbt_Handler: B PAbt_Handler -DAbt_Handler: B DAbt_Handler -FIQ_Handler: B FIQ_Handler - - .end diff --git a/arch/arm/mach-lpc23xx/libs/hal/ivt.S b/arch/arm/mach-lpc23xx/libs/hal/ivt.S new file mode 120000 index 0000000..684009b --- /dev/null +++ b/arch/arm/mach-lpc23xx/libs/hal/ivt.S @@ -0,0 +1 @@ +../../../mach-lpc21xx/libs/hal/ivt.S \ No newline at end of file diff --git a/arch/arm/mach-lpc23xx/libs/hal/startup.S b/arch/arm/mach-lpc23xx/libs/hal/startup.S deleted file mode 100644 index 3201fbc..0000000 --- a/arch/arm/mach-lpc23xx/libs/hal/startup.S +++ /dev/null @@ -1,128 +0,0 @@ -#/***********************************************************************/ -#/* Startup file for LPC21xx MCU applications */ -#/* Partially inspired by KEIL ELEKTRONIK startup code */ -#/***********************************************************************/ - - -# *** Startup Code (executed after Reset) *** - -# Standard definitions of Mode bits and Interrupt (I & F) flags in PSRs - .set MODE_USR, 0x10 // User Mode - .set MODE_FIQ, 0x11 // FIQ Mode - .set MODE_IRQ, 0x12 // IRQ Mode - .set MODE_SVC, 0x13 // Supervisor Mode - .set MODE_ABT, 0x17 // Abort Mode - .set MODE_UND, 0x1B // Undefined Mode - .set MODE_SYS, 0x1F // System Mode - - .equ I_BIT, 0x80 // when I bit is set, IRQ is disabled - .equ F_BIT, 0x40 // when F bit is set, FIQ is disabled - - .set UND_STACK_SIZE, 0x00000004 - .set ABT_STACK_SIZE, 0x00000004 - .set FIQ_STACK_SIZE, 0x00000004 - .set IRQ_STACK_SIZE, 0X00000400 - .set SVC_STACK_SIZE, 0x00000004 - -# Starupt Code must be linked first at Address at which it expects to run. - - .text -# .arm - - .global _stack // top of stack - .global _startup - .global reset_handler - .func _startup -_startup: - -reset_handler: - -# Memory Mapping (when Interrupt Vectors are in RAM) - .equ MEMMAP, 0xE01FC040 /* Memory Mapping Control */ - - MOV R1, #1 - LDR R0, =hal_vectors - CMP R0, #0 - BEQ mam_sram - MOV R1, #2 -mam_sram: - LDR R0, =MEMMAP - STR R1, [R0] - -# Initialize Interrupt System -# - Set stack location for each mode -# - Leave in System Mode with Interrupts Disabled -# ----------------------------------------------- - ldr r0,=_stack - msr CPSR_c,#MODE_UND|I_BIT|F_BIT // Undefined Instruction Mode - mov sp,r0 - sub r0,r0,#UND_STACK_SIZE - msr CPSR_c,#MODE_ABT|I_BIT|F_BIT // Abort Mode - mov sp,r0 - sub r0,r0,#ABT_STACK_SIZE - msr CPSR_c,#MODE_FIQ|I_BIT|F_BIT // FIQ Mode - mov sp,r0 - sub r0,r0,#FIQ_STACK_SIZE - msr CPSR_c,#MODE_IRQ|I_BIT|F_BIT // IRQ Mode - mov sp,r0 - sub r0,r0,#IRQ_STACK_SIZE - msr CPSR_c,#MODE_SVC|I_BIT|F_BIT // Supervisor Mode - mov sp,r0 - sub r0,r0,#SVC_STACK_SIZE - msr CPSR_c,#MODE_SYS|I_BIT|F_BIT // System Mode - mov sp,r0 - -# Disable interrupt from VIC - .equ VICINTENABLE, 0xFFFFF010 - .equ VICINTENCLR, 0xFFFFF014 - .equ VICSOFTINT, 0xFFFFF018 - .equ VICSOFTINTCLEAR, 0xFFFFF01C - LDR R0, =VICINTENABLE - MOV R1, #0 - STR R1, [R0] - MOV R1, #0xFFFFFFFF - STR R1, [R0,#VICINTENCLR-VICINTENABLE] - STR R1, [R0,#VICSOFTINTCLEAR-VICINTENABLE] - -# Enable interrupts and return back into supervisor mode - msr CPSR_c,#MODE_SVC // Supervisor Mode - -# Relocate .data section (Copy from ROM to RAM) - LDR R1, =_etext - LDR R2, =_data - LDR R3, =_edata - CMP R1, R2 - BEQ ZI -LoopRel:CMP R2, R3 - LDRLO R0, [R1], #4 - STRLO R0, [R2], #4 - BLO LoopRel - -ZI: -# Clear .bss section (Zero init) - MOV R0, #0 - LDR R1, =__bss_start__ - LDR R2, =__bss_end__ -LoopZI: CMP R1, R2 - STRLO R0, [R1], #4 - BLO LoopZI - - -# Enter the C _setup_board code - ADR LR, __main_start - LDR R0, =_setup_board - CMP R0, #0 - BEQ __main_start - BX R0 - -__main_start: - ADR LR, __main_exit - LDR R0, =main - BX R0 - -__main_exit: B __main_exit - - .size _start, . - _start - .endfunc - - .end diff --git a/arch/arm/mach-lpc23xx/libs/hal/startup.S b/arch/arm/mach-lpc23xx/libs/hal/startup.S new file mode 120000 index 0000000..201995a --- /dev/null +++ b/arch/arm/mach-lpc23xx/libs/hal/startup.S @@ -0,0 +1 @@ +../../../mach-lpc21xx/libs/hal/startup.S \ No newline at end of file -- 2.39.2