Rev 437 | Rev 700 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
@@@ Copyright 2010 TheSeven@@@ This file is part of emCORE.@@ emCORE is free software: you can redistribute it and/or@ modify it under the terms of the GNU General Public License as@ published by the Free Software Foundation, either version 2 of the@ License, or (at your option) any later version.@@ emCORE is distributed in the hope that it will be useful,@ but WITHOUT ANY WARRANTY; without even the implied warranty of@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.@ See the GNU General Public License for more details.@@ You should have received a copy of the GNU General Public License@ along with emCORE. If not, see <http://www.gnu.org/licenses/>.@@.section .intvect,"ax",%progbitsldr pc, =reset_handlerldr pc, =undef_instr_handlerldr pc, =syscall_handlerldr pc, =prefetch_abort_handlerldr pc, =data_abort_handlerldr pc, =reserved_handlerldr pc, =irq_handlerldr pc, =fiq_handler.ltorg.section .inithead,"ax",%progbits.global __start__start:b _start.section .initcode,"ax",%progbits.global _start_start:mrc p15, 0, r0,c1,c0orr r0, r0, #5mcr p15, 0, r0,c1,c0ldr r0, =_sramsourceldr r1, =_sramstartldr r2, =_sramend.copysram:cmp r2, r1ldrhi r3, [r0], #4strhi r3, [r1], #4bhi .copysramldr r0, =_sdramsourceldr r1, =_sdramstartldr r2, =_sdramend.copysdram:cmp r2, r1ldrhi r3, [r0], #4strhi r3, [r1], #4bhi .copysdramldr r0, =_ibssstartldr r1, =_ibssendmov r2, #0.clearibss:cmp r1, r0strhi r2, [r0], #4bhi .clearibssldr r0, =_bssstartldr r1, =_bssend.clearbss:cmp r1, r0strhi r2, [r0], #4bhi .clearbssldr r1, =0x38200000ldr r0, [r1]orr r0, r0, #1bic r0, r0, #0x10000str r0, [r1].cleancache:mrc p15, 0, r15,c7,c10,3bne .cleancachemov r0, #0mcr p15, 0, r0,c7,c10,4mcr p15, 0, r0,c7,c5,0ldr r1, =0x38200000ldr r0, [r1]orr r0, r0, #1bic r0, r0, #0x10000str r0, [r1]mov r0, #0mcr p15, 0, r0,c7,c5,0add r1, r1, #0x00c00000add r2, r1, #0x00001000add r3, r1, #0x00002000sub r4, r0, #1str r4, [r1,#0x14]str r4, [r2,#0x14]str r4, [r1,#0xf00]str r4, [r2,#0xf00]str r4, [r3,#0x08]str r4, [r3,#0x0c]str r0, [r1,#0x14]str r0, [r2,#0x14]msr cpsr_c, #0xd2ldr sp, =_irqstackendmsr cpsr_c, #0xd7ldr sp, =_abortstackendmsr cpsr_c, #0xdbldr sp, =_abortstackendmsr cpsr_c, #0x1fldr sp, =_abortstackendbl initbl yieldmov r0, #0ldr pc, =idleloop.ltorg.section .icode, "ax", %progbits.align 2idleloop:mcr p15, 0, r0,c7,c0,4b idleloop.global reset.global hang.type reset, %function.type hang, %functionreset:msr cpsr_c, #0xd3mov r0, #0x100000mov r1, #0x3c800000str r0, [r1]hang:msr cpsr_c, #0xd3mov r0, #0mcr p15, 0, r0,c7,c0,4b hang.size reset, .-reset.size hang, .-hang.type reset_handler, %functionreset_handler:mov r0, #0adr r1, reset_textb panicreset_text:.ascii "Hit reset vector!\0".size reset_handler, .-reset_handler.type undef_instr_handler, %functionundef_instr_handler:mov r0, #0adr r1, undef_instr_textsub r2, lr, #4b panicf.size undef_instr_handler, .-undef_instr_handler.type prefetch_abort_handler, %functionprefetch_abort_handler:mov r0, #0adr r1, prefetch_abort_textsub r2, lr, #4b panicf.size prefetch_abort_handler, .-prefetch_abort_handler.type data_abort_handler, %functiondata_abort_handler:mov r0, #0adr r1, data_abort_textsub r2, lr, #4b panicf.size data_abort_handler, .-data_abort_handler.type reserved_handler, %functionreserved_handler:mov r0, #0adr r1, reserved_textb panic.size reserved_handler, .-reserved_handler.type fiq_handler, %functionfiq_handler:mov r0, #2adr r1, fiq_textb panic.size fiq_handler, .-fiq_handlerundef_instr_text:.ascii "Undefined instruction at %08X!\0"prefetch_abort_text:.ascii "Prefetch abort at %08X!\0"data_abort_text:.ascii "Data abort at %08X!\0"reserved_text:.ascii "Hit reserved exception handler!\0"fiq_text:.ascii "Unhandled FIQ!\0"syscall_text:.ascii "Unhandled syscall!\0".section .icode.usec_timer, "ax", %progbits.align 2.global read_native_timer.type read_native_timer, %functionread_native_timer:ldr r0, val_3c700000ldr r1, [r0,#0xb4]mov r0, #0bx lr.size read_native_timer, .-read_native_timer.global read_usec_timer.type read_usec_timer, %functionread_usec_timer:ldr r0, val_3c700000ldr r0, [r0,#0xb4]bx lr.size read_usec_timer, .-read_usec_timerval_3c700000:.word 0x3c700000