📄 head.s
字号:
/* * head.S * * Copyright (C) 2001-2002 Hayden Luo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 32-bit startup code for s3c5410b board */#include "config.h"#include "board.h" .globl stext .globl system_table_offset .globl default_table_offset .globl _rom_base.section ".text"stext: b __init_entrysystem_table_offset: .long SYSTEM_TABLE_OFFSETdefault_table_offset: .long DEFAULT_TABLE_OFFSET_rom_base: .long stext__init_entry: ldr pc, =__entry__entry:/* * Setup Register SYSCFG * - Special Register Base Addr : 0x3ff0000 (reset default) * - Cache and Write Buffer Enable according to the environments * - Check DRAM type : Normal / SDRAM */ ldr r0, =SYSCFG ldr r1, =rSYSCFG_BIOS /* Cache Off, Write Buffer Off, 4K SRAM, 4K CACHE */ str r1, [r0]/* * SysInitVars: Initialise the DATA and BSS sections. * * The DATA section is initialised by copying data from the end of the * ROM image (given by _etext) to the start of the RAM image * (given by __data_start), stopping when we reach _edata. * All data from _edata to _end is then cleared to 0 *//* * Load up the linker defined values for the static data copy */ ldr r0, =_etext ldr r1, =__data_start ldr r3, =_edata/* * But first check whether we are trying to copy to the same address. * If so, this means that the image was linked as an application image * with the DATA section immediately following the CODE section. * Therefore there is nothing to copy since the data is already in place */ cmp r0, r1 beq 1f/* * Stop on CS (ie R1 becomes >= R3). */0: cmp r1, r3 ldrcc r2, [r0], #4 strcc r2, [r1], #4 bcc 0b/* * Clear remainder of data to _end to 0 */1: ldr r1, =_end mov r2, #02: cmp r3, r1 strcc r2, [r3], #4 bcc 2b/* * Now set up the BSPs SVC stack */ mrs r0, cpsr bic r0, r0, #PSR_MODE_MASK orr r1, r0, #PSR_SVC_MODE msr cpsr_cf, r1 ldr sp, =__stack/* * Cache Flush & Enable if requested */ ldr r0, =TAG_BASE /* Cache Flush */ mov r1, #0 mov r2, #256 1: str r1, [r0], #4 subs r2, r2, #1 bne 1b nop ldr r0, =SYSCFG ldr r2, [r0] orr r2, r2, #6 /* Cache, Write Buffer Enable */ str r2, [r0]bios_start: sub sp, sp, #24 mov r0, sp /* point to boot_param */ bl bios_main mov lr, r0 ldmfd sp!, {r0 - r5} /* boot_param *//* * Cache Flush & Enable if requested */ ldr r6, =SYSCFG ldr r7, =rSYSCFG_FLUSH /* Cache off, Write buffer off, 0K SRAM, 8K CACHE */ str r7, [r6] ldr r6, =TAG_BASE /* Cache Flush */ mov r7, #0 mov r8, #256 1: str r7, [r6], #4 subs r8, r8, #1 bne 1b nop ldr r6, =CLKCON str r4, [r6] /* user specified rCLKCON */ ldr r6, =SYSCFG str r5, [r6] /* user specified rSYSCFG */ /* * Call application, it should never return. */sys_start: mov pc, lr/* * Define stack for supervisor modes */ .align .section ".bss"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -